cancel
Showing results for 
Search instead for 
Did you mean: 

Extending contentModel.xml

pitt1
Champ in-the-making
Champ in-the-making
Is there a way to extend contentModel.xml without editing it?  Let me clarify what I'm trying to do:

I have some aspects that I want to ALWAYS be added for every cm:folder and cm:content node.  I realize that I can modify the definitions of these types by adding a list of mandatory aspects in the $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/model/contentModel.xml file, but this is part of the alfresco core.  I'd rather define something in extensions (i.e. in $TOMCAT_HOME/shared/classes/alfresco/extension) as an extension/override to what's in the base contentModel.xml file.  Can I do this in a custom model by referencing the cm:content type, for example, and adding a list of mandatory aspects?
5 REPLIES 5

ajshaw
Champ in-the-making
Champ in-the-making
Yes. Just copy and paste the cm:content type from contentModel.xml in to shared/alfresco/extension/myNewModels.xml, and edit it there.

davidc
Star Contributor
Star Contributor
I'm not sure that's true.

There isn't an explicit feature to extend the definition of an existing type or aspect (although, you can override parts of property).

The only guaranteed way is to replace contentModel.xml with your own, but you'll have to re-apply changes during an upgrade to a new version of Alfresco.  Also, you should limit any changes to just additions i.e. new properties, associations etc

ajshaw
Champ in-the-making
Champ in-the-making
I stand corrected. I would have sworn i've overridden types like this before, but having tried now i have no luck.

I think it's very probably that i got the idea that it was possible a long time ago when i was learning/confusing myself and have believed it true ever since. (i probably did something silly like change it in contentModel.xml, and then made it an extension, forgetting to actually removing it from the core file Smiley Tongue ).


Anyway, my apologies for leading you up the garden path.

alejandro
Champ in-the-making
Champ in-the-making
Hello:

I need to add new attributes to the user, ie extending the user model. We saw that in the contentModel, is where are the attributes that have defined the alfresco user, but what I find is where you put the code to display these properties, as is done when you create a content type and then modified the web-client-config.xml.

Greetings, I hope your help.

Note: Sorry for my English.

alejandro
Champ in-the-making
Champ in-the-making


Hello:

I need to add new attributes to the user, ie extending the user model. We saw that in the contentModel, is where are the attributes that have defined the alfresco user, but what I find is where you put the code to display these properties, as is done when you create a content type and then modified the web-client-config.xml.

Greetings, I hope your help.

Note: Sorry for my English.