mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
76593: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 76534: MNT-10226: Merged DEV to V4.2-BUG-FIX (4.2.4) 76512: 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. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77660 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -740,6 +740,16 @@ public class PropertyValue implements Cloneable, Serializable
|
||||
return valueType.getOrdinalNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* If property value of the type <code>QName</code> is supported
|
||||
*
|
||||
* @param typeQName the type qualified name
|
||||
*/
|
||||
public static boolean isDataTypeSupported(QName typeQName)
|
||||
{
|
||||
return valueTypesByPropertyType.keySet().contains(typeQName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
|
@@ -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.PropertyValue;
|
||||
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<PropertyDefiniti
|
||||
PropertyDefinition propDef = data.getPropertyDefinition(name);
|
||||
if (propDef != null)
|
||||
{
|
||||
return propDef.getDefaultValue();
|
||||
QName typeQName = propDef.getDataType().getName();
|
||||
String strDefaultValue = propDef.getDefaultValue();
|
||||
if (PropertyValue.isDataTypeSupported(typeQName))
|
||||
{
|
||||
// convert to the appropriate type
|
||||
PropertyValue pv = new PropertyValue(typeQName, strDefaultValue);
|
||||
return pv.getValue(typeQName);
|
||||
}
|
||||
return strDefaultValue;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user