Création de contenus personnalisés

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

Création de contenus personnalisés

Bonjour, je suis nouveau sur le forum tout comme avec Alfresco 3.2 =)

J'aurais besoin de votre aide concernant la création de contenu personnalisé, je m'explique :

Je voudrais que, en saisissant 'Créer un contenu', dans Propriétés générales > Type, je puisse sélectionner parmis plusieurs types de contenus.
[img]http://img830.imageshack.us/img830/8706/captureds.jpg[/img]
Je voudrais par exemple avoir le choix entre Contenu, Compte rendu d'une Réunion et Compte rendu d'une Réalisation.
compteRendu-model-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/compteRenduModel.xml</value>
            </list>
        </property>
    </bean>
</beans>
compteRenduModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cr:gemadecmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Gemadec Model</description>
   <author>ehtp</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 –>
   <namespaces>
      <namespace uri="http://www.gemadec.com/model/content/1.0" prefix="cr" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="cr:doc1">
         <title>Compte rendu de Reunion</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>            
            <property name="cr:titreProjet">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:objetReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:presentClient">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="cr:presentSociete">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>            
         </properties>         
      </type>
   </types>
</model>
Comme vous pouvez le voir, le premier marche et s'affiche.
Tous ces fichiers se trouvent dans C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension
Maintenant, je voudrais creer un autre type de contenu:
CRR2-model-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/CRR2Model.xml</value>
            </list>
        </property>
    </bean>
</beans>
CRR2Model.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cr:gemadecmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Gemadec Model</description>
   <author>ehtp</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 –>
   <namespaces>
      <namespace uri="http://www.gemadec.com/model/content/1.0" prefix="cr" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="cr:doc2">
         <title>Compte rendu d'une Realisation</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>            
         </properties>         
      </type>      
   </types>
</model>
Et voici enfin web-client-config-custom.xml :
<alfresco-config>



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



<!– Envoyer tache______________________________________________________________________ workflow tasks –>
  
  
    <config evaluator="node-type" condition="pwf:envoyerTache" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_adhoc_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_adhoc_due_date" />
       <show-property name="pwf:notifyAssignee" />
         <show-property name="pwf:notifyMe" />
       <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
      <show-association name="bpm:assignee" />
        
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheAssignee" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheComplete" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
        
      </property-sheet>
   </config>
  
  
  
  
  
    <!– Review and Approve workflow tasks –>

   <config evaluator="node-type" condition="pwf:submitReviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_review_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_review_due_date" />
        <show-property name="pwf:notifyAssignee1" />
       <show-property name="pwf:notifyMe1" />
      
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:reviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:rejectedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:approvedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>
  
   <!–  add webable aspect  ******************************************************************************************************************************properties to property sheet –>
   

   <!–  add product related aspect properties to property sheet –>
   

   <!– show related documents association on doc property sheet –>
   
   
   <config evaluator="node-type" condition="cr:doc1">
      <property-sheet>
         <separator name="sep2" display-label-id="detailCr" component-generator="HeaderSeparatorGenerator" />
         <show-property name="cr:NumReunion" display-label-id="NumReunion" />
         <show-property name="cr:dateReunion" display-label-id="dateReunion" />
         <show-property name="cr:lieuReunion" display-label-id="lieuReunion" />
         <show-property name="cr:titreProjet" display-label-id="titreProjet" />
         <show-property name="cr:objetReunion" component-generator="TextAreaGenerator" display-label-id="objetReunion" />
         <show-property name="cr:presentClient"  component-generator="TextAreaGenerator" display-label-id="presentClient" />
         <show-property name="cr:presentSociete" component-generator="TextAreaGenerator" display-label-id="presentSociete" />
         <show-property name="cr:absents" component-generator="TextAreaGenerator" display-label-id="absents" />
         
      </property-sheet>
   </config>

   <!– show related documents association on whitepaper property sheet –>
   
      
   <!–  add someco types to add content list –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </content-types>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
       <!– The list of aspects to show in the add/remove features action –>
       <!– and the has-aspect condition –>   
      
      <!– The list of types shown in the is-subtype condition –>
      <subtypes>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </subtypes>      

   <config evaluator="string-compare" condition="Action Wizards">
       <!– The list of aspects to show in the add/remove features action –>
       <!– and the has-aspect condition –>   
      
      <!– The list of types shown in the is-subtype condition –>
      <subtypes>
         <type name="cr:doc1" />
                        <type name="cr:doc2" />
      </subtypes>      

      <!– The list of content and/or folder types shown in the specialise-type action –>
      <specialise-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </specialise-types>      
   </config>   
   
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="cr:doc1" />
            <type name="cr:doc2" />
         </content-types>
      </advanced-search>
   </config>
