12-05-2014 08:32 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <!– Registration of new models –>   
    <bean id="myExtension" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/my-extension-model_1.xml</value>
                <value>alfresco/extension/my-extension-model_2.xml</value>
            </list>
        </property>
    </bean>
</beans>
my-extension-model_1.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<!– The important part here is the name - Note: the use of the my: namespace 
   which is defined further on in the document –>
<model name="my:model_1" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <!– Optional meta-data about the model –>
   <description>Model 1</description>
   <author>mtyc</author>
   <version>1.0</version>
   <!– Imports are required to allow references to definitions in other models –>
   <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" />
   </imports>
   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect 
      your own namespace –>
   <namespaces>
      <namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my" />
   </namespaces>
   <aspects>
      <aspect name="my:model_1_DedicatedAspect">
         <title>My model 1 aspect</title>
         <properties>
            <property name="my:property_1">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="my:property_2">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="my:property_3">
                <type>d:text</type>
            </property>
         </properties>
      </aspect>
   </aspects>
</model>                
my-extension-model_2.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<!– The important part here is the name - Note: the use of the my: namespace 
   which is defined further on in the document –>
<model name="my:model_2" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <!– Optional meta-data about the model –>
   <description>Model 2</description>
   <author>mtyc</author>
   <version>1.0</version>
   <!– Imports are required to allow references to definitions in other models –>
   <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" />
   </imports>
   <!– Introduction of new namespaces defined by this model –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect 
      your own namespace –>
   <namespaces>
      <namespace uri="http://www.mycompany.com/model/content/1.0" prefix="my" />
   </namespaces>
   <aspects>
      <aspect name="my:model_2_DedicatedAspect">
         <title>My model 2 aspect</title>
         <properties>
            <property name="my:property_1">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="my:property_2">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>
      </aspect>
   </aspects>
</model>                
my:model_1_DedicatedAspectmy:model_2_DedicatedAspectmy:companyIdmy:model_1_DedicatedAspect
private static ItemIterable<QueryResult> search(Session session, String property_1) {
   String query = "SELECT d.*, t.* FROM cmis:document as d JOIN my:model_1_DedicatedAspect as t ON d.cmis:objectId = t.cmis:objectId where t.my:property_1 = '" + property_1+ "'";
   ItemIterable<QueryResult> result = session.query(query, false);
   return result;
}
my:model_1_DedicatedAspectmy:model_2_DedicatedAspectmy:model_1_DedicatedAspectmy:model_2_DedicatedAspect 
					
				
		
01-06-2015 04:13 AM
 
					
				
				
			
		
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.