AnsweredAssumed Answered

Problem with custom Aspects (CMIS Policy)

Question asked by jawwad on Jun 1, 2011
Latest reply on Jun 2, 2011 by jawwad
Hi,

      I just created a custom model (book) in Alfresco 3.4.1. It includes a type b:bookType and an aspect b:bookPublication. Now both are present in the repository with the names D:b:bookType (a content type under cmis:document) and P:b:bookPublication (under cmis:policy)respectively. The D:b:bookType works fine but I cant figure out how to use the P:b:bookPublication. coz when i try to create a new policy using:

      properties.put(PropertyIds.OBJECT_TYPE_ID, BaseTypeId.CMIS_POLICY.value());
      properties.put(PropertyIds.NAME, policyType.getId());
      
      
      Policy policy = customFolder.createPolicy(properties);

it returns error: Exception in thread "main" java.lang.IllegalArgumentException: Property +'cmis:objectTypeId' is not valid for this type!

and I cant find a way to retrieve it as a Policy object. So plz can anyone tell me what should I do or what am I doing wrong?

Any help will be highly appreciated. Thanks in advance.

Outcomes