info.magnolia.setup.for5_2
Class RenameSameNameSiblingNodesTask

java.lang.Object
  extended by info.magnolia.module.delta.AbstractTask
      extended by info.magnolia.module.delta.AbstractRepositoryTask
          extended by info.magnolia.setup.for5_2.IdentifySameNameSiblingNodesTask
              extended by info.magnolia.setup.for5_2.RenameSameNameSiblingNodesTask
All Implemented Interfaces:
Task

public class RenameSameNameSiblingNodesTask
extends IdentifySameNameSiblingNodesTask

Identify all sibling nodes for a defined workspace, sub path and nodeTypes.
If the nodesTypes is empty or null, search all 'nt:base' nodes. Sibling nodes are renamed by adding a '_sibling_' suffix followed by an incremental number at the end of the node name.
- original node name : myNode
- renamed node name : myNode_sibling_0.


Field Summary
 
Fields inherited from class info.magnolia.setup.for5_2.IdentifySameNameSiblingNodesTask
session, workspace
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
RenameSameNameSiblingNodesTask(String name, String description, String workspace, String subPath, List<String> nodeTypes, boolean evaluateSupertypes)
           
 
Method Summary
protected  String createNewName(javax.jcr.Node node)
          Create a new unique name.
Override this method in order to create a unique name based on another pattern.
protected  void handleNode(javax.jcr.Node node, InstallContext installContext)
          Take action on a sibling node.
In this case, simply display in the install screen the sibling node name and path.
 
Methods inherited from class info.magnolia.setup.for5_2.IdentifySameNameSiblingNodesTask
doExecute, isSameNameSiblingNode
 
Methods inherited from class info.magnolia.module.delta.AbstractRepositoryTask
execute
 
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
 

Constructor Detail

RenameSameNameSiblingNodesTask

public RenameSameNameSiblingNodesTask(String name,
                                      String description,
                                      String workspace,
                                      String subPath,
                                      List<String> nodeTypes,
                                      boolean evaluateSupertypes)
Method Detail

handleNode

protected void handleNode(javax.jcr.Node node,
                          InstallContext installContext)
                   throws javax.jcr.RepositoryException
Description copied from class: IdentifySameNameSiblingNodesTask
Take action on a sibling node.
In this case, simply display in the install screen the sibling node name and path.

Overrides:
handleNode in class IdentifySameNameSiblingNodesTask
Throws:
javax.jcr.RepositoryException

createNewName

protected String createNewName(javax.jcr.Node node)
                        throws javax.jcr.RepositoryException
Create a new unique name.
Override this method in order to create a unique name based on another pattern.

Throws:
javax.jcr.RepositoryException


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