org.opencms.db.generic
Class CmsHistoryDriver

java.lang.Object
  extended by org.opencms.db.generic.CmsHistoryDriver
All Implemented Interfaces:
I_CmsDriver, I_CmsHistoryDriver
Direct Known Subclasses:
CmsBackupDriver, CmsHistoryDriver, CmsHistoryDriver, CmsHistoryDriver, CmsHistoryDriver, CmsHistoryDriver, CmsHistoryDriver, CmsHistoryDriver

public class CmsHistoryDriver
extends java.lang.Object
implements I_CmsDriver, I_CmsHistoryDriver

Generic (ANSI-SQL) database server implementation of the history driver methods.

Since:
6.9.1
Version:
$Revision: 1.22 $
Author:
Thomas Weckert, Michael Emmerich, Carsten Weinholz, Michael Moossen

Field Summary
protected  CmsDriverManager m_driverManager
          The driver manager instance.
protected  CmsSqlManager m_sqlManager
          The SQL manager instance.
 
Fields inherited from interface org.opencms.db.I_CmsDriver
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
 
Fields inherited from interface org.opencms.db.I_CmsHistoryDriver
DRIVER_TYPE_ID
 
Constructor Summary
CmsHistoryDriver()
           
 
Method Summary
 CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, java.lang.String name, CmsPropertyDefinition.CmsPropertyType type)
          Creates a new property defintion in the database.
 int deleteEntries(CmsDbContext dbc, I_CmsHistoryResource resource, int versionsToKeep, long time)
          Deletes all historical versions of a resource keeping maximal versionsToKeep versions.
 void deletePropertyDefinition(CmsDbContext dbc, CmsPropertyDefinition metadef)
          Deletes a property definition.
 void destroy()
          Destroys this driver.
 java.util.List getAllDeletedEntries(CmsDbContext dbc)
          Returns all historical resources (of deleted resources).
 java.util.List getAllNotDeletedEntries(CmsDbContext dbc)
          Returns all historical resources (of not deleted resources).
 CmsSqlManager getSqlManager()
          Returns the SqlManager of this driver.
 void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List successiveDrivers, CmsDriverManager driverManager)
          Initializes the driver.
 CmsSqlManager initSqlManager(java.lang.String classname)
          Initializes the SQL manager for this driver.
protected  void internalAddToPropMap(java.util.Map propertyMap, I_CmsHistoryResource resource, java.lang.String propertyKey, java.lang.String propertyValue, int mappingType)
          Updates the property map for the given resource with the given property data.
protected  void internalCleanup(CmsDbContext dbc, I_CmsHistoryResource resource)
          Deletes all historical entries of subresources of a folder without any historical netry left.
protected  int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, CmsUUID projectId)
          Returns the amount of properties for a propertydefinition.
protected  CmsHistoryProject internalCreateProject(java.sql.ResultSet res, java.util.List resources)
          Creates a historical project from the given result set and resources.
protected  I_CmsHistoryResource internalCreateResource(java.sql.ResultSet res)
          Creates a valid I_CmsHistoryResource instance from a JDBC ResultSet.
protected  I_CmsHistoryResource internalMergeResource(I_CmsHistoryResource histRes, java.sql.ResultSet res, int versionOffset)
          Merges an historical entry for a sibling, based on the structure data from the given historical resource and result set for the resource entry.
