AnsweredAssumed Answered

overriding properties simply does not work

Question asked by sbixsbix on Apr 3, 2013
Latest reply on May 27, 2014 by ipirat
Hi,
I have opened several threads because I was trying to override the cm:description property.
Then I decided to leave description as it is and to override some properties of my content not inherited by cm:content.
This is the relevant portion of contentmodel.xml file:
        <type name="acme:acmeCommon">
           <title> Modello base CM acme</title>
           <parent>cm:content</parent>
           <properties>
                 <property name="acme:XXX1">
                   <title>Variable field 1</title>
                   <type>d:text</type>
                   <mandatory>false</mandatory>
                </property>
                <property name="acme:FilingDate">
                   <title>Data Inserimento Doc</title>
                   <type>d:date</type>
                   <mandatory>true</mandatory>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                </property>
                <property name="acme:FilingOffice">
                   <title>Ufficio caricatore</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                   <default>Ufficio X</default>
                </property>
                <property name="acme:InnerRefNo">
                   <title>Protocollo ACS</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                   <constraints>
                        <constraint ref="acme:ReferenceNO"/>
                   </constraints>
                </property>
                <property name="acme:OuterRefNo">
                   <title>Protocollo Esterno</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                   <default>Non Specif</default>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                </property>
               <property name="acme:DocDate">
                   <title>Data Documento</title>
                   <type>d:date</type>
                   <mandatory>true</mandatory>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                </property>
           </properties>
        </type>
        <type name="acme:Assets">
           <title>Modello Comune Assets acme</title>
           <parent>acme:acmeCommon</parent>
           <properties>
                <property name="DocSubType">
                   <title>Doc Sub Type</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                </property>
                <property name="acme:acmeBranch">
                   <title>Casa acmea</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                   <index enabled="true">
                        <atomic>true</atomic>
                        <stored>false</stored>
                        <tokenised>false</tokenised>
                   </index>
                   <constraints>
                        <constraint ref="acme:acmeBranches" />
                   </constraints>
                </property>
                <property name="acme:LegalEntity">
                   <title>Ente Giuridico</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                </property>
                <property name="acme:CounterPart">
                   <title>Controparte</title>
                   <type>d:text</type>
                   <mandatory>true</mandatory>
                </property>
                <property name="acme:AssetValue">
                   <title>Valore</title>
                   <type>d:float</type>
                   <mandatory>false</mandatory>

                </property>
                <property name="acme:Currency">
                   <title>Valuta</title>
                   <type>d:text</type>
                   <mandatory>false</mandatory>
                   <constraints>
                        <constraint ref="acme:Currencies"/>
                   </constraints>
                </property>
           </properties>
        </type>
        <type name="acme:AcqDocs">
           <title>Acquisizione Immobili</title>
           <parent>acme:Assets</parent>
           <overrides>
                <property name="acme:XXX1">
                   <title>XXXXXX</title>
                   <mandatory>true</mandatory>
                   <constraints>
                        <constraint type="LIST">
                           <parameter name="allowedValues">
                                <list>
                                   <value>a1</value>
                                   <value>a2</value>
                                   <value>a3</value>
                                </list>
                           </parameter>
                        </constraint>
                   </constraints>
      <property/>
   </overrides>
   </type>

But when I stop & start Alfresco I got always the same error:
Caused by: org.jibx.runtime.JiBXException: Expected "{http://www.alfresco.org/model/dictionary/1.0}property" end tag, found "{http://www.alfresco.org/model/dictionary/1.0}title" start tag (line 2187, col 13)
        at org.jibx.runtime.impl.UnmarshallingContext.parsePastCurrentEndTag(UnmarshallingContext.java:731)
        at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_12()
        at org.alfresco.repo.dictionary.M2Class.JiBX_default_unmarshal_1_0(M2Class.java)
        at org.alfresco.repo.dictionary.M2Type.JiBX_default_unmarshal_2_0(M2Type.java)
        at org.alfresco.repo.dictionary.JiBX_defaultM2Type_access.unmarshal()
        at org.alfresco.repo.dictionary.JiBX_defaultMungeAdapter.JiBX_default_unmarshal_1_4()
        at org.alfresco.repo.dictionary.M2Model.JiBX_default_unmarshal_1_0(M2Model.java)
        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)
        … 37 more

Are there someone who can say which is the correct syntax for overriding properties?

Outcomes