Unpublishing heiarcy question | Community
Skip to main content
ryant58768566
New Participant
February 26, 2024
Solved

Unpublishing heiarcy question

  • February 26, 2024
  • 4 replies
  • 862 views

If I had a parent folder that has say 5 children pages.  If one of those children pages gets deleted but was never unpublished, would unpublishing the parent folder unpublish itself and all 5 children or only the 4 that remain leaving an orphaned child published?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Hi @ryant58768566 
Please check, when you delete the page , its get unpublished automatically.

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager-ideas/delete-page-in-author-should-auto-unpublish-the-page/idi-p/569977 

4 replies

arunpatidar
arunpatidarAccepted solution
New Participant
February 27, 2024
Imran__Khan
New Participant
February 27, 2024

@ryant58768566 This same problem I just had in my project if we are publishing data to third party API. @arunpatidar  Agree with Arun, on deletion, it will unpublish the page.

If require for third party, use below code to unpublish page data as soon as it gets delete.

 

import com.day.cq.replication.ReplicationAction; import com.day.cq.replication.ReplicationActionType; import org.apache.commons.lang3.StringUtils; import org.osgi.service.component.annotations.Component; import org.osgi.service.event.Event; import org.osgi.service.event.EventConstants; import org.osgi.service.event.EventHandler; import java.util.*; @Component(service = {EventHandler.class, ManagePages.class}, property = { EventConstants.EVENT_TOPIC+"="+ReplicationAction.EVENT_TOPIC }, immediate = true) public class ManagePages implements EventHandler { // main logic to handle specific AEM events for iPaas integration public void handleEvent(Event event) { String eventTopic = (String) event.getProperty(EventConstants.EVENT_TOPIC); List<String> agents = (List<String>) event.getProperty("agentIds"); if (StringUtils.isBlank(eventTopic) || agents.contains("preview")) { return; } // logic to get the page path for replication events ReplicationAction actionType = ReplicationAction.fromEvent(event); if (null != actionType) { if (!ReplicationActionType.DELETE.getName().equalsIgnoreCase(actionType.getType().getName()) { // unpublish page using Replication API } } } }

 

 

Shashi_Mulugu
New Participant
February 27, 2024

@ryant58768566 not sure if you have any customizations.. but ideally when ever you delete any page in AEM author.. it unpublish and deletes the page.. so there is no chance of page getting deleted in author and present in publisher..

 

 

SureshDhulipudi
New Participant
February 26, 2024

In AEM - General rule or scenario:

When you unpublish a parent page, it attempts to unpublish all of its child pages as well.

 

In the above your scenario - as the child page is deleted (without unpublished) - it will be remain available in Publish instance (remain published) , even after the parent page is unpublished.

because the Unpublished action will not find the deleted child page in author instance parent child structure.

 

- deleted page still available in publish instance.

Best way is - test this scenario in Development or QA environment.