|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.portals.graffito.jcr.repository.RepositoryUtil
public class RepositoryUtil
Utility class for managing JCR repositories. Note: most of the utility methods in this class can be used only with Jackrabbit.
Field Summary | |
---|---|
static java.lang.String |
GRAFFITO_NAMESPACE
Graffito namespace constant. |
static java.lang.String |
GRAFFITO_NAMESPACE_PREFIX
Graffito namespace prefix constant. |
static org.apache.commons.logging.Log |
log
|
static java.lang.String |
PATH_SEPARATOR
Item path separator |
Constructor Summary | |
---|---|
RepositoryUtil()
|
Method Summary | |
---|---|
static java.lang.String |
encodePath(java.lang.String path)
Encode a path |
static java.lang.String |
getNodeName(java.lang.String path)
Get the node name |
static java.lang.String |
getParentPath(java.lang.String path)
Get the parent path |
static javax.jcr.Repository |
getRepository(java.lang.String repositoryName)
Get a repository |
static boolean |
isValidPath(java.lang.String path)
Check if a path is valid |
static javax.jcr.Session |
login(javax.jcr.Repository repository,
java.lang.String user,
java.lang.String password)
Connect to a JCR repository |
static void |
registerRepository(java.lang.String repositoryName,
java.lang.String configFile,
java.lang.String homeDir)
Register a new repository |
static void |
unRegisterRepository(java.lang.String repositoryName)
Unregister a repository |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GRAFFITO_NAMESPACE_PREFIX
public static final java.lang.String GRAFFITO_NAMESPACE
public static final java.lang.String PATH_SEPARATOR
public static final org.apache.commons.logging.Log log
Constructor Detail |
---|
public RepositoryUtil()
Method Detail |
---|
public static void registerRepository(java.lang.String repositoryName, java.lang.String configFile, java.lang.String homeDir) throws RepositoryException
repositoryName
- The repository unique nameconfigFile
- The JCR config filehomeDir
- The directory containing the complete repository settings (workspace, node types, ...)
RepositoryException
- when it is not possible to register the repositorypublic static void unRegisterRepository(java.lang.String repositoryName) throws RepositoryException
repositoryName
- The repository unique name
RepositoryException
- when it is not possible to unregister the repositorypublic static javax.jcr.Repository getRepository(java.lang.String repositoryName) throws RepositoryException
repositoryName
- The repository name
RepositoryException
- when it is not possible to get the repository.
Before calling this method, the repository has to be registered (@see RepositoryUtil#registerRepository(String, String, String)public static javax.jcr.Session login(javax.jcr.Repository repository, java.lang.String user, java.lang.String password) throws RepositoryException
repository
- The JCR repositoryuser
- The user namepassword
- The password
RepositoryException
- when it is not possible to connect to the JCR repositorypublic static boolean isValidPath(java.lang.String path)
path
- The path to validate
public static java.lang.String getParentPath(java.lang.String path) throws PersistenceException
path
- The path from wich the parent path has to be returned
PersistenceException
- when the path is invalidpublic static java.lang.String getNodeName(java.lang.String path) throws PersistenceException
path
- The path from which the node name has to be retrieved
PersistenceException
- when the path is invalidpublic static java.lang.String encodePath(java.lang.String path)
path
- the path to encode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |