public interface TrashService
Modifier and Type | Interface and Description |
---|---|
static class |
TrashService.Feature
Features of the implementation of the service.
|
Modifier and Type | Field and Description |
---|---|
static String |
DISABLE_TRASH_RENAMING
Key for
DocumentModel.getContextData(String) which skips the renaming during trash/untrash mechanism when
the value is Boolean.TRUE . |
static String |
DOCUMENT_TRASHED
Event for a document trashed by the user.
|
static String |
DOCUMENT_UNTRASHED
Event for a document untrashed by the user.
|
static String |
IS_ALREADY_CALLED
TrashService was already called. |
Modifier and Type | Method and Description |
---|---|
boolean |
canDelete(List<DocumentModel> docs,
Principal principal,
boolean checkProxies)
Deprecated.
since 10.1 only used in JSF part, no replacement
|
default boolean |
canPurgeOrUndelete(List<DocumentModel> docs,
Principal principal)
Deprecated.
since 10.1, use
canPurgeOrUntrash(List, Principal) |
default boolean |
canPurgeOrUntrash(DocumentModel doc,
Principal principal)
Is document purgeable/untrashable?
|
boolean |
canPurgeOrUntrash(List<DocumentModel> docs,
Principal principal)
Are all documents purgeable/undeletable?
|
boolean |
checkDeletePermOnParents(List<DocumentModel> docs)
Deprecated.
since 10.1 only used in JSF part, no replacement
|
boolean |
folderAllowsDelete(DocumentModel folder)
Deprecated.
since 10.1 only used in JSF part, no replacement
|
DocumentModel |
getAboveDocument(DocumentModel doc,
Principal principal)
Gets the first non trashed ancestor.
|
DocumentModel |
getAboveDocument(DocumentModel doc,
Set<Path> paths)
Deprecated.
since 10.1 only used in JSF part, use
getAboveDocument(DocumentModel, Principal) instead. |
DocumentModelList |
getDocuments(DocumentModel parent)
Get all documents from the trash of the current document.
|
TrashInfo |
getTrashInfo(List<DocumentModel> docs,
Principal principal,
boolean checkProxies,
boolean checkDeleted)
Deprecated.
since 10.1 only used in JSF part, no replacement
|
boolean |
hasFeature(TrashService.Feature feature)
Checks if a feature is available.
|
boolean |
isTrashed(CoreSession session,
DocumentRef doc) |
String |
mangleName(DocumentModel doc)
Mangles the name of a document to avoid collisions with non-trashed documents when it's in the trash.
|
void |
purgeDocuments(CoreSession session,
List<DocumentRef> docRefs)
Purges (completely deletes) documents.
|
void |
purgeDocumentsUnder(DocumentModel parent)
Purges (completely deletes) trashed documents under the given parent.
|
default void |
trashDocument(DocumentModel doc)
Moves document to the trash.
|
void |
trashDocuments(List<DocumentModel> docs)
Moves documents to the trash.
|
Set<DocumentRef> |
undeleteDocuments(List<DocumentModel> docs)
Deprecated.
since 10.1 use
untrashDocuments(List) instead |
String |
unmangleName(DocumentModel doc)
Unmangles the name of a document in the trash to find its un-trashed name.
|
default void |
untrashDocument(DocumentModel doc)
Unmoves document from the trash.
|
default void |
untrashDocuments(List<DocumentModel> docs)
Unmoves documents from the trash.
|
static final String DOCUMENT_TRASHED
static final String DOCUMENT_UNTRASHED
static final String DISABLE_TRASH_RENAMING
DocumentModel.getContextData(String)
which skips the renaming during trash/untrash mechanism when
the value is Boolean.TRUE
.static final String IS_ALREADY_CALLED
TrashService
was already called. This is useful to bring backward mechanism on
followTransition("deleted").boolean isTrashed(CoreSession session, DocumentRef doc)
DocumentRef
is trashed.@Deprecated boolean folderAllowsDelete(DocumentModel folder)
folder
- the foldertrue
if the folder allows its children to be trashed@Deprecated boolean checkDeletePermOnParents(List<DocumentModel> docs)
docs
- the documentstrue
if one doc is in a folder that allows its children to be trashed@Deprecated boolean canDelete(List<DocumentModel> docs, Principal principal, boolean checkProxies)
docs
- the documentsprincipal
- the current user (to check locks)checkProxies
- true
to count proxies as non-deletabletrue
if at least one doc is deletable@Deprecated default boolean canPurgeOrUndelete(List<DocumentModel> docs, Principal principal)
canPurgeOrUntrash(List, Principal)
Documents need to be in the trash 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/undeletableboolean canPurgeOrUntrash(List<DocumentModel> docs, Principal principal)
Documents need to be in the trash 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/undeletabledefault boolean canPurgeOrUntrash(DocumentModel doc, Principal principal)
Documents need to be in the trash for this to be true, in addition to the standard permission checks.
doc
- the documentprincipal
- the current user (to check locks)true
if the documents are purgeable/untrashable@Deprecated TrashInfo getTrashInfo(List<DocumentModel> docs, Principal principal, boolean checkProxies, boolean checkDeleted)
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 trashed state to be considered (otherwise
forbidden)@Deprecated DocumentModel getAboveDocument(DocumentModel doc, Set<Path> paths)
getAboveDocument(DocumentModel, Principal)
instead.This is used to find what safe document to redirect to when deleting some.
doc
- the documentpaths
- the pathsDocumentModel getAboveDocument(DocumentModel doc, Principal principal)
This is used to find what safe document to redirect to when deleting one.
doc
- the trashed documentprincipal
- the current uservoid trashDocuments(List<DocumentModel> docs)
Do nothing if the document current state is trashed.
Placeless documents are deleted immediately.
docs
- the documents to trashdefault void trashDocument(DocumentModel doc)
Do nothing if the document current state is trashed.
Placeless documents are deleted immediately.
doc
- the document to trashvoid purgeDocuments(CoreSession session, List<DocumentRef> docRefs)
session
- the sessiondocRefs
- the documents to purgevoid purgeDocumentsUnder(DocumentModel parent)
parent
- The parent document of trashed documents.@Deprecated Set<DocumentRef> undeleteDocuments(List<DocumentModel> docs)
untrashDocuments(List)
insteadAlso fires async events to untrash the children.
docs
- the documents to undeletedefault void untrashDocuments(List<DocumentModel> docs)
Also fires async events to untrash the children.
docs
- the documents to untrashdefault void untrashDocument(DocumentModel doc)
Also fires async events to untrash the children.
doc
- the document to untrashDocumentModelList getDocuments(DocumentModel parent)
parent
- The parent document of trash document.String mangleName(DocumentModel doc)
doc
- the documentString unmangleName(DocumentModel doc)
doc
- the trashed documentboolean hasFeature(TrashService.Feature feature)
Copyright © 2018 Nuxeo. All rights reserved.