i am newbie to alfresco.This is the custom model.i need to fetch folder contents(cm:folder) also with other custom types(sparepart,metal).below method used to fetch the types but folder contents are not coming.what changes need to be made in custom model xml file and also in java class.List associationRefs = nodeService.getTargetAssocs(nodeRef, EMPContentModel.EMP_NAMESPACE_URI_QNAME_PATTERN);if i add another association under emp:fac then also its not working..
<association name="emp:containsFactoryFolder">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:folder</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
custommodel.xml
<namespaces>
<namespace uri="http://www.emp.com/model/emp-cms-core/2.0" prefix="emp"/>
</namespaces>
<types>
<type name="emp:container">
<title>Container</title>
<parent>cm:folder</parent>
</type>
<type name="emp:fac">
<title>Factory</title>
<parent>emp:container</parent>
<associations>
<association name="emp:containsFactoryAsset">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:asset</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:containsFactorySparePart">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:sparepart</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:containsFactoryMetal">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:metal</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
<type name="emp:sparepart">
<title>Spare Part</title>
<parent>emp:container</parent>
<properties>
<property name="emp:sparePartNumber">
<title>Spare Part Number</title>
<type>d:text</type>
</property>
</properties>
<associations>
<association name="emp:containsSparePartAsset">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:asset</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:containsSparePartMetal">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:metal</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:derivesFromSparePart">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>emp:sparepart</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
<type name="emp:metal">
<title>Metal</title>
<parent>emp:container</parent>
<associations>
<association name="emp:containsMetalAsset">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:asset</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:derivesFromMetal">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>emp:metal</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
<association name="emp:containsMetalMetal">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>emp:metal</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
<type name="emp:content">
<title>Content</title>
<parent>cm:content</parent>
</type>
<type name="emp:asset">
<title>Asset</title>
<parent>emp:content</parent>
</type>
</types>
</model>