AnsweredAssumed Answered

how to add multiple content types

Question asked by plakshmi on Dec 11, 2009
Latest reply on Dec 14, 2009 by plakshmi
I am new to Alfresco. I am working on a requirement wherein a separate content type(with corresponding fields) has to attached while adding different types of documents.
I created a custom content type (say Category 1) by modifying customModel.xml, web-client-config-custom.xml and defining my model in custom-model-context.xml.
My new content type (Category 1) is getting listed in the Content Tpye drop-down menu and I could succesfully attach values to the document as defined in Category 1.

Now that I want to add another content type (say Category 2 with a differnt set of fields) to the Content Type menu, I am unable to succeed.
This is what I did:
1. created a new file custom1Model.xml and defined my new model "res.customModel" with types , imports, namespaces etc similar to customModel.xml.
2. modified web-client-config-custom.xml to display and invoke my new model when selected.
3. In custom-model-context.xml made changes as below:
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">


I am getting the following errors:
15:05:47,968 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [C:\Alfresco\tomcat\shared\classes\alfresco\extension\custom-model-context.xml]: Invocation of init method failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: 11110001 Could not import bootstrap model alfresco/extension/custom1Model.xml
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 11110001 Could not import bootstrap model alfresco/extension/custom1Model.xml
.Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: 11110000 Failed to compile model res.customModel
   at org.alfresco.repo.dictionary.CompiledModel.<init>(
   at org.alfresco.repo.dictionary.M2Model.compile(
   at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(
   at org.alfresco.repo.dictionary.DictionaryBootstrap.onDictionaryInit(
   … 43 more
Caused by: org.alfresco.service.namespace.NamespaceException: Namespace prefix  is not mapped to a namespace URI
   at org.alfresco.service.namespace.QName.createQName(
   at org.alfresco.service.namespace.QName.createQName(
   at org.alfresco.repo.dictionary.M2ModelDefinition.<init>(
   at org.alfresco.repo.dictionary.CompiledModel.constructDefinitions(
   at org.alfresco.repo.dictionary.CompiledModel.<init>(
   … 46 more

I want to know if my approach is correct and what could be the problem.