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:
Derek Hulley
2006-03-09 11:39:29 +00:00
parent 848b2435da
commit 52110e3e66
3 changed files with 88 additions and 12 deletions

View File

@@ -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