AnsweredAssumed Answered

Custom model : metadata by doc type in search

Question asked by yanock on Aug 25, 2010
Latest reply on Jun 6, 2011 by ggranato
Hello,

i developped 3 custom model which each contain about 10 metadatas and in my search i have a combo-box with my doc type and i want that when i choose my doc type, it display associated medatadas.

I provide you my models :

model 1
    <?xml version="1.0" encoding="UTF-8"?>

        <!– Definition of new Model –>
        <model name="facture:facturemodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
        
          <!– Optional meta-data about the model –>  
          <description>Modele de documents facture</description>
          <author>M. Meignen</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="facture.new.model" prefix="facture"/>
          </namespaces>
        
          <types>
            <!– Definition of new Content Type: Documents Facture Type 1 –>
            <type name="facture:TypeFacture">
              <title>Facture</title>
              <parent>cm:content</parent>
              <properties>
             <property name="facture:Societe">
              <type>d:text</type>
             </property>
             <property name="facture:Numero de facture">
              <type>d:text</type>
             </property>
             <property name="facture:Type de facture">
              <type>d:text</type>
             </property>
             <property name="facture:Date de facture">
              <type>d:text</type>
             </property>
             <property name="facture:Numero de folio">
              <type>d:text</type>
             </property>
             <property name="facture:Numero de siren">
              <type>d:text</type>
             </property>
             <property name="facture:Numero de TVA">
              <type>d:text</type>
             </property>
             <property name="facture:Numero de commande">
              <type>d:text</type>
             </property>
             <property name="facture:Montant TTC">
              <type>d:text</type>
             </property>
             <property name="facture:Date de creation">
              <type>d:text</type>
             </property>
             <property name="facture:Nom fournisseur">
              <type>d:text</type>
             </property>
              </properties>
            </type>    
          </types>
        </model>


model 2
<?xml version="1.0" encoding="UTF-8"?>

    <!– Definition of new Model –>
    <model name="rh:rhmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    
      <!– Optional meta-data about the model –>  
      <description>Modele de documents RH</description>
      <author>Y. LAURENT</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="rh.new.model" prefix="rh"/>
      </namespaces>
    
      <types>
        <!– Definition of new Content Type: Documents SOS Type 1 –>
        <type name="rh:TypeRH">
          <title>RH</title>
          <parent>cm:content</parent>
          <properties>
            <property name="rh:Dkey">
              <type>d:text</type>
              <!–<mandatory>true</mandatory>–>
         </property>  
         <property name="rh:Periode">
          <type>d:text</type>
         </property>
         <property name="rh:Matricule">
          <type>d:text</type>
         </property>
         <property name="rh:Societe">
          <type>d:text</type>
         </property>
         <property name="rh:Etablissement">
          <type>d:text</type>
         </property>
         <property name="rh:Uo">
          <type>d:text</type>
         </property>
         <property name="rh:Typedoc">
          <type>d:text</type>
         </property>
         <property name="rh:Id_lot">
          <type>d:text</type>
         </property>
         <property name="rh:Credate">
          <type>d:text</type>
         </property>
         <property name="rh:Enregactif">
          <type>d:text</type>
         </property>
          </properties>
        </type>    
      </types>
    </model>

web-client-config-custom.xml :
    <alfresco-config>

       <!– Example of overriding the from email address –>
       <!–
       <config>
          <client>
             <from-email-address>someone@your-domain.com</from-email-address>
             <search-max-results>100</search-max-results>
          </client>
       </config>
       –>

       <!– Example of adding languages to the list in the login page –>

       <config evaluator="string-compare" condition="Languages">
          <languages>
             <language locale="fr_FR">French</language>
          </languages>
       </config>

      

          <!– Configuration de l interface entree doc  –>
          <config evaluator="string-compare" condition="Content Wizards">
            <content-types>
              <type name="rh:TypeRH" />
            <type name="societe:TypeSociete" />
            <type name="facture:TypeFacture" />
            </content-types>
          </config>
        
          <!– On rend visible les proprietes –>
          <config evaluator="node-type" condition="rh:TypeRH">
            <property-sheet>
              <show-property name="rh:Dkey" />
              <show-property name="rh:Periode" />
            <show-property name="rh:Matricule" />
            <show-property name="rh:Societe" />
            <show-property name="rh:Etablissement" />
            <show-property name="rh:Uo" />
            <show-property name="rh:Typedoc" />
            <show-property name="rh:Id_lot" />
            <show-property name="rh:Credate" />
            <show-property name="rh:Enregactif" />
            </property-sheet>
          </config>

          <config evaluator="node-type" condition="societe:TypeSociete">
            <property-sheet>
              <show-property name="societe:Dkey" />
              <show-property name="societe:Periode" />
            <show-property name="societe:Societe" />
            <show-property name="societe:Typedoc" />
            <show-property name="societe:Id_lot" />
            <show-property name="societe:Credate" />
            <show-property name="societe:Enregactif" />
            </property-sheet>
          </config>
       
         <config evaluator="node-type" condition="facture:TypeFacture">
            <property-sheet>
              <show-property name="facture:Societe" />
              <show-property name="facture:Numero de facture" />
            <show-property name="facture:Type de facture" />
            <show-property name="facture:Date de facture" />
            <show-property name="facture:Numero de folio" />
            <show-property name="facture:Numero de siren" />
            <show-property name="facture:Numero de TVA" />
            <show-property name="facture:Numero de commande" />
            <show-property name="facture:Montant TTC" />
            <show-property name="facture:Date de creation" />
            <show-property name="facture:Nom fournisseur" />
            </property-sheet>
          </config>


        <!– Rends actif les type dans le wizard "specialise le type –>  
          <config evaluator="string-compare" condition="Action Wizards">
            <specialise-types>
             <type name="rh:TypeRH"/>
             <type name="societe:TypeSociete"/>
             <type name="facture:TypeFacture" />
            </specialise-types>
          </config>

             <!– Example of configuring advanced search –>

             <config evaluator="string-compare" condition="Advanced Search" replace="true">
               <advanced-search>
                 <content-types>
                   <type name="rh:TypeRH"/>
                   <type name="societe:TypeSociete"/>
                   <type name="facture:TypeFacture" />
                 </content-types>
                 <custom-properties>
                    <meta-data type="rh:TypeRH" property="rh:Dkey"/>
                    <meta-data type="rh:TypeRH" property="rh:Periode" />
                    <meta-data type="rh:TypeRH" property="rh:Matricule" />
                    <meta-data type="rh:TypeRH" property="rh:Societe" />
                    <meta-data type="rh:TypeRH" property="rh:Etablissement" />
                    <meta-data type="rh:TypeRH" property="rh:Uo" />
                    <meta-data type="rh:TypeRH" property="rh:Typedoc" />
                    <meta-data type="rh:TypeRH" property="rh:Id_lot" />
                    <meta-data type="rh:TypeRH" property="rh:Credate" />
                    <meta-data type="rh:TypeRH" property="rh:Enregactif" />
                  
                    <meta-data type="facture:TypeFacture" property="facture:Societe"/>
                    <meta-data type="facture:TypeFacture" property="facture:Numero de facture"/>
                    <meta-data type="facture:TypeFacture" property="facture:Type de facture"/>
                 </custom-properties>
               </advanced-search>
             </config>
    </alfresco-config>


I hope that someone can help me, it will be clearer than display all my metadatas.

Thanks in advance.

Outcomes