protected  boolean internalValidateResource(CmsDbContext dbc, CmsResource resource, int publishTag)
          Tests if a history resource does exist.
 java.util.List readAllAvailableVersions(CmsDbContext dbc, CmsUUID structureId)
          Reads all file headers of the resource with the given structure id.
 byte[] readContent(CmsDbContext dbc, CmsUUID resourceId, int publishTag)
          Reads the content of the historical version of the resource identified by its structure id.
 java.util.List readDeletedResources(CmsDbContext dbc, CmsUUID structureId, CmsUUID userId)
          Reads all deleted (historical) resources below the given path, that the given user deleted by itself.
 I_CmsHistoryResource readFile(CmsDbContext dbc, CmsUUID structureId, int tagId)
          Deprecated. use readResource(CmsDbContext, CmsUUID, int) instead but notice that the publishTag != version
 int readLastVersion(CmsDbContext dbc, CmsUUID structureId)
          Returns the last historical version of a resource.
 int readMaxPublishTag(CmsDbContext dbc, CmsUUID resourceId)
          Reads the maximal publish tag for a specified resource id.
 int readNextPublishTag(CmsDbContext dbc)
          Returns the next available history publish tag.
 CmsHistoryPrincipal readPrincipal(CmsDbContext dbc, CmsUUID principalId)
          Reads an historical principal entry.
 CmsHistoryProject readProject(CmsDbContext dbc, CmsUUID projectId)
          Reads the latest historical project version with the given id.
 CmsHistoryProject readProject(CmsDbContext dbc, int publishTag)
          Reads an historical project version.
 java.util.List readProjectResources(CmsDbContext dbc, int publishTag)
          Reads all resources that belong to the historical project identified by the given publish tag.
 java.util.List readProjects(CmsDbContext dbc)
          Returns all projects from the history.
 java.util.List readProperties(CmsDbContext dbc, I_CmsHistoryResource resource)
          Returns a list of all properties of a historical file or folder.
 CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, java.lang.String name)
          Reads a property definition with the given name.
 int readPublishTag(CmsDbContext dbc, long maxdate)
          Gets the publish tag of the first historical project after a given date.
 I_CmsHistoryResource readResource(CmsDbContext dbc, CmsUUID structureId, int version)
          Reads a historical resource version without including the file content.
 void setDriverManager(CmsDriverManager driverManager)
          Sets the driver manager for this driver.
 void setSqlManager(CmsSqlManager sqlManager)
          Sets the SQL manager of this driver.
 void writePrincipal(CmsDbContext dbc, I_CmsPrincipal principal)
          Writes an historical entry for the given principal.
 void writeProject(CmsDbContext dbc, int publishTag, long publishDate)
          Creates an historical entry for the current project.
 void writeProperties(CmsDbContext dbc, CmsResource resource, java.util.List properties, int publishTag)
          Writes the properties of a resource to the history.
 void writeResource(CmsDbContext dbc, CmsResource resource, java.util.List properties, int publishTag)
          Writes a resource to the history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opencms.db.I_CmsDriver
toString
 

Field Detail

m_driverManager

protected CmsDriverManager m_driverManager
The driver manager instance.


m_sqlManager

protected CmsSqlManager m_sqlManager
The SQL manager instance.

Constructor Detail

CmsHistoryDriver

public CmsHistoryDriver()
Method Detail

createPropertyDefinition

public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc,
                                                      java.lang.String name,
                                                      CmsPropertyDefinition.CmsPropertyType type)
                                               throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Creates a new property defintion in the database.

Specified by:
createPropertyDefinition in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
name - the name of the property definition
type - the type of the property definition
Returns:
the new property definition object
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.createPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String, org.opencms.file.CmsPropertyDefinition.CmsPropertyType)

deleteEntries

public int deleteEntries(CmsDbContext dbc,
                         I_CmsHistoryResource resource,
                         int versionsToKeep,
                         long time)
                  throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Deletes all historical versions of a resource keeping maximal versionsToKeep versions.

Specified by:
deleteEntries in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resource - the historical resource to delete versions for
versionsToKeep - the number of versions to keep
time - deleted resources older than this will also be deleted, is ignored if negative
Returns:
the number of versions that were deleted
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.deleteEntries(CmsDbContext, I_CmsHistoryResource, int, long)

deletePropertyDefinition

public void deletePropertyDefinition(CmsDbContext dbc,
                                     CmsPropertyDefinition metadef)
                              throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Deletes a property definition.

Specified by:
deletePropertyDefinition in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
metadef - the property definition to be deleted
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.deletePropertyDefinition(org.opencms.db.CmsDbContext, org.opencms.file.CmsPropertyDefinition)

destroy

public void destroy()
             throws java.lang.Throwable
Description copied from interface: I_CmsHistoryDriver
Destroys this driver.

Specified by:
destroy in interface I_CmsHistoryDriver
Throws:
java.lang.Throwable - if something goes wrong
See Also:
I_CmsHistoryDriver.destroy()

getAllDeletedEntries

public java.util.List getAllDeletedEntries(CmsDbContext dbc)
                                    throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Returns all historical resources (of deleted resources).

Specified by:
getAllDeletedEntries in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
Returns:
a list of I_CmsHistoryResource objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.getAllDeletedEntries(org.opencms.db.CmsDbContext)

getAllNotDeletedEntries

public java.util.List getAllNotDeletedEntries(CmsDbContext dbc)
                                       throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Returns all historical resources (of not deleted resources).

Specified by:
getAllNotDeletedEntries in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
Returns:
a list of I_CmsHistoryResource objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.getAllNotDeletedEntries(org.opencms.db.CmsDbContext)

getSqlManager

public CmsSqlManager getSqlManager()
Description copied from interface: I_CmsHistoryDriver
Returns the SqlManager of this driver.

Specified by:
getSqlManager in interface I_CmsHistoryDriver
Returns:
the SqlManager of this driver
See Also:
I_CmsHistoryDriver.getSqlManager()

init

public void init(CmsDbContext dbc,
                 CmsConfigurationManager configurationManager,
                 java.util.List successiveDrivers,
                 CmsDriverManager driverManager)
Description copied from interface: I_CmsDriver
Initializes the driver.

Specified by:
init in interface I_CmsDriver
Parameters:
dbc - the current database context
configurationManager - the configuration manager
successiveDrivers - a list of successive drivers to be initialized
driverManager - the initialized OpenCms driver manager
See Also:
I_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)

initSqlManager

public CmsSqlManager initSqlManager(java.lang.String classname)
Description copied from interface: I_CmsHistoryDriver
Initializes the SQL manager for this driver.

Specified by:
initSqlManager in interface I_CmsHistoryDriver
Parameters:
classname - the classname of the SQL manager
Returns:
the SQL manager for this driver
See Also:
I_CmsHistoryDriver.initSqlManager(String)

readAllAvailableVersions

public java.util.List readAllAvailableVersions(CmsDbContext dbc,
                                               CmsUUID structureId)
                                        throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads all file headers of the resource with the given structure id.

This method returns a list with the history of the resource, i.e. the historical resources, independent of the project they were attached to.
The reading excludes the file content.

Specified by:
readAllAvailableVersions in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
structureId - the structure id
Returns:
a list of historical resources, as I_CmsHistoryResource objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readAllAvailableVersions(CmsDbContext, CmsUUID)

readContent

public byte[] readContent(CmsDbContext dbc,
                          CmsUUID resourceId,
                          int publishTag)
                   throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads the content of the historical version of the resource identified by its structure id.

Specified by:
readContent in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resourceId - the resource id of the resource to read the content for
publishTag - the publish tag of the version
Returns:
the content if found
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readContent(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, int)

readDeletedResources

public java.util.List readDeletedResources(CmsDbContext dbc,
                                           CmsUUID structureId,
                                           CmsUUID userId)
                                    throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads all deleted (historical) resources below the given path, that the given user deleted by itself.

Specified by:
readDeletedResources in interface I_CmsHistoryDriver
Parameters:
dbc - the current db context
structureId - the structure id of the parent resource to read the deleted resources from
userId - the id of the user that deleted the resources, or null to retrieve them all
Returns:
a list of I_CmsHistoryResource objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readDeletedResources(CmsDbContext, CmsUUID, CmsUUID)

readFile

public I_CmsHistoryResource readFile(CmsDbContext dbc,
                                     CmsUUID structureId,
                                     int tagId)
                              throws CmsDataAccessException
Deprecated. use readResource(CmsDbContext, CmsUUID, int) instead but notice that the publishTag != version

Description copied from interface: I_CmsHistoryDriver
Reads a historical file version including the file content.

Specified by:
readFile in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
structureId - the structure id of the file to read
tagId - the desired publish tag of the file
Returns:
the historical file version
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readFile(CmsDbContext, CmsUUID, int)

readLastVersion

public int readLastVersion(CmsDbContext dbc,
                           CmsUUID structureId)
                    throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Returns the last historical version of a resource.

