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