public class DeletedAttachment extends AbstractSimpleClass
AttachmentRecycleBinStore. Immutable, because
deleted attachments should not be modified.| Modifier | Constructor and Description |
|---|---|
protected |
DeletedAttachment()
Default constructor.
|
|
DeletedAttachment(long docId,
String docName,
String filename,
String storeType,
String deleter,
Date deleteDate,
DeletedAttachmentContent content) |
|
DeletedAttachment(long docId,
String docName,
String filename,
String storeType,
String deleter,
Date deleteDate,
DeletedAttachmentContent content,
long id) |
|
DeletedAttachment(XWikiAttachment attachment,
String deleter,
Date deleteDate,
XWikiContext context)
A constructor with all the information about the deleted attachment.
|
equals, hashCode, toStringprotected DeletedAttachment()
public DeletedAttachment(XWikiAttachment attachment, String deleter, Date deleteDate, XWikiContext context) throws XWikiException
attachment - Deleted attachment.deleter - User which deleted the attachment.deleteDate - Date of delete action.context - The current context. Used for determining the encoding.XWikiException - If the attachment cannot be exported to XML.public DeletedAttachment(long docId,
String docName,
String filename,
String storeType,
String deleter,
Date deleteDate,
DeletedAttachmentContent content)
docId - the ID of the document this attachment belonged todocName - the reference of the document this attachment belonged tofilename - the name of the attachmentstoreType - the way to store the documentdeleter - the user who delete documentdeleteDate - date of delete actioncontent - the stored deleted documentpublic DeletedAttachment(long docId,
String docName,
String filename,
String storeType,
String deleter,
Date deleteDate,
DeletedAttachmentContent content,
long id)
docId - the ID of the document this attachment belonged todocName - the reference of the document this attachment belonged tofilename - the name of the attachmentstoreType - the way to store the documentdeleter - the user who delete documentdeleteDate - date of delete actioncontent - the stored deleted documentid - the synthetic id of this deleted attachment. Uniquely identifies an entry in the recycle bin.public long getId()
id.protected void setId(long id)
id.id - The synthetic id to set. Used only by hibernate.public long getDocId()
docId.protected void setDocId(long docId)
docId.docId - The id of the document to set. Used only by hibernate.public String getDocName()
docName.protected void setDocName(String docName)
docName.docName - The document name to set. Used only by hibernate.protected void setFilename(String filename)
filename.filename - The attachment filename to set. Used only by hibernate.public AttachmentReference getAttachmentReference()
protected void setDate(Date date)
date.date - The date of the delete action to set. Used only by Hibernate.public String getDeleter()
deleter.XWiki.Admin)protected void setDeleter(String deleter)
deleter.deleter - The user which has removed the document to set. Used only by Hibernate.public String getContentStore()
public void setContentStore(String xmlStore)
xmlStore - the type of store (supported values are null/"hibernate" and "file")public String getXml()
content.XWikiAttachmentprotected void setXml(String xml)
content.xml - XML serialization of XWikiAttachment. Used only by Hibernate.@Deprecated protected void setAttachment(XWikiAttachment attachment, XWikiContext context) throws XWikiException
DeletedAttachment(long, String, String, String, String, Date, DeletedAttachmentContent)
insteadXWikiAttachment to DeletedAttachment.attachment - the deleted attachmentcontext - the current context, used in the XML exportXWikiException - if an exception occurs during the XML export@Deprecated public XWikiAttachment restoreAttachment(XWikiAttachment attachment, XWikiContext context) throws XWikiException
restoreAttachment(XWikiAttachment) insteadXWikiAttachment from a DeletedAttachment. Note that this method does not actually
restore the attachment to its owner document, it simply re-composes an XWikiAttachment object from the
saved data.attachment - optional object where to put the attachment data, if not nullcontext - the current contextXWikiException - If an exception occurs while the Attachment is restored from the XML. See
XWikiAttachment.fromXML(String).public XWikiAttachment restoreAttachment(XWikiAttachment attachment) throws XWikiException
XWikiAttachment from a DeletedAttachment. Note that this method does not actually
restore the attachment to its owner document, it simply re-composes an XWikiAttachment object from the
saved data.attachment - optional object where to put the attachment data, if not nullXWikiException - If an exception occurs while the Attachment is restored from the XML. See
XWikiAttachment.fromXML(String).public XWikiAttachment restoreAttachment() throws XWikiException
XWikiException - if error in XWikiDocument.fromXML(String)Copyright © 2004–2021 XWiki. All rights reserved.