info.magnolia.commands.impl
Class RestorePreviousVersionCommand

java.lang.Object
  extended by info.magnolia.commands.MgnlCommand
      extended by info.magnolia.commands.impl.BaseRepositoryCommand
          extended by info.magnolia.commands.impl.RestorePreviousVersionCommand
All Implemented Interfaces:
Command, Cloneable

public class RestorePreviousVersionCommand
extends BaseRepositoryCommand

Command to restore a node and all its descendants to their previous version.


Field Summary
 
Fields inherited from interface info.magnolia.commands.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
RestorePreviousVersionCommand(VersionManager versionManager)
           
 
Method Summary
 boolean execute(Context context)
          This is the actual method to be overridden in descendant classes.
 boolean isParentNodeTypeOnly()
           
protected  void restoreAllChildren(javax.jcr.Node node, String parentNodeType)
          Restores all descendants whose type is in the mgnl: namespace (default behavior) or will only restore descendants of the same types of the parent.
 
Methods inherited from class info.magnolia.commands.impl.BaseRepositoryCommand
getJCRNode, getNode, getPath, getRepository, getUuid, release, setPath, setRepository, setUuid
 
Methods inherited from class info.magnolia.commands.MgnlCommand
clone, execute, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestorePreviousVersionCommand

@Inject
public RestorePreviousVersionCommand(VersionManager versionManager)
Method Detail

execute

public boolean execute(Context context)
                throws Exception
Description copied from class: MgnlCommand
This is the actual method to be overridden in descendant classes.

Specified by:
execute in class MgnlCommand
Throws:
Exception

restoreAllChildren

protected void restoreAllChildren(javax.jcr.Node node,
                                  String parentNodeType)
                           throws javax.jcr.RepositoryException
Restores all descendants whose type is in the mgnl: namespace (default behavior) or will only restore descendants of the same types of the parent.

Throws:
javax.jcr.RepositoryException
See Also:
isParentNodeTypeOnly()

isParentNodeTypeOnly

public boolean isParentNodeTypeOnly()
Returns:
true if the command context contains an parentNodeTypeOnly parameter whose value is true, false (default setting) otherwise.


Copyright © 2003-2014 Magnolia International Ltd.. All Rights Reserved.