org.alfresco.repo.nodelocator
Class AncestorNodeLocator

java.lang.Object
  extended by org.alfresco.repo.nodelocator.AbstractNodeLocator
      extended by org.alfresco.repo.nodelocator.AncestorNodeLocator
All Implemented Interfaces:
NodeLocator

public class AncestorNodeLocator
extends AbstractNodeLocator

This NodeLocator identifies an ancestor of the source node.

The node returned can be of a specific type and/or have a specific aspect applied.

If no parameters are passed the immediate primary parent is returned.

Since:
4.0

Field Summary
static java.lang.String ASPECT_KEY
           
static java.lang.String NAME
           
static java.lang.String TYPE_KEY
           
 
Constructor Summary
AncestorNodeLocator()
           
 
Method Summary
 java.lang.String getName()
          
 org.alfresco.service.cmr.repository.NodeRef getNode(org.alfresco.service.cmr.repository.NodeRef source, java.util.Map params)
          Finds a NodeRef given a starting NodeRef and a Map of parameters.
 java.util.List getParameterDefinitions()
          A list containing the parmameter defintions for this NodeLocator.
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 
Methods inherited from class org.alfresco.repo.nodelocator.AbstractNodeLocator
setNodeLocatorService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

TYPE_KEY

public static final java.lang.String TYPE_KEY
See Also:
Constant Field Values

ASPECT_KEY

public static final java.lang.String ASPECT_KEY
See Also:
Constant Field Values
Constructor Detail

AncestorNodeLocator

public AncestorNodeLocator()
Method Detail

getNode

public org.alfresco.service.cmr.repository.NodeRef getNode(org.alfresco.service.cmr.repository.NodeRef source,
                                                           java.util.Map params)
Finds a NodeRef given a starting NodeRef and a Map of parameters. Returns null if the specified node could not be found.

params - an arbitrary Map of parameters.Can be null.
Returns:
the node to be found or null.

getParameterDefinitions

public java.util.List getParameterDefinitions()
A list containing the parmameter defintions for this NodeLocator.

Specified by:
getParameterDefinitions in interface NodeLocator
Overrides:
getParameterDefinitions in class AbstractNodeLocator
Returns:
a list of parameter definitions

getName

public java.lang.String getName()

Specified by:
getName in class AbstractNodeLocator

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - the nodeService to set

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Parameters:
namespaceService - the namespaceService to set


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.