public class DeletedAttachment extends AbstractSimpleClass
AttachmentRecycleBinStore
. Immutable, because
deleted attachments should not be modified.Modifier | Constructor and Description |
---|---|
protected |
DeletedAttachment()
Default constructor.
|
|
DeletedAttachment(XWikiAttachment attachment,
String deleter,
Date deleteDate,
XWikiContext context)
A constructor with all the information about the deleted attachment.
|
Modifier and Type | Method and Description |
---|---|
Date |
getDate()
Getter for
date . |
String |
getDeleter()
Getter for
deleter . |
long |
getDocId()
Getter for
docId . |
String |
getDocName()
Getter for
docName . |
String |
getFilename()
Getter for
filename . |
long |
getId()
Getter for
id . |
String |
getXml()
Getter for
xml . |
XWikiAttachment |
restoreAttachment(XWikiAttachment attachment,
XWikiContext context)
Restore a
XWikiAttachment from a DeletedAttachment . |
protected void |
setAttachment(XWikiAttachment attachment,
XWikiContext context)
Export
XWikiAttachment to DeletedAttachment . |
protected void |
setDate(Date date)
Setter for
date . |
protected void |
setDeleter(String deleter)
Setter for
deleter . |
protected void |
setDocId(long docId)
Setter for
docId . |
protected void |
setDocName(String docName)
Setter for
docName . |
protected void |
setFilename(String filename)
Setter for
filename . |
protected void |
setId(long id)
Setter for
id . |
protected void |
setXml(String xml)
Setter for
xml . |
equals, hashCode, toString
protected 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 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.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 getXml()
xml
.XWikiAttachment
protected void setXml(String xml)
xml
.xml
- XML serialization of XWikiAttachment
. Used only by Hibernate.protected void setAttachment(XWikiAttachment attachment, XWikiContext context) throws XWikiException
XWikiAttachment
to DeletedAttachment
.attachment
- the deleted attachmentcontext
- the current context, used in the XML exportXWikiException
- if an exception occurs during the XML exportpublic XWikiAttachment restoreAttachment(XWikiAttachment attachment, XWikiContext context) throws XWikiException
XWikiAttachment
from a DeletedAttachment
. Note that this method does not actually
restore the attachment to its owner document, it simply recomposes an XWikiAttachment
object from the
saved data.attachment
- optional object where to put the attachment data, if not null
context
- the current context
XWikiException
- If an exception occurs while the Attachment is restored from the XML. See
XWikiAttachment.fromXML(String)
.Copyright © 2004–2014 XWiki. All rights reserved.