Hi, i have created this child-association in Alfresco:
<child-association name="da:mcAssociation">
<title>Association</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:content</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
<duplicate>false</duplicate>
<propagateTimestamps>false</propagateTimestamps>
</child-association>
I have setted the "duplicate" tag to "false" because i don't want that duplicate node names are found within a set of children for the parent, so, when i tried to associated a duplicated child-node to a parent, i receive this exception:
"org.alfresco.service.cmr.repository.CyclicChildRelationshipException: Child Association Cycle detected hitting nodes: [1415]".
My goal is to change this exception message and customize it, is possible to change it?
Thank You.
Do you want to show a customised message for the user in Share web application?
I created a new custom content model containing my custom types and associations (type child-associations) and then i created a custom share action that runs a webscript to show this relations in alfresco share.
During the configuration of a node, a user can modify its properties and can associate it with another node that becames its child. Since i have setted the tag duplicate to false, if the user try to associate a duplicate child, the system return an exception message that i want to customize. The exception is of the type "CyclicChildRelationshipException", maybe should i override this type of exception?
A cyclic child relationship has nothing to do with the setting / value of duplicate. It is absolutely forbidden to have a cycle in your data structures. There is no way to override this type of exception without patching / overriding core services or out-of-the-box web scripts. There is also no way to override the exception message since this such a technical error that Alfresco actually embedded the message into the code instead of relying on a translate-able message resource.
Thank you Alex for your reply.
I want to avoid to have cycle in data structure, i want create associations between nodes but i don't want they create a cycle. The only way that i found to do this is to create the child-association as i write above. If there is another way, i appreciate any suggests. Thanks.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.