</alfresco-config>
Je suis conscient que le fait de debuter avec alfresco n'est pas une excuse pour faire d'aussi grosses gaffes (car je sais qu'il y'en a pas mal, surtout a la fin quand j'ai double les <type name> pour doc2), mais si quelqu'un pourrait me donner un petit coup de pouce, ce serait vraiment super!

Quelqu'un serait ce qu'il faudrait modifier dans tout ca pour avoir dans la liste deroulante les deux rapports ainsi que 'Contenu' ?
Merci d'avance pour toute aide!  Smiley Very Happy

PS : j'ai aussi change dans un certain someco-model-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/compteRenduModel.xml</value>
            <value>alfresco/extension/CRR2Model.xml</value>               
            
            </list>
        </property>
    </bean>
</beans>
Merci d'avance pour toute aide!


EDIT: J'ai cru comprendre qu'il faut créer un autre web-client-config-custom.xml pour le second type de contenu.
(J'enleverais donc ce que j'ai ajouter par rapport a doc2)
Ma question est : Ou faut-il mettre les fichiers du nouveau type de contenu ? Et que faut-il changer d'autre ?
7 Replies
jayjayecl
Active Member II

Re: Création de contenus personnalisés

Essayez l'architecture suivante, et revenez poster ici le contenu des différents fichiers après cette réorganisation :
- un seul modèle XXXModel.xml, ou si votre besoin est réel, deux modèles : compteRenduModel.xml et CRR2Model.xml
- un seul fichier de déclaration de contexte : XXX-context.xml
- un seul fichier web-client-config-custom.xml

le tout dans tomcat/shared/classes/alfresco/extension

si ca ne fonctionne pas, donnez-nous ici le contenu de chaque fichier.

Merci
mymemorial
Member II

Re: Création de contenus personnalisés

Salut, merci beaucoup d'essayer de m'aider  :wink:

Dans C:\Alfresco\tomcat\shared\classes\alfresco\extension :

compteRenduModel.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cr:gemadecmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Gemadec Model</description>
   <author>ehtp</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 –>
   <namespaces>
      <namespace uri="http://www.gemadec.com/model/content/1.0" prefix="cr" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="cr:doc1">
         <title>Compte rendu de Reunion</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>            
            <property name="cr:titreProjet">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:objetReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:presentClient">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="cr:presentSociete">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
         </properties>
         
      </type>

      
   </types>


</model>

CRR2Model.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cr:gemadecmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Gemadec Model</description>
   <author>ehtp</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 –>
   <namespaces>
      <namespace uri="http://www.gemadec.com/model/content/1.0" prefix="cr" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="cr:doc2">
         <title>Compte rendu de Realisation</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>            
            <property name="cr:titreProjet">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:objetReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:presentClient">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="cr:presentSociete">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
         </properties>
         
      </type>

      
   </types>


</model>

compteRendu-model-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/compteRenduModel.xml</value>
                <value>alfresco/extension/CRR2Model.xml</value>
            </list>
        </property>
    </bean>
</beans>
web-client-config-custom.xml :
<alfresco-config>



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



<!– Envoyer tache______________________________________________________________________ workflow tasks –>
  
  
    <config evaluator="node-type" condition="pwf:envoyerTache" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_adhoc_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_adhoc_due_date" />
       <show-property name="pwf:notifyAssignee" />
         <show-property name="pwf:notifyMe" />
       <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
      <show-association name="bpm:assignee" />
        
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheAssignee" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheComplete" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
        
      </property-sheet>
   </config>
  
  
  
  
  
    <!– Review and Approve workflow tasks –>

   <config evaluator="node-type" condition="pwf:submitReviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_review_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_review_due_date" />
        <show-property name="pwf:notifyAssignee1" />
       <show-property name="pwf:notifyMe1" />
     
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:reviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:rejectedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:approvedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>
  
   <!–  add webable aspect  ******************************************************************************************************************************properties to property sheet –>
  

   <!–  add product related aspect properties to property sheet –>
  

   <!– show related documents association on doc property sheet –>
  
  
   <config evaluator="node-type" condition="cr:doc1">
      <property-sheet>
         <separator name="sep2" display-label-id="detailCr" component-generator="HeaderSeparatorGenerator" />
         <show-property name="cr:NumReunion" display-label-id="NumReunion" />
         <show-property name="cr:dateReunion" display-label-id="dateReunion" />
         <show-property name="cr:lieuReunion" display-label-id="lieuReunion" />
         <show-property name="cr:titreProjet" display-label-id="titreProjet" />
         <show-property name="cr:objetReunion" component-generator="TextAreaGenerator" display-label-id="objetReunion" />
         <show-property name="cr:presentClient"  component-generator="TextAreaGenerator" display-label-id="presentClient" />
         <show-property name="cr:presentSociete" component-generator="TextAreaGenerator" display-label-id="presentSociete" />
         <show-property name="cr:absents" component-generator="TextAreaGenerator" display-label-id="absents" />
        
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="cr:doc2">
      <property-sheet>
         <separator name="sep2" display-label-id="detailCr" component-generator="HeaderSeparatorGenerator" />
         <show-property name="cr:NumReunion" display-label-id="NumReunion" />
         <show-property name="cr:dateReunion" display-label-id="dateReunion" />
         <show-property name="cr:lieuReunion" display-label-id="lieuReunion" />
         <show-property name="cr:titreProjet" display-label-id="titreProjet" />
         <show-property name="cr:objetReunion" component-generator="TextAreaGenerator" display-label-id="objetReunion" />
         <show-property name="cr:presentClient"  component-generator="TextAreaGenerator" display-label-id="presentClient" />
         <show-property name="cr:presentSociete" component-generator="TextAreaGenerator" display-label-id="presentSociete" />
         <show-property name="cr:absents" component-generator="TextAreaGenerator" display-label-id="absents" />
        
      </property-sheet>
   </config>


   <!– show related documents association on whitepaper property sheet –>
  
     
   <!–  add someco types to add content list –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </content-types>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
       <!– The list of aspects to show in the add/remove features action –>
       <!– and the has-aspect condition –>  
     
      <!– The list of types shown in the is-subtype condition –>
      <subtypes>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </subtypes>     

   <config evaluator="string-compare" condition="Action Wizards">
       <!– The list of aspects to show in the add/remove features action –>
       <!– and the has-aspect condition –>  
     
      <!– The list of types shown in the is-subtype condition –>
      <subtypes>
         <type name="cr:doc1" />
                        <type name="cr:doc2" />
      </subtypes>     

      <!– The list of content and/or folder types shown in the specialise-type action –>
      <specialise-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </specialise-types>     
   </config>  
  
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="cr:doc1" />
            <type name="cr:doc2" />
         </content-types>
      </advanced-search>
   </config>
</alfresco-config>
J'ai redémarrer Tomcat, et pour le moment je vois juste le 'Compte rendu de Reunion', comme dans la capture d'écran tout en haut, dans le premier sujet.
Apparement il n'y a pas eu de changements, comme si ce que j'ai fait dans tomcat/shared/classes/alfresco/extension n'a pas ete pris en compte…
jayjayecl
Active Member II

Re: Création de contenus personnalisés

Si vous avez deux fichiers de modèles, ils ne peuvent pas avoir le même nom, la même URI ni le même prefix :

<model name="cr:gemadecmodel" etc …
mymemorial
Member II

Re: Création de contenus personnalisés

J'ai change les noms, URI et préfixes entre les deux fichiers de modèles, ca ne donne rien.

Pareil, j'ai utilisé le même fichier .xml pour les deux modèles, et toujours rien.

compteRendu-model-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/compteRenduModel.xml</value>
            </list>
        </property>
    </bean>
</beans>

compteRenduModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cr:gemadecmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Gemadec Model</description>
   <author>ehtp</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 –>
   <namespaces>
      <namespace uri="http://www.gemadec.com/model/content/1.0" prefix="cr" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="cr:doc1">
         <title>Compte rendu de Reunion</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>            
            <property name="cr:titreProjet">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:objetReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:presentClient">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="cr:presentSociete">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
         </properties>
         
      </type>

      <type name="cr:doc2">
         <title>Compte rendu de Realisation</title>
         <parent>cm:content</parent>
         <properties>
            <property name="cr:NumReunion">
               <type>d:int</type>
               <mandatory>true</mandatory>
            </property>   
            <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>      
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>            
            <property name="cr:titreProjet">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:objetReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:presentClient">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            <property name="cr:presentSociete">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="cr:absents">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
            
         </properties>
         
      </type>

   </types>


</model>

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



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



<!– Envoyer tache______________________________________________________________________ workflow tasks –>
  
  
    <config evaluator="node-type" condition="pwf:envoyerTache" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_adhoc_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_adhoc_due_date" />
       <show-property name="pwf:notifyAssignee" />
         <show-property name="pwf:notifyMe" />
       <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
      <show-association name="bpm:assignee" />
        
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheAssignee" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:tacheComplete" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true" />
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
        
      </property-sheet>
   </config>
  
  
  
  
  
    <!– Review and Approve workflow tasks –>

   <config evaluator="node-type" condition="pwf:submitReviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:workflowDescription" component-generator="TextAreaGenerator" />
         <show-property name="bpm:workflowPriority" display-label-id="pwf_review_priority" />
         <show-property name="bpm:workflowDueDate" display-label-id="pwf_review_due_date" />
        <show-property name="pwf:notifyAssignee1" />
       <show-property name="pwf:notifyMe1" />
      
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:reviewTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:rejectedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="pwf:approvedTask" replace="true">
      <property-sheet>
         <separator name="sep1" display-label-id="general" component-generator="HeaderSeparatorGenerator" />
         <show-property name="bpm:taskId" />
         <show-property name="bpm:description" component-generator="TextAreaGenerator" read-only="true"/>
         <show-property name="bpm:dueDate" read-only="true" />
         <show-property name="bpm:priority" read-only="true" />
         <show-property name="bpm:status" />
         <show-property name="bpm:comment" component-generator="TextAreaGenerator" />
         <separator name="sep2" display-label-id="users_and_roles" component-generator="HeaderSeparatorGenerator" />
         <show-association name="bpm:assignee" display-label-id="pwf_reviewer" read-only="true" />
      </property-sheet>
   </config>

  
  

  
  
  
  
  
  
  
   <!–  add webable aspect  ******************************************************************************************************************************properties to property sheet –>
   

   <!–  add product related aspect properties to property sheet –>
   

   <!– show related documents association on doc property sheet –>
   
   
   <config evaluator="node-type" condition="cr:doc1">
      <property-sheet>
         <separator name="sep2" display-label-id="detailCr" component-generator="HeaderSeparatorGenerator" />
         <show-property name="cr:NumReunion" display-label-id="NumReunion" />
         <show-property name="cr:dateReunion" display-label-id="dateReunion" />
         <show-property name="cr:lieuReunion" display-label-id="lieuReunion" />
         <show-property name="cr:titreProjet" display-label-id="titreProjet" />
         <show-property name="cr:objetReunion" component-generator="TextAreaGenerator" display-label-id="objetReunion" />
         <show-property name="cr:presentClient"  component-generator="TextAreaGenerator" display-label-id="presentClient" />
         <show-property name="cr:presentSociete" component-generator="TextAreaGenerator" display-label-id="presentSociete" />
         <show-property name="cr:absents" component-generator="TextAreaGenerator" display-label-id="absents" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="cr:doc2">
      <property-sheet>
         <separator name="sep2" display-label-id="detailCr" component-generator="HeaderSeparatorGenerator" />
         <show-property name="cr:NumReunion" display-label-id="NumReunion" />
         <show-property name="cr:dateReunion" display-label-id="dateReunion" />
         <show-property name="cr:lieuReunion" display-label-id="lieuReunion" />
         <show-property name="cr:titreProjet" display-label-id="titreProjet" />
         <show-property name="cr:objetReunion" component-generator="TextAreaGenerator" display-label-id="objetReunion" />
         <show-property name="cr:presentClient"  component-generator="TextAreaGenerator" display-label-id="presentClient" />
         <show-property name="cr:presentSociete" component-generator="TextAreaGenerator" display-label-id="presentSociete" />
         <show-property name="cr:absents" component-generator="TextAreaGenerator" display-label-id="absents" />
      </property-sheet>
   </config>

   <!– show related documents association on whitepaper property sheet –>
   
      
   <!–  add someco types to add content list –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </content-types>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
       <!– The list of aspects to show in the add/remove features action –>
       <!– and the has-aspect condition –>   
      
      <!– The list of types shown in the is-subtype condition –>
      <subtypes>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </subtypes>      

      <!– The list of content and/or folder types shown in the specialise-type action –>
      <specialise-types>
         <type name="cr:doc1" />
         <type name="cr:doc2" />
      </specialise-types>      
   </config>   
   
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="cr:doc1" />
            <type name="cr:doc2" />
         </content-types>
      </advanced-search>
   </config>

</alfresco-config>


Dois-je changer la configuration d'un autre fichier ?
Je me suis amusé a créer des erreurs intentionnelles dans ces fichiers mais Tomcat ne les relèvent pas et la situation reste toujours la même, a savoir celle de la capture d'écran dans le premier message ('Contenu' et 'Compte rendu de Réunion' seulement, sans afficher le 'Compte rendu de Réalisation').
J'ai comme de plus en plus l'impression qu'il ne prend même pas en compte ces fichiers, mais plutôt ceux de C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension… Devrais-je changer quelque chose d'autre ?

(Mon projet de stage consiste a améliorer un projet Alfresco déjà commencé par une autre équipe, donc je ne sais pas ce qui a été modifié avant…)
jayjayecl
Active Member II

Re: Création de contenus personnalisés

Si en créant une erreur XML dans le fichier de model.xml, tomcat ne dit rien au démarrage, c'est que le fichier n'est pas chargé.

Sinon, autre erreur dans le fichier, vous définisser plusieurs fois les même "properties". Par exemple :

 <property name="cr:dateReunion">
               <type>d:datetime</type>
               <mandatory>true</mandatory>
            </property>     
            <property name="cr:lieuReunion">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>

Cela n'est pas correct.
Si différents types portent la même propriété, il faut s'orienter vers la conception d'aspects. Je vous laisse voir le wiki de ce côté là.
Pourriez-vous en outre donner ici :
- le contenu du Dictionnaire des données / Models
- le contenu de WEB-INF/classes/modules
- la trace de démarrage de tomcat

Merci Smiley Happy
mymemorial
Member II

Re: Création de contenus personnalisés

Bonjour =)

