How change exception message in a child-association
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2018 06:23 AM
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.
- Labels:
-
Alfresco Content Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 04:22 AM
Do you want to show a customised message for the user in Share web application?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 05:09 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 05:38 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2018 06:02 AM
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.
