11-23-2018 07:25 AM
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!
12-05-2018 09:48 AM
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.
11-29-2018 03:55 PM
First problem is editing an existing content model. I need to add new values to the selection list e.g., 'As-Built' and 'Specifications' so these can be selected. At this point, I can only have a vendor come in and make the change.
Second problem is extending this model to include new properties. I want to add 'Company' as a multi-line text entry later on in this complex model.
The other problem is property layout in a form but that's beyond this question. I had hoped to use Model Manager for all content model attributes but now I'm stuck with engaging expensive consultants to make minor changes as we expand our models for searching.
Ultimately, it would be best if a robust Model Manager was added to Alfresco that allows both file system models to be exposed and new models to be added.
11-29-2018 04:55 AM
I just read your post and want to add to your requirement "mechanism to have an active incremental custom model":
Alfresco's document model behaves like a hierachical, NOT like a relational database (or like a bunch of xml documents you write a xml schema for). Altering the type in the document model is not the equivalent of "alter table modify column ...". This means
If you change the document model it is your responsibility to make only changes which are compatible with your already existing content. There is no mechanism to migrate already existing data to comply with your modified model. Even harder: If you use versions it may not be possible to modify (meta) data already stored and you will get into trouble when you don't expect to since Alfresco parses the model on read and write - e.g. when a user tries to show a document in Share UI years after you made the changes on the document model.
To make the long story short: Alfresco has only very limited support for document model changes and you should therefore spend as much analysis as possible to make sure you don't need to change the model.
Over then years after we started with Alfresco document models we have the best practices:
Since we had to reengeneer several Alfresco implementations over the years we created our own lowlevel migration module which is able to migrate all the metadata, types and aspects in any node as a batch routine - even for document versions but this approach shouldn't be used on a regular basis 😉
11-30-2018 02:53 AM
Hi, thanks for all the answers.
In my case, your recomendations do not work for me.
What I have is a document manager wich document types have some properties and, maybe, on two or five month, that document type will have two more properties. That could happen to all types i have.
What I need is to import all those documents (only those that are not going to be modified) and import them to Alfresco, to create a historic document storage.
After studying what could be the best solution, I think that an aggregation model is the solution. I made a software that can create a model with all properties for all documents extracted and create CMM file for them all, but, in the future, will be more extractions, so I'll need to add all those new properties and types. The old model will be update with the new model generated on the extraction.
There will be a moment that I'll have an active model that I have to update.
Finally, my questions are:
- Having the model created, wich options do i have to import it to alfresco?
- Do I have to create manually all cofigurations files and update them all (config, message, etc) or there is an alternative (like an amp file) to import it automatically?
Hope there is someone in my situation with an answer
12-05-2018 09:48 AM
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.
Explore our Alfresco products with the links below. Use labels to filter content by product module.