Class DeletedDocument


  • public class DeletedDocument
    extends Api
    Information about a deleted document in the recycle bin.
    Version:
    $Id: 6249b94b8d332dd2cf48c65e3c83176eb5aade44 $
    • Constructor Detail

      • DeletedDocument

        public DeletedDocument​(XWikiDeletedDocument deletedDoc,
                               XWikiContext context)
        Simple constructor, initializes a new API object with the current context and the specified protected deleted document object.
        Parameters:
        deletedDoc - the internal object wrapped by this API
        context - the current request context
    • Method Detail

      • getFullName

        public String getFullName()
        Returns:
        full name of document (ie: Main.WebHome)
      • getLocale

        public Locale getLocale()
        Returns:
        locale of document
        Since:
        8.0M1
      • getDate

        public Date getDate()
        Returns:
        date of delete action
      • getDeleter

        public String getDeleter()
        Returns:
        user which delete document
      • getDeleterReference

        public DocumentReference getDeleterReference()
        Returns:
        the reference of the user who deleted this document
        Since:
        11.5RC1
      • getId

        public long getId()
        Returns:
        id of deleted document. id is unique only for this document.
      • getBatchId

        public String getBatchId()
        Returns:
        the id of the operation that deleted multiple documents at the same time, including this one
        Since:
        9.4RC1
      • canUndelete

        public boolean canUndelete()
        Check if the current user has the right to restore the document.
        Returns:
        true if the current user can restore this document, false otherwise
      • canView

        @Unstable
        public boolean canView()
        Check if the current user has the right to view the deleted document. This is allowed either if the user has admin right on the original reference of the doc, or if they were the original user who deleted it.
        Returns:
        {code true} if the current user is allowed to view the deleted document.
        Since:
        14.10, 14.4.7, 13.10.11
      • canDelete

        public boolean canDelete()
        Returns:
        true if the current user can permanently delete this document, false otherwise
        xwiki.cfg configuration:
        xwiki.store.recyclebin.adminWaitDays How many days should an administrator wait before being able to permanently delete this document from the recycle bin. 0 by default., xwiki.store.recyclebin.waitDays How many days should a normal user with "delete" right wait before being able to permanently delete this document from the recycle bin. 7 by default.
      • getDeletedDocument

        @Programming
        public XWikiDeletedDocument getDeletedDocument()
        Returns:
        original deleted document if user has programming rights, else null.
      • getDocument

        public Document getDocument()
        Returns:
        the document as it is in the recycle bin if the user is allowed to restore it, null otherwise
      • getDocumentReference

        public DocumentReference getDocumentReference()
        Returns:
        the document reference for the deleted document, including any locale information
        Since:
        9.4RC1