public abstract class BaseAction extends java.lang.Object implements LiveAction
LiveAction interface.
This abstract class offers some basic configuration tasks for building a
LiveAction and also default implementations for the deprecated
methods. It will speed up the implementation of a LiveAction
by only implementing the handles and doExecute abstract methods.| Modifier and Type | Method and Description |
|---|---|
void |
execute(ResourceResolver resolver,
LiveRelationship relation,
ActionConfig config,
boolean autoSave)
Deprecated.
|
void |
execute(ResourceResolver resolver,
LiveRelationship relation,
ActionConfig config,
boolean autoSave,
boolean isResetRollout)
Deprecated.
|
void |
execute(Resource source,
Resource target,
LiveRelationship relation,
boolean autoSave,
boolean isResetRollout)
Executes the current action.
- checks the preconditions using handles()- if preconditions are met the doExecute() is called- changes will be saved automatically if the autoSave flag is set to true This method needs that at least one of the Resource parameters (source,target) to be non-null when used in conjunction with
the autoSave flag since a ResourceResolver will need to be obtained to save the changes. |
java.lang.String |
getName()
The name of this action.
|
java.lang.String |
getParameterName()
Deprecated.
|
java.lang.String[] |
getPropertiesNames()
Deprecated.
|
int |
getRank()
Deprecated.
|
java.lang.String |
getTitle()
Deprecated.
|
static boolean |
isPage(Node node)
Checks if the given Node is considered a
PageThe check considers the and its primary child the Node as being a Page. |
static boolean |
resourceHasNode(Resource resource)
Simple test if a Resource exists and is adaptable to
Node |
void |
write(JSONWriter jsonWriter)
Deprecated.
|
public java.lang.String getName()
createsAction() from LiveActionFactory
that creates this actiongetName in interface LiveActionpublic void execute(Resource source, Resource target, LiveRelationship relation, boolean autoSave, boolean isResetRollout) throws WCMException
handles()doExecute() is calledResource parameters (source,target) to be non-null when used in conjunction with
the autoSave flag since a ResourceResolver will need to be obtained to save the changes.
A NonExistingResource should be used when dealing with non existing resources.execute in interface LiveActionsource - The Resource to roll-out. This may bee nulltarget - The Resource to receive modification. This may bee nullrelation - LiveRelationship between the two given ResourcesautoSave - Save modificationsisResetRollout - True if rollout is run in reset modeWCMException - if an error occursRolloutManager.rollout(com.day.cq.wcm.msm.api.RolloutManager.RolloutParams)public static boolean resourceHasNode(Resource resource)
Noderesource - in questionpublic static boolean isPage(Node node) throws RepositoryException
PageRolloutManager calls the LiveActions
with the later. As modifications should only be written to its content. Pages should not be changed.
Pages are considered an aggregate of all the Nodes and sub-graph at its Node.
Thus Services may require special treatment of them. Eg. Replication, Revisions are bound to Pages.node - to TestRepositoryException - on errors accessing the Repository@Deprecated public void execute(ResourceResolver resolver, LiveRelationship relation, ActionConfig config, boolean autoSave) throws WCMException
LiveActionexecute in interface LiveActionresolver - resource resolverrelation - live relationship concerned by action.config - action configautoSave - Save modificationsWCMException - if an error occursActionManager.executeAction(org.apache.sling.api.resource.ResourceResolver, LiveRelationship, ActionConfig, boolean)@Deprecated public void execute(ResourceResolver resolver, LiveRelationship relation, ActionConfig config, boolean autoSave, boolean isResetRollout) throws WCMException
LiveActionexecute in interface LiveActionresolver - resource resolverrelation - live relationship concerned by action.config - action configautoSave - Save modificationsisResetRollout - True if rollout is run in reset modeWCMException - if an error occursActionManager.executeAction(org.apache.sling.api.resource.ResourceResolver, LiveRelationship, ActionConfig, boolean, boolean)@Deprecated public java.lang.String getParameterName()
LiveActiongetParameterName in interface LiveAction@Deprecated public int getRank()
LiveActiongetRank in interface LiveAction@Deprecated public java.lang.String getTitle()
LiveActiongetTitle in interface LiveAction@Deprecated public java.lang.String[] getPropertiesNames()
LiveActiongetPropertiesNames in interface LiveAction@Deprecated public void write(JSONWriter jsonWriter) throws JSONException
JSONItemwrite in interface JSONItemwrite in interface LiveActionjsonWriter - json writerJSONException - if a JSON error occursCopyright © 2010 - 2023 Adobe. All Rights Reserved