I want to create two model in alfresco having parent and child relation. From child model, i want to access all the property of parent model.
Asked
Active
Viewed 111 times
1 Answers
1
This should be practically trivial.
Your child model needs to import the parent model, and this is done through the child model's XML. After this, you will be able to access properties from the parent model by using their prefix.
For example:
<imports>
<!-- Import Alfresco Dictionary Definitions -->
<import uri="http://www.alfresco.org/model/dictionary/1.0"
prefix="d"/>
<!-- Import Alfresco Content Domain Model Definitions -->
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
<!-- Import Alfresco Records Management Model Definitions -->
<import uri="http://www.alfresco.org/model/recordsmanagement/1.0"
prefix="rma"/>
</imports>

Lista
- 2,186
- 1
- 15
- 18
-
1to avoid misunderstandings (since chandan singh mentioned parent and child relation): Alfresco does not support to dynamically inherit properties from nodes having a parent assoc as seen in other dms systems. So you can't search for child nodes using properties defined on a parent node assoc (JOIN). The only work around would be to either extend the solr tracker to also collect the parent properties into the index doc (no extension points from Alfresco) or to duplicate the properties by implementing a behavior which may be quite heavy. – Heiko Robert Dec 17 '20 at 10:47