Reputation: 43
I'm trying to use Groovy to roll out a blueprint page to a specific live copy page. The following script works in AEM 6.5 but it rolls out to all the live copies. It ignores 'targets'.
How can I limit the rollout to the page specified in the target_path variable?
import com.day.cq.wcm.msm.api.RolloutManager;
import com.day.cq.wcm.msm.api.RolloutManager.RolloutParams;
source_path = '/content/mysite/en/about-us';
target_path = '/content/mysite/en_us/about-us';
resource = resourceResolver.getResource(source_path);
masterPage = resource.adaptTo(Page.class);
rolloutParms = RolloutParams.newInstance();
rolloutParms.master = masterPage;
rolloutParms.targets= target_path;
rolloutParms.isDeep = false;
rolloutParms.reset= false;
def rolloutManager = getService('com.day.cq.wcm.msm.api.RolloutManager');
rolloutManager.rollout(rolloutParms);
Upvotes: 1
Views: 480
Reputation: 43
Putting target_path in brackets solved the issue. target_path = ['/content/mysite/en_us/about-us']
Upvotes: 1