09-17-2021 08:59 AM
I would like to know how I can delete an aspect from an active model
I tried to remove all the linked documents but still getting the same error after deleting all the documents cannot delete an aspect from an active model. I need the solution urgent, please
09-17-2021 11:42 AM
The right way is to remove the aspect from any nodes that has the aspect you want to remove. Usually removing the aspects from content/nodes should do. and you should be able to remove the aspect from content model once there are no references of the aspect on any nodes in repo. You don't need to delete the nodes
Follow the steps and see if it works:
Option 1:
1- Create a webscript (java/js) or use JSConsole to find all the folders/content/nodes and remove the aspects (aspects which you want to remove from the model) from these nodes. A sample js based script can be found here for reference: https://hub.alfresco.com/t5/alfresco-content-services-forum/remove-rma-cutoff-aspect-from-record/m-p...
2- Once aspects are removed that are no longer needed from the matching nodes, stop the alfresco and solr severs
3- Update the content model, deploy the updated model
4- Delete models from solr server
5- Start alfresco and solr.
Option 2:
1- Create a webscript (java/js) or use JSConsole to find all the folders/content/nodes and remove the aspects (aspects which you want to remove from the model) from these nodes. A sample js based script can be found here for reference: https://hub.alfresco.com/t5/alfresco-content-services-forum/remove-rma-cutoff-aspect-from-record/m-p...
2- Once aspects are removed that are no longer needed from the matching nodes, stop the alfresco and solr severs
3- Delete indexes and models from solr server (may need to do full reindex)
4- Remove the aspect from the model and deploy the updated model (amp, jar, or extension)
5- Start the alfresco and solr servers. It will re-create the indexes
09-24-2021 09:01 AM
Hi ,
Thanks for your reply
for your solution Point1 - Create a webscript (java/js) or use JSConsole to find all the folders/content/nodes and remove the aspects (aspects which you want to remove from the model) from these nodes. A sample js based script can be found here for reference: https://hub.alfresco.com/t5/alfresco-content-services-forum/remove-rma-cutoff-aspect-from-record/m-p...
would you please tell me how to run the script I am not professional in using putty I opened the content model from web browser and I extracted the model and it extracted zip file with two xmls
MCCG_ContentModel.xml
CMM_MCCG_ContentModel_module.xml
I can share the contents if needed
09-24-2021 10:28 AM
If you are sure you might have applied the aspect to nodes, you need to take reference from webscript shared, update it as needed to remove the aspect you want to remove. You Can either use the JSConsole add-on : https://www.youtube.com/watch?v=c3JIeVY8Nnk
or Use the webscript extension https://docs.alfresco.com/content-services/latest/develop/reference/web-scripts-ref/#file-locations and execute the webscript.
Doc to learn webscripts:
https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/web-scripts/
http://ecmarchitect.com/alfresco-developer-series-tutorials/webscripts/tutorial/tutorial.html
Explore our Alfresco products with the links below. Use labels to filter content by product module.