mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
63749: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (4.3.0.BF) 63717: Merged V4.1-BUG-FIX (4.1.9) to V4.2-BUG-FIX (4.2.2) 63646: Merged DEV to V4.1-BUG-FIX (4.1.9) 55519: MNT-9203: CMIS: Cannot unset (set to null) property during checkin - CMISConnector#setProperty method was modified. Now we can set null values according to provided API. Also, testCheckIn unit test was added for this approach. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64327 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3427,34 +3427,27 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
nodeService.removeProperty(nodeRef, propertyQName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// overflow check
|
||||
if(propDef.getPropertyDefinition().getPropertyType() == PropertyType.INTEGER && value instanceof BigInteger)
|
||||
{
|
||||
org.alfresco.service.cmr.dictionary.PropertyDefinition def = dictionaryService.getProperty(propertyQName);
|
||||
QName dataDef = def.getDataType().getName();
|
||||
BigInteger bigValue = (BigInteger)value;
|
||||
|
||||
if ((bigValue.compareTo(maxInt) > 0 || bigValue.compareTo(minInt) < 0 ) && dataDef.equals(DataTypeDefinition.INT))
|
||||
{
|
||||
throw new CmisConstraintException("Value is out of range for property " + propertyQName.getLocalName());
|
||||
}
|
||||
|
||||
if ((bigValue.compareTo(maxLong) > 0 || bigValue.compareTo(minLong) < 0 ) && dataDef.equals(DataTypeDefinition.LONG))
|
||||
{
|
||||
throw new CmisConstraintException("Value is out of range for property " + propertyQName.getLocalName());
|
||||
}
|
||||
}
|
||||
|
||||
nodeService.setProperty(nodeRef, propertyQName, value);
|
||||
}
|
||||
}
|
||||
{
|
||||
// overflow check
|
||||
if (propDef.getPropertyDefinition().getPropertyType() == PropertyType.INTEGER && value instanceof BigInteger)
|
||||
{
|
||||
org.alfresco.service.cmr.dictionary.PropertyDefinition def = dictionaryService.getProperty(propertyQName);
|
||||
QName dataDef = def.getDataType().getName();
|
||||
BigInteger bigValue = (BigInteger) value;
|
||||
|
||||
if ((bigValue.compareTo(maxInt) > 0 || bigValue.compareTo(minInt) < 0) && dataDef.equals(DataTypeDefinition.INT))
|
||||
{
|
||||
throw new CmisConstraintException("Value is out of range for property " + propertyQName.getLocalName());
|
||||
}
|
||||
|
||||
if ((bigValue.compareTo(maxLong) > 0 || bigValue.compareTo(minLong) < 0) && dataDef.equals(DataTypeDefinition.LONG))
|
||||
{
|
||||
throw new CmisConstraintException("Value is out of range for property " + propertyQName.getLocalName());
|
||||
}
|
||||
}
|
||||
|
||||
nodeService.setProperty(nodeRef, propertyQName, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user