Désolé, je n'ai pas pu répondre plus tôt car, pour être honnête, je n'ai pas su comment avoir les informations que vous cherchez, a savoir:
- le contenu du Dictionnaire des données / Models
- le contenu de WEB-INF/classes/modules
- la trace de démarrage de tomcat

Par contre, je voulais vous signaler que j'ai réussi a faire la manipulation que j'essayais de réaliser:
[img]http://img697.imageshack.us/img697/3335/capturesz.png[/img]
Je ne suis pas allé bien loin pour pouvoir ajouter 'Compte rendu d'une Realisation', tout s'est passé au niveau du fichier web-client-config-custom.xml
Certes je n'ai pas arrêter de planter Tomcat durant mes "expériences", mais en ajoutant chaque chose a la fois petit a petit, ca a fini par marcher.
Je ne sais pas la configuration du groupe précèdent qui a commencé ce projet, mais tout c'est passé dans C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension.
Par contre j'ai suivi votre conseil de mettre les deux modèles dans le même fichier modèle XML et ca marche parfaitement, merci beaucoup pour cela! ^^

Je garde ce sujet ouvert, histoire de ne pas créer des sujets pour chaque question.
Merci beaucoup Rodel pour ton soutien et ton aide! J'espère que ca ne te dérangera pas trop si tu peux m'aider dans d'autres trucs plus tard =)
:wink:
jayjayecl
Active Member II

Re: Création de contenus personnalisés

Eh bien, nul ne le sait Smiley Happy