public interface DirectoryService
Modifier and Type | Field and Description |
---|---|
static String |
SYSTEM_DIRECTORY_TYPE |
Modifier and Type | Method and Description |
---|---|
List<Directory> |
getDirectories()
Gets all the directories.
|
Directory |
getDirectory(String id)
Return the directory with the given id.
|
Directory |
getDirectory(String id,
DocumentModel documentContext)
Returns the directory for the specified id and document context.
|
BaseDirectoryDescriptor |
getDirectoryDescriptor(String id)
Gets the effective directory descriptor for the given directory.
|
String |
getDirectoryIdField(String id)
Gets the id field for a directory.
|
List<String> |
getDirectoryNames()
Gets the directory ids.
|
String |
getDirectoryPasswordField(String directoryName)
Gets the password field for a directory.
|
String |
getDirectorySchema(String id)
Gets the schema for a directory.
|
String |
getParentDirectoryName(String id)
Gets the parent directory id a directory.
|
Session |
open(String directoryName)
Opens a session on specified directory.
|
Session |
open(String directoryName,
DocumentModel documentContext)
Opens a session on the directory for the specified context.
|
void |
registerDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
INTERNAL registers a directory descriptor.
|
void |
unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
INTERNAL unregisters a directory descriptor.
|
static final String SYSTEM_DIRECTORY_TYPE
List<String> getDirectoryNames()
List<Directory> getDirectories()
Directory getDirectory(String id, DocumentModel documentContext)
The context is given by the document. The document service will try to find the directory local configuration of the document that will specify the suffix. The directory service will fetch the id + suffix found. If no local configuration is found the service will return the directory with the given id.
If the id is null
, returns null
.
id
- the directory iddocumentContext
- the document contextnull
if not foundDirectory getDirectory(String id)
If the id is null
, returns null
.
id
- the directory idnull
if not foundBaseDirectoryDescriptor getDirectoryDescriptor(String id)
id
- the directory idnull
if not registeredSession open(String directoryName) throws DirectoryException
This method prefers to throw rather than returning null.
directoryName
- DirectoryException
- in case the session cannot be createdSession open(String directoryName, DocumentModel documentContext) throws DirectoryException
This method prefers to throw rather than returning null.
directoryName
- documentContext
- DirectoryException
- in case the session cannot be createdString getDirectorySchema(String id) throws DirectoryException
id
- the directory idDirectoryException
- if the directory does not existString getDirectoryIdField(String id) throws DirectoryException
id
- the directory idDirectoryException
- if the directory does not existString getDirectoryPasswordField(String directoryName) throws DirectoryException
id
- the directory idDirectoryException
- if the directory does not existString getParentDirectoryName(String id) throws DirectoryException
id
- the directory idnull
DirectoryException
- if the directory does not existvoid registerDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
void unregisterDirectoryDescriptor(BaseDirectoryDescriptor descriptor)
Copyright © 2017 Nuxeo. All rights reserved.