public class TrashServiceImpl extends DefaultComponent implements TrashService
| Constructor and Description |
|---|
TrashServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDelete(List<DocumentModel> docs,
Principal principal,
boolean checkProxies)
Is at least one doc deletable?
|
boolean |
canPurgeOrUndelete(List<DocumentModel> docs,
Principal principal)
Are all documents purgeable/undeletable?
|
boolean |
canUndelete(List<DocumentModel> docs) |
boolean |
checkDeletePermOnParents(List<DocumentModel> docs)
Is at least one doc deletable according to its container?
|
boolean |
folderAllowsDelete(DocumentModel folder)
Can a child of the folder be deleted?
|
DocumentModel |
getAboveDocument(DocumentModel doc,
Set<Path> rootPaths)
Gets the closest document's ancestor above all the paths.
|
DocumentModelList |
getDocuments(DocumentModel currentDoc)
Get all documents from the trash of the current document.
|
TrashInfo |
getTrashInfo(List<DocumentModel> docs,
Principal principal,
boolean checkProxies,
boolean checkDeleted)
Gets the trash info for a list of documents.
|
void |
purgeDocuments(CoreSession session,
List<DocumentRef> docRefs)
Purges (completely deletes) documents .
|
void |
trashDocuments(List<DocumentModel> docs)
Moves documents to the trash, or directly deletes them if their lifecycle does not allow trash use.
|
Set<DocumentRef> |
undeleteDocuments(List<DocumentModel> docs)
Undeletes documents (and ancestors if needed to make them visible).
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, unregisterContribution, unregisterExtensionpublic boolean folderAllowsDelete(DocumentModel folder) throws ClientException
TrashServicefolderAllowsDelete in interface TrashServicefolder - the foldertrue if the folder allows its children to be deletedClientExceptionpublic boolean checkDeletePermOnParents(List<DocumentModel> docs) throws ClientException
TrashServicecheckDeletePermOnParents in interface TrashServicedocs - the documentstrue if one doc is in a folder that allows its children to be deletedClientExceptionpublic boolean canDelete(List<DocumentModel> docs, Principal principal, boolean checkProxies) throws ClientException
TrashServicecanDelete in interface TrashServicedocs - the documentsprincipal - the current user (to check locks)checkProxies - true to count proxies as non-deletabletrue if at least one doc is deletableClientExceptionpublic boolean canPurgeOrUndelete(List<DocumentModel> docs, Principal principal) throws ClientException
TrashServiceDocuments need to be in the deleted lifecycle state for this to be true, in addition to the standard permission checks.
canPurgeOrUndelete in interface TrashServicedocs - the documentsprincipal - the current user (to check locks)true if the documents are purgeable/undeletableClientExceptionpublic boolean canUndelete(List<DocumentModel> docs) throws ClientException
ClientExceptionpublic TrashInfo getTrashInfo(List<DocumentModel> docs, Principal principal, boolean checkProxies, boolean checkDeleted) throws ClientException
TrashServicegetTrashInfo in interface TrashServicedocs - the documentsprincipal - the current user (to check locks)checkProxies - true to count proxies as non-deletablecheckDeleted - true if documents have to be in the deleted state to be considered (otherwise
forbidden)ClientExceptionpublic DocumentModel getAboveDocument(DocumentModel doc, Set<Path> rootPaths) throws ClientException
TrashServiceThis is used to find what safe document to redirect to when deleting some.
getAboveDocument in interface TrashServicedoc - the documentrootPaths - the pathsClientExceptionpublic void trashDocuments(List<DocumentModel> docs) throws ClientException
TrashServicetrashDocuments in interface TrashServicedocs - the documents to trashClientExceptionpublic void purgeDocuments(CoreSession session, List<DocumentRef> docRefs) throws ClientException
TrashServicepurgeDocuments in interface TrashServicesession - the sessiondocRefs - the documents to purgeClientExceptionpublic Set<DocumentRef> undeleteDocuments(List<DocumentModel> docs) throws ClientException
TrashServiceAlso fires async events to undelete the children.
undeleteDocuments in interface TrashServicedocs - the documents to undeleteClientExceptionpublic DocumentModelList getDocuments(DocumentModel currentDoc)
getDocuments in interface TrashServicecurrentDoc - The current/parent document of trash document.Copyright © 2015 Nuxeo SA. All rights reserved.