AnsweredAssumed Answered

Error deploying Content Model

Question asked by padmalaya on Mar 23, 2011
Latest reply on Apr 6, 2011 by openpj
I am using the conventional method of deploying a new content model, uploading customModel.xml,custom-model-context.xml and web-client-config.xml in the extensions folder.

However , whenever I customize a new custom model, I get Invalid Aspect error, or else a memory leak.
I have one more query, how do I deploy a model without aspects? And if I do , how do I know that the given model is active and that the content being uploaded used the model defined for it.

Thanks in advance,

Padmalaya

customModel.xml

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

   <constraints>
   

   <constraint name="custom:name_length" type="LENGTH">
         <parameter name="minLength">
             <value>3</value>
         </parameter>
         <parameter name="maxLength">
             <value>20</value>
         </parameter>
   </constraint>

   <constraint name="custom:car_list" type="LIST">
         <parameter name="allowedValues">
              <list>
                  <value>Volkswagon Vento</value>
                  <value>Maruti</value>
                  <value>Tata Manza</value>
                  <value>Skoda Fabia</value>
                  <value>TATA Sumo</value>
              </list>
         </parameter>
   </constraint>
   </constraints>
  
  
         <aspects>
     
      <!– Definition of new Content Aspect: Car Details –>
      <aspect name="custom:CarDetails">
         <title>Car Details</title>
         <properties>
            <property name="custom:CarName">
               <title>Car Name</title>
               <type>d:text</type>
               <protected>false</protected>
               <mandatory>false</mandatory>
               <multiple>false</multiple>
          <index enabled="true">
             <atomic>false</atomic>
             <stored>false</stored>
             <tokenised>true</tokenised>
          </index>
               <constraints>
                 <constraint ref="custom:name_length"/>
               </constraints>
            </property>
           
            <property name="custom:CarModel">
               <title>Car Model</title>
               <type>d:text</type>
               <constraints>
                 <constraint ref="custom:car_list"/>
               </constraints>
            </property>

      <property name="custom:CarPrice">
               <title>Car Price</title>
               <type>d:text</type>
               <constraints>
                 <constraint ref="custom:office_list"/>
               </constraints>
            </property>
</properties>
      </aspect>
     
   </aspects>
        
</model>

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




web-client-config-custom.xml

<alfresco-config>

  
   
<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
<aspects>
<aspect name="custom:CarDetails"/>
</aspects>
</config>

<!– Displays the properties in view details page –>
<config evaluator="aspect-name" condition="custom:CustomerDetails">
<property-sheet>
<separator name="sepCust1" display-label="Customer Details" component-generator="HeaderSeparatorGenerator" />
<show-property name="custom:CustomerName"/>
<show-property name="custom:CustomerContactName"/>

<show-property name="custom:CarDetails"/>
<show-property name="custom:CustomerContactPhone"/>

<show-property name="custom:CustomerProjectID"/>

</property-sheet>
</config></alfresco-config>

Outcomes