AnsweredAssumed Answered

Changing Type fails on Custom Types

Question asked by michaelmtz on Oct 4, 2012
Latest reply on Oct 8, 2012 by michaelmtz
Hello,

Version : 4.0.e  (cent-os & mac)

Followed Jeff Potts brillant article to build custom content model.   The Custom Types are displaying where they should.
The problem is when I change  a documents custom type,  I can only change it a couple times,  then I get the following message:

Unable to change type of document 'name-of-doc.pdf'

Here is the mdModel.xml config:

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="md:materialsdesignmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Materials Design Model</description>
   <author>Michael Martinez</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 –>
   <namespaces>
      <namespace uri="http://www.materialsdesign.com/model/content/1.0" prefix="md" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="md:doc">
         <title>Materials Design Document</title>
         <parent>cm:content</parent>
         <associations>
            <association name="md:relatedDocuments">
               <title>Related Documents</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>md:doc</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </type>

      <type name="md:legal">
         <title>MaterialsDesign Legal</title>
         <parent>md:doc</parent>
      </type>
      <type name="md:invoice">
         <title>MaterialsDesign Invoice</title>
         <parent>md:doc</parent>
      </type>
      <type name="md:expensereport">
         <title>MaterialsDesign Expense Report</title>
         <parent>md:doc</parent>
      </type>
      <type name="md:financial">
         <title>MaterialsDesign Financial</title>
         <parent>md:doc</parent>
      </type>
      <type name="md:financial3year">
         <title>MaterialsDesign Financial 3 year</title>
         <parent>md:financial</parent>
      </type>
      <type name="md:financial7year">
         <title>MaterialsDesign Financial 7 year</title>
         <parent>md:financial</parent>
      </type>

   </types>

   <aspects>
      <aspect name="md:productRelated">
         <title>Materials Design Product Metadata</title>
         <properties>
            <property name="md:product">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>            
            <property name="md:version">
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>
         </properties>
      </aspect>   
   </aspects>
</model>

Here is the share-custom-config.xml code, I suspect this is the config that is incorrect.

<alfresco-config>
   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary">
      <!–
         Used by the "Manage Aspects" action

         For custom aspects, remember to also add the relevant i18n string(s)
            cm_myaspect=My Aspect
      –>
      <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="sc:webable" />
            <aspect name="sc:productRelated" />           
            <aspect name="md:productRelated" />           
         </visible>

         <!– Aspects that a user can add. Same as "visible" if left empty –>
         <addable>
         </addable>

         <!– Aspects that a user can remove. Same as "visible" if left empty –>
         <removeable>
         </removeable>
      </aspects>

      <!–
         Used by the "Change Type" action

         Define valid subtypes using the following example:
            <type name="cm:content">
               <subtype name="cm:mysubtype" />
            </type>

         Remember to also add the relevant i18n string(s):
            cm_mysubtype=My SubType
      –>
      <types>
             <type name="cm:content">
                <subtype name="sc:doc" />
                <subtype name="sc:whitepaper" />
             </type>
             <type name="sc:doc">
                <subtype name="sc:whitepaper" />
             </type>
             <type name="cm:content">
                <subtype name="md:doc" />
                <subtype name="md:expensereport" />
                <subtype name="md:financial" />
                <subtype name="md:financial3year" />
                <subtype name="md:financial7year" />
                <subtype name="md:invoice" />
                <subtype name="md:legal" />
             </type>
             <type name="md:doc">
                <subtype name="md:expensereport" />
                <subtype name="md:financial" />
                <subtype name="md:financial3year" />
                <subtype name="md:financial7year" />
                <subtype name="md:invoice" />
                <subtype name="md:legal" />
             </type>
             <type name="md:financial">
                <subtype name="md:doc" />
                <subtype name="md:expensereport" />
                <subtype name="md:financial3year" />
                <subtype name="md:financial7year" />
                <subtype name="md:invoice" />
                <subtype name="md:legal" />
             </type>
             <type name="md:legal">
                <subtype name="md:doc" />
                <subtype name="md:expensereport" />
                <subtype name="md:financial" />
                <subtype name="md:financial3year" />
                <subtype name="md:financial7year" />
                <subtype name="md:invoice" />
             </type>

      </types>
   </config>
  
</alfresco-config>

Just need to be pointed in the right direction.

Thanks in Advance.

Michael Mtz

Outcomes