Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Deletion of property from Pages and asset

Avatar

Employee Advisor

I have a requirement to delete a property from almost all of the content page and assets. Apart from groovy script what could be the best way to handle this scenario. This is one time activity

1) Write a servlet and iterating over all the assets and pages

2) Query the page and assets containing specific property 

 

Apart from the above-mentioned solutions, any other solution to perform this activity.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Nikita___Garg,

First of all, I have to say I fully agree with the other guys - groovy console seems to be the best option. Described case is just perfect one to use GC.

Regarding alternatives, apart what you have already listed.

1) Write a servlet and iterating over all the assets and pages

2) Query the page and assets containing specific property 


You can consider ACS Commons capabilities:

Option 1:

Use Manage Controlled Processes with your own Process Definition:

Option 2:

Use On Deploy Scripts:

In general above feature is disabled in newer version of ACS Commons and is not supported on AEM as a Cloud setup. However if your ACS Commons version is old enough you can take it to account as an option.

Summarizing, in case you are not able to convinced your client that groovy console will be the most efficient way to do the job, I would go with Option 1 - especially that entire implementation is already done - so you will only have to add it to your code base.

View solution in original post

6 Replies

Avatar

Community Advisor

Hi @Nikita___Garg,

Why not groovy script? Any specific reason if I ask.

If this is one time activity I certainly believe that groovy script is the best option. I would efforts estimate implementing this logic(Servlet/Query) Vs. quick and simple way to achieve target assignment since it's one time activity.

Regards,

Santosh

Avatar

Community Advisor

If client maynot agree then use querybuilder api to fetch path of matched property and do your operation.

Avatar

Community Advisor

@Nikita___Garg Best way would be to handle it through Groovy script. As it's a one time activity, writing the code logic would take longer time compared to Groovy script which you can simply write and test it in lower environment. 

 

I also faced similar kind of challenge where client and AMS wasn't agreed on running the groovy script on PROD, we synced the PROD content on Stage and the ran the groovy script and after that push back the changes to PROD. You can suggest something similar kind of approach.

 

Bulk editor is also an alternative to solve your problem and it's available across all the environments however it has some limitation, you can remove the property value from the content but won't be able to delete the property completely.

Avatar

Community Advisor

Hi @Nikita___Garg,

 

After reading through your above comment, besides the Groovy script, I suggest creating a workflow process step where you could perform the logic (preferably using query builder API). 

In spite of a one-time action, you can also utilize this process step if you want to add/remove any property for future use. Since it is through a workflow, even your client can have a proper hold on it for permissions, etc.

Thank you.

 

Regards,

Sravan

Avatar

Correct answer by
Community Advisor

Hi @Nikita___Garg,

First of all, I have to say I fully agree with the other guys - groovy console seems to be the best option. Described case is just perfect one to use GC.

Regarding alternatives, apart what you have already listed.

1) Write a servlet and iterating over all the assets and pages

2) Query the page and assets containing specific property 


You can consider ACS Commons capabilities:

Option 1:

Use Manage Controlled Processes with your own Process Definition:

Option 2:

Use On Deploy Scripts:

In general above feature is disabled in newer version of ACS Commons and is not supported on AEM as a Cloud setup. However if your ACS Commons version is old enough you can take it to account as an option.

Summarizing, in case you are not able to convinced your client that groovy console will be the most efficient way to do the job, I would go with Option 1 - especially that entire implementation is already done - so you will only have to add it to your code base.