Package com.xpn.xwiki.store
Interface XWikiRecycleBinStoreInterface
-
- All Known Implementing Classes:
XWikiHibernateRecycleBinStore
@Role public interface XWikiRecycleBinStoreInterface
Interface for RecycleBin feature (XWIKI-543) store system.- Since:
- 1.2M1
- Version:
- $Id: 50bd20932d8ec731058b580fdf86d80e7f32187f $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default void
checkAccess(Right right, org.xwiki.user.UserReference userReference, XWikiDeletedDocument deletedDocument)
Check if the given deleted document can be accessed for the given right by the given user.default void
deleteFromRecycleBin(long index, XWikiContext context, boolean bTransaction)
Permanently delete document from recycle bin.void
deleteFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
Deprecated.since 9.4RC1.XWikiDeletedDocument[]
getAllDeletedDocuments(XWikiDocument doc, XWikiContext context, boolean bTransaction)
default XWikiDeletedDocument[]
getAllDeletedDocuments(String batchId, boolean withContent, XWikiContext context, boolean bTransaction)
default XWikiDeletedDocument[]
getAllDeletedDocuments(String batchId, XWikiContext context, boolean bTransaction)
default Long[]
getAllDeletedDocumentsIds(XWikiContext context, int limit)
Get all the deleted documents ID or a specified number.default XWikiDeletedDocument
getDeletedDocument(long index, XWikiContext context, boolean bTransaction)
XWikiDeletedDocument
getDeletedDocument(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
Deprecated.since 9.4RC1.default Long
getNumberOfDeletedDocuments(XWikiContext context)
default boolean
hasAccess(Right right, org.xwiki.user.UserReference userReference, XWikiDeletedDocument deletedDocument)
Check if the given deleted document can be accessed for the given right by the given user.default XWikiDocument
restoreFromRecycleBin(long index, XWikiContext context, boolean bTransaction)
XWikiDocument
restoreFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
Deprecated.since 9.4RC1.void
saveToRecycleBin(XWikiDocument doc, String deleter, Date date, XWikiContext context, boolean bTransaction)
Save document to recycle bin.default void
saveToRecycleBin(XWikiDocument doc, String deleter, Date date, String batchId, XWikiContext context, boolean bTransaction)
Save document to recycle bin.
-
-
-
Method Detail
-
saveToRecycleBin
void saveToRecycleBin(XWikiDocument doc, String deleter, Date date, XWikiContext context, boolean bTransaction) throws XWikiException
Save document to recycle bin.- Parameters:
doc
- - document to savedeleter
- - the user which delete documentdate
- - date of delete actionbTransaction
- - should use old transaction(false) or create new (true)context
- - used while saving- Throws:
XWikiException
- if error in saving
-
saveToRecycleBin
default void saveToRecycleBin(XWikiDocument doc, String deleter, Date date, String batchId, XWikiContext context, boolean bTransaction) throws XWikiException
Save document to recycle bin.- Parameters:
doc
- - document to savedeleter
- - the user which delete documentdate
- - date of delete actionbatchId
- - id of the operation that deleted multiple documents at the same time, useful when trying to revert the operation.null
or empty values are ignoredbTransaction
- - should use old transaction(false) or create new (true)context
- - used while saving- Throws:
XWikiException
- if error in saving- Since:
- 9.4RC1
-
restoreFromRecycleBin
@Deprecated XWikiDocument restoreFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.since 9.4RC1. The document parameter is useless and gets in the way. UserestoreFromRecycleBin(long, XWikiContext, boolean)
instead.- Parameters:
doc
- - document to restoreindex
- - what deleted document to restore. seeXWikiDeletedDocument.getId()
context
- - used while loadingbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- restored document from recycle bin
- Throws:
XWikiException
- if error while loading
-
restoreFromRecycleBin
default XWikiDocument restoreFromRecycleBin(long index, XWikiContext context, boolean bTransaction) throws XWikiException
- Parameters:
index
- - what deleted document to restore. seeXWikiDeletedDocument.getId()
context
- - used while loadingbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- the restored document from recycle bin
- Throws:
XWikiException
- if error while loading- Since:
- 9.4RC1
-
getDeletedDocument
@Deprecated XWikiDeletedDocument getDeletedDocument(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.since 9.4RC1. The document parameter is useless and gets in the way. UsegetDeletedDocument(long, XWikiContext, boolean)
instead.- Parameters:
doc
- - deleted documentindex
- - what deleted document to restore. seeXWikiDeletedDocument.getId()
context
- - used while loadingbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- specified deleted document from recycle bin. null if not found.
- Throws:
XWikiException
- if error while loading
-
getDeletedDocument
default XWikiDeletedDocument getDeletedDocument(long index, XWikiContext context, boolean bTransaction) throws XWikiException
- Parameters:
index
- - what deleted document to restore. SeeXWikiDeletedDocument.getId()
context
- - used while loadingbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- specified deleted document from recycle bin or
null
if not found. - Throws:
XWikiException
- if error while loading- Since:
- 9.4RC1
-
getAllDeletedDocuments
XWikiDeletedDocument[] getAllDeletedDocuments(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException
- Parameters:
doc
- - the deleted documentcontext
- - used to loadbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- info about all delete actions of specific document. sorted by date.
- Throws:
XWikiException
- - if error in loading
-
getAllDeletedDocumentsIds
default Long[] getAllDeletedDocumentsIds(XWikiContext context, int limit) throws XWikiException
Get all the deleted documents ID or a specified number. Sorted by date.- Parameters:
context
- - used to load the deleted documents id.limit
- - if > 0 then all deleted documents id are returned. Else the specified number.- Returns:
- an array of IDs of deleted documents.
- Throws:
XWikiException
- - if error in loading- Since:
- 10.10RC1
-
getNumberOfDeletedDocuments
default Long getNumberOfDeletedDocuments(XWikiContext context) throws XWikiException
- Parameters:
context
- - used to realize the query.- Returns:
- the number of deleted documents in the recycle bin.
- Throws:
XWikiException
- - if error in loading.- Since:
- 10.10RC1
-
getAllDeletedDocuments
default XWikiDeletedDocument[] getAllDeletedDocuments(String batchId, XWikiContext context, boolean bTransaction) throws XWikiException
- Parameters:
batchId
- - id of the operation that deleted multiple documents at the same time; useful when trying to revert the operationcontext
- - used to loadbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- info about all documents that were deleted in the same batch, as part of the same operation
- Throws:
XWikiException
- - if error in loading- Since:
- 9.4RC1
-
getAllDeletedDocuments
default XWikiDeletedDocument[] getAllDeletedDocuments(String batchId, boolean withContent, XWikiContext context, boolean bTransaction) throws XWikiException
- Parameters:
batchId
- - id of the operation that deleted multiple documents at the same time; useful when trying to revert the operationwithContent
- -true
if the deleted document's content should also be loaded;false
ifcontext
- - used to loadbTransaction
- - should use old transaction(false) or create new (true)- Returns:
- info about all documents that were deleted in the same batch, as part of the same operation
- Throws:
XWikiException
- - if error in loading- Since:
- 9.4RC1
-
deleteFromRecycleBin
@Deprecated void deleteFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.since 9.4RC1. The document parameter is useless and gets in the way. UsedeleteFromRecycleBin(long, XWikiContext, boolean)
instead.Permanently delete document from recycle bin.- Parameters:
doc
- - document to deleteindex
- - which instance document in recycle bin to deletecontext
- - used for environmentbTransaction
- - should use old transaction(false) or create new (true)- Throws:
XWikiException
- if any error
-
deleteFromRecycleBin
default void deleteFromRecycleBin(long index, XWikiContext context, boolean bTransaction) throws XWikiException
Permanently delete document from recycle bin.- Parameters:
index
- - which instance document in recycle bin to deletecontext
- - used for environmentbTransaction
- - should use old transaction(false) or create new (true)- Throws:
XWikiException
- if any error- Since:
- 9.4RC1
-
checkAccess
@Unstable default void checkAccess(Right right, org.xwiki.user.UserReference userReference, XWikiDeletedDocument deletedDocument) throws AuthorizationException
Check if the given deleted document can be accessed for the given right by the given user. This method only throw theAuthorizationException
if the right is not granted.- Parameters:
right
- the right to check access foruserReference
- the user for whom to check accessdeletedDocument
- the document to be accessed- Throws:
AuthorizationException
- if the user doesn't have appropriate right- Since:
- 14.10, 14.4.7, 13.10.11
-
hasAccess
@Unstable default boolean hasAccess(Right right, org.xwiki.user.UserReference userReference, XWikiDeletedDocument deletedDocument)
Check if the given deleted document can be accessed for the given right by the given user.- Parameters:
right
- the right to check access foruserReference
- the user for whom to check accessdeletedDocument
- the document to be accessed- Returns:
true
if the user have appropriate right- Since:
- 14.10, 14.4.7, 13.10.11
-
-