cancel
Showing results for 
Search instead for 
Did you mean: 

Model does not exist

nyszhangyong
Champ in-the-making
Champ in-the-making
alfresco community 4.0.d.

Defining a custom model for Knowledge Base articles

Deploying a content model - dynamic approach

Please help me analyze the cause of the error Thank you very much !

tomcat logs:

2012-06-11 14:49:42,160  WARN  [repo.dictionary.DictionaryDAO] [http-8080-1] org.alfresco.service.cmr.dictionary.DictionaryException: 05110050 Model '{http://www.alfresco.org/model/knowledgebase/1.0}contentmodel' does not exist


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

<!–                              –>
<!– Knowledge Base Content Model –>
<!–                              –>

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

   <!– Metadata about the model –>
   <description>Knowledge Base Content Model</description>
   <author>alfresco_professional</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>

   <!– Define the URI and Prefix for this content model –>
   <namespaces>
      <namespace uri="http://www.alfresco.org/model/knowledgebase/1.0" prefix="kb"/>
   </namespaces>

   <!– Define constraints –>
   <constraints>
        
      <!– Ensures that one of the allowed values is assigned –>
      <constraint name="kb:attachmenttype_constraint" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Patch</value>
               <value>Sample</value>
               <value>Documentation</value>
            </list>
         </parameter>
      </constraint>

      <!– Ensures that one of the allowed values is assigned –>
      <constraint name="kb:status_constraint" type="LIST">
         <parameter name="allowedValues">
            <list>
               <value>Draft</value>
               <value>Pending Approval</value>
               <value>Current</value>
               <value>Archived</value>
            </list>
         </parameter>
      </constraint>
     
   </constraints>

   <!– Content Types –>
   <types>
      <type name="kb:space">
         <title>Knowledge Base Space</title>
         <parent>cm:folder</parent>
      </type>

      <type name="kb:attachment">
         <title>Attachment</title>
         <parent>cm:content</parent>
         <properties>
            <property name="kb:attachmenttype">
               <title>Attachment Type</title>
               <type>d:text</type>
               <default>Sample</default>
               <constraints>
                   <constraint ref="kb:attachmenttype_constraint"/>
               </constraints>
            </property>
         </properties>
      </type>
   </types>

   <!– Aspects –>
   <aspects>

      <!– Marks a content item as having status –>
      <aspect name="kb:status">
         <title>Knowledge Base Status</title>
         <properties>

            <!– Adds a new metadata property to the KB article –>
            <!– Constrains the value –>
            <property name="kb:status">
               <title>Status</title>
               <type>d:text</type>
               <default>Draft</default>
               <constraints>
                  <constraint ref="kb:status_constraint" />
               </constraints>
            </property>

         </properties>
      </aspect>

      <!– Marks a content item as a KB Article –>
      <aspect name="kb:article">
         <title>Knowledge Base Article</title>
         <properties>
        
            <!– Adds a new metadata property to the KB article –>
            <!– Constrains the value –>
            <property name="kb:articletype">
               <title>Article Type</title>
               <type>d:text</type>
               <default>Article</default>
               <constraints>
                  <constraint type="LIST">
                     <parameter name="allowedValues">
                        <list>
                           <value>Any</value>
                           <value>Article</value>
                           <value>FAQ</value>
                           <value>White Paper</value>
                        </list>
                     </parameter>
                  </constraint>
               </constraints>
            </property>
         </properties>

         <associations>
            <child-association name="kb:artifacts">
               <target>
                  <class>kb:attachment</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
               <duplicate>true</duplicate>
            </child-association>
            <association name="kb:related">
               <title>Related Articles</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>kb:article</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>

         <!– Content with this aspect also receive kb:status aspect –>
         <mandatory-aspects>
            <aspect>kb:status</aspect>
         </mandatory-aspects>
      </aspect>

   </aspects>

</model>
1 REPLY 1

kevindorr
Champ in-the-making
Champ in-the-making
After giving your model a cursory review, I don't see anything glaring that is wrong. However, I have found that if a model is not working, you can try deploying it through the admin console, and you'll get some useful messages about why the server won't compile it. Instructions on using the admin console are here: http://wiki.alfresco.com/wiki/Dynamic_Models "Using the Repository Admin Console". There is also a stand alone model test class that you can invoke, however, I don't have a reference to what it is called right now. Good luck!