Hi John,

The reason for your error (gc:reviews is not an object type) is that Alfresco 
does not map all of its child associations to the CMIS domain model, so they 
are unknown to the CMIS layer. In Alfresco, we only map the folder "contains" 
child association to the native CMIS folder/document parent/child relationship. 
Please note, other CMIS servers may have a different approach to mapping their 
notion of relationships to CMIS.

As you have seen, we map all Alfresco peer associations to CMIS relationships, 
and so gc:reviews becomes visible to CMIS.

I realise this doesn't necessarily resolve your issue, but at least you should 
know why it happens.

Regards,
Dave


On 7 Oct 2010, at 06:46, John Dorman wrote:

> Hey all,
> 
> I have a child-association on on a custom object in Alfresco 3.4a.  When I
> call the code below it tells me that gc:reviews is not a objectType
> 
> Map<String,Object> relProps = new HashMap<String, Object>();
> relProps.put("cmis:sourceId", document.getId());
>        relProps.put("cmis:targetId", entity.getDocId());
>        relProps.put("cmis:objectTypeId", "R:gc:reviews");
>        session.createRelationship(relProps, null, null, null);
> 
> If I change the relationship type from child-association to just an
> association it works fine.
> 
> Any thoughts?
> 
> Association in customModel.xml
> 
> BAD:
> <associations>
> <child-association name="gc:reviews">
> <source>
> <mandatory>false</mandatory>
> <many>false</many>
> </source>
> <target>
> <class>gc:course_review</class>
> <mandatory>false</mandatory>
> <many>true</many>
> </target>
> </child-association>
> </associations>
> 
> GOOD:
> 
> <associations>
> <association name="gc:reviews">
> <source>
> <mandatory>false</mandatory>
> <many>false</many>
> </source>
> <target>
> <class>gc:user_review</class>
> <mandatory>false</mandatory>
> <many>true</many>
> </target>
> </association>
> </associations>
> 
> 
> Thanks a ton for looking into it!

Reply via email to