public class DbDocumentModule extends Object implements DocumentModule
Constructor and Description |
---|
DbDocumentModule() |
Modifier and Type | Method and Description |
---|---|
void |
cancelCheckout(String token,
String docId)
Cancel a previous checked out state in a document.
|
Version |
checkin(String token,
String docId,
InputStream is,
long size,
String comment,
String userId)
Used when big files and WebDAV
|
Version |
checkin(String token,
String docId,
InputStream is,
long size,
String comment,
String userId,
int increment)
Used when increase document major version
|
Version |
checkin(String token,
String docId,
InputStream is,
String comment)
Check in the document to create a new version.
|
Version |
checkin(String token,
String docId,
InputStream is,
String comment,
int increment)
Check in the document to create a new version.
|
Version |
checkin(String token,
String docId,
InputStream is,
String comment,
String userId)
Used in Zoho extension
|
void |
checkout(String token,
String docId)
Checkout the document to edit it.
|
void |
checkout(String token,
String docId,
String userId)
Used in Zoho extension
|
void |
copy(String token,
String docPath,
String dstPath)
Copy a document to another location in the repository.
|
Document |
create(String token,
Document doc,
InputStream is)
Creates a new document in the repository.
|
Document |
create(String token,
Document doc,
InputStream is,
long size,
String userId)
Used when big files and WebDAV and GoogleDocs
|
Document |
create(String token,
Document doc,
InputStream is,
long size,
String userId,
Ref<FileUploadResponse> fuResponse)
Used when big files and FileUpload
|
void |
delete(String token,
String docId)
Deletes a document from the repository.
|
void |
extendedCopy(String token,
String docId,
String dstId,
String docName,
ExtendedAttributes extAttr)
Copy a document to another location in the repository.
|
void |
forceCancelCheckout(String token,
String docId)
Force to cancel a previous checked out state in a document.
|
void |
forceUnlock(String token,
String docId)
For document unlock, so will be editable for other users.
|
List<Document> |
getChildren(String token,
String fldId)
Retrieve a list of children documents from an existing folder.
|
List<Document> |
getChilds(String token,
String fldId)
Deprecated.
|
InputStream |
getContent(String token,
String docId,
boolean checkout)
Obtain document content from the repository.
|
InputStream |
getContent(String token,
String docId,
boolean checkout,
boolean extendedSecurity)
Retrieve the content input stream from a document
|
InputStream |
getContentByVersion(String token,
String docId,
String verName)
Obtain document content from the repository.
|
LockInfo |
getLockInfo(String token,
String docId)
Returns a lock information.
|
String |
getPath(String token,
String uuid)
Get the document path from a UUID
|
Document |
getProperties(String token,
String docId)
Obtain document properties from the repository.
|
List<Version> |
getVersionHistory(String token,
String docId)
Get the document version history.
|
long |
getVersionHistorySize(String token,
String docId)
Get the version size of a Document.
|
boolean |
isCheckedOut(String token,
String docId)
Test if a node has been already checked out.
|
boolean |
isLocked(String token,
String docId)
Tell if a document is locked.
|
boolean |
isValid(String token,
String docId)
Test if a document path is valid.
|
void |
liveEditCancelCheckout(String token,
String docId)
Cancel checkout and delete temporal file.
|
Version |
liveEditCheckin(String token,
String docId,
String comment,
int increment)
New version and delete temporal file.
|
void |
liveEditForceCancelCheckout(String token,
String docId)
Cancel checkout and delete temporal file.
|
void |
liveEditSetContent(String token,
String docId,
InputStream is)
Create temporal file and set content.
|
LockInfo |
lock(String token,
String docId)
Lock a document, so only is editable by the locker.
|
void |
move(String token,
String docId,
String dstId)
Move a document to another location in the repository.
|
void |
purge(String token,
String docId)
Deletes definitively a document from the repository.
|
void |
purgeVersionHistory(String token,
String docId)
Purge a Document version history, so delete all previous versions but last one.
|
Document |
rename(String token,
String docId,
String newName)
Rename a document in the repository.
|
void |
restoreVersion(String token,
String docId,
String versionId)
Revert the document to an specific previous version.
|
void |
setProperties(String token,
Document doc)
Set document properties in the repository.
|
void |
unlock(String token,
String docId)
Unlock a document, so will be editable for other users.
|
public Document create(String token, Document doc, InputStream is) throws UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
DocumentModule
create
in interface DocumentModule
doc
- A document object with the new document properties.UnsupportedMimeTypeException
- If the uploaded file has an unsupported MIME type.FileSizeExceededException
- If the document content is biggest than the maximum accepted.ItemExistsException
- If there is already a document in the repository with the same name.PathNotFoundException
- If the parent folder doesn't exist.AccessDeniedException
- If there is any security problem: you can't modify the parent document folder
because of lack of permissions.RepositoryException
- If there is any general repository problem.IOException
- An error when inserting document data into the repository.UserQuotaExceededException
VirusDetectedException
DatabaseException
ExtensionException
AutomationException
public Document create(String token, Document doc, InputStream is, long size, String userId) throws UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
public Document create(String token, Document doc, InputStream is, long size, String userId, Ref<FileUploadResponse> fuResponse) throws UnsupportedMimeTypeException, FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException, ExtensionException, AutomationException
public void delete(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, AutomationException, RepositoryException, DatabaseException
DocumentModule
delete
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- Can't delete a locked document.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.AutomationException
DatabaseException
public Document rename(String token, String docId, String newName) throws PathNotFoundException, ItemExistsException, AccessDeniedException, AutomationException, LockException, RepositoryException, DatabaseException
DocumentModule
rename
in interface DocumentModule
docId
- The path that identifies an unique document.newName
- The new folder name.PathNotFoundException
- If there is no document in this repository path.ItemExistsException
- If there is already a document in the repository with the same name in the same path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.AutomationException
LockException
DatabaseException
public Document getProperties(String token, String docId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
getProperties
in interface DocumentModule
PathNotFoundException
- If there is no document in this repository path. you can't modify the document
because of lack of permissions.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public void setProperties(String token, Document doc) throws VersionException, LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
setProperties
in interface DocumentModule
doc
- An document object with the propertiesVersionException
- A document checked in can't be modified.LockException
- A locked document can't be modified.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public InputStream getContent(String token, String docId, boolean checkout) throws PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException
DocumentModule
getContent
in interface DocumentModule
docId
- The path that identifies an unique document or its UUID.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify this document because of lack of
permissions. Related to extended security.RepositoryException
- If there is any general repository problem.IOException
- An error when retrieving document data from the repository.DatabaseException
public InputStream getContent(String token, String docId, boolean checkout, boolean extendedSecurity) throws PathNotFoundException, AccessDeniedException, RepositoryException, IOException, DatabaseException
token
- Authorization token.docId
- Path of the document to get the content or its UUID.checkout
- If the content is retrieved due to a checkout or not.extendedSecurity
- If the extended security DOWNLOAD permission should be evaluated.
This is used to enable the document preview.PathNotFoundException
AccessDeniedException
RepositoryException
IOException
DatabaseException
public InputStream getContentByVersion(String token, String docId, String verName) throws RepositoryException, AccessDeniedException, PathNotFoundException, IOException, DatabaseException
DocumentModule
getContentByVersion
in interface DocumentModule
docId
- The path that identifies an unique document or its UUID.verName
- The id of the version to get the content from.RepositoryException
- If there is any general repository problem.AccessDeniedException
- If there is any security problem: you can't modify this document because of lack of
permissions.PathNotFoundException
- If there is no folder in the repository with this path.IOException
- An error when retrieving document data from the repository.DatabaseException
@Deprecated public List<Document> getChilds(String token, String fldId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
getChilds
in interface DocumentModule
fldId
- The path that identifies an unique folder or its UUID.PathNotFoundException
- If there is no folder in this repository path.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public List<Document> getChildren(String token, String fldId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
getChildren
in interface DocumentModule
fldId
- The path that identifies an unique folder or its UUID.PathNotFoundException
- If there is no folder in this repository path.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public void checkout(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
checkout
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- A locked document can't be modified.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public void checkout(String token, String docId, String userId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
public void cancelCheckout(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
cancelCheckout
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- A locked document can't be modified.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public void forceCancelCheckout(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException
DocumentModule
forceCancelCheckout
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- A locked document can't be modified.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
PrincipalAdapterException
public boolean isCheckedOut(String token, String docId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
isCheckedOut
in interface DocumentModule
docId
- The path that identifies an unique document.PathNotFoundException
- If there is no document in this repository path.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public Version checkin(String token, String docId, InputStream is, String comment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
DocumentModule
checkin
in interface DocumentModule
docId
- The path that identifies an unique document.comment
- A comment for this checkin.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.PathNotFoundException
- If there is no document in this repository path.LockException
- A locked document can't be modified.VersionException
- If the nodes was not previously checked out.FileSizeExceededException
UserQuotaExceededException
VirusDetectedException
IOException
DatabaseException
AutomationException
public Version checkin(String token, String docId, InputStream is, String comment, int increment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
DocumentModule
checkin
in interface DocumentModule
docId
- The path that identifies an unique document.comment
- A comment for this checkin.increment
- Which increment should be increased.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.PathNotFoundException
- If there is no document in this repository path.LockException
- A locked document can't be modified.VersionException
- If the nodes was not previously checked out.FileSizeExceededException
UserQuotaExceededException
VirusDetectedException
IOException
DatabaseException
AutomationException
public Version checkin(String token, String docId, InputStream is, String comment, String userId) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
public Version checkin(String token, String docId, InputStream is, long size, String comment, String userId) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
public Version checkin(String token, String docId, InputStream is, long size, String comment, String userId, int increment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
public LockInfo lock(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
lock
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- If the node is already locked.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public void unlock(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
unlock
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- If the node is not locked.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
public void forceUnlock(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException
DocumentModule
forceUnlock
in interface DocumentModule
docId
- The path that identifies an unique document.LockException
- If the node is not locked.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.DatabaseException
PrincipalAdapterException
public boolean isLocked(String token, String docId) throws RepositoryException, AccessDeniedException, PathNotFoundException, DatabaseException
DocumentModule
isLocked
in interface DocumentModule
docId
- The path that identifies an unique document.RepositoryException
- If there is any repository problem.AccessDeniedException
- If there is any security problem: you can't access this document because of lack of
permissions.PathNotFoundException
- If there is no document in the repository with this path.DatabaseException
public LockInfo getLockInfo(String token, String docId) throws RepositoryException, AccessDeniedException, PathNotFoundException, LockException, DatabaseException
DocumentModule
getLockInfo
in interface DocumentModule
docId
- The path that identifies an unique document.RepositoryException
- If there is any repository problem.AccessDeniedException
- If there is any security problem: you can't access this document because of lack of
permissions.PathNotFoundException
- If there is no document in the repository with this path.LockException
- If the node is not locked.DatabaseException
public void purge(String token, String docId) throws LockException, AccessDeniedException, RepositoryException, PathNotFoundException, DatabaseException
DocumentModule
purge
in interface DocumentModule
docId
- The path that identifies an unique document.AccessDeniedException
- If there is any security problem: you can't access this document because of lack of
permissions.RepositoryException
- If there is any general repository problem.PathNotFoundException
- If there is no document in the repository with this path.LockException
DatabaseException
public void move(String token, String docId, String dstId) throws PathNotFoundException, ItemExistsException, AccessDeniedException, LockException, RepositoryException, DatabaseException, ExtensionException, AutomationException
DocumentModule
move
in interface DocumentModule
docId
- The path that identifies an unique document.dstId
- The destination folder path.PathNotFoundException
- If the dstPath does not existsItemExistsException
- If there is already a document in the destination folder with the same name.AccessDeniedException
- If there is any security problem: you can't modify the document's parent folder or
the destination folder because of lack of permissions.RepositoryException
- If there is any general repository problem.LockException
DatabaseException
ExtensionException
AutomationException
public void copy(String token, String docPath, String dstPath) throws ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, AutomationException, DatabaseException, UserQuotaExceededException
DocumentModule
copy
in interface DocumentModule
docPath
- The path that identifies an unique document.dstPath
- The destination folder path.ItemExistsException
- If there is already a document in the destination folder with the same name.PathNotFoundException
- If the dstPath does not existsAccessDeniedException
- If there is any security problem: you can't modify the document's parent folder or
the destination folder because of lack of permissions.RepositoryException
- If there is any general repository problem.IOException
AutomationException
DatabaseException
UserQuotaExceededException
public void extendedCopy(String token, String docId, String dstId, String docName, ExtendedAttributes extAttr) throws ItemExistsException, PathNotFoundException, AccessDeniedException, RepositoryException, IOException, AutomationException, DatabaseException, UserQuotaExceededException
DocumentModule
extendedCopy
in interface DocumentModule
docId
- The path that identifies an unique document.dstId
- The destination folder path.docName
- The name of the new document or null if not changedextAttr
- Attributes to define what need to be duplicated.ItemExistsException
- If there is already a document in the destination folder with the same name.PathNotFoundException
- If the dstPath does not existsAccessDeniedException
- If there is any security problem: you can't modify the document's parent folder or
the destination folder because of lack of permissions.RepositoryException
- If there is any general repository problem.IOException
AutomationException
DatabaseException
UserQuotaExceededException
public void restoreVersion(String token, String docId, String versionId) throws PathNotFoundException, AccessDeniedException, LockException, RepositoryException, DatabaseException
DocumentModule
restoreVersion
in interface DocumentModule
docId
- The path that identifies an unique document.versionId
- The version id to revert to.PathNotFoundException
- If there is no document in this repository path.AccessDeniedException
- If there is any security problem: you can't modify the document because of lack of
permissions.RepositoryException
- If there is any general repository problem.LockException
DatabaseException
public void purgeVersionHistory(String token, String docId) throws AccessDeniedException, PathNotFoundException, LockException, RepositoryException, DatabaseException
DocumentModule
purgeVersionHistory
in interface DocumentModule
docId
- The path that identifies an unique document.AccessDeniedException
- If there is any security problem: you can't access this folder because of lack of
permissions.PathNotFoundException
- If there is no folder in the repository with this path.RepositoryException
- If there is any general repository problem.LockException
DatabaseException
public List<Version> getVersionHistory(String token, String docId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
getVersionHistory
in interface DocumentModule
docId
- The path that identifies an unique document or its UUID.PathNotFoundException
- If there is no document in this repository path.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public long getVersionHistorySize(String token, String docId) throws RepositoryException, AccessDeniedException, PathNotFoundException, DatabaseException
DocumentModule
getVersionHistorySize
in interface DocumentModule
docId
- The path that identifies an unique document or its UUID.RepositoryException
- If there is any general repository problem.AccessDeniedException
- If there is any security problem: you can't access this folder because of lack of
permissions.PathNotFoundException
- If there is no folder in the repository with this path.DatabaseException
public boolean isValid(String token, String docId) throws AccessDeniedException, PathNotFoundException, RepositoryException, DatabaseException
DocumentModule
isValid
in interface DocumentModule
docId
- The path that identifies an unique document or its UUID.PathNotFoundException
- If the node does not exists.RepositoryException
- If there is any general repository problem.AccessDeniedException
DatabaseException
public String getPath(String token, String uuid) throws AccessDeniedException, RepositoryException, DatabaseException
DocumentModule
getPath
in interface DocumentModule
uuid
- The unique document id.AccessDeniedException
- If there is any security problem: you can't access this node because of lack of
permissions.RepositoryException
- If there is any problem.DatabaseException
public void liveEditSetContent(String token, String docId, InputStream is) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException
public Version liveEditCheckin(String token, String docId, String comment, int increment) throws FileSizeExceededException, UserQuotaExceededException, VirusDetectedException, AccessDeniedException, RepositoryException, PathNotFoundException, LockException, VersionException, IOException, DatabaseException, AutomationException
public void liveEditCancelCheckout(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
public void liveEditForceCancelCheckout(String token, String docId) throws LockException, PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
Copyright © 2018 Open Knowledge Management System S.L.. All rights reserved.