cancel
Showing results for 
Search instead for 
Did you mean: 

Incremental custom model

javiercasfer
Champ on-the-rise
Champ on-the-rise

Hello,

I'm new at Alfresco and, after Googled alot, i have no solution to my current problem. 

My situation is that i have custom content model xml file and a cmm file for that model, both generated by a java application. First time is generated, i deploy the zip file to alfresco, activate the model and use bulk import tool to upload all my documents wich types are on that model. 

After a month, i repeat the process, the java application generates new model wich may have same types as the last model, and may have new with new properties. Now, i want to update the old model adding new types and properties wich are on the new model generated. Of course, I can't  deactivate the old model or add those new properties manually. 

So, what i need is a mechanism to have an active incremental custom model.

My questions are:  

   - What options do i have?

   - Really can i do that?

I'm using Alfresco Community version. 

Thanks in advice!

‌ #

1 ACCEPTED ANSWER

Hi everybody!

I've solved my problem. 

What I do is, when I do a content extraction from the source, i generate a model content xml with the types and properties i get. Then I use the xsd definition to compare my old model with my new one and add all new types and properties i have to the new one. 

Then, from may aggregation model (the old updated), i generate my own share-config-custom.xml with the forms and properties I need and model.propreties files. Then, replace these 3 files on my alfresco instalation and restart it. It works perfectly. Keep in mind that these only will work if you don't remove types or properties when you are updating your custom model. 

Maybe that could help someone. Thanks for all the answers. 

View answer in original post

13 REPLIES 13

angelborroy
Community Manager Community Manager
Community Manager

Probably I'm missing something, but re-deploying your new XML Content Model (the one with the new properties) file should be enough. Just overwrite your old XML file.

Hyland Developer Evangelist

Hi, thanks for the answer, but it doesn't work.

I deploy the model by the ui, on admin tools > Model management. So, when i try to import the same model but with updated properties, Alfresco says that a model with that name already exists. 

Ah, ok, so you are using Model Manager tool.

Sorry, I have no experience with that tool. I'm always using the other content model deployment options.

Hyland Developer Evangelist

afaust
Legendary Innovator
Legendary Innovator

The Model Management tool should come with a big, red sticker stating "This tool is only good for quick prototyping / test models - it should not be used for anything more serious than that".

In short, the UI does not support importing a model as "an update" to an already active/deployed model. You could technically override the XML file by going via the Repository -> Data Dictionary -> Models folder, but be aware that your XML may be overidden by changes made via the model management tool afterwards.

My usual suggestion is to always use the traditional, Spring-based XML bootstrap approach using an extension module (JAR / AMP, whatever you prefer) for serious development use or production.

Ok, gonna try it. 

Do you have a link to any good tutorial of a proyect example? 

Thanks in advice. 

afaust
Legendary Innovator
Legendary Innovator

Well, Jeff Potts' tutorial is a mandatory read.

Thanks!

rsclark3
Champ in-the-making
Champ in-the-making

This is an odd question but are there any alternatives for model management if you do not have root or admin access to the server? The server teams does not allow the Alfresco support team access to the server. I had hoped Model Manager, and the Model Manager group rights, to help with non-server team model management but we can't use it for the reasons stated above. A vendor installed a Spring-based XML model and if I dare use Model Manager, I'm sure disaster awaits. We're stuck with extending our generic model for various business units that would like additional attributes.

You could store your model in the Alfresco repo (/Data Dictionary/Models) which can be easily modified from Share-UI or WebDAV but I would not recommend this in production systems. You don't have the same flexibility and how would you implement deployments / lifecycle management, QM? Why not creating traditional spring based models packaged in jars which can be easily deployed by the server team? Of course you need a dev system with server filesystem access to develop and test your changes ...

Could you please give an example for the model extensions you want to implement?

We tried to implement a shared model (GitHub - ecm4u/businessdocumentmodel: ecm4u Alfresco Business Document Model ) to be used by as many Alfresco users as possible to avoid the problems you are facing with but we didn't find enough combatants. We should update this model since we already refactored this to a more flexible aproach which allows online changes on generic types referencing relational and/or external data.