Fixed failing test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@47310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-02-28 14:09:57 +00:00
parent 66e8923643
commit 5198e95a2b

View File

@@ -32,14 +32,14 @@ import org.apache.commons.lang.ArrayUtils;
/** /**
* Node parameter processor. * Node parameter processor.
* *
* @author Roy Wetherall * @author Roy Wetherall
* @since 2.1 * @since 2.1
*/ */
public class NodeParameterProcessor extends ParameterProcessor public class NodeParameterProcessor extends ParameterProcessor
{ {
/** Supported data types */ /** Supported data types */
private QName[] supportedDataTypes = private QName[] supportedDataTypes =
{ {
DataTypeDefinition.TEXT, DataTypeDefinition.TEXT,
DataTypeDefinition.BOOLEAN, DataTypeDefinition.BOOLEAN,
@@ -49,16 +49,16 @@ public class NodeParameterProcessor extends ParameterProcessor
DataTypeDefinition.FLOAT, DataTypeDefinition.FLOAT,
DataTypeDefinition.INT DataTypeDefinition.INT
}; };
/** Node service */ /** Node service */
private NodeService nodeService; private NodeService nodeService;
/** Namespace service */ /** Namespace service */
private NamespaceService namespaceService; private NamespaceService namespaceService;
/** Dictionary service */ /** Dictionary service */
private DictionaryService dictionaryService; private DictionaryService dictionaryService;
/** /**
* @param nodeService node service * @param nodeService node service
*/ */
@@ -66,7 +66,7 @@ public class NodeParameterProcessor extends ParameterProcessor
{ {
this.nodeService = nodeService; this.nodeService = nodeService;
} }
/** /**
* @param namespaceService namespace service * @param namespaceService namespace service
*/ */
@@ -74,7 +74,7 @@ public class NodeParameterProcessor extends ParameterProcessor
{ {
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
} }
/** /**
* @param dictionaryService dictionary service * @param dictionaryService dictionary service
*/ */
@@ -82,7 +82,7 @@ public class NodeParameterProcessor extends ParameterProcessor
{ {
this.dictionaryService = dictionaryService; this.dictionaryService = dictionaryService;
} }
/** /**
* @see org.alfresco.repo.action.parameter.ParameterProcessor#process(java.lang.String, org.alfresco.service.cmr.repository.NodeRef) * @see org.alfresco.repo.action.parameter.ParameterProcessor#process(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
*/ */
@@ -91,19 +91,19 @@ public class NodeParameterProcessor extends ParameterProcessor
{ {
// the default position is to return the value un-changed // the default position is to return the value un-changed
String result = value; String result = value;
// strip the processor name from the value // strip the processor name from the value
value = stripName(value); value = stripName(value);
if (value.isEmpty() == false) if (value.isEmpty() == false)
{ {
QName qname = QName.createQName(value, namespaceService); QName qname = QName.createQName(NamespaceService.CONTENT_MODEL_PREFIX, value, namespaceService);
PropertyDefinition propertyDefinition = dictionaryService.getProperty(qname); PropertyDefinition propertyDefinition = dictionaryService.getProperty(qname);
if (propertyDefinition == null) if (propertyDefinition == null)
{ {
throw new AlfrescoRuntimeException("The property " + value + " does not have a property definition."); throw new AlfrescoRuntimeException("The property " + value + " does not have a property definition.");
} }
QName type = propertyDefinition.getDataType().getName(); QName type = propertyDefinition.getDataType().getName();
if (ArrayUtils.contains(supportedDataTypes, type) == true) if (ArrayUtils.contains(supportedDataTypes, type) == true)
{ {
@@ -115,7 +115,7 @@ public class NodeParameterProcessor extends ParameterProcessor
throw new AlfrescoRuntimeException("The property " + value + " is of type " + type.toString() + " which is not supported by parameter substitution."); throw new AlfrescoRuntimeException("The property " + value + " is of type " + type.toString() + " which is not supported by parameter substitution.");
} }
} }
return result; return result;
} }
} }