Fix for ALF-10447 - Share Admin -> NodeBrowser: NPE when trying to access version node (child of version history node)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30801 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2011-09-27 13:16:36 +00:00
parent 6d5bef365f
commit e556b1070f
3 changed files with 10 additions and 5 deletions

View File

@@ -1,9 +1,10 @@
<webscript>
<shortname>Node Browser Repository support</shortname>
<description>Execute searches, return information on a node and return a list of stores</description>
<description>Execute searches, return information on a node or return a list of stores</description>
<url>/slingshot/node/{protocol}/{store}/{id}</url>
<url>/slingshot/node/search</url>
<url>/slingshot/node/stores</url>
<format default="json">argument</format>
<authentication>admin</authentication>
<transaction allow="readonly">required</transaction>
</webscript>

View File

@@ -38,7 +38,7 @@
"values": [
<#list p.values as val>
{
"dataType": "${val.dataType}",
"dataType": "${val.dataType!""}",
"value": <@printPropertyValue val />,
"isContent": ${val.content?string},
"isNodeRef": ${val.nodeRef?string},
@@ -47,8 +47,8 @@
</#list>
],
"type": {
"name": "${p.typeName.name}",
"prefixedName": "${p.typeName.prefixedName}"
"name": "<#if p.typeName??>${p.typeName.name}</#if>",
"prefixedName": "<#if p.typeName??>${p.typeName.prefixedName}</#if>"
},
"multiple": ${p.collection?string},
"residual": ${p.residual?string}

View File

@@ -991,7 +991,11 @@ public class NodeBrowserScript extends DeclarativeWebScript
*/
public String getDataType()
{
String datatype = Property.this.getTypeName().getName();
String datatype = null;
if (Property.this.getTypeName() != null)
{
datatype = Property.this.getTypeName().getName();
}
if (datatype == null || datatype.equals(DataTypeDefinition.ANY.toString()))
{
if (value != null)