delete an aspect from active model

cancel
Showing results for 
Search instead for 
Did you mean: 
MohsenH
Member II

delete an aspect from active model

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

3 Replies
abhinavmishra14
Advanced

Re: delete an aspect from active model

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 

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)
MohsenH
Member II

Re: delete an aspect from active model

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

abhinavmishra14
Advanced

Re: delete an aspect from active model

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

~Abhinav
(ACSCE, AWS SAA-C02, GAIQ)