AnsweredAssumed Answered

Problems creating custom content model

Question asked by dooley on Nov 15, 2007
Latest reply on Jan 2, 2008 by kevinr
I'm trying to create a custom content model to create a new content type, here is my code

blog-model.xml

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="bg:blogmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   
   <description>Blog Model</description>
   <author>Dooley</author>
   <version>1.0</version>

   <imports>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/forum/1.0" prefix="fm"/>
   </imports>
   
   <namespaces>
      <namespace uri="http://wwww.tsgrp.com/model/blog/1.0" prefix="bg"/>
   </namespaces>

   <types>
      <type name="bg:blogs">
         <title>Blog Space</title>
         <parent>fm:forum</parent>
      </type>
      
      <type name="bg:blog">
         <title>Blog</title>
         <parent>fm:topic</parent>
         <mandatory-aspects>
            <aspect>fm:discussable</aspect>
         </mandatory-aspects>
      </type>
      
      <type name="bg:blogpost">
         <title>Blog Post</title>
         <parent>fm:post</parent>
      </type>
      
   </types>
   
</model>

blog-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/blog-model.xml</value>
            </list>
        </property>
    </bean>

</beans>

Right now I'm trying to see if it works by trying to adding the bg:blogpost to the create content wizard, but I can't get it to be included in the drop down.  Here is my code for my web-client-config-custom.xml:

<!– add blog types to teh add content list –>
   <config evaluator="string-compare" condition="Content Wizards">
      <content-types>
         <type name="bg:blogpost" />
      </content-types>
   </config>

If I'm missing something here, please let me know.  This is my first try in creating new content models

Outcomes