Recherche globale sur un custom model

cancel
Showing results for 
Search instead for 
Did you mean: 
yanock
Member II

Recherche globale sur un custom model

Bonjour,

j'aimerai savoir s'il est possible d'utiliser la recherche globale (le carré en haut à droite) afin de rechercher sur des méta-données d'un custom model.

J'ai intégré ces méta-données dans la recherche avancée mais si je pouvais l'implémenter dans la recherche générale, cela faciliterai l'utilisation de mes utilisateurs.

Je joins mes models, peut-être ai-je oublier quelque chose.


Model :

<?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:NumFacture">
            <title>Numero de facture</title>
             <type>d:text</type>
           </property>
           <property name="facture:TypeFacture">
            <title>Type de facture</title>
             <type>d:text</type>
           </property>
           <property name="facture:DateFacture">
               <title>Date de facture</title>
             <type>d:text</type>
           </property>
           <property name="facture:NumFolio">
               <title>Numero de folio</title>
             <type>d:text</type>
           </property>
           <property name="facture:NumSiren">
               <title>Numero de siren</title>
             <type>d:text</type>
           </property>
           <property name="facture:NumTVA">
               <title>Numero de TVA</title>
             <type>d:text</type>
           </property>
           <property name="facture:NumCommande">
               <title>Numero de commande</title>
             <type>d:text</type>
           </property>
           <property name="facture:MontantTTC">
            <title>Montant TTC</title>
             <type>d:text</type>
           </property>
           <property name="facture:DateCreation">
            <title>Date de creation</title>
             <type>d:text</type>
           </property>
           <property name="facture:NomFournisseur">
            <title>Nom fournisseur</title>
             <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:NumFacture" />
          <show-property name="facture:TypeFacture" />
          <show-property name="facture:DateFacture" />
          <show-property name="facture:NumFolio" />
          <show-property name="facture:NumSiren" />
          <show-property name="facture:NumTVA" />
          <show-property name="facture:NumCommande" />
          <show-property name="facture:MontantTTC" />
          <show-property name="facture:DateCreation" />
          <show-property name="facture:NomFournisseur" />
        </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="facture:TypeFacture" property="facture:Societe"/>
                     <meta-data type="facture:TypeFacture" property="facture:NumFacture"/>
                     <meta-data type="facture:TypeFacture" property="facture:TypeFacture"/>
                     <meta-data type="facture:TypeFacture" property="facture:DateFacture"/>
                     <meta-data type="facture:TypeFacture" property="facture:NumFolio"/>
                     <meta-data type="facture:TypeFacture" property="facture:NumSiren"/>
                     <meta-data type="facture:TypeFacture" property="facture:NumTVA"/>
                     <meta-data type="facture:TypeFacture" property="facture:NumCommande"/>
                     <meta-data type="facture:TypeFacture" property="facture:MontantTTC"/>
                     <meta-data type="facture:TypeFacture" property="facture:DateCreation"/>
                     <meta-data type="facture:TypeFacture" property="facture:NomFournisseur"/>
                 <!–
                     <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" />
                –>
                </custom-properties>
                
              </advanced-search>
           </config>
   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>
   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <property-sheet>
         <show-property name="mimetype" display-label-id="content_type"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />              
         <show-property name="my:publishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="my:processSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="cm:storeSelector">
      <property-sheet>
         <show-property name="cm:storeName" />
      </property-sheet>
   </config>
   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="cm:storeSelector"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

</alfresco-config>


Merci d'avance.
1 Reply
yanock
Member II

Re: Recherche globale sur un custom model

Un petit message pour dire que j'ai réussi à le faire fonctionner sur Explorer.

Dans mon model j'ai modifié :

<namespaces>
        <namespace uri="facture.model" prefix="facture"/>
</namespaces>

facture.new.model devient facture.model


et dans le web-client-config-custom.xml j'ai rajouté ça :

   <config>
      <client>
         <simple-search-additional-attributes>
            <qname>
               {facture.model}Societe
            </qname>
            <qname>
               {facture.model}NumFacture
            </qname>
            <qname>
               {facture.model}TypeDeFacture
            </qname>
            <qname>
               {facture.model}DateFacture
            </qname>
            <qname>
               {facture.model}NumFolio
            </qname>
            <qname>
               {facture.model}NumSiren
            </qname>
            <qname>
               {facture.model}NumTVA
            </qname>
            <qname>
               {facture.model}NumCommande
            </qname>
            <qname>
               {facture.model}MontantTTC
            </qname>
            <qname>
               {facture.model}DateCreation
            </qname>
            <qname>
               {facture.model}NomFournisseur
            </qname>            
         </simple-search-additional-attributes>
      </client>
   </config>
  

En esperant que cela aidera certains.

Maintenant je voudrais faire fonctionner cette même recherche dans share, je suis étonné d'ailleurs que cela ne se transmette pas.
Je modifie les models et le web-client.xml à travers explorer  : Company Home > Data Dictionary > Models pour le model and Company Home > Data Dictionary > Web Client Extension pour le web-client.xml.

Je me dis que le problème vient peut être de là. Sinon je n'ai pas d'autres pistes.

Avis aux amateurs Smiley Happy