Package com.xpn.xwiki.doc
Class XWikiDeletedDocument
- java.lang.Object
-
- com.xpn.xwiki.util.AbstractSimpleClass
-
- com.xpn.xwiki.doc.XWikiDeletedDocument
-
public class XWikiDeletedDocument extends AbstractSimpleClass
Archive of deleted document, stored inXWikiRecycleBinStoreInterface. Immutable, because we don't need modify deleted document.- Since:
- 1.2M1
- Version:
- $Id: c0c145414f6da5853561a2f4185b244e49b794e4 $
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedXWikiDeletedDocument()Default constructor.XWikiDeletedDocument(XWikiDocument doc, String deleter, Date deleteDate, XWikiContext context)XWikiDeletedDocument(String fullName, Locale locale, String storeType, String deleter, Date deleteDate, XWikiDeletedDocumentContent content)XWikiDeletedDocument(String fullName, Locale locale, String storeType, String deleter, Date deleteDate, XWikiDeletedDocumentContent content, String batchId)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringgetBatchId()DategetDate()StringgetDeleter()DocumentReferencegetDeleterReference()DocumentReferencegetDocumentReference()StringgetFullName()longgetId()StringgetLanguage()Deprecated.since 8.0M1, usegetLocale()insteadLocalegetLocale()StringgetXml()Only used in Hibernate.StringgetXmlStore()XWikiDocumentrestoreDocument(XWikiDocument doc, XWikiContext context)XWikiDocumentrestoreDocument(XWikiContext context)protected voidsetBatchId(String batchId)protected voidsetDate(Date date)protected voidsetDeleter(String deleter)protected voidsetDocument(XWikiDocument doc, XWikiContext context)Deprecated.since 9.0RC1, useinsteadprotected voidsetFullName(String docFullName)protected voidsetId(long id)protected voidsetLanguage(String locale)Deprecated.since 8.0M1protected voidsetXml(String xml)Only used in Hibernate.protected voidsetXmlStore(String xmlStore)-
Methods inherited from class com.xpn.xwiki.util.AbstractSimpleClass
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
XWikiDeletedDocument
protected XWikiDeletedDocument()
Default constructor. Used only in hibernate.
-
XWikiDeletedDocument
public XWikiDeletedDocument(XWikiDocument doc, String deleter, Date deleteDate, XWikiContext context) throws XWikiException
- Parameters:
doc- - deleted documentdeleter- - user which delete documentdeleteDate- - date of delete actioncontext- - used for environment- Throws:
XWikiException- if any error
-
XWikiDeletedDocument
public XWikiDeletedDocument(String fullName, Locale locale, String storeType, String deleter, Date deleteDate, XWikiDeletedDocumentContent content) throws XWikiException
- Parameters:
fullName- the local reference of the documentlocale- the locale of the documentstoreType- the way to store the documentdeleter- the user who delete documentdeleteDate- date of delete actioncontent- the stored deleted document- Throws:
XWikiException- if any error- Since:
- 9.0RC1
-
XWikiDeletedDocument
public XWikiDeletedDocument(String fullName, Locale locale, String storeType, String deleter, Date deleteDate, XWikiDeletedDocumentContent content, String batchId) throws XWikiException
- Parameters:
fullName- the local reference of the documentlocale- the locale of the documentstoreType- the way to store the documentdeleter- the user who delete documentdeleteDate- date of delete actioncontent- the stored deleted documentbatchId- the id of the batch deletion- Throws:
XWikiException- if any error- Since:
- 9.4RC1
-
-
Method Detail
-
getId
public long getId()
- Returns:
- the synthetic id of this deleted document. unique only for document.
-
setId
protected void setId(long id)
- Parameters:
id- - the synthetic id to set. used only in Hibernate.
-
getFullName
public String getFullName()
- Returns:
XWikiDocument.getFullName()
-
setFullName
protected void setFullName(String docFullName)
- Parameters:
docFullName- -XWikiDocument.getFullName()to set
-
getDocumentReference
public DocumentReference getDocumentReference()
- Returns:
- the document reference for the deleted document, including any locale information
- Since:
- 9.4RC1
-
getLanguage
@Deprecated public String getLanguage()
Deprecated.since 8.0M1, usegetLocale()instead- Returns:
XWikiDocument.getLanguage()
-
getLocale
public Locale getLocale()
- Returns:
XWikiDocument.getLocale()- Since:
- 8.0M1
-
setLanguage
@Deprecated protected void setLanguage(String locale)
Deprecated.since 8.0M1- Parameters:
locale- -XWikiDocument.getLanguage()to set
-
getDate
public Date getDate()
- Returns:
- the date of delete action
-
setDate
protected void setDate(Date date)
- Parameters:
date- - the date of delete action to set
-
getDeleter
public String getDeleter()
- Returns:
- the user which has removed the document
-
getDeleterReference
public DocumentReference getDeleterReference()
- Returns:
- the reference of the user who deleted this document
- Since:
- 11.5RC1
-
setDeleter
protected void setDeleter(String deleter)
- Parameters:
deleter- - the user which has removed the document to set
-
getXmlStore
public String getXmlStore()
- Returns:
- the type of the store used for the content
- Since:
- 9.0RC1
-
setXmlStore
protected void setXmlStore(String xmlStore)
- Parameters:
xmlStore- the type of store (supported values are null/"hibernate" and "file")- Since:
- 9.0RC1
-
getXml
public String getXml()
Only used in Hibernate.- Returns:
- xml serialization of
XWikiDocument
-
setXml
protected void setXml(String xml)
Only used in Hibernate.- Parameters:
xml- - xml serialization ofXWikiDocument
-
setDocument
@Deprecated protected void setDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
Deprecated.since 9.0RC1, useinsteadExportXWikiDocumenttoXWikiDeletedDocument.- Parameters:
doc- - the deleted documentcontext- - used inXWikiDocument.toXML(XWikiContext)- Throws:
XWikiException- in error inXWikiDocument.toXML(XWikiContext)
-
restoreDocument
public XWikiDocument restoreDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
- Parameters:
doc- optional object where to put the document data, if notnullcontext- the currentcontext- Returns:
- restored document
- Throws:
XWikiException- if error inXWikiDocument.fromXML(String)
-
restoreDocument
public XWikiDocument restoreDocument(XWikiContext context) throws XWikiException
- Parameters:
context- the currentcontext- Returns:
- restored document
- Throws:
XWikiException- if error inXWikiDocument.fromXML(String)- Since:
- 9.0RC1
-
setBatchId
protected void setBatchId(String batchId)
- Parameters:
batchId- batch operation ID to set- Since:
- 9.4RC1
-
getBatchId
public String getBatchId()
- Returns:
- the id of the operation that deleted multiple documents at the same time, including this one
- Since:
- 9.4RC1
-
-