public class ChangeAllPropertiesWithCertainValueTask extends NodeVisitorTask
PropertyType.STRING
and has a certain value.
Note that this uses the query functionality of JCR and is therefore usable only if currentValue
is a
valid fullTextSearchExpression
as defined in JCR2 6.7.19. More specifically it is not guaranteed to
find all properties intended to be changed if currentValue
either:
OR
DO_NOTHING, log
Constructor and Description |
---|
ChangeAllPropertiesWithCertainValueTask(String currentValue,
String newValue) |
ChangeAllPropertiesWithCertainValueTask(String workspaceName,
String currentValue,
String newValue) |
ChangeAllPropertiesWithCertainValueTask(String workspaceName,
String absPath,
String currentValue,
String newValue) |
ChangeAllPropertiesWithCertainValueTask(String name,
String description,
String workspaceName,
String currentValue,
String newValue) |
ChangeAllPropertiesWithCertainValueTask(String name,
String description,
String workspaceName,
String absPath,
String currentValue,
String newValue) |
Modifier and Type | Method and Description |
---|---|
protected void |
doExecute(InstallContext installContext) |
protected boolean |
nodeMatches(javax.jcr.Node node)
Implement this method to define which nodes should subsequently be operated upon.
|
protected void |
operateOnNode(InstallContext installContext,
javax.jcr.Node node)
Implement this method to apply changes to each of the nodes that are matched by
NodeVisitorTask.nodeMatches(Node) . |
getFilteringPredicate
execute
getDescription, getName, toString
public ChangeAllPropertiesWithCertainValueTask(String currentValue, String newValue)
public ChangeAllPropertiesWithCertainValueTask(String workspaceName, String currentValue, String newValue)
public ChangeAllPropertiesWithCertainValueTask(String workspaceName, String absPath, String currentValue, String newValue)
public ChangeAllPropertiesWithCertainValueTask(String name, String description, String workspaceName, String currentValue, String newValue)
protected void doExecute(InstallContext installContext) throws javax.jcr.RepositoryException, TaskExecutionException
doExecute
in class NodeVisitorTask
javax.jcr.RepositoryException
TaskExecutionException
protected boolean nodeMatches(javax.jcr.Node node)
NodeVisitorTask
This will be called for every visited node in that task, and serves a similar purpose as a JCR query statement.
nodeMatches
in class NodeVisitorTask
node
- the JCR node that is currently being visitedtrue
if the node should be operated upon, false
otherwiseNodeVisitorTask.operateOnNode(InstallContext, Node)
protected void operateOnNode(InstallContext installContext, javax.jcr.Node node)
NodeVisitorTask
NodeVisitorTask.nodeMatches(Node)
.
This is typically where the update logic goes, in a similar fashion as the QueryTask
.
operateOnNode
in class NodeVisitorTask
installContext
- the current install contextnode
- the JCR node that should be operated uponQueryTask.operateOnNode(InstallContext, Node)
Copyright © 2003–2018 Magnolia International Ltd.. All rights reserved.