|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface IRepositoryService
The IRepositoryService provides all functionality for document management operations.
This includes:
IRepositoryCapabilities the IRepositoryProvider
provides only a subset has to be implemented.UnsupportedOperationException must be thrown.
| Method Summary | |
|---|---|
Document |
createDocument(String folderId,
DocumentInfo document)
Creates document in a folder described by the document info. |
Document |
createDocument(String folderId,
DocumentInfo document,
byte[] content,
String encoding)
Creates document in a folder described by the document info. |
Folder |
createFolder(String parentFolderId,
FolderInfo folder)
Creates document in a folder described by the document info. |
Documents |
findDocuments(DocumentQuery query)
Retrieves all documents satisfying the criteria specified in the provided query. |
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> |
getApplicablePolicies(String resourceId)
Returns the IAccessControlPolicy objects that can be set for the resource denoted by resourceId. |
Document |
getDocument(String documentId)
Gets the document by ID or path. |
List<? extends Document> |
getDocuments(List<String> documentIds)
Gets multiple documents by ID or path. |
List<? extends Document> |
getDocumentVersions(String documentId)
Gets all versions of the document by document ID (of any of its version). |
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> |
getEffectivePolicies(String resourceId)
Returns the IAccessControlPolicy objects that currently are in effect on the resource denoted by resourceId (cumulated). |
Folder |
getFolder(String folderId)
Retrieves a folder and lists its members. |
Folder |
getFolder(String folderId,
int levelOfDetail)
Retrieves a folder. |
List<? extends Folder> |
getFolders(List<String> folderIds,
int levelOfDetail)
Gets multiple folders by ID or path. |
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> |
getPolicies(String resourceId)
Returns the IAccessControlPolicy objects that are currently set for the resource denoted by resourceId. |
Set<org.eclipse.stardust.engine.api.runtime.Privilege> |
getPrivileges(String resourceId)
Returns the privileges the session has for the resource denoted by resourceId, which must exist. |
byte[] |
getSchemaDefinition(String schemaLocation)
Retrieves the XSD schema for the specified schema location from the Document Repository serialized into a byte[]. |
RepositoryMigrationReport |
migrateRepository(int batchSize,
boolean evaluateTotalCount)
Migrates resources in the repository. |
Document |
moveDocument(String documentId,
String targetPath)
Moves the document to the target path. |
void |
removeDocument(String documentId)
Removes document. |
void |
removeDocumentVersion(String documentId,
String documentRevisionId)
Removes a version of a document. |
void |
removeFolder(String folderId,
boolean recursive)
Removes folder. |
byte[] |
retrieveDocumentContent(String documentId)
Retrieves the content of the document identified by documentId. |
void |
retrieveDocumentContentStream(String documentId,
OutputStream target)
Retrieves an OutputStream for the document. |
void |
setPolicy(String resourceId,
org.eclipse.stardust.engine.api.runtime.AccessControlPolicy policy)
Binds the policy to the resource denoted by resourceId (overwrites the old version of the policy) |
Document |
updateDocument(Document document,
boolean createNewRevision,
String versionComment,
String versionLabel,
boolean keepLocked)
Updates document (except document content). |
Document |
updateDocument(Document document,
byte[] content,
String encoding,
boolean createNewRevision,
String versionComment,
String versionLabel,
boolean keepLocked)
Updates document. |
Folder |
updateFolder(Folder folder)
Updates folder. |
void |
uploadDocumentContentStream(String documentId,
InputStream source,
String contentType,
String contentEncoding)
Allows to set a InputStream for content upload. |
Document |
versionDocument(String documentId,
String versionComment,
String versionLabel)
Creates a new version of the document. |
| Method Detail |
|---|
Document getDocument(String documentId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
documentId - the ID or path of the document.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
List<? extends Document> getDocumentVersions(String documentId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isVersioningSupported() is true.
documentId - the ID (any version) or path of the document.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
List<? extends Document> getDocuments(List<String> documentIds)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
documentIds - list of document IDs or paths.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
byte[] retrieveDocumentContent(String documentId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
documentId.
Warning: this method should only be used for documents of reasonable size as the
full content will be materialized in memory both on the server as well as on the
client. It is recommended to us the facilities provided by
DmsContentServlet for memory efficient content access.
The DmsContentServlet will use retrieveDocumentContentStream(String, OutputStream).
Implementation is mandatory.
documentId - The ID or path of the document content should be retrieved for.
Document.getEncoding() attribute.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errorsretrieveDocumentContentStream(String, OutputStream)
void retrieveDocumentContentStream(String documentId,
OutputStream target)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
documentId - The ID or path of the document stream should be retrieved for.target - The target OutputStream
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Folder getFolder(String folderId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
folderId - The ID or path expression identifying the folder to be retrieved.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errorsFolder.LOD_LIST_MEMBERS
Folder getFolder(String folderId,
int levelOfDetail)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
folderId - ID or path of the folder.levelOfDetail - one of Folder.LOD_NO_MEMBERS, Folder.LOD_LIST_MEMBERS
or Folder.LOD_LIST_MEMBERS_OF_MEMBERS.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errorsFolder.LOD_LIST_MEMBERS
List<? extends Folder> getFolders(List<String> folderIds,
int levelOfDetail)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
folderIds - list of IDs or paths.levelOfDetail - one of Folder.LOD_NO_MEMBERS, Folder.LOD_LIST_MEMBERS
or Folder.LOD_LIST_MEMBERS_OF_MEMBERS.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document createDocument(String folderId,
DocumentInfo document)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
folderId - ID or path of the folder to create the document in. Value "/"
designates the top-level folder.document - an instance of DocumentInfo that describs the document.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document createDocument(String folderId,
DocumentInfo document,
byte[] content,
String encoding)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
For the content an encoding can be specified e.g. (UTF-8, UTF-16).
The encoding can take any value and can be used to decode the content byte[]
after retrieving it via retrieveDocumentContentStream(String, OutputStream).
Warning: this method should only be used for documents of reasonable size as the
full content will be materialized in memory both on the server as well as on the
client. It is recommended to us the facilities provided by
DmsContentServlet for memory efficient content access.
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
folderId - ID or path of the folder to create the document in. Value "/"
designates the top-level folderdocument - an instance of DocumentInfo that describes the document.content - the content of the new document.encoding - encoding of the new document content.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document versionDocument(String documentId,
String versionComment,
String versionLabel)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() and IRepositoryCapabilities.isVersioningSupported() is true.
documentId - ID or path of the document to be versionedversionComment - comment for the new revisionversionLabel - label for the new revision. The label must be unique per document.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
void removeDocumentVersion(String documentId,
String documentRevisionId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
DocumentManagementServiceException.DocumentManagementServiceException will be thrown.documentId will lead to a DocumentManagementServiceException.
Implementation is optional if IRepositoryCapabilities.isWriteSupported() and IRepositoryCapabilities.isVersioningSupported() is true.
documentId - ID or path of the document.documentRevisionId - The revisionId of the document version to be removed.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document moveDocument(String documentId,
String targetPath)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
documentId - The document to be moved.targetPath - The path to move the document to.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document updateDocument(Document document,
boolean createNewRevision,
String versionComment,
String versionLabel,
boolean keepLocked)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() and IRepositoryCapabilities.isVersioningSupported() is true.
document - document to update.createNewRevision - if true, new revision of the document will be createdversionComment - can be specified to comment the version operation.versionLabel - if createNewRevision is true, the new revision will be labeled with this label. The label must be unique per document.keepLocked - if true, the document will be kept locked after update.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Document updateDocument(Document document,
byte[] content,
String encoding,
boolean createNewRevision,
String versionComment,
String versionLabel,
boolean keepLocked)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Warning: this method should only be used for documents of reasonable size as the
full content will be materialized in memory both on the server as well as on the
client. It is recommended to us the facilities provided by
DmsContentServlet for memory efficient content access.
The DmsContentServlet will use uploadDocumentContentStream(String, InputStream, String, String).
Implementation is needed if IRepositoryCapabilities.isWriteSupported() and IRepositoryCapabilities.isVersioningSupported() is true.
document - document to update.content - new document content.encoding - encoding of the new document content.createNewRevision - if true, new revision of the document will be createdversionComment - can be specified to comment the version operation.versionLabel - if createNewRevision is true, the new revision will be labeled with this label. The label must be unique per document.keepLocked - if true, the document will be kept locked after update.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errorsuploadDocumentContentStream(String, InputStream, String, String)
void uploadDocumentContentStream(String documentId,
InputStream source,
String contentType,
String contentEncoding)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is mandatory.
documentId - The ID or path of the document stream should be uploaded for.source - The source InputStream.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
void removeDocument(String documentId)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
documentId - ID or path of the document to remove.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Folder createFolder(String parentFolderId,
FolderInfo folder)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
parentFolderId - ID or path of the folder to create the folder in. Value "/"
designates the top-level folder.folder - an instance of FolderInfo that describs the folder.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
Folder updateFolder(Folder folder)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
folder - folder to be updated.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errors
void removeFolder(String folderId,
boolean recursive)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Implementation is needed if IRepositoryCapabilities.isWriteSupported() is true.
folderId - ID or path of the folder to remove.recursive - if true, documents and subfolders will be removed also
(applies to all the children). If false, only the folder itself will be removed.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - on DMS specific errorsSet<org.eclipse.stardust.engine.api.runtime.Privilege> getPrivileges(String resourceId)
Implementation is needed if IRepositoryCapabilities.isAccessControlPolicySupported() is true.
resourceId - absolute path or ID of a file or folder
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> getEffectivePolicies(String resourceId)
Implementation is needed if IRepositoryCapabilities.isAccessControlPolicySupported() is true.
Returned objects can not be modified, they represent a read-only view of
effective policies.
resourceId - absolute path or ID of a file or folder
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> getPolicies(String resourceId)
Implementation is needed if IRepositoryCapabilities.isAccessControlPolicySupported() is true.
Returned objects can be changed, changes take effect after calling
setPolicy()
resourceId - absolute path or ID of a file or folder
Set<org.eclipse.stardust.engine.api.runtime.AccessControlPolicy> getApplicablePolicies(String resourceId)
Implementation is needed if IRepositoryCapabilities.isAccessControlPolicySupported() is true.
Returned objects can be changed, and used as arguments to
setPolicy() in order to add a new policy.
resourceId - absolute path or ID of a file or folder
void setPolicy(String resourceId,
org.eclipse.stardust.engine.api.runtime.AccessControlPolicy policy)
Implementation is needed if IRepositoryCapabilities.isAccessControlPolicySupported() is true.
If the policy does not contain any IAccessControlEntry then this policy is
removed from the resource.
If the policy was obtained using getApplicablePolicies(), the policy will
be added, if it was obtained using getPolicies(), the policy will replace
its old version.
resourceId - absolute path or ID of a file or folderpolicy -
RepositoryMigrationReport migrateRepository(int batchSize,
boolean evaluateTotalCount)
throws org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException
Important Note Please ensure there is no other write access on the repository to avoid race conditions! Since there is no locking mechanism this should be run in read-only maintenance window!
The MigrationReport returned by each call contains information about: Total resources that need migration to the next version, resources already migrated, current version, next version and target version of the repository structure.
There are two different versions, internal versions are migrated first.
The vfs internal version called repositoryVersion.
RepositoryMigrationReport.getTargetRepositoryVersion()
The engine's structure version called repositoryStructureVersion.
RepositoryMigrationReport.getTargetRepositoryStructureVersion()
Implementation is optional.
batchSize - count of resources to be migrated in this call. A value of 0 will return a
MigrationReport without migrating.evaluateTotalCount - if set to true the total count of resources that need processing in this
migration step is evaluated. Setting this parameter to false saves
performance.
org.eclipse.stardust.engine.api.runtime.DocumentManagementServiceException - if there are problems in repository access or the user is not an administrator.
byte[] getSchemaDefinition(String schemaLocation)
throws org.eclipse.stardust.common.error.ObjectNotFoundException
Implementation is optional.
schemaLocation - the document type's schema location
org.eclipse.stardust.common.error.ObjectNotFoundException - if the specified schema location cannot be foundDocuments findDocuments(DocumentQuery query)
Implementation of DocumentQuery.META_DATA is needed if IRepositoryCapabilities.isMetaDataSearchSupported() is true.
Implementation of DocumentQuery.DOC_CONTENT is needed if IRepositoryCapabilities.isFullTextSearchSupported() is true.
Implementation of all other options is optional.
query - the document query.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||