problème aspect

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

problème aspect

Bonjour,

Je tente de créer des propriétés différentes en fonction de répertoire de destinations et donc de règles de classement.

J'ai modifié le fichier web-client-config-custon.xml, et le fichier custonModel.xml et custom-model-context.xml.

Tout fonctionne parfaitement….. déjà premier succès et c'est vraiment bien..

Je pousse donc un peu plus loin je vais devoir créer 20 type de propriété il là mes fichier web-client-config-custom.xml et customModel.xml vont devenir énorme et vite illisible.

J'ai donc voulu créer un fichier (type1 = contrat) contratModel.xml
<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<model name="custom:contratModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Contrat Model</description>
   <author></author>
   <version>1.0</version>

   <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 custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="contrat.model" prefix="custom"/>
   </namespaces>
     
    <aspects>
      <!– Definition of new Content Aspect: Individu Details –>
     
      <aspect name="custom:ContractuelDetails">
         <title>Contrat Details</title>
         <properties>
            <property name="custom:ContractuelMatricule">
                       <title>Matricule</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelSociete">
                       <title>Societe</title>
                       <type>d:text</type>
                  </property>             </properties>
      </aspect>
         </aspects>
</model>


Le fichier contrat-context.xml

<?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="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/contratModel.xml</value>
            </list>
        </property>
    </bean>
         
</beans>

Et enfin 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="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </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="mySmiley TongueublishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="mySmiley TonguerocessSteps" />
      </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="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>
   –>

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

   <config evaluator="aspect-name" condition="custom:IndividuDetails">
      <property-sheet>
      <separator name="sepCust1" display-label="Individu Details" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:IndividuNom"/>
         <show-property name="custom:IndividuPrenom"/>
      </property-sheet>
   </config>  
  
    <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:ContractuelDetails"/>
      </aspects>
   </config>

   <config evaluator="aspect-name" condition="custom:ContractuelDetails">
         <property-sheet>
      <separator name="sepCust1" display-label="Contractuels Details" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:ContractuelMatricule"/>
         <show-property name="custom:ContractuelSociete"/>
         <show-property name="custom:ContractuelCompsal"/>
         <show-property name="custom:ContractuelNom"/>
         <show-property name="custom:ContractuelPrenom"/>
         <show-property name="custom:ContractuelEtab"/>
         <show-property name="custom:ContractuelService"/>
         <show-property name="custom:ContractuelNature"/>
         <show-property name="custom:ContractuelRubrique"/>
         <show-property name="custom:ContractuelSignature"/>
         <show-property name="custom:ContractuelTypepaie"/>
         <show-property name="custom:ContractuelDebutPeriode"/>
         <show-property name="custom:ContractuelFinPeriode"/>
         <show-property name="custom:ContractuelMoisPaie"/>
         <show-property name="custom:ContractuelDateEvenement"/>
         <show-property name="custom:ContractuelCodeBarre"/>
         <show-property name="custom:ContractuelCategorie"/>
         <show-property name="custom:ContractuelDebutValidite"/>
         <show-property name="custom:ContractuelFinValidite"/>
         <show-property name="custom:ContractuelDateNum"/>
       </property-sheet>
   </config>  
  
</alfresco-config>



et j'ai une erreur dans les logs :

Caused by: org.alfresco.service.cmr.dictionary.InvalidAspectException: The aspect is invalid: {custom.model}ContractuelDetails

Est ce vraiment possible, et si oui j'ai du louper une truc.

Merci pour votre aide
28 Replies
hlander10
Member II

Re: problème aspect

Pas d'idée ou de vécu….
bch
Member II

Re: problème aspect

Bonjour,

L'erreur est obtenu au lancement d'Alfresco ou durant l'exécution.
hlander10
Member II

Re: problème aspect

durant l'exécution,
bch
Member II

Re: problème aspect

Je pense que la configuration de votre client graphique est incorrecte (dans le cas où le modèle que vous avez fourni est complet) car vous spécifiez une configuration graphique pour l'aspect custom:IndividuDetails mais il n'existe pas dans votre définition du modèle.
hlander10
Member II

Re: problème aspect

je pense que si car j'ai ce fichier customModel.xml

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

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author></author>
   <version>1.0</version>

   <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 custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
   </namespaces>
     
   <aspects>
      <!– Definition of new Content Aspect: Individu Details –>
     
      <aspect name="custom:IndividuDetails">
         <title>Individu Details</title>
         <properties>
            <property name="custom:IndividuNom">
               <title>Individu Nom</title>
               <type>d:text</type>
            </property>
            <property name="custom:IndividuPrenom">
               <title>Individu prénom</title>
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
     
     
     
   </aspects>
</model>
bch
Member II

Re: problème aspect

Vous spécifiez une configuration graphique pour l'aspect custom:IndividuDetails mais il n'existe pas dans votre définition du modèle.

De plus, vous souhaitez afficher des attributs de l'aspect qui n'existent pas :
<show-property name="custom:ContractuelMatricule"/>
<show-property name="custom:ContractuelSociete"/>
<show-property name="custom:ContractuelCompsal"/>
<show-property name="custom:ContractuelNom"/>
<show-property name="custom:ContractuelPrenom"/>
<show-property name="custom:ContractuelEtab"/>
<show-property name="custom:ContractuelService"/>
<show-property name="custom:ContractuelNature"/>
<show-property name="custom:ContractuelRubrique"/>
<show-property name="custom:ContractuelSignature"/>
<show-property name="custom:ContractuelTypepaie"/>
<show-property name="custom:ContractuelDebutPeriode"/>
<show-property name="custom:ContractuelFinPeriode"/>
<show-property name="custom:ContractuelMoisPaie"/>
<show-property name="custom:ContractuelDateEvenement"/>
<show-property name="custom:ContractuelCodeBarre"/>
<show-property name="custom:ContractuelCategorie"/>
<show-property name="custom:ContractuelDebutValidite"/>
<show-property name="custom:ContractuelFinValidite"/>
<show-property name="custom:ContractuelDateNum"/>
hlander10
Member II

