use of com.xpn.xwiki.doc.XWikiDeletedDocumentContent in project xwiki-platform by xwiki.
the class XWikiHibernateRecycleBinStore method resolveDeletedDocumentContent.
private XWikiDeletedDocument resolveDeletedDocumentContent(XWikiDeletedDocument deletedDocument, boolean bTransaction) throws XWikiException {
XWikiRecycleBinContentStoreInterface contentStore = getXWikiRecycleBinContentStore(deletedDocument.getXmlStore());
if (contentStore != null) {
DocumentReference reference = deletedDocument.getDocumentReference();
XWikiDeletedDocumentContent content = contentStore.get(reference, deletedDocument.getId(), bTransaction);
try {
FieldUtils.writeDeclaredField(deletedDocument, "content", content, true);
} catch (IllegalAccessException e) {
throw new XWikiException(XWikiException.MODULE_XWIKI_STORE, XWikiException.ERROR_XWIKI_UNKNOWN, "Failed to set deleted document content", e);
}
}
return deletedDocument;
}
use of com.xpn.xwiki.doc.XWikiDeletedDocumentContent in project xwiki-platform by xwiki.
the class XWikiHibernateRecycleBinStore method createXWikiDeletedDocument.
private XWikiDeletedDocument createXWikiDeletedDocument(XWikiDocument doc, String deleter, Date date, XWikiRecycleBinContentStoreInterface contentStore, String batchId) throws XWikiException {
XWikiDeletedDocument trashdoc;
String storeType = null;
XWikiDeletedDocumentContent deletedDocumentContent = null;
if (contentStore != null) {
storeType = contentStore.getHint();
} else {
deletedDocumentContent = new XWikiHibernateDeletedDocumentContent(doc);
}
trashdoc = new XWikiDeletedDocument(doc.getFullName(), doc.getLocale(), storeType, deleter, date, deletedDocumentContent, batchId);
return trashdoc;
}
Aggregations