Package com.xpn.xwiki.doc
Interface DocumentRevisionProvider
-
@Role public interface DocumentRevisionProvider
Provide generic way of requesting a specific revision of a document from several sources (database, installed XAR extension, etc.).The revision syntax is
<provider hint>:<revision>
, default provide being database (the version of the document in the history).- Since:
- 9.4RC1
- Version:
- $Id: ce21cd452fa088c17a54fcd1ee878db79155ef1b $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
checkAccess(Right right, org.xwiki.user.UserReference userReference, DocumentReference documentReference, String revision)
Check if access is granted on the given document revision, for the given user and right: if the access is not granted this method will throw anAccessDeniedException
.XWikiDocument
getRevision(XWikiDocument document, String revision)
Load the document in the provided revision.XWikiDocument
getRevision(DocumentReference reference, String revision)
Load the document in the provided revision.
-
-
-
Method Detail
-
getRevision
XWikiDocument getRevision(DocumentReference reference, String revision) throws XWikiException
Load the document in the provided revision.- Parameters:
reference
- the reference of the documentrevision
- the revision of the document- Returns:
- the
XWikiDocument
instance or null if none existing - Throws:
XWikiException
- when failing to load the document revision
-
getRevision
XWikiDocument getRevision(XWikiDocument document, String revision) throws XWikiException
Load the document in the provided revision.- Parameters:
document
- the current documentrevision
- the revision of the document- Returns:
- the
XWikiDocument
instance or null if none existing - Throws:
XWikiException
- when failing to load the document revision
-
checkAccess
@Unstable default void checkAccess(Right right, org.xwiki.user.UserReference userReference, DocumentReference documentReference, String revision) throws AuthorizationException, XWikiException
Check if access is granted on the given document revision, for the given user and right: if the access is not granted this method will throw anAccessDeniedException
. This method allows each revision provider to have their own check depending on the type of revision.- Parameters:
right
- the right for which to check if access is granteduserReference
- the user for whom to check accessdocumentReference
- the reference of the documentrevision
- the revision of the document- Throws:
AuthorizationException
- if the access is deniedXWikiException
- in case of problem when loading the revision- Since:
- 14.10, 14.4.7, 13.10.11
-
-