com.xpn.xwiki.store
Class XWikiHibernateRecycleBinStore

java.lang.Object
  extended by com.xpn.xwiki.store.XWikiHibernateBaseStore
      extended by com.xpn.xwiki.store.XWikiHibernateRecycleBinStore
All Implemented Interfaces:
XWikiRecycleBinStoreInterface, org.xwiki.component.phase.Initializable

@Component
@Named(value="hibernate")
@Singleton
public class XWikiHibernateRecycleBinStore
extends XWikiHibernateBaseStore
implements XWikiRecycleBinStoreInterface

Realization of XWikiRecycleBinStoreInterface for Hibernate store.

Version:
$Id: eca9c116cabba7c30d149ae9d220d344d474994c $

Nested Class Summary
 
Nested classes/interfaces inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
XWikiHibernateBaseStore.HibernateCallback<T>
 
Field Summary
 
Fields inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
loggerManager
 
Constructor Summary
XWikiHibernateRecycleBinStore()
          Empty constructor needed for component manager.
XWikiHibernateRecycleBinStore(XWikiContext context)
          Deprecated. 1.6M1. Use ComponentManager.lookup(XWikiRecycleBinStoreInterface.class) instead.
 
Method Summary
 void deleteFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
          Permanently delete document from recycle bin.
 XWikiDeletedDocument[] getAllDeletedDocuments(XWikiDocument doc, XWikiContext context, boolean bTransaction)
           
 XWikiDeletedDocument getDeletedDocument(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
           
 XWikiDocument restoreFromRecycleBin(XWikiDocument doc, long index, XWikiContext context, boolean bTransaction)
           
 void saveToRecycleBin(XWikiDocument doc, String deleter, Date date, XWikiContext context, boolean bTransaction)
          Save document to recycle bin.
 
Methods inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
beginTransaction, beginTransaction, beginTransaction, beginTransaction, checkHibernate, cleanUp, dynamicMappingTableName, endTransaction, endTransaction, escapeSchema, execute, execute, executeRead, executeRead, executeWrite, executeWrite, failSafeExecute, failSafeExecuteRead, failSafeExecuteWrite, getConfiguration, getConnections, getDatabaseProductName, getDatabaseProductName, getMapping, getNbConnections, getPath, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaFromWikiName, getSchemaUpdateScript, getSession, getSessionFactory, getTransaction, initialize, isInSchemaMode, isVirtual, makeMapping, setDatabase, setNbConnections, setPath, setSession, setSessionFactory, setTransaction, shutdownHibernate, updateSchema, updateSchema, updateSchema, updateSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XWikiHibernateRecycleBinStore

@Deprecated
public XWikiHibernateRecycleBinStore(XWikiContext context)
Deprecated. 1.6M1. Use ComponentManager.lookup(XWikiRecycleBinStoreInterface.class) instead.

Parameters:
context - used for environment

XWikiHibernateRecycleBinStore

public XWikiHibernateRecycleBinStore()
Empty constructor needed for component manager.

Method Detail

saveToRecycleBin

public void saveToRecycleBin(XWikiDocument doc,
                             String deleter,
                             Date date,
                             XWikiContext context,
                             boolean bTransaction)
                      throws XWikiException
Description copied from interface: XWikiRecycleBinStoreInterface
Save document to recycle bin.

Specified by:
saveToRecycleBin in interface XWikiRecycleBinStoreInterface
Parameters:
doc - - document to save
deleter - - the user which delete document
date - - date of delete action
context - - used while saving
bTransaction - - should use old transaction(false) or create new (true)
Throws:
XWikiException - if error in saving

restoreFromRecycleBin

public XWikiDocument restoreFromRecycleBin(XWikiDocument doc,
                                           long index,
                                           XWikiContext context,
                                           boolean bTransaction)
                                    throws XWikiException
Specified by:
restoreFromRecycleBin in interface XWikiRecycleBinStoreInterface
Parameters:
doc - - document to restore
index - - what deleted document to restore. see XWikiDeletedDocument.getId()
context - - used while loading
bTransaction - - should use old transaction(false) or create new (true)
Returns:
restored document from recycle bin
Throws:
XWikiException - if error while loading

getDeletedDocument

public XWikiDeletedDocument getDeletedDocument(XWikiDocument doc,
                                               long index,
                                               XWikiContext context,
                                               boolean bTransaction)
                                        throws XWikiException
Specified by:
getDeletedDocument in interface XWikiRecycleBinStoreInterface
Parameters:
doc - - deleted document
index - - what deleted document to restore. see XWikiDeletedDocument.getId()
context - - used while loading
bTransaction - - should use old transaction(false) or create new (true)
Returns:
specified deleted document from recycle bin. null if not found.
Throws:
XWikiException - if error while loading

getAllDeletedDocuments

public XWikiDeletedDocument[] getAllDeletedDocuments(XWikiDocument doc,
                                                     XWikiContext context,
                                                     boolean bTransaction)
                                              throws XWikiException
Specified by:
getAllDeletedDocuments in interface XWikiRecycleBinStoreInterface
Parameters:
doc - - the deleted document
context - - used to load
bTransaction - - should use old transaction(false) or create new (true)
Returns:
infos about all delete actions of specific document. sorted by date.
Throws:
XWikiException - - if error in loading

deleteFromRecycleBin

public void deleteFromRecycleBin(XWikiDocument doc,
                                 long index,
                                 XWikiContext context,
                                 boolean bTransaction)
                          throws XWikiException
Description copied from interface: XWikiRecycleBinStoreInterface
Permanently delete document from recycle bin.

Specified by:
deleteFromRecycleBin in interface XWikiRecycleBinStoreInterface
Parameters:
doc - - document to delete
index - - which instance document in recycle bin to delete
context - - used for environment
bTransaction - - should use old transaction(false) or create new (true)
Throws:
XWikiException - if eny error


Copyright © 2004-2013 XWiki. All Rights Reserved.