Specified by:
readLastVersion in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
structureId - the structure ID of the resource
Returns:
the last historical version of a resource
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readLastVersion(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

readMaxPublishTag

public int readMaxPublishTag(CmsDbContext dbc,
                             CmsUUID resourceId)
                      throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads the maximal publish tag for a specified resource id.

Specified by:
readMaxPublishTag in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resourceId - the id of the resource the get the publish tag for
Returns:
the maximal publish tag for the given resource
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readMaxPublishTag(CmsDbContext, CmsUUID)

readNextPublishTag

public int readNextPublishTag(CmsDbContext dbc)
Description copied from interface: I_CmsHistoryDriver
Returns the next available history publish tag.

Specified by:
readNextPublishTag in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
Returns:
the next available history publish tag
See Also:
I_CmsHistoryDriver.readNextPublishTag(org.opencms.db.CmsDbContext)

readPrincipal

public CmsHistoryPrincipal readPrincipal(CmsDbContext dbc,
                                         CmsUUID principalId)
                                  throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads an historical principal entry.

Specified by:
readPrincipal in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
principalId - the id of the principal to retrieve
Returns:
the historical principal entry
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readPrincipal(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)

readProject

public CmsHistoryProject readProject(CmsDbContext dbc,
                                     CmsUUID projectId)
                              throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads the latest historical project version with the given id.

Specified by:
readProject in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
projectId - the project id
Returns:
the requested historical project
Throws:
CmsDataAccessException - is something goes wrong
See Also:
I_CmsHistoryDriver.readProject(org.opencms.db.CmsDbContext, CmsUUID)

readProject

public CmsHistoryProject readProject(CmsDbContext dbc,
                                     int publishTag)
                              throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads an historical project version.

Specified by:
readProject in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
publishTag - the publish tag
Returns:
the requested historical project
Throws:
CmsDataAccessException - is something goes wrong
See Also:
I_CmsHistoryDriver.readProject(org.opencms.db.CmsDbContext, int)

readProjectResources

public java.util.List readProjectResources(CmsDbContext dbc,
                                           int publishTag)
                                    throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads all resources that belong to the historical project identified by the given publish tag.

Specified by:
readProjectResources in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
publishTag - the publish tag
Returns:
all resources that belong to the historical project identified by the given publish tag
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readProjectResources(org.opencms.db.CmsDbContext, int)

readProjects

public java.util.List readProjects(CmsDbContext dbc)
                            throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Returns all projects from the history.

Specified by:
readProjects in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
Returns:
list of CmsHistoryProject objects with all projects from history.
Throws:
CmsDataAccessException - if an error occurs
See Also:
I_CmsHistoryDriver.readProjects(org.opencms.db.CmsDbContext)

readProperties

public java.util.List readProperties(CmsDbContext dbc,
                                     I_CmsHistoryResource resource)
                              throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Returns a list of all properties of a historical file or folder.

Specified by:
readProperties in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resource - the resource to read the properties from
Returns:
a list of CmsProperty objects
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readProperties(org.opencms.db.CmsDbContext, org.opencms.file.history.I_CmsHistoryResource)

readPropertyDefinition

public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc,
                                                    java.lang.String name)
                                             throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads a property definition with the given name.

Specified by:
readPropertyDefinition in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
name - the name of the property definition to read
Returns:
the property definition that corresponds to the given arguments - or null if not found
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String)

readPublishTag

public int readPublishTag(CmsDbContext dbc,
                          long maxdate)
                   throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Gets the publish tag of the first historical project after a given date.

This method is used during the deletion process of older historical data.

Specified by:
readPublishTag in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
maxdate - the date to compare the historical projects with
Returns:
publish tag of the first historical project after maxdate
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readPublishTag(org.opencms.db.CmsDbContext, long)

readResource

public I_CmsHistoryResource readResource(CmsDbContext dbc,
                                         CmsUUID structureId,
                                         int version)
                                  throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Reads a historical resource version without including the file content.

Specified by:
readResource in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
structureId - the structure id of the resource to read
version - the desired version number
Returns:
the historical resource version
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.readResource(CmsDbContext, CmsUUID, int)

setDriverManager

public void setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver.

Parameters:
driverManager - the new driver manager

setSqlManager

public void setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager of this driver.

Parameters:
sqlManager - the new SQL manager

writePrincipal

public void writePrincipal(CmsDbContext dbc,
                           I_CmsPrincipal principal)
                    throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Writes an historical entry for the given principal.

Specified by:
writePrincipal in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
principal - the principal to write
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.writePrincipal(CmsDbContext, org.opencms.security.I_CmsPrincipal)