Re: problème aspect

Excusez moi mais je comprends pas votre remarque.

Je repart du début, tout fonctionne (du moins il me semble) avec ces fichiers

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="ca_ES">Catalan</language>
         <language locale="hr_HR">Croatian</language>
         <language locale="cs_CZ">Czech</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pl_PL">Polish</language>
         <language locale="pt_PT">Portuguese</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="sv_SV">Swedish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </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="mySmiley TongueublishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="mySmiley TonguerocessSteps" />
      </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="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>
   –>

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

   <config evaluator="aspect-name" condition="custom:IndividuDetails">
      <property-sheet>
      <separator name="sepCust1" display-label="Individu Details" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:IndividuNom"/>
         <show-property name="custom:IndividuPrenom"/>
      </property-sheet>
   </config>  
  
    <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="custom:ContractuelDetails"/>
      </aspects>
   </config>

   <config evaluator="aspect-name" condition="custom:ContractuelDetails">
         <property-sheet>
      <separator name="sepCust1" display-label="Contractuels Details" component-generator="HeaderSeparatorGenerator" />
         <show-property name="custom:ContractuelMatricule"/>
         <show-property name="custom:ContractuelSociete"/>
         <show-property name="custom:ContractuelCompsal"/>
         <show-property name="custom:ContractuelNom"/>
         <show-property name="custom:ContractuelPrenom"/>
         <show-property name="custom:ContractuelEtab"/>
         <show-property name="custom:ContractuelService"/>
         <show-property name="custom:ContractuelNature"/>
         <show-property name="custom:ContractuelRubrique"/>
         <show-property name="custom:ContractuelSignature"/>
         <show-property name="custom:ContractuelTypepaie"/>
         <show-property name="custom:ContractuelDebutPeriode"/>
         <show-property name="custom:ContractuelFinPeriode"/>
         <show-property name="custom:ContractuelMoisPaie"/>
         <show-property name="custom:ContractuelDateEvenement"/>
         <show-property name="custom:ContractuelCodeBarre"/>
         <show-property name="custom:ContractuelCategorie"/>
         <show-property name="custom:ContractuelDebutValidite"/>
         <show-property name="custom:ContractuelFinValidite"/>
         <show-property name="custom:ContractuelDateNum"/>
       </property-sheet>
   </config>  
  
</alfresco-config>
———————————————————————-
et celui-ci : customModel.xml
——————————————————————–
<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<!– Note: This model is pre-configured to load at startup of the Repository.  So, all custom –>
<!–       types and aspects added here will automatically be registered –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author></author>
   <version>1.0</version>

   <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 custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
   </namespaces>
     
   <aspects>
      <!– Definition of new Content Aspect: Individu Details –>
     
      <aspect name="custom:IndividuDetails">
         <title>Individu Details</title>
         <properties>
            <property name="custom:IndividuNom">
               <title>Individu Nom</title>
               <type>d:text</type>
            </property>
            <property name="custom:IndividuPrenom">
               <title>Individu prénom</title>
               <type>d:text</type>
            </property>
         </properties>
      </aspect>
     
      <aspect name="custom:ContractuelDetails">
         <title>Contrat Details</title>
         <properties>
            <property name="custom:ContractuelMatricule">
                       <title>Matricule</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelSociete">
                       <title>Societe</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelCompsal">
                       <title>Compsal></title>
                       <type>d:int</type>
                  </property>
                  <property name="custom:ContractuelNom">
                       <title>Nom</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelPrenom">
                       <title>Prenom</title>
                        <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelEtab">
                       <title>Etablissement</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelService">
                       <title>Service</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelNature">
                       <title>Nature</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelRubrique">
                       <title>Rubrique</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelSignature">
                       <title>Signature</title>
                       <type>d:boolean</type>
                  </property>
                  <property name="custom:ContractuelTypepaie">
                       <title>Typepaie</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelDebutPeriode">
                       <title>Debut Periode</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelFinPeriode">
                       <title>FinPeriode</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelMoisPaie">
                       <title>Mois Paie</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelDateEvenement">
                       <title>Date Evenement</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelCodeBarre">
                       <title>Code Barre</title>
                       <type>d:text</type>
                  </property>
                  <property name="custom:ContractuelDebutValidite">
                       <title>Debut Validite</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelFinValidite">
                       <title>FinValidite</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelDateNum">
                       <title>Date Numérisation</title>
                       <type>d:date</type>
                  </property>
                  <property name="custom:ContractuelCategorie">
                       <title>Categorie</title>
                       <type>d:text</type>
                  </property>
             </properties>
      </aspect>
     
   </aspects>
</model>
—————————————————————————
Comment faire alors pour sortir la partit contrat du customModel.xml ?
bch
Member II

Re: problème aspect

Dans les premiers fichiers que vous avez envoyé, votre définition de modèle contient seulement l'aspect custom:ContractuelDetails alors qu'il existe une configuration graphique pour les aspects custom:ContractuelDetails  et custom:IndividuDetails.
hlander10
Member II

Re: problème aspect

excusez moi alors….

mais coment découper ce fichier qui fonctionne en plusieurs