|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.magnolia.module.delta.AbstractTask
it.openutils.mgnltasks.ConditionalTask
public abstract class ConditionalTask
Base abstract task that executes a list of other tasks only if a specific node/nodedata doesn't already exists in the
repository. Subclasses must implement the verifyCondition
method.
Field Summary | |
---|---|
protected String |
handle
Handle to check. |
protected List<info.magnolia.module.delta.Task> |
tasks
Subtasks that will be executed if the node doesn't exists. |
protected String |
workspace
Workspace to check. |
Fields inherited from class info.magnolia.module.delta.AbstractTask |
---|
log |
Constructor Summary | |
---|---|
ConditionalTask(String workspace,
String handle,
List<info.magnolia.module.delta.Task> tasks)
|
Method Summary | |
---|---|
void |
execute(info.magnolia.module.InstallContext installContext)
|
boolean |
existsNode(info.magnolia.cms.core.HierarchyManager hm,
String handle)
Check if a node exists. |
boolean |
existsNodedata(info.magnolia.cms.core.HierarchyManager hm,
String handle,
String nodedata)
Check if a nodedata exists. |
boolean |
nodeDataEquals(info.magnolia.cms.core.HierarchyManager hm,
String handle,
String nodedata,
Object value)
Check if a nodedata exists with a specific value. |
abstract boolean |
verifyCondition(info.magnolia.cms.core.HierarchyManager hm,
String handle)
|
Methods inherited from class info.magnolia.module.delta.AbstractTask |
---|
getDescription, getName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String workspace
protected String handle
protected List<info.magnolia.module.delta.Task> tasks
Constructor Detail |
---|
public ConditionalTask(String workspace, String handle, List<info.magnolia.module.delta.Task> tasks)
taskName
- taskDescription
- Method Detail |
---|
public void execute(info.magnolia.module.InstallContext installContext) throws info.magnolia.module.delta.TaskExecutionException
info.magnolia.module.delta.TaskExecutionException
public boolean existsNode(info.magnolia.cms.core.HierarchyManager hm, String handle)
hm
- HieararchyManagerhandle
- node handle
true
if node existspublic boolean existsNodedata(info.magnolia.cms.core.HierarchyManager hm, String handle, String nodedata) throws javax.jcr.RepositoryException
hm
- HieararchyManagerhandle
- node handlenodedata
- nodedata name
true
if nodedata exists
javax.jcr.RepositoryException
- exceptions while checking contentpublic boolean nodeDataEquals(info.magnolia.cms.core.HierarchyManager hm, String handle, String nodedata, Object value) throws javax.jcr.RepositoryException
hm
- HieararchyManagerhandle
- node handlenodedata
- nodedata namevalue
- expected value for nodeData
true
if nodedata has the same value
javax.jcr.RepositoryException
- exceptions while checking contentpublic abstract boolean verifyCondition(info.magnolia.cms.core.HierarchyManager hm, String handle) throws javax.jcr.RepositoryException
hm
- HieararchyManagerhandle
- node handle
true
if the task must be executed
javax.jcr.RepositoryException
- exceptions while checking content
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |