AnsweredAssumed Answered

Ajouter nouveau modèle de document

Question asked by jgautier on Mar 9, 2011
Latest reply on Mar 11, 2011 by jgautier
Bonjour,

je reviens vers vous car j'ai un problème. Je souhaite ajouter un nouveau modèle de document.
J'ai donc recherché sur le forum et il existe des sujets similaires. Je m'en suis inspiré mais j'ai une erreur lorsque je reboot Tomcat :
La ressource demandée () n'est pas disponible.

J'ai pourtant fait ce qui était écrit dans les différent sujets à savoir :
J'ai crée 3 fichiers que j'ai mis dans tomcat\shared\classes\alfresco\extension :
- custom-context.xml
- customModel.xml
- web-client-config-custom.xml

Dans ces fichiers j'ai :

custom-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/customModel.xml</value>
             </list>
          </property>
       </bean>
    </beans>

customModel.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!–Definition of new Model –>
    <model name="custom:somecomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <!–Optional metadata about the model –>
    <description>Someco Model</description>
    <author>Moi</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.someco.com/model/content/1.0" prefix="custom" />
    </namespaces>

    <types>
    <!–Enterprisewide generic document type –>

       <type name="custom:Doc">
          <title>Someco Document</title>
          <parent>cm:content</parent>
          <associations>
             <association name="custom:relatedDocuments">
                <title>Related Documents</title>
                <source>
                   <mandatory>false</mandatory>
                   <many>true</many>
                </source>
                <target>
                   <class>custom:Doc</class>
                   <mandatory>false</mandatory>
                   <many>true</many>
                </target>
             </association>
          </associations>
          <mandatory-aspects>
             <aspect>cm:generalclassifiable</aspect>
          </mandatory-aspects>
       </type>
      
       <type name="custom:whitepaper">
          <title>Someco Whitepaper</title>
          <parent>custom:Doc</parent>
       </type>
    </types>

    <aspects>
       <aspect name="custom:webable">
          <title>Someco Webable</title>
          <properties>
             <property name="custom:published">
                <type>d:date</type>
             </property>
             <property name="custom:isActive">
                <type>d:boolean</type>
                <default>false</default>
             </property>
          </properties>
       </aspect>
          <aspect name="custom:productRelated">
          <title>Someco Product Metadata</title>
          <properties>
             <property name="custom:product">
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
             <property name="custom:version">
                <type>d:text</type>
                <mandatory>true</mandatory>
             </property>
          </properties>
       </aspect>
    </aspects>
    </model>

web-client-config-custom.xml
    <alfresco-config>
       <config evaluator="string-compare" condition="Languages" replace="true">
          <languages>      
             <language locale="fr_FR">French</language>
          </languages>
       </config>

       <config evaluator="string-compare" condition="Content Wizards">
          <content-types>
             <type name="custom:Doc" />
          </content-types>
       </config>
      
       <config evaluator="node-type" condition="custom:Doc">
          <property-sheet>     
             <show-property name="custom:DocDate" />
             <show-property name="custom:Racine" />
             <show-property name="custom:DocType" />
             <show-property name="custom:DocNature" />
           <show-property name="custom:Groupe" />
          </property-sheet>
       </config>
      
      
      <!– **************************** ADVANCED SEARCH ********************** –>
      
       <config evaluator="string-compare" condition="Advanced Search">
         <advanced-search>
          <content-types>
            <type name="custom:Doc" />
          </content-types>
          <custom-properties>
             <meta-data type="custom:Doc" property="custom:DocDate" />
             <meta-data type="custom:Doc" property="custom:Racin" />
             <meta-data type="custom:Doc" property="custom:DocType" />
             <meta-data type="custom:Doc" property="custom:DocNature" />
             <meta-data type="custom:Doc" property="custom:Groupe" />
          </custom-properties>
         </advanced-search>
       </config>
      
      
       <!– ******************************************************* –>
       <config evaluator="string-compare" condition="Action Wizards">
          <subtypes>
          <type name="custom:Doc"/>  
          </subtypes>    
       </config>  
      

    </alfresco-config>

Il y a t-il des erreurs ou d'autres fichiers à ajouter/modifier ?

Merci d'avance.

Outcomes