Class DeletedAttachment


  • public class DeletedAttachment
    extends AbstractSimpleClass
    Archive of deleted attachment, stored in AttachmentRecycleBinStore. Immutable, because deleted attachments should not be modified.
    Since:
    1.4M1
    Version:
    $Id: c6098193e08b8722504f07926fa10c10f2c5c71f $
    • Constructor Detail

      • DeletedAttachment

        protected DeletedAttachment()
        Default constructor. Used only by hibernate when restoring objects from the database.
      • DeletedAttachment

        public DeletedAttachment​(XWikiAttachment attachment,
                                 String deleter,
                                 Date deleteDate,
                                 XWikiContext context)
                          throws XWikiException
        A constructor with all the information about the deleted attachment.
        Parameters:
        attachment - Deleted attachment.
        deleter - User which deleted the attachment.
        deleteDate - Date of delete action.
        context - The current context. Used for determining the encoding.
        Throws:
        XWikiException - If the attachment cannot be exported to XML.
      • DeletedAttachment

        public DeletedAttachment​(long docId,
                                 String docName,
                                 String filename,
                                 String storeType,
                                 String deleter,
                                 Date deleteDate,
                                 DeletedAttachmentContent content)
        Parameters:
        docId - the ID of the document this attachment belonged to
        docName - the reference of the document this attachment belonged to
        filename - the name of the attachment
        storeType - the way to store the document
        deleter - the user who delete document
        deleteDate - date of delete action
        content - the stored deleted document
        Since:
        9.10RC1
      • DeletedAttachment

        public DeletedAttachment​(long docId,
                                 String docName,
                                 String filename,
                                 String storeType,
                                 String deleter,
                                 Date deleteDate,
                                 DeletedAttachmentContent content,
                                 long id)
        Parameters:
        docId - the ID of the document this attachment belonged to
        docName - the reference of the document this attachment belonged to
        filename - the name of the attachment
        storeType - the way to store the document
        deleter - the user who delete document
        deleteDate - date of delete action
        content - the stored deleted document
        id - the synthetic id of this deleted attachment. Uniquely identifies an entry in the recycle bin.
        Since:
        9.10RC1
    • Method Detail

      • getId

        public long getId()
        Getter for id.
        Returns:
        The synthetic id of this deleted attachment. Uniquely identifies an entry in the recycle bin.
      • setId

        protected void setId​(long id)
        Setter for id.
        Parameters:
        id - The synthetic id to set. Used only by hibernate.
      • getDocId

        public long getDocId()
        Getter for docId.
        Returns:
        The id of the document this attachment belonged to.
      • setDocId

        protected void setDocId​(long docId)
        Setter for docId.
        Parameters:
        docId - The id of the document to set. Used only by hibernate.
      • getDocName

        public String getDocName()
        Getter for docName.
        Returns:
        The name of the document this attachment belonged to.
      • setDocName

        protected void setDocName​(String docName)
        Setter for docName.
        Parameters:
        docName - The document name to set. Used only by hibernate.
      • getFilename

        public String getFilename()
        Getter for filename.
        Returns:
        The name of the attachment.
      • setFilename

        protected void setFilename​(String filename)
        Setter for filename.
        Parameters:
        filename - The attachment filename to set. Used only by hibernate.
      • getAttachmentReference

        public AttachmentReference getAttachmentReference()
        Returns:
        the attachment reference for the deleted attachment
        Since:
        9.9RCA
      • getDate

        public Date getDate()
        Getter for date.
        Returns:
        The date of the delete action.
      • setDate

        protected void setDate​(Date date)
        Setter for date.
        Parameters:
        date - The date of the delete action to set. Used only by Hibernate.
      • getDeleter

        public String getDeleter()
        Getter for deleter.
        Returns:
        the user who deleted the attachment, as its document name (e.g. XWiki.Admin)
      • setDeleter

        protected void setDeleter​(String deleter)
        Setter for deleter.
        Parameters:
        deleter - The user which has removed the document to set. Used only by Hibernate.
      • getContentStore

        public String getContentStore()
        Returns:
        the type of the store used for the content
        Since:
        9.10RC1
      • setContentStore

        public void setContentStore​(String xmlStore)
        Parameters:
        xmlStore - the type of store (supported values are null/"hibernate" and "file")
        Since:
        9.10RC1
      • setXml

        protected void setXml​(String xml)
        Setter for content.
        Parameters:
        xml - XML serialization of XWikiAttachment. Used only by Hibernate.