mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed up property type restrictions for types d:any
- You can now pass single or multiple values into a property of type d:any Type | Multiple | Allow Single | Allow Multiple d:text N Y N d:text Y Y Y d:any N Y Y d:any Y Y Y anon Y Y git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2524 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,7 +24,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.domain.PropertyValue;
|
||||
import org.alfresco.repo.node.NodeServicePolicies.BeforeAddAspectPolicy;
|
||||
@@ -561,9 +560,15 @@ public abstract class AbstractNodeServiceImpl implements NodeService
|
||||
}
|
||||
else if (!isMultiValued && (value instanceof Collection))
|
||||
{
|
||||
throw new DictionaryException("A single-valued property may not be a collection: \n" +
|
||||
" Property: " + propertyDef + "\n" +
|
||||
" Value: " + value);
|
||||
// we only allow this case if the property type is ANY
|
||||
if (!propertyTypeQName.equals(DataTypeDefinition.ANY))
|
||||
{
|
||||
throw new DictionaryException(
|
||||
"A single-valued property of this type may not be a collection: \n" +
|
||||
" Property: " + propertyDef + "\n" +
|
||||
" Type: " + propertyTypeQName + "\n" +
|
||||
" Value: " + value);
|
||||
}
|
||||
}
|
||||
}
|
||||
try
|
||||
|
Reference in New Issue
Block a user