Ajouter un nouveau type donne des 'error'

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

Ajouter un nouveau type donne des 'error'

Bonjour. Et je m’excuse pou la longer du post
Ma configuration actuelle  est la souvent :
Alfresco  Explorer Web Client : Alfresco LAbs 3Stable
Apache Tomcat : 6.0.18
Mysql :5.1.31-community
Java : 1.6.0_11
S.O : Windos XP

Je viens d’ajouter un nouvel aspect: Voici mes pas :
1) j'ai crée un file.xml où j'ai défini  mon model
2) j'ai insère le path de ce file dans example-model-context.xml
3) j'ai modifié le web-client-config-custom.xml
Tous ces fichiers  sont dans Alfresco\Extension
Pour cet aspect tout va bien


Maintenant le problème :
Je suis passée à créer un nouveau type en faisant les mêmes pas.
Voici le fichier qui va définir le model
  
<?xml version="1.0" encoding="UTF-8"?>
<model name="dant:customTModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Custom Model</description>
   <author></author>
   <published></published>
   <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"/>
      <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
   </imports>

   <namespaces>
      <namespace uri="custom.tmodel" prefix="dant"/>
   </namespaces>

<!– Definition of new content Type: Press Release –>
<types>
   <type name ="dant:pressrelease">
     <title>Press Release</title>
     <parent>cm:content</parent>
     <properties>
        <property nome="dant:PRName">
           <title>PR Person Name</title>
           <type>d:text</type>
        </property>
        <property nome="dant:PREmail">
           <title>PR Person Email</title>
           <type>d:text</type>
        </property>
   <property nome="dant:PRPhone">
           <title>PR Person Phone</title>
           <type>d:text</type>
        </property>
   <property nome="dant:PRDate">
           <title>PR Released Date</title>
           <type>d:date</type>
        </property>
     </properties>
     <mandatory-aspects>
        <aspect> cm:versionable</aspect>
     </mandatory-aspects>
   </type>
</types>
</model>

J’ai modifié la fichier example-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/customModelType.xml</value>
   <value>alfresco/extension/customModelAspect.xml</value>
            </list>
        </property>
    </bean>
</beans>

J’ai encor modifié le file
web-client-config-custom.xml
Voici les morceaux de code que j'ai ajouté

<!– List the custom aspect in businezss rules action wizard–>
   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="danm:CustomerDetails"/>
      </aspects> 
     <subtypes>     
   <type name="dant:pressrelease"/>  
      </subtypes>
   </config>


<!–Display the type in add/create content–>
<config evaluator="node-type" condition="dant:pressrelease">
      <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="dant:PRName"/>
         <show-property name="dant:PREmail"/>
    <show-property name="dant:PRPhone"/>
    <show-property name="dant:PRDate"/>
      </property-sheet>
</config>
<!– This code ensures that the press release content type is misted when you create new content. –>
    <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
   <type name="dant:pressrelease"/>
      </content-types>
     </config>
Au démarrage du Tomcat j'ai des « errors »
voici le file.log
11:32:57,015 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
11:33:18,171 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\example-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModelType.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModelType.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:142)
   … 42 more
Caused by: org.jibx.runtime.JiBXException: Missing required attribute "name" (line 36, col 38)
   at org.jibx.runtime.impl.UnmarshallingContext.attributeText(UnmarshallingContext.java:1029)
   at org.alfresco.repo.dictionary.M2Property.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshalAttr_1_0(M2Property.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Property_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_10()
   at org.alfresco.repo.dictionary.M2Class.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Class.java)
   at org.alfresco.repo.dictionary.M2Type.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_2_0(M2Type.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Type_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_4()
   at org.alfresco.repo.dictionary.M2Model.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Model.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access.unmarshal()
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2515)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2675)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
   … 43 more
11:34:06,265 INFO  [org.alfresco.web.site.FrameworkHelper] Successfully Initialized Web Framework
11:34:34,546 INFO  [org.alfresco.web.scripts.DeclarativeRegistry] Registered 67 Web Scripts (+0 failed), 71 URLs
11:34:34,562 INFO  [org.alfresco.web.scripts.AbstractRuntimeContainer] Initialised Presentation Web Script Container (in 3274.8955ms)
11:56:20,375 INFO  [org.alfresco.config.xml.XMLConfigService$PropertyConfigurer] Loading properties file from class path resource [alfresco/file-servers.properties]
11:56:37,421 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\example-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModelType.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModelType.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
   at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
   at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:99)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:142)
   … 42 more
Caused by: org.jibx.runtime.JiBXException: Missing required attribute "name" (line 37, col 38)
   at org.jibx.runtime.impl.UnmarshallingContext.attributeText(UnmarshallingContext.java:1029)
   at org.alfresco.repo.dictionary.M2Property.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshalAttr_1_0(M2Property.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Property_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_10()
   at org.alfresco.repo.dictionary.M2Class.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Class.java)
   at org.alfresco.repo.dictionary.M2Type.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_2_0(M2Type.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Type_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_MungeAdapter.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_4()
   at org.alfresco.repo.dictionary.M2Model.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2binding_unmarshal_1_0(M2Model.java)
   at org.alfresco.repo.dictionary.JiBX_root_projects_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access.unmarshal()
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2515)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2675)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:94)
   … 43 more

J’ai alors décidé de suivre l’outre indication du livre Enterprise Content Management Implementation.
J’ai mis la définition du content type dans le customModel.xml et j'utilise le file custom-model-context.xml
J’ai alors enlevé le path dans example-model-context.xml

Si j’ai bien compris le file web-client-config-custom.xml c'est le meme ;
Au démarrage du tomcat il n’y a pas  des error mais il ne prend pas en cherche le nouveau type
Je dois modifié le file core-service-contex.xml qui si trouve sur Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco ?

C’est où l'error et en plus quel’ est la meilleur façon de faire?

Merci en avance et j’espère de ne vous pas déranger avec  de bétis.
Merci encor
Anbira
3 Replies
jayjayecl
Active Member II

Re: Ajouter un nouveau type donne des 'error'

<property nome="dant:PRName">
           <title>PR Person Name</title>
           <type>d:text</type>
        </property>
        <property nome="dant:PREmail">
           <title>PR Person Email</title>
           <type>d:text</type>
        </property>
   <property nome="dant:PRPhone">
           <title>PR Person Phone</title>
           <type>d:text</type>
        </property>
   <property nome="dant:PRDate">
           <title>PR Released Date</title>
           <type>d:date</type>
        </property>


tentez l'attribut "name" et non pas "nome", vous aurez sans doute plus de succès Smiley Wink

Au passage, evitez l'espace avant le nom de l'aspect dans
<mandatory-aspects>
        <aspect> cm:versionable</aspect>
     </mandatory-aspects>
anbira
Member II

Re: Ajouter un nouveau type donne des 'error'

Comme toujours vous avez raison
Je pense que désormais  je deviendrai fameuse pour mon connerie Smiley Surprisedops:
Anbira
jayjayecl
Active Member II

Re: Ajouter un nouveau type donne des 'error'

Aucun problème.
Il n'y a pas de honte a poser des questions, tant que la forme y est, si on donne tous les éléments comme vous l'avez fait.

De plus, sur ce genre d'erreur "évidente", il est courant de passer un temps infini à les résoudre, à discerner d'ou vient le problème. Par contre, un oeil neuf permet d'y voir assez clair assez vite.

Cdt,