public class CmsHistoryDriver extends java.lang.Object implements I_CmsDriver, I_CmsHistoryDriver
| 限定符和类型 | 字段和说明 |
|---|---|
protected CmsDriverManager |
m_driverManager
The driver manager instance.
|
protected CmsSqlManager |
m_sqlManager
The SQL manager instance.
|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITIONDRIVER_TYPE_ID| 构造器和说明 |
|---|
CmsHistoryDriver() |
| 限定符和类型 | 方法和说明 |
|---|---|
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<I_CmsHistoryResource> |
getAllDeletedEntries(CmsDbContext dbc)
Returns all historical resources (of deleted resources).
|
java.util.List<I_CmsHistoryResource> |
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<java.lang.String> 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<java.lang.String,CmsProperty> 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(CmsDAOHistoryProjects hp,
java.util.List<java.lang.String> resources)
Creates a historical project from the given result set and resources.
|
protected I_CmsHistoryResource |
internalCreateResource(java.lang.Object[] res)
Creates a valid
I_CmsHistoryResource instance from a JDBC ResultSet. |
protected I_CmsHistoryResource |
internalMergeResource(I_CmsHistoryResource histRes,
CmsDAOHistoryResources hr,
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<I_CmsHistoryResource> |
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<I_CmsHistoryResource> |
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)
已过时。
|
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<java.lang.String> |
readProjectResources(CmsDbContext dbc,
int publishTag)
Reads all resources that belong to the historical project identified by the given publish tag.
|
java.util.List<CmsHistoryProject> |
readProjects(CmsDbContext dbc)
Returns all projects from the history.
|
java.util.List<CmsProperty> |
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 if possible.
|
void |
setSqlManager(CmsSqlManager sqlManager)
Sets the SQL manager for this driver if possible.
|
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<CmsProperty> properties,
int publishTag)
Writes the properties of a resource to the history.
|
void |
writeResource(CmsDbContext dbc,
CmsResource resource,
java.util.List<CmsProperty> properties,
int publishTag)
Writes a resource to the history.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringprotected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
public CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc, java.lang.String name, CmsPropertyDefinition.CmsPropertyType type) throws CmsDataAccessException
I_CmsHistoryDrivercreatePropertyDefinition 在接口中 I_CmsHistoryDriverdbc - the current database contextname - the name of the property definitiontype - the type of the property definitionCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.createPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String, org.opencms.file.CmsPropertyDefinition.CmsPropertyType)public int deleteEntries(CmsDbContext dbc, I_CmsHistoryResource resource, int versionsToKeep, long time) throws CmsDataAccessException
I_CmsHistoryDriverversionsToKeep versions.deleteEntries 在接口中 I_CmsHistoryDriverdbc - the current database contextresource - the historical resource to delete versions forversionsToKeep - the number of versions to keeptime - deleted resources older than this will also be deleted, is ignored if negativeCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.deleteEntries(org.opencms.db.CmsDbContext, org.opencms.file.history.I_CmsHistoryResource, int, long)public void deletePropertyDefinition(CmsDbContext dbc, CmsPropertyDefinition metadef) throws CmsDataAccessException
I_CmsHistoryDriverdeletePropertyDefinition 在接口中 I_CmsHistoryDriverdbc - the current database contextmetadef - the property definition to be deletedCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.deletePropertyDefinition(org.opencms.db.CmsDbContext, org.opencms.file.CmsPropertyDefinition)public void destroy()
throws java.lang.Throwable
I_CmsHistoryDriverdestroy 在接口中 I_CmsHistoryDriverjava.lang.Throwable - if something goes wrongI_CmsHistoryDriver.destroy()public java.util.List<I_CmsHistoryResource> getAllDeletedEntries(CmsDbContext dbc) throws CmsDataAccessException
I_CmsHistoryDrivergetAllDeletedEntries 在接口中 I_CmsHistoryDriverdbc - the current database contextI_CmsHistoryResource objectsCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.getAllDeletedEntries(org.opencms.db.CmsDbContext)public java.util.List<I_CmsHistoryResource> getAllNotDeletedEntries(CmsDbContext dbc) throws CmsDataAccessException
I_CmsHistoryDrivergetAllNotDeletedEntries 在接口中 I_CmsHistoryDriverdbc - the current database contextI_CmsHistoryResource objectsCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.getAllNotDeletedEntries(CmsDbContext)public CmsSqlManager getSqlManager()
I_CmsHistoryDrivergetSqlManager 在接口中 I_CmsHistoryDriverI_CmsHistoryDriver.getSqlManager()public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List<java.lang.String> successiveDrivers, CmsDriverManager driverManager)
I_CmsDriverinit 在接口中 I_CmsDriverdbc - the current database contextconfigurationManager - the configuration managersuccessiveDrivers - a list of successive drivers to be initializeddriverManager - the initialized OpenCms driver managerI_CmsDriver.init(org.opencms.db.CmsDbContext, org.opencms.configuration.CmsConfigurationManager, java.util.List, org.opencms.db.CmsDriverManager)public CmsSqlManager initSqlManager(java.lang.String classname)
I_CmsHistoryDriverinitSqlManager 在接口中 I_CmsHistoryDriverclassname - the classname of the SQL managerI_CmsHistoryDriver.initSqlManager(java.lang.String)public java.util.List<I_CmsHistoryResource> readAllAvailableVersions(CmsDbContext dbc, CmsUUID structureId) throws CmsDataAccessException
I_CmsHistoryDriver
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.
readAllAvailableVersions 在接口中 I_CmsHistoryDriverdbc - the current database contextstructureId - the structure idI_CmsHistoryResource objectsCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readAllAvailableVersions(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public byte[] readContent(CmsDbContext dbc, CmsUUID resourceId, int publishTag) throws CmsDataAccessException
I_CmsHistoryDriverreadContent 在接口中 I_CmsHistoryDriverdbc - the current database contextresourceId - the resource id of the resource to read the content forpublishTag - the publish tag of the versionCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readContent(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, int)public java.util.List<I_CmsHistoryResource> readDeletedResources(CmsDbContext dbc, CmsUUID structureId, CmsUUID userId) throws CmsDataAccessException
I_CmsHistoryDriverreadDeletedResources 在接口中 I_CmsHistoryDriverdbc - the current db contextstructureId - the structure id of the parent resource to read the deleted resources fromuserId - the id of the user that deleted the resources, or null to retrieve them allI_CmsHistoryResource objectsCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readDeletedResources(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.util.CmsUUID)@Deprecated public I_CmsHistoryResource readFile(CmsDbContext dbc, CmsUUID structureId, int tagId) throws CmsDataAccessException
TODO: check if this method is used somewhere TODO: remove this method
dbc - the db contextstructureId - the structure idtagId - the tag idCmsDataAccessException - if something goes wrongpublic int readLastVersion(CmsDbContext dbc, CmsUUID structureId) throws CmsDataAccessException
I_CmsHistoryDriverreadLastVersion 在接口中 I_CmsHistoryDriverdbc - the current database contextstructureId - the structure ID of the resourceCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readLastVersion(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public int readMaxPublishTag(CmsDbContext dbc, CmsUUID resourceId) throws CmsDataAccessException
I_CmsHistoryDriverreadMaxPublishTag 在接口中 I_CmsHistoryDriverdbc - the current database contextresourceId - the id of the resource the get the publish tag forCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readMaxPublishTag(CmsDbContext, CmsUUID)public int readNextPublishTag(CmsDbContext dbc)
I_CmsHistoryDriverreadNextPublishTag 在接口中 I_CmsHistoryDriverdbc - the current database contextI_CmsHistoryDriver.readNextPublishTag(org.opencms.db.CmsDbContext)public CmsHistoryPrincipal readPrincipal(CmsDbContext dbc, CmsUUID principalId) throws CmsDataAccessException
I_CmsHistoryDriverreadPrincipal 在接口中 I_CmsHistoryDriverdbc - the current database contextprincipalId - the id of the principal to retrieveCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readPrincipal(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)public CmsHistoryProject readProject(CmsDbContext dbc, CmsUUID projectId) throws CmsDataAccessException
I_CmsHistoryDriverreadProject 在接口中 I_CmsHistoryDriverdbc - the current database contextprojectId - the project idCmsDataAccessException - is something goes wrongI_CmsHistoryDriver.readProject(org.opencms.db.CmsDbContext, CmsUUID)public CmsHistoryProject readProject(CmsDbContext dbc, int publishTag) throws CmsDataAccessException
I_CmsHistoryDriverreadProject 在接口中 I_CmsHistoryDriverdbc - the current database contextpublishTag - the publish tagCmsDataAccessException - is something goes wrongI_CmsHistoryDriver.readProject(org.opencms.db.CmsDbContext, int)public java.util.List<java.lang.String> readProjectResources(CmsDbContext dbc, int publishTag) throws CmsDataAccessException
I_CmsHistoryDriverreadProjectResources 在接口中 I_CmsHistoryDriverdbc - the current database contextpublishTag - the publish tagCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readProjectResources(org.opencms.db.CmsDbContext, int)public java.util.List<CmsHistoryProject> readProjects(CmsDbContext dbc) throws CmsDataAccessException
I_CmsHistoryDriverreadProjects 在接口中 I_CmsHistoryDriverdbc - the current database contextCmsHistoryProject objects
with all projects from history.CmsDataAccessException - if an error occursI_CmsHistoryDriver.readProjects(org.opencms.db.CmsDbContext)public java.util.List<CmsProperty> readProperties(CmsDbContext dbc, I_CmsHistoryResource resource) throws CmsDataAccessException
I_CmsHistoryDriverreadProperties 在接口中 I_CmsHistoryDriverdbc - the current database contextresource - the resource to read the properties fromCmsProperty objectsCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readProperties(org.opencms.db.CmsDbContext, org.opencms.file.history.I_CmsHistoryResource)public CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc, java.lang.String name) throws CmsDataAccessException
I_CmsHistoryDriverreadPropertyDefinition 在接口中 I_CmsHistoryDriverdbc - the current database contextname - the name of the property definition to readnull if not foundCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readPropertyDefinition(org.opencms.db.CmsDbContext, java.lang.String)public int readPublishTag(CmsDbContext dbc, long maxdate) throws CmsDataAccessException
I_CmsHistoryDriverThis method is used during the deletion process of older historical data.
readPublishTag 在接口中 I_CmsHistoryDriverdbc - the current database contextmaxdate - the date to compare the historical projects withCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readPublishTag(org.opencms.db.CmsDbContext, long)public I_CmsHistoryResource readResource(CmsDbContext dbc, CmsUUID structureId, int version) throws CmsDataAccessException
I_CmsHistoryDriverreadResource 在接口中 I_CmsHistoryDriverdbc - the current database contextstructureId - the structure id of the resource to readversion - the desired version numberCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.readResource(CmsDbContext, CmsUUID, int)public void setDriverManager(CmsDriverManager driverManager)
I_CmsHistoryDriversetDriverManager 在接口中 I_CmsHistoryDriverdriverManager - the new driver managerI_CmsHistoryDriver.setDriverManager(org.opencms.db.CmsDriverManager)public void setSqlManager(CmsSqlManager sqlManager)
I_CmsHistoryDriversetSqlManager 在接口中 I_CmsHistoryDriversqlManager - the new SQL managerI_CmsHistoryDriver.setSqlManager(org.opencms.db.CmsSqlManager)public void writePrincipal(CmsDbContext dbc, I_CmsPrincipal principal) throws CmsDataAccessException
I_CmsHistoryDriverwritePrincipal 在接口中 I_CmsHistoryDriverdbc - the current database contextprincipal - the principal to writeCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.writePrincipal(CmsDbContext, org.opencms.security.I_CmsPrincipal)public void writeProject(CmsDbContext dbc, int publishTag, long publishDate) throws CmsDataAccessException
I_CmsHistoryDriverwriteProject 在接口中 I_CmsHistoryDriverdbc - the current database contextpublishTag - the publish tagpublishDate - long timestamp when the current project was publishedCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.writeProject(org.opencms.db.CmsDbContext, int, long)public void writeProperties(CmsDbContext dbc, CmsResource resource, java.util.List<CmsProperty> properties, int publishTag) throws CmsDataAccessException
I_CmsHistoryDriverwriteProperties 在接口中 I_CmsHistoryDriverdbc - the current database contextresource - the resource of the propertiesproperties - the properties to writepublishTag - the publish tagCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.writeProperties(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, int)public void writeResource(CmsDbContext dbc, CmsResource resource, java.util.List<CmsProperty> properties, int publishTag) throws CmsDataAccessException
I_CmsHistoryDriverwriteResource 在接口中 I_CmsHistoryDriverdbc - the current database contextresource - the resource that is written to the historyproperties - the properties of the resourcepublishTag - the publish tagCmsDataAccessException - if something goes wrongI_CmsHistoryDriver.writeResource(org.opencms.db.CmsDbContext, org.opencms.file.CmsResource, java.util.List, int)protected void internalAddToPropMap(java.util.Map<java.lang.String,CmsProperty> propertyMap, I_CmsHistoryResource resource, java.lang.String propertyKey, java.lang.String propertyValue, int mappingType) throws CmsDbConsistencyException
propertyMap - the map to updateresource - the resource the properties belong topropertyKey - the property keypropertyValue - the property valuemappingType - the mapping typeCmsDbConsistencyException - if the mapping type is wrongprotected void internalCleanup(CmsDbContext dbc, I_CmsHistoryResource resource) throws CmsDataAccessException
dbc - the current database contextresource - the resource to checkCmsDataAccessException - if something goes wrongprotected int internalCountProperties(CmsDbContext dbc, CmsPropertyDefinition metadef, CmsUUID projectId) throws CmsDataAccessException
dbc - the current database contextmetadef - the propertydefinition to testprojectId - the ID of the current projectCmsDataAccessException - if something goes wrongprotected CmsHistoryProject internalCreateProject(CmsDAOHistoryProjects hp, java.util.List<java.lang.String> resources) throws javax.persistence.PersistenceException
hp - the CmsDAOHistoryProjects instanceresources - the historical resourcesjavax.persistence.PersistenceException - if something goes wrongprotected I_CmsHistoryResource internalCreateResource(java.lang.Object[] res)
I_CmsHistoryResource instance from a JDBC ResultSet.res - the JDBC result setprotected I_CmsHistoryResource internalMergeResource(I_CmsHistoryResource histRes, CmsDAOHistoryResources hr, int versionOffset)
histRes - the original historical entryhr - the CmsDAOHistoryResources instance of the resource entryversionOffset - the offset for the structure versionprotected boolean internalValidateResource(CmsDbContext dbc, CmsResource resource, int publishTag) throws CmsDataAccessException
dbc - the current database contextresource - the resource to testpublishTag - the publish tag of the resource to testtrue if the resource already exists, false otherwiseCmsDataAccessException - if something goes wrong