Error while creating a custom rollout option
Hi,
I am trying to update the reference to experience fragments in my live copy for which I want to create a custom rollout config, below is the code.
Just for testing I am adding this action in the default rollout configuration in libs even though I should override it in apps (that i can do later)
but this is not working what am I doing wrong?

import javax.jcr.RepositoryException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.osgi.service.component.annotations.Component;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.day.cq.wcm.api.WCMException;
import com.day.cq.wcm.msm.api.LiveRelationship;
import com.day.cq.wcm.msm.commons.BaseAction;
import com.day.cq.wcm.msm.commons.BaseActionFactory;
@Component(immediate = true, property = {"liveAction=" + UpdateReferenceFactory.LIVE_ACTION_CLASS_NAME,
"liveAction=" + UpdateReferenceFactory.LIVE_ACTION_NAME })
public class UpdateReferenceFactory extends BaseActionFactory<BaseAction> {
public static final String LIVE_ACTION_CLASS_NAME = "ReferencesUpdateAction";
public static final String LIVE_ACTION_NAME = "expreferencesUpdate";
@Override
protected ReferencesUpdateAction newActionInstance(ValueMap config) throws WCMException {
return new ReferencesUpdateAction(config, this);
}
@Override
public String createsAction() {
return LIVE_ACTION_CLASS_NAME;
}
private static final class ReferencesUpdateAction extends BaseAction {
public ReferencesUpdateAction(ValueMap config, BaseActionFactory<BaseAction> factory) {
super(config, factory);
}
protected boolean handles(Resource source, Resource target, LiveRelationship relation, boolean resetRollout)
throws RepositoryException, WCMException {
return (relation.getStatus().isPage() && source != null);
}
protected void doExecute(Resource source, Resource target, LiveRelationship relation, boolean resetRollout)
throws RepositoryException, WCMException {
System.out.print("I am custom rollout");
}
}
}.