Handling updates to Initial Content and Structure

Avatar

Avatar
Boost 1
Level 1
ved_s
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
ved_s
Level 1

Like

1 like

Total Posts

6 posts

Correct reply

0 solutions
Top badges earned
Boost 1
View profile
ved_s
Level 1

13-12-2020

Hi, I have two parts to my question below.

1) We have in Production an editable template with initial content and now there is a requirement to update a part of this initial content and we want it to reflect on all pages that were first created based on that template.

I know that if I create a new instance of this page, it will have the updated initial content but I want to know whether it is possible or if there are workarounds to have it reflected on the prior created page.

 

2) If we make a change to the structure of an editable template say delete a component, then, in that case, the deleted component remains in the JCR structure of the pages that were created before. Is there an automated way to clean these orphan components?

 

Thanks

Ved

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

246 likes

Total Posts

410 posts

Correct reply

105 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile

Avatar
Affirm 100
MVP
shelly-goel
MVP

Likes

246 likes

Total Posts

410 posts

Correct reply

105 solutions
Top badges earned
Affirm 100
Give Back 25
Ignite 3
Give Back 10
Validate 1
View profile
shelly-goel
MVP

13-12-2020

Hi @ved_s 

1. There's no specific set pattern on how that updated or new content appear along with the existing content (above or below, etc.).
2. A warning is shown on deletion that there would be orphaned nodes on the contents though the page does not show that removed content anymore and deletion of those orphaned nodes might impact large number of contents.

Both the use cases need specific implementation and monitoring of the nodes being updated as it would impact large number of contents. You would have to write that specific logic as per your requirements. You may leverage "Page Structure Conversion Tool" and tweak it as per your needs.

AEM Modernization Tools have a Page Structure Conversion Tool (https://opensource.adobe.com/aem-modernize-tools/pages/plan-operate/usage.html) aimed at converting the page structure from static template to editable template. You can leverage the same UI that it provides (Under Tools > Sites) to find all the pages to be updated under a chosen path and then select as needed to convert. Convert button calls a servlet (com.adobe.aem.modernize.structure.impl.StructureConversionServlet) which reads from the "Page Rewrite Rule" configuration and calls one of the implementation of PageStructureRewriteRule (/src/main/java/com/adobe/aem/modernize/structure/impl/rules) based on service ranking & matches condition and then manipulates/ delete the content as needed. Most of the logic is there though it would not work as is because it's meant for static to editable conversion, you could add a new implementation of PageStructureRewriteRule as needed.

Code Reference: https://github.com/adobe/aem-modernize-tools/tree/develop/bundles/aem-modernize-tools