AnsweredAssumed Answered

Custom content type with LIST constraint

Question asked by zliu on Feb 10, 2012
Latest reply on Feb 14, 2012 by mitpatoliya
As a practice, I am trying to extend the custom content model in "Working with Custom Content Types", 2nd edition by Jeff Potts, which BTW is a must read.

Basically, I created an aspect sc:reviewable with a multi-value property sc:reviewer. I also created a LIST constraint sc:reviewerList - the list of allowed values are hard-coded in scModel.xml for now. The LIST constraint sc:reviewerList was applied to sc:reviewer property. The configuration was loaded to Alfresco and tomcat was restarted.

In, I tried to create a document as below

properties.put(PropertyIds.OBJECT_TYPE_ID, "D:sc:whitepaper,P:sc:reviewable");

properties.put("sc:reviewer", Arrays.asList("John Smith", "Jane Doe"));

Somehow, the code threw an error "Constraint violation… the value is not an allowed value: John Smith". To verify the definition, I browsed to
and found "John Smith" was indeed listed as one of the cmis:choiceString/cmis:value.

Why would the code complain then? What am I missing? Thanks.