From b1453aa246dd4ddbf39cd7add3308b9d08d48f93 Mon Sep 17 00:00:00 2001 From: Erik Winlof Date: Wed, 3 Sep 2014 12:49:30 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 78692: ACE-2346: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 76534: MNT-10226: Web Script - Status 500 error on 'Edit Properties' page after adding 'Restrictable' aspect through CMIS 1.1 API - Convert default value in appliance with type of the property. 76654: MNT-10226: Web Script - Status 500 error on 'Edit Properties' page after adding 'Restrictable' aspect through CMIS 1.1 API - Fix unit test failures: now webscripts return values with appropriate type, so in tests it should be compared with value of the expected type. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82630 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/domain/node/NodePropertyValue.java | 10 ++++++++++ .../forms/processor/node/PropertyFieldProcessor.java | 11 ++++++++++- .../processor/workflow/WorkflowFormProcessorTest.java | 8 ++++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/source/java/org/alfresco/repo/domain/node/NodePropertyValue.java b/source/java/org/alfresco/repo/domain/node/NodePropertyValue.java index c6323fb201..5752f73e14 100644 --- a/source/java/org/alfresco/repo/domain/node/NodePropertyValue.java +++ b/source/java/org/alfresco/repo/domain/node/NodePropertyValue.java @@ -818,6 +818,16 @@ public class NodePropertyValue implements Cloneable, Serializable return valueType.getOrdinalNumber(); } + /** + * If property value of the type QName is supported + * + * @param typeQName the type qualified name + */ + public static boolean isDataTypeSupported(QName typeQName) + { + return valueTypesByPropertyType.keySet().contains(typeQName); + } + /** the type of the property, prior to serialization persistence */ private ValueType actualType; /** the type of persistence used */ diff --git a/source/java/org/alfresco/repo/forms/processor/node/PropertyFieldProcessor.java b/source/java/org/alfresco/repo/forms/processor/node/PropertyFieldProcessor.java index 08ec7bc6f3..e42fbdc5c1 100644 --- a/source/java/org/alfresco/repo/forms/processor/node/PropertyFieldProcessor.java +++ b/source/java/org/alfresco/repo/forms/processor/node/PropertyFieldProcessor.java @@ -31,6 +31,7 @@ import java.util.Set; import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint; import org.alfresco.repo.dictionary.constraint.RegisteredConstraint; +import org.alfresco.repo.domain.node.NodePropertyValue; import org.alfresco.repo.forms.Field; import org.alfresco.repo.forms.FieldGroup; import org.alfresco.repo.forms.PropertyFieldDefinition; @@ -166,7 +167,15 @@ public class PropertyFieldProcessor extends QNameFieldProcessor fields = Arrays.asList(fieldName); Form form = processForm(fields); - checkSingleProperty(form, fieldName, "2"); + checkSingleProperty(form, fieldName, 2); // Check Status field is added to Form, when explicitly typed as a // property. String fullPropertyName = "prop:" + fieldName; fields = Arrays.asList(fullPropertyName); form = processForm(fields); - checkSingleProperty(form, fieldName, "2"); + checkSingleProperty(form, fieldName, 2); checkPackageActionGroups(form.getFormData()); } @@ -194,7 +194,7 @@ public class WorkflowFormProcessorTest extends TestCase String priorityField = PRIORITY_NAME.toPrefixString(namespaceService); List fields = Arrays.asList(fakeFieldName, priorityField); Form form = processForm(fields); - checkSingleProperty(form, priorityField, "2"); + checkSingleProperty(form, priorityField, 2); checkPackageActionGroups(form.getFormData()); } @@ -219,7 +219,7 @@ public class WorkflowFormProcessorTest extends TestCase FormData formData = form.getFormData(); assertEquals(fieldData, formData.getFieldData("assoc_bpm_assignee").getValue()); checkPackageActionGroups(formData); - assertEquals("2", formData.getFieldData("prop_bpm_workflowPriority").getValue()); + assertEquals(2, formData.getFieldData("prop_bpm_workflowPriority").getValue()); } public void testGeneratePackageItems() throws Exception