writeProject

public void writeProject(CmsDbContext dbc,
                         int publishTag,
                         long publishDate)
                  throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Creates an historical entry for the current project.

Specified by:
writeProject in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
publishTag - the publish tag
publishDate - long timestamp when the current project was published
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.writeProject(org.opencms.db.CmsDbContext, int, long)

writeProperties

public void writeProperties(CmsDbContext dbc,
                            CmsResource resource,
                            java.util.List properties,
                            int publishTag)
                     throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Writes the properties of a resource to the history.

Specified by:
writeProperties in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resource - the resource of the properties
properties - the properties to write
publishTag - the publish tag
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.writeProperties(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, int)

writeResource

public void writeResource(CmsDbContext dbc,
                          CmsResource resource,
                          java.util.List properties,
                          int publishTag)
                   throws CmsDataAccessException
Description copied from interface: I_CmsHistoryDriver
Writes a resource to the history.

Specified by:
writeResource in interface I_CmsHistoryDriver
Parameters:
dbc - the current database context
resource - the resource that is written to the history
properties - the properties of the resource
publishTag - the publish tag
Throws:
CmsDataAccessException - if something goes wrong
See Also:
I_CmsHistoryDriver.writeResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, int)

internalAddToPropMap

protected void internalAddToPropMap(java.util.Map propertyMap,
                                    I_CmsHistoryResource resource,
                                    java.lang.String propertyKey,
                                    java.lang.String propertyValue,
                                    int mappingType)
                             throws CmsDbConsistencyException
Updates the property map for the given resource with the given property data.

Parameters:
propertyMap - the map to update
resource - the resource the properties belong to
propertyKey - the property key
propertyValue - the property value
mappingType - the mapping type
Throws:
CmsDbConsistencyException - if the mapping type is wrong

internalCleanup

protected void internalCleanup(CmsDbContext dbc,
                               I_CmsHistoryResource resource)
                        throws CmsDataAccessException
Deletes all historical entries of subresources of a folder without any historical netry left.

Parameters:
dbc - the current database context
resource - the resource to check
Throws:
CmsDataAccessException - if something goes wrong

internalCountProperties

protected int internalCountProperties(CmsDbContext dbc,
                                      CmsPropertyDefinition metadef,
                                      CmsUUID projectId)
                               throws CmsDataAccessException
Returns the amount of properties for a propertydefinition.

Parameters:
dbc - the current database context
metadef - the propertydefinition to test
projectId - the ID of the current project
Returns:
the amount of properties for a propertydefinition
Throws:
CmsDataAccessException - if something goes wrong

internalCreateProject

protected CmsHistoryProject internalCreateProject(java.sql.ResultSet res,
                                                  java.util.List resources)
                                           throws java.sql.SQLException
Creates a historical project from the given result set and resources.

Parameters:
res - the resource set
resources - the historical resources
Returns:
the historical project
Throws:
java.sql.SQLException - if something goes wrong

internalCreateResource

protected I_CmsHistoryResource internalCreateResource(java.sql.ResultSet res)
                                               throws java.sql.SQLException
Creates a valid I_CmsHistoryResource instance from a JDBC ResultSet.

Parameters:
res - the JDBC result set
Returns:
the new historical resource instance
Throws:
java.sql.SQLException - if a requested attribute was not found in the result set

internalMergeResource

protected I_CmsHistoryResource internalMergeResource(I_CmsHistoryResource histRes,
                                                     java.sql.ResultSet res,
                                                     int versionOffset)
                                              throws java.sql.SQLException
Merges an historical entry for a sibling, based on the structure data from the given historical resource and result set for the resource entry.

Parameters:
histRes - the original historical entry
res - the result set of the resource entry
versionOffset - the offset for the structure version
Returns:
a merged historical entry for the sibling
Throws:
java.sql.SQLException - if something goes wrong

internalValidateResource

protected boolean internalValidateResource(CmsDbContext dbc,
                                           CmsResource resource,
                                           int publishTag)
                                    throws CmsDataAccessException
Tests if a history resource does exist.

Parameters:
dbc - the current database context
resource - the resource to test
publishTag - the publish tag of the resource to test
Returns:
true if the resource already exists, false otherwise
Throws:
CmsDataAccessException - if something goes wrong