How to achieve automatic deletion of pages after certain period of time in aem programmatically? | Community
Skip to main content
New Participant
Sep 16, 2019 6:40 PM UTC
Solved

How to achieve automatic deletion of pages after certain period of time in aem programmatically?

Anybody has implemented this before, will be great help if you can share.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
leoberliantAccepted solution
Employee
Sep 17, 2019 12:15 PM UTC

You can possibly employ two different approaches:

- you can develop a custom scheduler to delete a page and use OSGi configuration to define a path and deletion time. You can find a bunch of example for the same. Here is a good one that is following OSGi R6 Annotations: https://medium.com/adobetech/aem-6-4-creating-a-scheduler-using-osgi-r6-annotations-4ad0b8c6fce7

- you can use create a workflow that deletes a payload. You can then use OOTB "Scheduling Workflow" (Manage Publication in AEM 6.4 Touch UI) to execute your custom workflow for a node deletion at the required time:

2 replies

leoberliantAccepted solution
Employee
Sep 17, 2019 12:15 PM UTC

You can possibly employ two different approaches:

- you can develop a custom scheduler to delete a page and use OSGi configuration to define a path and deletion time. You can find a bunch of example for the same. Here is a good one that is following OSGi R6 Annotations: https://medium.com/adobetech/aem-6-4-creating-a-scheduler-using-osgi-r6-annotations-4ad0b8c6fce7

- you can use create a workflow that deletes a payload. You can then use OOTB "Scheduling Workflow" (Manage Publication in AEM 6.4 Touch UI) to execute your custom workflow for a node deletion at the required time:

Translate
Employee
Sep 16, 2019 6:51 PM UTC

You can try to write custom code to read the on-off time fields from the page properties and use the page manager API[1] to delete the pages.

[1] PageManager ("The Adobe AEM Quickstart and Web Application.")

Translate