PageMoveAction for rollout in AEM | Community
Skip to main content
Anny0505
Community Advisor
Community Advisor
December 4, 2020
Solved

PageMoveAction for rollout in AEM

  • December 4, 2020
  • 1 reply
  • 3439 views

Hi All,

 

I need to implement PageMoveAction on a blueprint page whenever any page moved within the blueprint pages. Anyone, could you please help me with how to implement this as I have 20 live copies and I need to move all live copies whenever the blueprint page moved.

 

Any suggestions would really help me.

 

Thanks,

Aruna

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 Vijayalakshmi_S

Hi @anny0505,

If a Page move on Blueprint has to be rolled out to Live copy pages, 

Create custom rollout config with OOB Synchronization action named "PageMoveAction"

This action will retain pages in old location and newly moved location in live copy pages. It has to be followed by Standard rollout config which will help in removing the page from old location. More details about this behavior is clearly documented in https://experienceleague.adobe.com/docs/experience-manager-65/administering/introduction/msm-best-practices.html?lang=en#structure-changes-and-rollouts

Steps for creating rollout configuration with desired action is documented in https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-msm.html?lang=en#create-the-rollout-configuration

Note : Position the actions based on the behavior expected in live copy pages. 

1 reply

Vijayalakshmi_S
Vijayalakshmi_SAccepted solution
Level 10
December 4, 2020

Hi @anny0505,

If a Page move on Blueprint has to be rolled out to Live copy pages, 

Create custom rollout config with OOB Synchronization action named "PageMoveAction"

This action will retain pages in old location and newly moved location in live copy pages. It has to be followed by Standard rollout config which will help in removing the page from old location. More details about this behavior is clearly documented in https://experienceleague.adobe.com/docs/experience-manager-65/administering/introduction/msm-best-practices.html?lang=en#structure-changes-and-rollouts

Steps for creating rollout configuration with desired action is documented in https://experienceleague.adobe.com/docs/experience-manager-65/developing/extending-aem/extending-msm.html?lang=en#create-the-rollout-configuration

Note : Position the actions based on the behavior expected in live copy pages. 

Anny0505
Community Advisor
Anny0505Community AdvisorAuthor
Community Advisor
December 6, 2020

Thank you @ Vijayalakshmi_S for the valuable suggestions.

 

I have created LiveActionFactory for my custom rollout and created livesync action under apps/msm/rolloutconfigs.

As mentioned below I have created factory class it is getting invoking when I move page but EXECUTE method is not triggerring.

Am I missing anything here. Please help me.

 

import java.util.Collections;
import com.day.cq.wcm.msm.api.ActionConfig;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.cq.commerce.common.ValueMapDecorator;
import com.day.cq.wcm.msm.api.ActionConfig;
import com.day.cq.wcm.msm.api.LiveAction;
import com.day.cq.wcm.msm.api.LiveActionFactory;
import com.day.cq.wcm.msm.api.LiveRelationship;
import com.day.cq.wcm.api.WCMException;

@8220494(service = LiveActionFactory.class, immediate = true, property = {
PageMoveActionFactory.ACTION_NAME + "=PageMoveAction" })
public class PageMoveActionFactory implements LiveActionFactory<LiveAction> {

private static Logger LOG = LoggerFactory.getLogger(PageMoveActionFactory.class);

@3214626
private ResourceResolverFactory resourceResolverFactory;

static final String ACTION_NAME = LiveActionFactory.LIVE_ACTION_NAME;

@9944223
public LiveAction createAction(Resource config) throws WCMException {
LOG.debug("INSIDE PAGE MOVE ACTION FACTORY >>>>>>" + ACTION_NAME);

return new PageMoveAction(ACTION_NAME, config);
}

@9944223
public String createsAction() {
return ACTION_NAME;
}

/************* LiveAction ****************/
private static class PageMoveAction implements LiveAction {

private String name;
private static final Logger log = LoggerFactory.getLogger(PageMoveAction.class);


public PageMoveAction(String actionName, Resource config) {

log.debug(" *** invoked constructor PageMoveAction *** "+actionName);
actionName = actionName;
config = config;
}

public void execute(Resource source, Resource target, LiveRelationship liverel, boolean autoSave,
boolean isResetRollout) throws WCMException {
log.debug(" *** Executing PageMoveAction *** ");
LOG.debug("ARUNA HERE....");

}

@9944223
@2371202
public void execute(ResourceResolver arg0, LiveRelationship arg1, ActionConfig arg2, boolean arg3)
throws WCMException {

}

@9944223
@2371202
public void execute(ResourceResolver arg0, LiveRelationship arg1, ActionConfig arg2, boolean arg3, boolean arg4)
throws WCMException {

}

public String getName() {
return name;
}

@9944223
@2371202
public String getParameterName() {
return null;
}
@9944223
@2371202
public String[] getPropertiesNames() {
return null;
}

@9944223
@2371202
public int getRank() {
return 0;
}

@9944223
@2371202
public String getTitle() {
return null;
}

@9944223
@2371202
public void write(JSONWriter arg0) throws JSONException {

}

}
}

 

 

August 2, 2022

Have you resolved this issue?