Class DeletedDocument


  • public class DeletedDocument
    extends Api
    Information about a deleted document in the recycle bin.
    Version:
    $Id: da4443c8c6baf6d3bc61f3b8b544098c2395ae57 $
    • 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
      • 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