Ajouter nouveau modèle de document

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

Ajouter nouveau modèle de document

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.
4 Replies
jayjayecl
Active Member II

Re: Ajouter nouveau modèle de document

Il y a toujours l'erreur de ne pas mettre les logs Smiley Happy
jgautier
Member II

Re: Ajouter nouveau modèle de document

Ci-dessou le log :

16:58:32,127  ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:alfresco/application-context.xml]
Offending resource: ServletContext resource [/WEB-INF/web-application-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:alfresco/extension/*-context.xml]
Offending resource: class path resource [alfresco/application-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 1 in XML document from file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\custom-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
jgautier
Member II

Re: Ajouter nouveau modèle de document

Bon j'ai réussi à corriger cette erreur, cela venait du fait qu'il y avait une tabulation au début de mon fichier -_-' !

Maintenant j'ai un autre problème, dans le log j'ai l'erreur suivante :

[repo.dictionary.DictionaryDAO] Type not found: {contract.model}Doc
jgautier
Member II

Re: Ajouter nouveau modèle de document

Bon j'ai réussi, j'avais juste mis 'doc' dans un fichier et 'Doc' dans l'autre.

Merci à Rodel pour m'avoir appris que les logs pouvaient être très importants  Smiley Very Happy !