com.xpn.xwiki.store
Class XWikiHibernateVersioningStore

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

@Component
@Named(value="hibernate")
@Singleton
public class XWikiHibernateVersioningStore
extends XWikiHibernateBaseStore
implements XWikiVersioningStoreInterface

Realization of XWikiVersioningStoreInterface for Hibernate-based storage.

Version:
$Id: 16ead9d667ba3995a342369267a939b83f7181be $

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
XWikiHibernateVersioningStore()
          Empty constructor needed for component manager.
XWikiHibernateVersioningStore(String hibpath)
          Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.
XWikiHibernateVersioningStore(XWikiContext context)
          Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.
XWikiHibernateVersioningStore(XWiki xwiki, XWikiContext context)
          Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.
 
Method Summary
 void deleteArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context)
          Delete all document history.
 XWikiDocumentArchive getXWikiDocumentArchive(XWikiDocument doc, XWikiContext context)
           
 org.suigeneris.jrcs.rcs.Version[] getXWikiDocVersions(XWikiDocument doc, XWikiContext context)
           
protected  List<XWikiRCSNodeInfo> loadAllRCSNodeInfo(XWikiContext context, long id, boolean bTransaction)
           
 XWikiRCSNodeContent loadRCSNodeContent(XWikiRCSNodeId id, boolean bTransaction, XWikiContext context)
          Load XWikiRCSNodeContent by demand.
 XWikiDocument loadXWikiDoc(XWikiDocument basedoc, String sversion, XWikiContext context)
           
 void loadXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context)
           
 void resetRCSArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context)
           
 void saveXWikiDocArchive(XWikiDocumentArchive archivedoc, boolean bTransaction, XWikiContext context)
           
 void updateXWikiDocArchive(XWikiDocument doc, boolean bTransaction, XWikiContext context)
           
 
Methods inherited from class com.xpn.xwiki.store.XWikiHibernateBaseStore
beginTransaction, beginTransaction, beginTransaction, beginTransaction, checkHibernate, cleanUp, createHibernateSequenceIfRequired, dynamicMappingTableName, endTransaction, endTransaction, escapeSchema, execute, execute, executeRead, executeRead, executeWrite, executeWrite, failSafeExecute, failSafeExecuteRead, failSafeExecuteWrite, getConfiguration, getConnections, getDatabaseProductName, getDatabaseProductName, getExecution, 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

XWikiHibernateVersioningStore

@Deprecated
public XWikiHibernateVersioningStore(XWiki xwiki,
                                                XWikiContext context)
Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.

This allows to initialize our storage engine. The hibernate config file path is taken from xwiki.cfg or directly in the WEB-INF directory.

Parameters:
xwiki - The xwiki object
context - The current context

XWikiHibernateVersioningStore

@Deprecated
public XWikiHibernateVersioningStore(String hibpath)
Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.

Initialize the storage engine with a specific path This is used for tests.

Parameters:
hibpath - path to hibernate.hbm.xml file

XWikiHibernateVersioningStore

@Deprecated
public XWikiHibernateVersioningStore(XWikiContext context)
Deprecated. 1.6M1. use ComponentManager.lookup(XWikiVersioningStoreInterface.class) instead.

Parameters:
context - The current context
See Also:
XWikiHibernateVersioningStore(XWiki, XWikiContext)

XWikiHibernateVersioningStore

public XWikiHibernateVersioningStore()
Empty constructor needed for component manager.

Method Detail

getXWikiDocVersions

public org.suigeneris.jrcs.rcs.Version[] getXWikiDocVersions(XWikiDocument doc,
                                                             XWikiContext context)
                                                      throws XWikiException
Specified by:
getXWikiDocVersions in interface XWikiVersioningStoreInterface
Throws:
XWikiException

getXWikiDocumentArchive

public XWikiDocumentArchive getXWikiDocumentArchive(XWikiDocument doc,
                                                    XWikiContext context)
                                             throws XWikiException
Specified by:
getXWikiDocumentArchive in interface XWikiVersioningStoreInterface
Throws:
XWikiException

loadXWikiDocArchive

public void loadXWikiDocArchive(XWikiDocumentArchive archivedoc,
                                boolean bTransaction,
                                XWikiContext context)
                         throws XWikiException
Specified by:
loadXWikiDocArchive in interface XWikiVersioningStoreInterface
Throws:
XWikiException

saveXWikiDocArchive

public void saveXWikiDocArchive(XWikiDocumentArchive archivedoc,
                                boolean bTransaction,
                                XWikiContext context)
                         throws XWikiException
Specified by:
saveXWikiDocArchive in interface XWikiVersioningStoreInterface
Throws:
XWikiException

loadXWikiDoc

public XWikiDocument loadXWikiDoc(XWikiDocument basedoc,
                                  String sversion,
                                  XWikiContext context)
                           throws XWikiException
Specified by:
loadXWikiDoc in interface XWikiVersioningStoreInterface
Throws:
XWikiException

resetRCSArchive

public void resetRCSArchive(XWikiDocument doc,
                            boolean bTransaction,
                            XWikiContext context)
                     throws XWikiException
Specified by:
resetRCSArchive in interface XWikiVersioningStoreInterface
Throws:
XWikiException

updateXWikiDocArchive

public void updateXWikiDocArchive(XWikiDocument doc,
                                  boolean bTransaction,
                                  XWikiContext context)
                           throws XWikiException
Specified by:
updateXWikiDocArchive in interface XWikiVersioningStoreInterface
Throws:
XWikiException

loadAllRCSNodeInfo

protected List<XWikiRCSNodeInfo> loadAllRCSNodeInfo(XWikiContext context,
                                                    long id,
                                                    boolean bTransaction)
                                             throws XWikiException
Parameters:
context - the XWiki context
id - XWikiRCSNodeContent.getId()
bTransaction - should store to use old transaction(false) or create new (true)
Returns:
loaded rcs node content
Throws:
XWikiException - if any error

loadRCSNodeContent

public XWikiRCSNodeContent loadRCSNodeContent(XWikiRCSNodeId id,
                                              boolean bTransaction,
                                              XWikiContext context)
                                       throws XWikiException
Description copied from interface: XWikiVersioningStoreInterface
Load XWikiRCSNodeContent by demand. Used in XWikiRCSNodeInfo#getContent(XWikiContext)

Specified by:
loadRCSNodeContent in interface XWikiVersioningStoreInterface
Parameters:
id - = XWikiRCSNodeContent.getId()
Returns:
loaded rcs node content
Throws:
XWikiException

deleteArchive

public void deleteArchive(XWikiDocument doc,
                          boolean bTransaction,
                          XWikiContext context)
                   throws XWikiException
Description copied from interface: XWikiVersioningStoreInterface
Delete all document history.

Specified by:
deleteArchive in interface XWikiVersioningStoreInterface
Parameters:
doc - - deleted document
Throws:
XWikiException


Copyright © 2004–2014 XWiki. All rights reserved.