I have node has an association as child association with set of another nodes, what i know is once the node deleted the child association will be deleted in a cascading manner.
but i don't see that in my code, i write a recursive function to delete the child and my question how to enable the cascading delete.
My Model.
<description>Security Cont开发者_运维知识库ent Model</description>
<author>MOHAMMED AMR</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
<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 uri="http://www.alfresco.org/model/user/1.0" prefix="usr"/>
</imports>
<namespaces>
<namespace uri="www.ds.alfresco.security.extension.com" prefix="sec" />
</namespaces>
<constraints>
<constraint name="sec:permissionValue" type="LIST">
<parameter name="allowedValues">
<list>
<value>READ SADER</value>
<value>WRITE SADER</value>
<value>READ WARED</value>
<value>WRITE WARED</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<type name="sec:organizationSequence">
<title>Organization Sequence</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>sec:sequencable</aspect>
</mandatory-aspects>
</type>
<type name="sec:positionSequence">
<title>Position Sequence</title>
<parent>cm:content</parent>
<mandatory-aspects>
<aspect>sec:sequencable</aspect>
</mandatory-aspects>
</type>
<type name="sec:position">
<title>Position</title>
<parent>cm:content</parent>
<properties>
<property name="sec:positionId">
<title>Position ID</title>
<type>d:text</type>
</property>
<property name="sec:positionName">
<title>Position Name</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sec:positionDescription">
<title>Position Description</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sec:parentPositionId">
<title>Position Description</title>
<type>d:int</type>
<default>0</default>
</property>
<property name="sec:permissions">
<title>Position Permission</title>
<type>d:text</type>
<multiple>true</multiple>
<constraints>
<constraint ref="sec:permissionValue" />
</constraints>
</property>
</properties>
<associations>
<child-association name="sec:suborindatesPositions">
<source>
<mandatory>true</mandatory>
<many>false</many>
</source>
<target>
<class>sec:position</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
<duplicate>false</duplicate>
<propagateTimestamps>true</propagateTimestamps>
</child-association>
</associations>
</type>
<type name="sec:organization">
<title>Organization</title>
<parent>cm:content</parent>
<properties>
<property name="sec:organizationId">
<title>Organization ID</title>
<type>d:int</type>
</property>
<property name="sec:organizationName">
<title>Organization Name</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sec:organizationDescription">
<title>Organization Description</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="sec:rootPosition">
<title>Root Position</title>
<type>d:noderef</type>
</property>
</properties>
</type>
</types>
<aspects>
<aspect name="sec:sequencable">
<title>Capable to have sequence</title>
<parent>cm:content</parent>
<properties>
<property name="sec:sequenceId">
<title>Sequence</title>
<type>d:int</type>
</property>
<property name="sec:sequenceName">
<title>Sequence Name</title>
<type>d:text</type>
</property>
</properties>
</aspect>
<aspect name="sec:positionable">
<title>Capable to have position</title>
<properties>
<property name="sec:primaryPosition">
<title>Primary Position</title>
<type>d:noderef</type>
<multiple>false</multiple>
</property>
<property name="sec:secondaryPositions">
<title>Primary Position</title>
<type>d:noderef</type>
<multiple>true</multiple>
</property>
</properties>
</aspect>
</aspects>
精彩评论