Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Need info of updateRolloutInfo implementation of RolloutManager

Avatar

Level 3

In com.day.cq.wcm.msm.api.RolloutManager,  updateRolloutInfo method as per documentation it says Update rollout info on the node.

 

Can I know what are the properties in the node it is updating?

 

1 Accepted Solution

Avatar

Correct answer by
Level 3

Hi Arun 

I found in the implementation class what the method it is doing.

 

public void updateRolloutInfo(final Node node, final boolean deepUpdate, final boolean autoSave) throws WCMException {
final RolloutExceptionHandler.RolloutInfo info = new RolloutExceptionHandler.RolloutInfo();
try {
info.operation = "updateRolloutInfo";
info.src = node.getPath();
info.target = node.getPath();
info.user = node.getSession().getUserID();
if (!this.isExcludedNode(node)) {
if (node.isNodeType("cq:LiveRelationship")) {
node.setProperty("cq:lastRolledout", Calendar.getInstance());
node.setProperty("cq:lastRolledoutBy", node.getSession().getUserID());
}
if (deepUpdate) {
final NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
final Node child = (Node)iter.next();
this.updateRolloutInfo(child, true, autoSave);
}
}
if (autoSave) {
node.getSession().save();
}
}
}
catch (RepositoryException re) {
if (!this.rolloutExceptionHandler.handleException((Exception)re, info)) {
RolloutManagerImpl.log.error("Error while updating rollout info", (Throwable)re);
throw new WCMException("Error while updating rollout info", (Throwable)re);
}
}
catch (WCMException we) {
if (!this.rolloutExceptionHandler.handleException((Exception)we, info)) {
throw we;
}
}
}
 
Thanks for helping me.
 
Thanks
Dillibabu

View solution in original post

4 Replies

Avatar

Community Advisor
Page rolloutthispage = pageManager.getPage("/content/geometrixx/en/toolbar"); //source page
RolloutManager.RolloutParams rolloutparams = new RolloutManager.RolloutParams();
rolloutparams.master = rolloutthispage; 
rolloutparams.isDeep = true;
//rolloutmanager is an OSGI service so using here sling.getService to have a reference
com.day.cq.wcm.msm.api.RolloutManager rolloutManager = sling.getService(com.day.cq.wcm.msm.api.RolloutManager.class);
rolloutManager.rollout(rolloutparams);

 

void updateRolloutInfo(Node node,
                       boolean deepUpdate,
                       boolean autoSave)
                throws WCMException
Update rollout info on the node. To use after a rollout operation.
Parameters:
node - Node to update
deepUpdate - Children of the node can be updated by setting deepUpdate to true.
autoSave - Save modifications

Page rolloutthispage = pageManager.getPage("/content/livecopy/en/toolbar"); //livecopy page com.day.cq.wcm.msm.api.RolloutManager rolloutManager = sling.getService(com.day.cq.wcm.msm.api.RolloutManager.class); rolloutManager.updateRolloutInfo(rolloutthispage.adaptTo(Node.class),true,true);

 



Arun Patidar

Avatar

Level 3

Hi Arun

 

I did the same  But one thing I need to know is which all properties are created or updated on the node after updateRollOutinfo.I am not able to find the exact implementation class to check those. If you can let me know, it would be helpful.

 

Dillibabu77_0-1662041315094.png

 

Thanks

Dillibabu

Avatar

Community Advisor

Hi,

I did not find the documentation about it.

You can decompile this bundle and check the exact implementation to know more in details.



Arun Patidar

Avatar

Correct answer by
Level 3

Hi Arun 

I found in the implementation class what the method it is doing.

 

public void updateRolloutInfo(final Node node, final boolean deepUpdate, final boolean autoSave) throws WCMException {
final RolloutExceptionHandler.RolloutInfo info = new RolloutExceptionHandler.RolloutInfo();
try {
info.operation = "updateRolloutInfo";
info.src = node.getPath();
info.target = node.getPath();
info.user = node.getSession().getUserID();
if (!this.isExcludedNode(node)) {
if (node.isNodeType("cq:LiveRelationship")) {
node.setProperty("cq:lastRolledout", Calendar.getInstance());
node.setProperty("cq:lastRolledoutBy", node.getSession().getUserID());
}
if (deepUpdate) {
final NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
final Node child = (Node)iter.next();
this.updateRolloutInfo(child, true, autoSave);
}
}
if (autoSave) {
node.getSession().save();
}
}
}
catch (RepositoryException re) {
if (!this.rolloutExceptionHandler.handleException((Exception)re, info)) {
RolloutManagerImpl.log.error("Error while updating rollout info", (Throwable)re);
throw new WCMException("Error while updating rollout info", (Throwable)re);
}
}
catch (WCMException we) {
if (!this.rolloutExceptionHandler.handleException((Exception)we, info)) {
throw we;
}
}
}
 
Thanks for helping me.
 
Thanks
Dillibabu