public class NodeUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getDataPath(java.lang.String cn,
Node node)
Translate the path to this node into a path containing the name of the
repository and the name of the workspace.
|
static Node |
getGroupHome(Session session,
java.lang.String groupname)
Returns the home node of the user or null if none was found.
|
static Repository |
getRepositoryByAlias(RepositoryFactory repositoryFactory,
java.lang.String alias)
Wraps the call to the repository factory based on parameter
NodeConstants.CN in order to simplify it and protect against future
API changes. |
static Repository |
getRepositoryByUri(RepositoryFactory repositoryFactory,
java.lang.String uri)
Wraps the call to the repository factory based on parameter
NodeConstants.LABELED_URI in order to simplify it and protect against
future API changes. |
static Repository |
getRepositoryByUri(RepositoryFactory repositoryFactory,
java.lang.String uri,
java.lang.String alias)
Wraps the call to the repository factory based on parameter
NodeConstants.LABELED_URI in order to simplify it and protect against
future API changes. |
static Node |
getUserHome(Session session)
Returns the home node of the session user or null if none was found.
|
static Node |
getUserHome(Session session,
java.lang.String username)
Returns the home node of the user or null if none was found.
|
static Session |
openDataAdminSession(Repository repository,
java.lang.String workspaceName)
Open a JCR session with full read/write rights on the data, as
NodeConstants.ROLE_USER_ADMIN , using the
NodeConstants.LOGIN_CONTEXT_DATA_ADMIN login context. |
public static Repository getRepositoryByAlias(RepositoryFactory repositoryFactory, java.lang.String alias)
NodeConstants.CN
in order to simplify it and protect against future
API changes.public static Repository getRepositoryByUri(RepositoryFactory repositoryFactory, java.lang.String uri)
NodeConstants.LABELED_URI
in order to simplify it and protect against
future API changes.public static Repository getRepositoryByUri(RepositoryFactory repositoryFactory, java.lang.String uri, java.lang.String alias)
NodeConstants.LABELED_URI
in order to simplify it and protect against
future API changes.public static Node getUserHome(Session session, java.lang.String username)
session
- the session to use in order to perform the search, this can
be a session with a different user ID than the one searched,
typically when a system or admin session is used.username
- the username of the userpublic static Node getGroupHome(Session session, java.lang.String groupname)
session
- the session to use in order to perform the search, this can
be a session with a different user ID than the one searched,
typically when a system or admin session is used.groupname
- the name of the grouppublic static Node getUserHome(Session session)
public static java.lang.String getDataPath(java.lang.String cn, Node node) throws RepositoryException
RepositoryException
public static Session openDataAdminSession(Repository repository, java.lang.String workspaceName)
NodeConstants.ROLE_USER_ADMIN
, using the
NodeConstants.LOGIN_CONTEXT_DATA_ADMIN
login context. For security
hardened deployement, use AuthPermission
on this login context.Copyright © 2007–2020. All rights reserved.