|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TrashService
Service containing the logic about deleting/purging/undeleting a document.
Method Summary | |
---|---|
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 |
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> paths)
Gets the closest document's ancestor above all the paths. |
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). |
Method Detail |
---|
boolean folderAllowsDelete(DocumentModel folder) throws ClientException
folder
- the folder
true
if the folder allows its children to be deleted
ClientException
boolean checkDeletePermOnParents(List<DocumentModel> docs) throws ClientException
docs
- the documents
true
if one doc is in a folder that allows its children
to be deleted
ClientException
boolean canDelete(List<DocumentModel> docs, Principal principal, boolean checkProxies) throws ClientException
docs
- the documentsprincipal
- the current user (to check locks)checkProxies
- true
to count proxies as non-deletable
true
if at least one doc is deletable
ClientException
boolean canPurgeOrUndelete(List<DocumentModel> docs, Principal principal) throws ClientException
Documents need to be in the deleted lifecycle state for this to be true, in addition to the standard permission checks.
docs
- the documentsprincipal
- the current user (to check locks)
true
if the documents are purgeable/undeletable
ClientException
TrashInfo getTrashInfo(List<DocumentModel> docs, Principal principal, boolean checkProxies, boolean checkDeleted) throws ClientException
docs
- 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)
ClientException
DocumentModel getAboveDocument(DocumentModel doc, Set<Path> paths) throws ClientException
This is used to find what safe document to redirect to when deleting some.
doc
- the documentpaths
- the paths
ClientException
void trashDocuments(List<DocumentModel> docs) throws ClientException
docs
- the documents to trash
ClientException
void purgeDocuments(CoreSession session, List<DocumentRef> docRefs) throws ClientException
session
- the sessiondocRefs
- the documents to purge
ClientException
Set<DocumentRef> undeleteDocuments(List<DocumentModel> docs) throws ClientException
Also fires async events to undelete the children.
docs
- the documents to undelete
ClientException
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |