@Component @Named(value="hibernate") @Singleton public class HibernateAttachmentRecycleBinStore extends XWikiHibernateBaseStore implements AttachmentRecycleBinStore
AttachmentRecycleBinStore
for Hibernate-based storage.XWikiHibernateBaseStore.HibernateCallback<T>
hibernateConfiguration, HINT, loggerManager, store
Constructor and Description |
---|
HibernateAttachmentRecycleBinStore()
Empty constructor needed for component manager.
|
HibernateAttachmentRecycleBinStore(XWikiContext context)
Deprecated.
1.6M1. Use ComponentManager.lookup(AttachmentRecycleBinStore.class) instead.
|
Modifier and Type | Method and Description |
---|---|
void |
deleteFromRecycleBin(long index,
XWikiContext inputxcontext,
boolean bTransaction)
Permanently delete attachment from recycle bin.
|
List<DeletedAttachment> |
getAllDeletedAttachments(XWikiAttachment attachment,
XWikiContext context,
boolean bTransaction)
Get all the deleted attachments from the database matching an attachment template (document name and filename).
|
List<DeletedAttachment> |
getAllDeletedAttachments(XWikiDocument doc,
XWikiContext context,
boolean bTransaction)
Get all the deleted attachments for a given document.
|
protected AttachmentRecycleBinContentStore |
getAttachmentRecycleBinContentStore(String storeType) |
DeletedAttachment |
getDeletedAttachment(long index,
XWikiContext context,
boolean bTransaction)
Returns a
handler for a deleted attachment. |
XWikiAttachment |
restoreFromRecycleBin(XWikiAttachment attachment,
long index,
XWikiContext inputxcontext,
boolean bTransaction)
Restore an attachment from the recycle bin (with full history).
|
void |
saveToRecycleBin(XWikiAttachment attachment,
String deleter,
Date date,
XWikiContext inputxcontext,
boolean bTransaction)
Save attachment to recycle bin, with full history.
|
beginTransaction, beginTransaction, beginTransaction, beginTransaction, checkHibernate, cleanUp, createHibernateSequenceIfRequired, dynamicMappingTableName, endTransaction, endTransaction, escapeSchema, execute, execute, executeRead, executeRead, executeWrite, executeWrite, failSafeExecute, failSafeExecuteRead, failSafeExecuteWrite, getConfiguration, getConnections, getDatabaseMetaData, getDatabaseProductName, getDatabaseProductName, getDialect, getExecution, getHint, getMapping, getMetadata, getNbConnections, getPath, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaUpdateScript, getSession, getSessionFactory, getTransaction, isInSchemaMode, isVirtual, makeMapping, setDatabase, setNbConnections, setPath, setSession, setSessionFactory, setTransaction, shutdownHibernate, updateSchema, updateSchema, updateSchema, updateSchema
@Deprecated public HibernateAttachmentRecycleBinStore(XWikiContext context)
XWiki
during storage initialization.context
- The current context.public HibernateAttachmentRecycleBinStore()
public void saveToRecycleBin(XWikiAttachment attachment, String deleter, Date date, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
saveToRecycleBin
in interface AttachmentRecycleBinStore
attachment
- The attachment to save.deleter
- The user which deleted the attachment.date
- Date of delete action.inputxcontext
- The current context.bTransaction
- Should use old transaction (false) or create new (true).XWikiException
- If an exception occurs during the attachment export or attachment persistence.public XWikiAttachment restoreFromRecycleBin(XWikiAttachment attachment, long index, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
restoreFromRecycleBin
in interface AttachmentRecycleBinStore
attachment
- Optional attachment to restore. If a non-null value is passed, then this object will be changed
to reflect the contents/history of the deleted attachment.index
- What deleted attachment to restore. See DeletedAttachment.getId()
.inputxcontext
- The current context.bTransaction
- Should use old transaction (false) or create new (true).null
if an entry with the requested ID does not exist.XWikiException
- If an error occurs while loading or restoring the attachment.AttachmentRecycleBinStore.getDeletedAttachment(long, XWikiContext, boolean)
public DeletedAttachment getDeletedAttachment(long index, XWikiContext context, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
handler
for a deleted attachment.getDeletedAttachment
in interface AttachmentRecycleBinStore
index
- What deleted attachment to restore. See DeletedAttachment.getId()
context
- The current context.bTransaction
- Should use old transaction (false) or create new (true).null
if not found.XWikiException
- If an error occurs while loading or restoring the attachment.AttachmentRecycleBinStore.restoreFromRecycleBin(XWikiAttachment, long, XWikiContext, boolean)
public List<DeletedAttachment> getAllDeletedAttachments(XWikiAttachment attachment, XWikiContext context, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
getAllDeletedAttachments
in interface AttachmentRecycleBinStore
attachment
- Optional attachment template. If null
, return information about all deleted
attachments from the database. Otherwise, filter by the document and filename provided in the passed
attachment.context
- The current context.bTransaction
- Should use old transaction (false) or create new (true).XWikiException
- If an error occurs while loading or restoring the attachments.public List<DeletedAttachment> getAllDeletedAttachments(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
getAllDeletedAttachments
in interface AttachmentRecycleBinStore
doc
- The document for which to retrieve deleted attachments.context
- The current context.bTransaction
- Should use old transaction (false) or create new (true).XWikiException
- If an error occurs while loading or restoring the attachments.public void deleteFromRecycleBin(long index, XWikiContext inputxcontext, boolean bTransaction) throws XWikiException
AttachmentRecycleBinStore
deleteFromRecycleBin
in interface AttachmentRecycleBinStore
index
- Which instance to delete from the recycle bin.inputxcontext
- The current context.bTransaction
- Should use old transaction (false) or create new (true).XWikiException
- If an error occurs while executing the query.protected AttachmentRecycleBinContentStore getAttachmentRecycleBinContentStore(String storeType)
Copyright © 2004–2022 XWiki. All rights reserved.