如何启用级联删除

时间:2011-08-28 09:43:26

标签: alfresco

我有节点有一个关联作为子关联与另一个节点的集合,我知道一旦删除节点,子关联将以级联方式删除。

但我没有看到在我的代码中,我编写了一个递归函数来删除子项以及我的问题如何启用级联删除。

我的模特。

<description>Security Content 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>

0 个答案:

没有答案