Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Programmatically rollout using RolloutParams

Avatar

Avatar
Establish
MVP
Ravi_Pampana
MVP

Likes

190 likes

Total Posts

239 posts

Correct Reply

74 solutions
Top badges earned
Establish
Contributor
Shape 1
Ignite 5
Ignite 3
View profile

Avatar
Establish
MVP
Ravi_Pampana
MVP

Likes

190 likes

Total Posts

239 posts

Correct Reply

74 solutions
Top badges earned
Establish
Contributor
Shape 1
Ignite 5
Ignite 3
View profile
Ravi_Pampana
MVP

26-04-2021

Out of the box RolloutManager provides below 3 methods by using that we can rollout the page programmatically.

 

1) void rollout(RolloutParams params) throws WCMException;

2) void rollout(ResourceResolver resolver, LiveRelationship relation, boolean reset) throws WCMException;

3) void rollout(ResourceResolver resolver, LiveRelationship relation, boolean reset, boolean autoSave) throws WCMException;

 

When using 2nd and 3rd method we are able to rollout the page but the references will not get updated to the corresponding locale.

This is because we are not providing the rollout trigger in 2nd and 3rd methods, so referenceUpdate action is not getting triggered. 

 

In order to update the link references in the rollout page we need to use 1st method and pass/set the required details in RolloutParams class.

 

Below is example code for setting the RolloutParams

 

                                    RolloutParams rolloutParams = new RolloutParams();

                                    /** if true, all child pages are updated too */
                                    rolloutParams.isDeep = false; 
                                    /** master page to rollout */
                                    rolloutParams.master = targetPage;
                                    /** path of lives copies to update, null to update all */
                                    rolloutParams.targets = new String[] {relationship.getTargetPath()};
                                    /** if true, Live Copy is completely reset */
                                    rolloutParams.reset = true; 
                                    /** rollout trigger. It can be other rollout as per the requirements */
                                    rolloutParams.trigger = RolloutManager.Trigger.ROLLOUT;
                                    rolloutManager.rollout(rolloutParams);

rollout rolloutparams

Replies

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,164 likes

Total Posts

6,273 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,164 likes

Total Posts

6,273 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

28-04-2021

Thank you for sharing this.