cancel
Showing results for 
Search instead for 
Did you mean: 

problem creating custom content model

developer_resea
Champ in-the-making
Champ in-the-making
Hello,

     I am trying create a custom model for alfresco (community edition 3.3). When I create a custom space (based on cm:folder) works fine but when I create a custom content (based on cm:content) I can not see it (select it) into the content creation wizard. At the time of content creation, the log shows:

17:38:07,220 User:admin WARN  [bean.content.BaseContentWizard] Failed to add 'ccm:mycontent' to the list of content types as the type is not recognised.

     What could be causing this error? How I can fix it? I hope someone can help me

     My configuration files are:

1. customContentModel.xml

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

<model name="ccm:customcontent" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <description>Custom Content Model</description>  
   <version>1.0</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="model.customcontent" prefix="ccm"/>
   </namespaces>

  <types>
   <type name="ccm:mycontent">
      <title>Expedient</title>
      <parent>cm:content</parent>
      <properties>
         <property name="ccm:Area">
            <title>Area</title>
         <description>Name of Area</description>
            <type>d:text</type>
         </property>
         <property name="ccm:Priority">
            <title>Priority</title>
         <description>Priority of Expedient</description>
            <type>d:text</type>
         </property>        
      </properties>
   </type>
  </types>

  <aspects>
  </aspects>
</model>

2. customContentModel-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>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customContentModel.xml</value>
            </list>
        </property>
    </bean>  
</beans>

3. web-client-config-custom.xml

<alfresco-config>
  
   <config evaluator="string-compare" condition="Action Wizards">
          <subtypes>             
         <type name="ccm:mycontent"/>
          </subtypes>
   </config>
  
   <config evaluator="string-compare" condition="Action Wizards">
          <especialise-types>
              <type name="ccm:mycontent"/>
          </especialise-types>
   </config>
  
   <config evaluator="string-compare" condition="Content Wizards">     
     <content-types>
               <type name="ccm:mycontent" />
          </content-types>
   </config>
  
   <config evaluator="node-type" condition="ccm:mycontent">
      <property-sheet>
         <show-property name="ccm:Area"/>
         <show-property name="ccm:Priority"/>        
      </property-sheet>
   </config>

</alfresco-config>

Thanks in advance,
3 REPLIES 3

patil
Champ on-the-rise
Champ on-the-rise
Hi,

From the files you have everything looks fine.

Just make sure you are putting the files in the extension directory.


Thanks,
Patil
Cignex Technologies
Bangalore

developer_resea
Champ in-the-making
Champ in-the-making
Hello Patil,

     I have all files in "ALFRESCO_HOME\tomcat\shared\classes\alfresco\extension". By the log it appears to be some minor error but no signs of how it could solve the problem. Has anyone had this same error message?

WARN [bean.content.BaseContentWizard] Failed to add 'ccm:mycontent' to the list of content types as the type is not recognised.

Thanks in advance,

jmartorell
Champ in-the-making
Champ in-the-making
I have the same problem, because I've created a new model folder, but I can't create a new content type

Arxivable.xml

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

<!– Arxivable –>

<model name="jmj:contingutPersonalitzat" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>  
   <description>Contingut Personalitzat Arxivable</description>
   <author>Josep Martorell Juvanteny</author>
   <version>1.0</version>

   <imports>
        <!– Importem definicions d-Alfresco, concretament el diccionari de dades i el model de contingut Alfresco –>
      <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>

   <!– Registrem el Nou namespaces que s-utilitzara en aquest model –>
   <!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
   <namespaces>
      <namespace uri="contingut.earxiu" prefix="jmj"/>
   </namespaces>
    
  <types>
   <!– Definicio del nou tipus de contingut personalitzat –>
  
   <!–  Definicio del tipus de contingut jmj:Arxivable –>
   <type name="jmj:Arxivable">
      <title>Contingut Arxivable</title>
      <parent>cm:content</parent>
      <properties>
         <property name="jmj:CodRef">
            <title>Codi referència</title>
            <type>d:text</type>
         </property>
         <property name="jmj:nDoc">
            <title>Número Document</title>
            <type>d:text</type>
         </property>
         <property name="jmj:DataCreacio">
            <title>Data Creació</title>
            <type>d:date</type>
         </property>
      </properties>
   </type>  
  </types>

  <aspects>
   <!– Definicio dels aspectes personalitzats –>
  </aspects>
</model>

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

    <!– Registre del contingut Arxivable –>  
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/Arxivable.xml</value>
            </list>
        </property>
    </bean>
        
</beans>

web-client-config-custom.xml (only the part for to register a new content type)

      <config evaluator="string-compare" condition="Action Wizards">
          <subtypes>
              <type name="jmj:Arxivable"/>
          </subtypes>
       </config>
     
      <config evaluator="string-compare" condition="Action Wizards">
          <especialise-types>
              <type name="jmj:Arxivable"/>
          </especialise-types>
       </config>
  
       <config evaluator="string-compare" condition="Content Wizards">
          <content-types>
             <type name="jmj:Arxivable"/>
          </content-types>
       </config>   
      
     <config evaluator="node-type" condition="jmj:Arxivable">
          <property-sheet>
             <show-property name="jmj:CodRef"/>
             <show-property name="jmj:nDoc"/>
             <show-property name="jmj:DataCreacio"/>
          </property-sheet>
      </config>

All the files are: C:\Alfresco\tomcat\shared\classes\alfresco\extension

And in my Alfresco's log file, I can see:
User:admin WARN  [bean.content.BaseContentWizard] Failed to add 'jmj:Arxivable' to the list of content types as the type is not recognised

someone could help me with this problem?

Thanks in advance,