public class RestorePreviousVersionCommand extends RuleBasedCommand
Modifier and Type | Field and Description |
---|---|
static String |
ATTRIBUTE_INCLUDING_CHILDREN |
static String |
ATTRIBUTE_PARENT_NODE_TYPE_ONLY |
static int |
HOLD_LOCK_IN_SECONDS |
ATTRIBUTE_RULE
CONTINUE_PROCESSING, PROCESSING_COMPLETE
Constructor and Description |
---|
RestorePreviousVersionCommand(VersionManager versionManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
execute(Context context)
This is the actual method to be overridden in descendant classes.
|
protected Rule |
getDefaultRule() |
boolean |
isParentNodeTypeOnly() |
protected void |
restoreAllChildren(javax.jcr.Node node,
String parentNodeType)
Restores all descendant nodes according to the following strategy:
Restore descendants of the same type as the parent, if
isParentNodeTypeOnly() is set to true
Restore descendants according to the configured Rule for allowed node-types
Restore descendants of type mgnl:metaData and node-types defined by itemTypes parameter of command definition (fallback behavior). |
getItemTypes, getRule, release, setItemTypes, setRule
getJCRNode, getNode, getPath, getRepository, getUuid, setPath, setRepository, setUuid
clone, execute, isEnabled, setEnabled
public static final String ATTRIBUTE_PARENT_NODE_TYPE_ONLY
public static final String ATTRIBUTE_INCLUDING_CHILDREN
public static final int HOLD_LOCK_IN_SECONDS
@Inject public RestorePreviousVersionCommand(VersionManager versionManager)
public boolean execute(Context context) throws Exception
MgnlCommand
execute
in class MgnlCommand
Exception
protected Rule getDefaultRule()
getDefaultRule
in class RuleBasedCommand
protected void restoreAllChildren(javax.jcr.Node node, String parentNodeType) throws javax.jcr.RepositoryException
isParentNodeTypeOnly()
is set to true
Rule
for allowed node-types
mgnl:metaData
and node-types defined by itemTypes
parameter of command definition (fallback behavior).
javax.jcr.RepositoryException
isParentNodeTypeOnly()
,
RuleBasedCommand.getRule()
public boolean isParentNodeTypeOnly()
parentNodeTypeOnly
parameter whose value is true, false (default setting) otherwise.Copyright © 2003–2017 Magnolia International Ltd.. All rights reserved.