Package org.exoplatform.onlyoffice.jcr
Class JCRNodeFinder
java.lang.Object
org.exoplatform.onlyoffice.jcr.JCRNodeFinder
- All Implemented Interfaces:
NodeFinder
Created by The eXo Platform SAS.
- Version:
- $Id: JCRNodeFinder.java 00000 Feb 26, 2013 pnedonosko $
- Author:
- Peter Nedonosko
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreatorThe hierarchy creator.protected final org.exoplatform.services.jcr.RepositoryServiceThe jcr service.protected final org.exoplatform.services.jcr.ext.app.SessionProviderServiceThe session provider service. -
Constructor Summary
ConstructorsConstructorDescriptionJCRNodeFinder(org.exoplatform.services.jcr.RepositoryService jcrService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator) Instantiates a new JCR node finder. -
Method Summary
Modifier and TypeMethodDescriptionAlign given name to current repository conventions by removing or escaping forbidden characters.javax.jcr.ItemFind 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.ItemReturn JCR item by given path.javax.jcr.NodegetUserNode(String userName) Return user home node of given user.
-
Field Details
-
jcrService
protected final org.exoplatform.services.jcr.RepositoryService jcrServiceThe jcr service. -
sessionProviderService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderServiceThe session provider service. -
hierarchyCreator
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreatorThe hierarchy creator.
-
-
Constructor Details
-
JCRNodeFinder
public JCRNodeFinder(org.exoplatform.services.jcr.RepositoryService jcrService, org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviderService, org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator) Instantiates a new JCR node finder.- Parameters:
jcrService- the jcr servicesessionProviderService- the session provider servicehierarchyCreator- the hierarchy creator
-
-
Method Details
-
getItem
public 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.- Specified by:
getItemin interfaceNodeFinder- Parameters:
userSession-Sessionpath-StringsymlinkTarget- boolean, iftrueand found item is a symlink node, return the symlink target node, iffalsejust return the item obtained from the session- Returns:
- the item
- Throws:
javax.jcr.PathNotFoundException- if item not found by given pathjavax.jcr.RepositoryException- if repository error eccurs
-
findItem
public 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.- Specified by:
findItemin interfaceNodeFinder- Parameters:
userSession-Sessionpath-String- Returns:
- the item
- Throws:
javax.jcr.PathNotFoundException- if item not found by given pathjavax.jcr.RepositoryException- if repository error eccurs
-
findLinked
public Collection<javax.jcr.Node> findLinked(javax.jcr.Session session, String uuid) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException Find nodes linked to given node.- Specified by:
findLinkedin interfaceNodeFinder- Parameters:
session- the sessionuuid-String- Returns:
Collectionof nodes- Throws:
javax.jcr.PathNotFoundException- the path not found exceptionjavax.jcr.RepositoryException- the repository exception
-
cleanName
Align given name to current repository conventions by removing or escaping forbidden characters.- Specified by:
cleanNamein interfaceNodeFinder- Parameters:
name-String- Returns:
Stringcleaned name
-
getUserNode
Return user home node of given user.- Specified by:
getUserNodein interfaceNodeFinder- Parameters:
userName- String with user name in organization- Returns:
Nodeuser home node- Throws:
Exception- the exception
-