Help in using CMLCreateAssociation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2011 09:13 AM
Hi
I am trying to create peer association between two nodes . Following is my code
This is Giving following Exception
What i am doing wrong here.
Please help
Thank you
Anshul
I am trying to create peer association between two nodes . Following is my code
try { Predicate predicate_epubFile=new Predicate(new Reference[]{ref_epubFile},storeRef, null); Predicate predicate_epubCoverImage=new Predicate(new Reference[]{ref_epubImage},storeRef,null); CMLCreateAssociation createAssociation=new CMLCreateAssociation(predicate_epubFile,null,predicate_epubCoverImage,null,Constants.ASSOC_CONTAINS); cml = new CML(); cml.setCreateAssociation(new CMLCreateAssociation[]{createAssociation}); WebServiceFactory.getRepositoryService().update(cml); } catch(RepositoryFault e) { e.getMessage(); }
This is Giving following Exception
org.alfresco.repo.node.integrity.IntegrityException: 01010388 Found 1 integrity violations:The association source type is incorrect: Source Node: workspace://SpacesStore/27aedefe-eeb9-45d3-a0b8-99c8cd8b7941 Association: Association[ class=ClassDef[name={http://www.alfresco.org/model/content/1.0}folder], name={http://www.alfresco.org/model/content/1.0}contains, target class={http://www.alfresco.org/model/system/1.0}base, source role=null, target role=null] Required Source Type: {http://www.alfresco.org/model/content/1.0}folder Actual Source Type: {http://www.alfresco.org/model/content/1.0}content
What i am doing wrong here.
Please help
Thank you
Anshul
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2011 06:16 AM
Have you declared the peer association between these two content types?
Associations must be declared in the Content Model of Alfresco in the content type definition or in an Aspect definition:
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Peer_.28Non-Child.29_Associations
Hope this helps.
Associations must be declared in the Content Model of Alfresco in the content type definition or in an Aspect definition:
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#Peer_.28Non-Child.29_Associations
Hope this helps.
