We have background process that automatically creates AEM pages as well as deletes old AEM pages. For pages to appear/disappear on the published site, they need to be activated (Published) / deactivated (Unpublished).
However, after searching from Google, I am not able to find AEM Java API that can publish/unpublish pages automatically.
Where can I find information on how to do this?
Best How To :
what you are looking for is the Replicator api. ReplicationActionType decides if you want to activate or deactivate.
You can obtain Replicator instance using the @Reference annotation inside your OSGI service.