AnsweredAssumed Answered

Error con Aspecto -Modelo

Question asked by juanvzla on Jul 30, 2015
Latest reply on Jul 31, 2015 by angelborroy
Hola tengo un error al momento de usar un Aspecto sencillo en mi modelo:

<code>
<?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>
  
  
<types>

   <type name = "custom:modelo">

      <title>Registro de Asociaciones</title>

         <parent>cm:content</parent>                            
             <properties>
                <property name="cont:parteContratada">
                    <title>Parte contratada</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
                <property name="cont:dni">
                    <title>DNI</title>
                    <type>d:text</type>
                    <mandatory>false</mandatory>
                </property>
            </properties>
            
             <mandatory-aspects>

            <aspect>custom:aspectTest</aspect>

         </mandatory-aspects>
   
</type>



</types>
<aspects>
<aspect name ="custom:aspectTest">

   <title>Titulo</title>

      <properties>

            <property name = "custom:campo1">

               <title>campo 1</title>

               <type>d:text</type>

         </property>

             <property name =  "custom:campo2">

               <title>campos  2</title>

               <type>d:text</type>

         </property>


      </properties>
      
      

</aspect>

</aspects>
     
</model>
<code>
============================================================================================================
Error:


Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 06290001 Could not import bootstrap model alfresco/extension/customModel.xml
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:159)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:105)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1639)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1580)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1510)
   … 26 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 06290000 Failed to parse model
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:102)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:88)
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(DictionaryBootstrap.java:148)
   … 34 more
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}aspect" end tag, found "{http://www.alfresco.org/model/dictionary/1.0}appearance" start tag (line 120, col 15)
   at org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:731)
   at org.alfresco.repo.dictionary.JiBX_defaultM2Aspect_access.unmarshal()
   at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_8()
   at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_9()
   at org.alfresco.repo.dictionary.JiBX_defaultM2Model_access.unmarshal()
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2757)
   at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2900)
   at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:97)
   … 36 more





Si quito mi aspecto dentro de mi modelo no me da el error pero quisiera usar un aspecto para efecto de mejores practicas.







Outcomes