info.magnolia.setup.for5_2
Class IdentifySameNameSiblingNodesTask

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
All Implemented Interfaces:
Task
Direct Known Subclasses:
RenameSameNameSiblingNodesTask

public class IdentifySameNameSiblingNodesTask
extends AbstractRepositoryTask

Identify all sibling nodes for a defined workspace, sub path and nodeTypes.
If the nodesTypes is empty or null, search all 'nt:base' nodes.


Field Summary
protected  javax.jcr.Session session
           
protected  String workspace
           
 
Fields inherited from class info.magnolia.module.delta.AbstractTask
DO_NOTHING
 
Constructor Summary
IdentifySameNameSiblingNodesTask(String name, String description, String workspace, String subPath, List<String> nodeTypes, boolean evaluateSupertypes)
           
 
Method Summary
protected  void doExecute(InstallContext installContext)
           
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.
protected  boolean isSameNameSiblingNode(javax.jcr.Node node)
          Return true if the node match the siblingMatcherPattern.
 
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
 

Field Detail

workspace

protected final String workspace

session

protected javax.jcr.Session session
Constructor Detail

IdentifySameNameSiblingNodesTask

public IdentifySameNameSiblingNodesTask(String name,
                                        String description,
                                        String workspace,
                                        String subPath,
                                        List<String> nodeTypes,
                                        boolean evaluateSupertypes)
Parameters:
name - task name
description - task description
workspace - task is running against this workspace. TaskExecutionException is throws if the workspace is invalid or null.
subPath - used to limit the operation to a specified subPath '/demo-project/about'
nodeTypes - List of nodeTypes that has to search. If null or empty, the search of siblings is performed against 'nt:base'
evaluateSupertypes - if set to true, the child nodeTypes of a defined 'nodeType' are also part of the evaluation.
Method Detail

doExecute

protected void doExecute(InstallContext installContext)
                  throws javax.jcr.RepositoryException,
                         TaskExecutionException
Specified by:
doExecute in class AbstractRepositoryTask
Throws:
javax.jcr.RepositoryException
TaskExecutionException

isSameNameSiblingNode

protected boolean isSameNameSiblingNode(javax.jcr.Node node)
Return true if the node match the siblingMatcherPattern.


handleNode

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

Throws:
javax.jcr.RepositoryException


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