I have created a model using a model manager and model is active and Aspects from the model is already applied to the documents and data in the properties is also populated and it is important.
Now the requirement is to add association in the Aspect which is not possible using model manager approach.
How could I change the model from model manager to XML using Bootstrap approach without any data loss?
Solved! Go to Solution.
If you have use the aspects / properties on any files that are versioned, then you are quite frankly out of luck - you would have to write quite custom logic to create a consistent export of the data, then delete the nodes, activate the model, re-import.
If you don't have any versions, then you can simply use the default export / import actions to extract / backup the current data and reimport after switching the model.
Note that by default, the export / import actions are not available in the UI. You'd either have to customise the UI or use the JavaScript Console (or some other admin tooling) to be able to trigger those actions.
1)Export you xxxModel.xml and edit as per your requirement and place it inside \alfresco\tomcat\shared\classes\alfresco\extension.
2)Create xxx-context.xml file and register your contentmodel using below code.
<?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/xxxModel.xml</value>
</list>
</property>
</bean>
</beans>
Thanks,
But it won't give exception if we would have two models with the same namespace one by the model manager and another by XML?
Of course it will give an exception. You also need to first undeploy / deactivate the model in the model manager, and then restart with the model bootstrapped via the Spring context file. Of course to undeploy / disable the model from the model manager, you'd need to delete all uses of it, i.e. all nodes of types defined in the model, and remove all aspects / properties from nodes which were defined in the model. Also make sure to clear the trashcan as any nodes there using the model will also prevent its deactivation.
Axel Faust How could I retrieve data of the already applied model, because the data is important in the properties of files to which the model's Aspects are applied?
If you have use the aspects / properties on any files that are versioned, then you are quite frankly out of luck - you would have to write quite custom logic to create a consistent export of the data, then delete the nodes, activate the model, re-import.
If you don't have any versions, then you can simply use the default export / import actions to extract / backup the current data and reimport after switching the model.
Note that by default, the export / import actions are not available in the UI. You'd either have to customise the UI or use the JavaScript Console (or some other admin tooling) to be able to trigger those actions.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.