Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Implementation for MSM Custom Rollout Conflict when the name of Blueprint and Livecopy templates are collided

Avatar

Level 1

Hi everyone,

I would like to seek for anyone who could help advice on the implementation of handling rollout conflict in which Java is the language used this time. I am referring to this guide https://experienceleague.adobe.com/docs/experience-manager-65/administering/introduction/msm-rollout...

 

Background:

Now I have a published template (named "email_abc") on its live copy branch (lc-level-1), e.g. "email_abc". Then, I create another template with same name (i.e. email_abc) on Blueprint branch (bp-level-1).

The as-is result after the creation is that the Blueprint's template (i.e. email_abc) is published to the live copy branch while the live copy branch's template is renamed to "email_abc_msm" and modified to "Not published" status. This is default behavior when the MSM conflict option is checked for rollout manager.

 

What needs to achieve:

It is expected to customized this rollout behavior for

  • renaming the live copy branch's template to be "email_abc_1" instead of "email_abc_msm"
  • not to unpublish the live copy branch's template

Implementation issue needs to be resolved:

By referring to the guide posted on the heading, I wonder how the resourceResolver argument from the method handleNameConflict in ResourceNameRolloutConflictHandler interface can be implemented to achieve which template for publishing as well as adopting a different name aside "_msm_moved". Would the RolloutManager help on this case?

 

Many thanks and appreciate for your advice on this issue.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

The LiveRelationship interface passed in the method "handleNameConflict" provides the path of livecopy page using method getTargetPath(). You can use the path to modify the name of the resource? 

 

Regarding resource resolver, below is sample code

 

@Reference
private ResourceResolverFactory resourceResolverFactory;

 

protected ResourceResolver getResourceResolver() throws LoginException {
Map<String, Object> param = Maps.newHashMap();
//Create the service user in AEM
param.put(ResourceResolverFactory.SUBSERVICE, Constants.SERVICE_USER);
return resourceResolverFactory.getServiceResourceResolver(param);
}

 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

The LiveRelationship interface passed in the method "handleNameConflict" provides the path of livecopy page using method getTargetPath(). You can use the path to modify the name of the resource? 

 

Regarding resource resolver, below is sample code

 

@Reference
private ResourceResolverFactory resourceResolverFactory;

 

protected ResourceResolver getResourceResolver() throws LoginException {
Map<String, Object> param = Maps.newHashMap();
//Create the service user in AEM
param.put(ResourceResolverFactory.SUBSERVICE, Constants.SERVICE_USER);
return resourceResolverFactory.getServiceResourceResolver(param);
}