Interface NodeFinder

All Known Implementing Classes:
CMSNodeFinder, JCRNodeFinder

public interface NodeFinder
An abstraction for a Node lookup in JCR repository.
We need this to decouple WCM's NodeFinder from dependencies of the add-on.
Created by The eXo Platform SAS.
Version:
$Id: NodeFinder.java 00000 Feb 26, 2013 pnedonosko $
Author:
Peter Nedonosko
  • Method Summary

    Modifier and Type
    Method
    Description
    Align given name to current repository conventions by removing or escaping forbidden characters.
    javax.jcr.Item
    findItem(javax.jcr.Session userSession, String path)
    Find JCR item by given path, if the path points to a symlink this method return a target node of the link.
    Collection<javax.jcr.Node>
    findLinked(javax.jcr.Session session, String uuid)
    Find nodes linked to given node.
    javax.jcr.Item
    getItem(javax.jcr.Session userSession, String path, boolean symlinkTarget)
    Return JCR item by given path.
    javax.jcr.Node
    getUserNode(String userName)
    Return user home node of given user.
  • Method Details

    • getItem

      javax.jcr.Item getItem(javax.jcr.Session userSession, String path, boolean symlinkTarget) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
      Return JCR item by given path.
      Parameters:
      userSession - Session
      path - String
      symlinkTarget - boolean, if true and found item is a symlink node, return the symlink target node, if false just return the item obtained from the session
      Returns:
      the item
      Throws:
      javax.jcr.PathNotFoundException - if item not found by given path
      javax.jcr.RepositoryException - if repository error eccurs
    • findItem

      javax.jcr.Item findItem(javax.jcr.Session userSession, String path) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
      Find JCR item by given path, if the path points to a symlink this method return a target node of the link.
      Parameters:
      userSession - Session
      path - String
      Returns:
      the item
      Throws:
      javax.jcr.PathNotFoundException - if item not found by given path
      javax.jcr.RepositoryException - if repository error eccurs
    • findLinked

      Collection<javax.jcr.Node> findLinked(javax.jcr.Session session, String uuid) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
      Find nodes linked to given node.
      Parameters:
      session - the session
      uuid - String
      Returns:
      Collection of nodes
      Throws:
      javax.jcr.PathNotFoundException - the path not found exception
      javax.jcr.RepositoryException - the repository exception
    • cleanName

      String cleanName(String name)
      Align given name to current repository conventions by removing or escaping forbidden characters.
      Parameters:
      name - String
      Returns:
      String cleaned name
    • getUserNode

      javax.jcr.Node getUserNode(String userName) throws Exception
      Return user home node of given user.
      Parameters:
      userName - String with user name in organization
      Returns:
      Node user home node
      Throws:
      Exception - the exception