cancel
Showing results for 
Search instead for 
Did you mean: 

Custom content model works fine 1.4 but error on 2.0 preview

alexr
Champ in-the-making
Champ in-the-making
On Alfresco 1.4 (Tomcat / Windows) I deployed a custom content model (let's call it blablaModel).

To implement this custom model I had to change/create the following files:

blablaModel.xml                      (comparable to exampleModel.xml)
web-client-config-custom.xml
example-model-context.xml    (based on the .sample file)

After stopping Tomcat these files where deployed in:

D:\alfresco\tomcat\shared\classes\alfresco\extension

After starting tomcat in Alfresco version 1.4 the custom model is available
at import. I can fill in custom properties and everything works fine (also the custom search).

Now when I deploy the same files in the same directory structure for Alfresco 2.0 preview (also Tomcat/Windows version) the following happens.

Alfresco starts correctly. Login no problem.
Now when I want to import a file while selecting the content type to be of blablaModel type. After it mentions that the file is uploaded, but before you normaly go to filling in your properties/attributes on the content Alfresco gives the following error and I can't go to the next screen to fill in the custom attributes of the document as defined in blablaModel.xml.
The error is thrown in the "Modify Content Dialog" pane, before one get a chance to next to " Modify Content Properties".

The error is:

Please correct the errors below then click OK.
    * A system error happened during the operation: Transaction didn't commit: Integrity failure


What can be the problem. Has the content type definition changed from version 1.4 to version 2.0 and if so where can I find documentation on this.

Please help

Kind regards,

Alex
2 REPLIES 2

alexr
Champ in-the-making
Champ in-the-making
The following files are copied to the filepath:
C:\Alfresco\tomcat\shared\classes\alfresco\extension


blablaModel.xml


<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>

<!– The important part here is the name - Note: the use of the my: namespace
     which is defined further on in the document –>
<model name="sm:blablanewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Bla Bla Model</description>
   <author>Alex Revesz</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 –>
   <!– NOTE: The following namespace my.new.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="sm.new.model" prefix="sm"/>
    </namespaces>
  
   <constraints>
   
     <constraint name="sm:dtypes" type="LIST">
              <parameter name="allowedValues">
                 <list>
               <value>Technical</value>
               <value>Contractual</value>
               <value>Correspondence</value>
               <value>Reporting</value>
               <value>Other</value>
                 </list>
              </parameter>
      </constraint>

     <constraint name="sm:sxauth" type="LIST">
              <parameter name="allowedValues">
                 <list>
               <value>bla</value>
                 <value>bla2</value>
                <value>bla3</value>
            </list>
              </parameter>
      </constraint>
    
<!–
     <constraint name="sm:secgrps" type="LIST">
              <parameter name="allowedValues">
                 <list>
                <value> </value>
               <value>Public</value>
               <value>SLF</value>
               <value>abnamro</value>
               <value>operations</value>
               <value>planning</value>
               <value>systrust</value>
                 </list>
              </parameter>
      </constraint>  
–>
    
     <constraint name="sm:deps" type="LIST">
              <parameter name="allowedValues">
                 <list>
               <value>Bla1 Services</value>
               <value>Bla2 Services</value>
               <value>Bla3 Services</value>
                 </list>
              </parameter>
      </constraint>
    
       <constraint name="sm:custs" type="LIST">
              <parameter name="allowedValues">
                 <list>
                <value> </value>
               <value>BlaBla1</value>
               <value>BlaBla2</value>
               <value>BlaBla3</value>
                 </list>
              </parameter>
      </constraint>
    
        <constraint name="sm:stats" type="LIST">
              <parameter name="allowedValues">
                 <list>
               <value>Concept</value>
               <value>Final</value>
               <value>Obsolete</value>
                 </list>
              </parameter>
      </constraint>  

        <constraint name="sm:servconf" type="LIST">
              <parameter name="allowedValues">
                 <list>
               <value> </value>
               <value>BLA1-SRV-ACC</value>
               <value>BLA2-SRV-PRD</value>
            </list>
              </parameter>
      </constraint>  

   </constraints>
  
   <types>
  
     <!– Definition of new Content Type: Siennax Document  (main doctype)–>
      <type name="sm:blabladoc">
         <title>Bla Bla Document</title>
         <parent>cm:content</parent>
         <properties>

           <property name="sm:sxauthor">
              <title>Author</title>
                 <type>d:text</type>
             <default> </default>
                 <constraints>
                    <constraint ref="sm:sxauth" />
                 </constraints>
              </property>

           <property name="sm:department">
              <title>Department</title>
                 <type>d:text</type>
             <default> </default>
                 <constraints>
                    <constraint ref="sm:deps" />
                 </constraints>
              </property>

           <property name="sm:doctype">
              <title>Document Type</title>
                 <type>d:text</type>
             <default> </default>
                 <constraints>
                    <constraint ref="sm:dtypes" />
                 </constraints>
              </property>

           <property name="sm:identifiers">
                <title>Identifier(s)</title>
                 <type>d:text</type>
             <default> </default>
              </property>

           <property name="sm:customer">
              <title>Customer</title>
                 <type>d:text</type>
             <default> </default>
             <constraints>
                    <constraint ref="sm:custs" />
                 </constraints>
              </property>

           <property name="sm:status">
              <title>Status</title>
                 <type>d:text</type>
             <default> </default>
                 <constraints>
                    <constraint ref="sm:stats" />
                 </constraints>
              </property>

           <property name="smSmiley Tongueroj">
                <title>PROJ</title>
                 <type>d:text</type>
             <default> </default>
              </property>

           <property name="sm:serviceconf">
              <title>Service Configuration</title>
                 <type>d:text</type>
             <default> </default>
             <constraints>
                    <constraint ref="sm:servconf" />
                 </constraints>
           </property>

       </properties>        
     </type>

   </types>

</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> –>
                <value>alfresco/extension/blablaModel.xml</value>
         </list>
        </property>
    </bean>
         
</beans>

————————————————-
web-client-config-custom.xml

<alfresco-config>

   <!– Example of overriding the from email address –>
   <!–
   <config>
      <client>
         <from-email-address>someone@your-domain.com</from-email-address>
         <search-max-results>100</search-max-results>
      </client>
   </config>
   –>

   <!– Example of adding languages to the list in the login page –>
   <config evaluator="string-compare" condition="Languages">
      <languages>
         <language locale="ca_ES">Catalan</language>
         <language locale="da_DK">Danish</language>
         <language locale="de_DE">German</language>
         <language locale="es_ES">Spanish</language>
         <language locale="el_GR">Greek</language>
         <language locale="fr_FR">French</language>
         <language locale="it_IT">Italian</language>
         <language locale="ja_JP">Japanese</language>
         <language locale="du_NL">Dutch</language>
         <language locale="pt_BR">Portuguese (Brazilian)</language>
         <language locale="ru_RU">Russian</language>
         <language locale="fi_FI">Finnish</language>
         <language locale="tr_TR">Turkish</language>
         <language locale="zh_CN">Simplified Chinese</language>
      </languages>
   </config>

   <!– Example of configuring advanced search –>
   <!–
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
         </content-types>
         <custom-properties>
            <meta-data aspect="app:simpleworkflow" property="app:approveStep" />
         </custom-properties>
      </advanced-search>
   </config>
   –>

   <!– Example of changing the sort direction for a view in the client –>
   <!–
   <config evaluator="string-compare" condition="Views">
      <views>
         <view-defaults>
            <topic>
               <sort-direction>ascending</sort-direction>
            </topic>
         </view-defaults>
      </views>
   </config>
   –>

   <!– Example of adding a custom icon to the Create Space dialog –>
   <!–
   <config evaluator="string-compare" condition="cm:folder icons">
      <icons>
         <icon name="space-icon-custom" path="/images/icons/space-icon-custom.gif" />
      </icons>
   </config>
   –>

   <!– The config below shows how to incorporate the example model–>
   <!– into the web client, for this to work you will need to –>
   <!– rename example-model-context.xml.sample to example-model-context.xml –>

   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="sm:blabladoc" />
      </content-types>
   </config>

  <config evaluator="node-type" condition="cm:content">
      <property-sheet>
         <show-property name="author" show-in-edit-mode="false" />
      </property-sheet>
   </config>

   <config evaluator="node-type" condition="sm:blabladoc">
      <property-sheet>

         <show-property name="author" show-in-view-mode="false" show-in-edit-mode="false" />
       <show-property name="sm:sxauthor"/>
       <show-property name="sm:department"/>
<!–
       <show-property name="sm:secgroup"/>
–>
       <show-property name="sm:doctype"/>
<!–
       <show-property name="sm:docid" />
–>
       <show-property name="sm:identifiers"/>
       <show-property name="sm:customer" />
         <show-property name="sm:status"/>
<!–
       <show-property name="sm:abstract"/>
–>
       <show-property name="smSmiley Tongueroj" />
       <show-property name="sm:serviceconf"/>
<!–
       <show-property name="created" show-in-edit-mode="false"/>
       <show-property name="modifier" show-in-edit-mode="false"/>
       <show-property name="modified" show-in-edit-mode="false"/>
–>
       <show-property name="mimetype" display-label-id="content_format"
                        component-generator="MimeTypeSelectorGenerator" />
         <show-property name="size" display-label-id="size"
                        converter="org.alfresco.faces.ByteSizeConverter"
                        show-in-edit-mode="false" />
      </property-sheet>
   </config>

   <!–
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="my:sop" />
      </content-types>
   </config>

   <config evaluator="node-type" condition="my:sop">
      <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="mySmiley TongueublishedDate" />
         <show-association name="my:signOff" />
         <show-property name="my:authorisedBy" />
         <show-child-association name="mySmiley TonguerocessSteps" />
      </property-sheet>
   </config>

   <config evaluator="aspect-name" condition="my:imageClassification">
      <property-sheet>
         <show-property name="my:width"/>
         <show-property name="my:height"/>
         <show-property name="my:resolution"/>
      </property-sheet>
   </config>

   <config evaluator="string-compare" condition="Action Wizards">
      <aspects>
         <aspect name="my:imageClassification"/>
      </aspects>
   </config>

   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="my:sop" />
         </content-types>
         <custom-properties>
            <meta-data type="my:sop" property="my:authorisedBy" />
            <meta-data aspect="my:imageClassification" property="my:resolution" />
         </custom-properties>
      </advanced-search>
   </config>
   –>
   <config evaluator="string-compare" condition="Advanced Search">
      <advanced-search>
         <content-types>
            <type name="sm:blabladoc" />
         </content-types>
         <custom-properties>
            <meta-data type="sm:blabladoc" property="sm:sxauthor" />
             <meta-data type="sm:blabladoc" property="sm:department" />      
<!–         
            <meta-data type="sm:blabladoc" property="sm:secgroup" />
–>
            <meta-data type="sm:blabladoc" property="sm:doctype" />
<!–
         <meta-data type="sm:blabladoc" property="sm:docid" />
–>
            <meta-data type="sm:blabladoc" property="sm:identifiers" />
            <meta-data type="sm:blabladoc" property="sm:customer" />
         <meta-data type="sm:blabladoc" property="sm:status" />
<!–         
            <meta-data type="sm:blabladoc" property="sm:abstract" />
–>
            <meta-data type="sm:blabladoc" property="smSmiley Tongueroj" />
            <meta-data type="sm:blabladoc" property="sm:serviceconf" />
       </custom-properties>
      </advanced-search>
   </config>
</alfresco-config>


Again this worked for 1.4 Community Preview, but not in the 22 jan. 2.0 Community Preview version (Tomcat/Windows setup)

alexr
Champ in-the-making
Champ in-the-making
I tried it both with example-model-context.xml and custom-model-context.xml (containing exactly the same definitions).

But no success so far…