cancel
Showing results for 
Search instead for 
Did you mean: 

Child Associations

removedquasar
Champ in-the-making
Champ in-the-making
I created 5 content types and i want to associate them with some child associations: a type (mm:doc) should be the "father" of the other 4 types, is it correct this code? :

<types>  
          <!– Documento Generale  –>
          <type name="mm:doc">
           <title>Documento Generale</title>
           <parent>cm:content</parent>
        </type>      
         
   

          <!– Documento Ufficio Legale–>
          <type name="mm:legal">
           <title>Documento Legale</title>
           <parent>mm:doc</parent>
           <associations>
            <child-association name="mm:Legalassociations">
              <title>Documenti Legali collegati</title>
              <source>
               <mandatory>false</mandatory>
               <many>false</many>
              </source>
              <target>
               <class>mm:doc</class>
               <mandatory>false</mandatory>
               <many>true</many>
              </target>
             </child-association>
            </associations>
          </type>        
       

        <!– Documento Ufficio Amministrazione –>
        <type name="mm:administration">
         <title>Documento Amministrazione</title>
         <parent>mm:doc</parent>
         <associations>
            <child-association name="mm:Adminassociations">
              <title>Documenti Amministrativi collegati</title>
              <source>
               <mandatory>false</mandatory>
               <many>true</many>
              </source>
              <target>
               <class>mm:doc</class>
               <mandatory>false</mandatory>
               <many>true</many>
              </target>
             </child-association>
            </associations>
        </type>
      
      
       <!– Documento Magazzino –>
       <type name="mm:store">
        <title>Documento Magazzino</title>
        <parent>mm:doc</parent>
        <associations>
            <child-association name="mm:Storeassociations">
              <title>Documenti Magazzino collegati</title>
              <source>
               <mandatory>false</mandatory>
               <many>false</many>
              </source>
              <target>
               <class>mm:doc</class>
               <mandatory>false</mandatory>
               <many>true</many>
              </target>
             </child-association>
            </associations>
       </type>
      
       <!– Documento Ufficio Vendite–>
       <type name="mm:sell">
        <title>Documento Vendite</title>
        <parent>mm:doc</parent>
        <properties>
             <property name="mm:prop">
              <type>d:text</type>
              <protected>true</protected>
              <default></default>
              <constraints>
                <constraint ref="mm:stringLength"/>
              </constraints>
            </property>
         </properties>
         <associations>
            <child-association name="mm:Sellassociations">
              <title>Documenti Vendite collegati</title>
              <source>
               <mandatory>false</mandatory>
               <many>false</many>
              </source>
              <target>
               <class>mm:doc</class>
               <mandatory>false</mandatory>
               <many>true</many>
              </target>
             </child-association>
            </associations>
       
      </type>


</types>

Ad another question, in the file web-config-custom.xml i have to use a config tag for each type wichi i want to associate?
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
I didn't test it, but from a quick glance it looks right to me.

Yes, you have to provide UI config for each of those types.

Jeff