public class JcrRepositoryModule extends Object implements RepositoryModule
Constructor and Description |
---|
JcrRepositoryModule() |
Modifier and Type | Method and Description |
---|---|
void |
copyAttributes(String token,
String srcId,
String dstId,
ExtendedAttributes extAttr)
Copy attributes from a node to another.
|
static String |
create(javax.jcr.Session session)
Create OpenKM repository structure
|
AppVersion |
getAppVersion(String token)
Retrieve application version.
|
Folder |
getCategoriesFolder(String token)
Obtain the categories folder of the repository.
|
Folder |
getMailFolder(String token)
Obtain the personal mails folder of the repository.
|
Folder |
getMailFolderBase(String token) |
String |
getNodePath(String token,
String uuid)
Obtain the node path with a given uuid.
|
String |
getNodeUuid(String token,
String path)
Obtain the node uuid with a given path.
|
Folder |
getPersonalFolder(String token)
Obtain the personal documents folder of the repository.
|
Folder |
getPersonalFolderBase(String token) |
static javax.jcr.Repository |
getRepository()
Cache the repository information
|
static org.apache.jackrabbit.core.config.RepositoryConfig |
getRepositoryConfig()
Obtain repository configuration
|
String |
getRepositoryUuid(String token)
Get the unique repository identifier
|
Folder |
getRootFolder(String token)
Obtain the root folder of the repository.
|
static javax.jcr.Session |
getSystemSession()
Get the System User Session to perform unsecured operations.
|
Folder |
getTemplatesFolder(String token)
Obtain the template folder of the repository.
|
Folder |
getThesaurusFolder(String token)
Obtain the thesaurus folder of the repository.
|
Folder |
getTrashFolder(String token)
Obtains the user trash folder.
|
Folder |
getTrashFolderBase(String token) |
String |
getUpdateMessage(String token)
Get the update message, if any.
|
boolean |
hasNode(String token,
String path)
Test if a node path exists
|
static String |
initialize()
Initialize the repository.
|
void |
purgeTrash(String token)
Remove all the items in the user trash folder for ever.
|
static void |
registerCustomNodeTypes(javax.jcr.Session session,
InputStream cndFile)
Register custom node definition from file.
|
void |
remove()
Remove a repository from disk.
|
static void |
shutdown()
Close repository and free the lock
|
public static javax.jcr.Repository getRepository() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static org.apache.jackrabbit.core.config.RepositoryConfig getRepositoryConfig() throws org.apache.jackrabbit.core.config.ConfigurationException
org.apache.jackrabbit.core.config.ConfigurationException
public static void shutdown()
public static javax.jcr.Session getSystemSession()
public static String initialize() throws javax.jcr.RepositoryException, FileNotFoundException, org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException, org.apache.jackrabbit.core.nodetype.compact.ParseException, DatabaseException
AccessDeniedException
- If there is any security problem: you can't access the parent
document folder because of lack of permissions.RepositoryException
- If there is any general repository problem.javax.jcr.RepositoryException
FileNotFoundException
org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException
org.apache.jackrabbit.core.nodetype.compact.ParseException
DatabaseException
public static String create(javax.jcr.Session session) throws javax.jcr.RepositoryException, FileNotFoundException, org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException, org.apache.jackrabbit.core.nodetype.compact.ParseException
javax.jcr.RepositoryException
FileNotFoundException
org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException
org.apache.jackrabbit.core.nodetype.compact.ParseException
public void remove() throws RepositoryException
AccessDeniedException
- If there is any security problem: you can't access the parent
document folder because of lack of permissions.RepositoryException
- If there is any general repository problem.public Folder getRootFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getRootFolder
in interface RepositoryModule
PathNotFoundException
- If there is no root folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getTrashFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getTrashFolder
in interface RepositoryModule
PathNotFoundException
- If there is no user trash folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getTrashFolderBase(String token) throws PathNotFoundException, RepositoryException, DatabaseException
getTrashFolderBase
in interface RepositoryModule
PathNotFoundException
RepositoryException
DatabaseException
public Folder getTemplatesFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getTemplatesFolder
in interface RepositoryModule
PathNotFoundException
- If there is no templates folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getPersonalFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getPersonalFolder
in interface RepositoryModule
PathNotFoundException
- If there is no user documents folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getPersonalFolderBase(String token) throws PathNotFoundException, RepositoryException, DatabaseException
getPersonalFolderBase
in interface RepositoryModule
PathNotFoundException
RepositoryException
DatabaseException
public Folder getMailFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getMailFolder
in interface RepositoryModule
PathNotFoundException
- If there is no user documents folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getMailFolderBase(String token) throws PathNotFoundException, RepositoryException, DatabaseException
getMailFolderBase
in interface RepositoryModule
PathNotFoundException
RepositoryException
DatabaseException
public Folder getThesaurusFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getThesaurusFolder
in interface RepositoryModule
PathNotFoundException
- If there is no user documents folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public Folder getCategoriesFolder(String token) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getCategoriesFolder
in interface RepositoryModule
PathNotFoundException
- If there is no user documents folder node in the repository.RepositoryException
- If there is any general repository problem.DatabaseException
public static void registerCustomNodeTypes(javax.jcr.Session session, InputStream cndFile) throws FileNotFoundException, org.apache.jackrabbit.core.nodetype.compact.ParseException, javax.jcr.RepositoryException, org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException
FileNotFoundException
org.apache.jackrabbit.core.nodetype.compact.ParseException
javax.jcr.RepositoryException
org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException
public void purgeTrash(String token) throws AccessDeniedException, RepositoryException, DatabaseException
RepositoryModule
purgeTrash
in interface RepositoryModule
AccessDeniedException
- If there is any security problem:
you can't modify the user deleted folders and documents because
of lack of permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public String getUpdateMessage(String token) throws RepositoryException
RepositoryModule
getUpdateMessage
in interface RepositoryModule
RepositoryException
- If there is any general repository problem.public String getRepositoryUuid(String token) throws RepositoryException
RepositoryModule
getRepositoryUuid
in interface RepositoryModule
RepositoryException
- If there is any general repository problem.public boolean hasNode(String token, String path) throws RepositoryException, DatabaseException
RepositoryModule
hasNode
in interface RepositoryModule
path
- The path that identifies an unique document or its UUID.RepositoryException
- If there is any general repository problem.DatabaseException
public String getNodePath(String token, String uuid) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getNodePath
in interface RepositoryModule
uuid
- An unique node identifierPathNotFoundException
- If there is no user node in the repository with this uuid.RepositoryException
- If there is any general repository problem.DatabaseException
public String getNodeUuid(String token, String path) throws PathNotFoundException, RepositoryException, DatabaseException
RepositoryModule
getNodeUuid
in interface RepositoryModule
path
- An unique path node identifierPathNotFoundException
- If there is no user node in the repository with this uuid.RepositoryException
- If there is any general repository problem.DatabaseException
public AppVersion getAppVersion(String token) throws RepositoryException, DatabaseException
RepositoryModule
getAppVersion
in interface RepositoryModule
token
- Security token.RepositoryException
DatabaseException
public void copyAttributes(String token, String srcId, String dstId, ExtendedAttributes extAttr) throws AccessDeniedException, PathNotFoundException, DatabaseException
RepositoryModule
copyAttributes
in interface RepositoryModule
token
- Security token.srcId
- The path that identifies an unique document or its UUID.dstId
- The path that identifies an unique document or its UUID.extAttr
- Which attributes need to be copied.AccessDeniedException
PathNotFoundException
DatabaseException
Copyright © 2016. All rights reserved.