|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
public interface I_CmsHistoryDriver
Definitions of all required history driver methods.
A history driver is a driver to write projects, resources and properties of resources optionally to a second set of history database tables while resources get published. A unique publish tag ID is used to identify a set of resource that were saved during one publish process.
| Field Summary | |
|---|---|
static int |
DRIVER_TYPE_ID
The type ID to identify history driver implementations. |
| 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 histResource,
int versionsToKeep,
long time)
Deletes all historical versions of a resource keeping maximal versionsToKeep versions. |
void |
deletePropertyDefinition(CmsDbContext dbc,
CmsPropertyDefinition propertyDef)
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. |
CmsSqlManager |
initSqlManager(java.lang.String classname)
Initializes the SQL manager for this driver. |
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 publishTag)
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 historicalResource)
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 |
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. |
| Field Detail |
|---|
static final int DRIVER_TYPE_ID
| Method Detail |
|---|
CmsPropertyDefinition createPropertyDefinition(CmsDbContext dbc,
java.lang.String name,
CmsPropertyDefinition.CmsPropertyType type)
throws CmsDataAccessException
dbc - the current database contextname - the name of the property definitiontype - the type of the property definition
CmsDataAccessException - if something goes wrong
int deleteEntries(CmsDbContext dbc,
I_CmsHistoryResource histResource,
int versionsToKeep,
long time)
throws CmsDataAccessException
versionsToKeep versions.
dbc - the current database contexthistResource - 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 negative
CmsDataAccessException - if something goes wrong
void deletePropertyDefinition(CmsDbContext dbc,
CmsPropertyDefinition propertyDef)
throws CmsDataAccessException
dbc - the current database contextpropertyDef - the property definition to be deleted
CmsDataAccessException - if something goes wrong
void destroy()
throws java.lang.Throwable
java.lang.Throwable - if something goes wrong
java.util.List getAllDeletedEntries(CmsDbContext dbc)
throws CmsDataAccessException
dbc - the current database context
I_CmsHistoryResource objects
CmsDataAccessException - if something goes wrong
java.util.List getAllNotDeletedEntries(CmsDbContext dbc)
throws CmsDataAccessException
dbc - the current database context
I_CmsHistoryResource objects
CmsDataAccessException - if something goes wrongCmsSqlManager getSqlManager()
CmsSqlManager initSqlManager(java.lang.String classname)
classname - the classname of the SQL manager
java.util.List readAllAvailableVersions(CmsDbContext dbc,
CmsUUID structureId)
throws CmsDataAccessException
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.
dbc - the current database contextstructureId - the structure id
I_CmsHistoryResource objects
CmsDataAccessException - if something goes wrong
byte[] readContent(CmsDbContext dbc,
CmsUUID resourceId,
int publishTag)
throws CmsDataAccessException
dbc - the current database contextresourceId - the resource id of the resource to read the content forpublishTag - the publish tag of the version
CmsDataAccessException - if something goes wrong
java.util.List readDeletedResources(CmsDbContext dbc,
CmsUUID structureId,
CmsUUID userId)
throws CmsDataAccessException
dbc - 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 all
I_CmsHistoryResource objects
CmsDataAccessException - if something goes wrong
I_CmsHistoryResource readFile(CmsDbContext dbc,
CmsUUID structureId,
int publishTag)
throws CmsDataAccessException
readResource(CmsDbContext, CmsUUID, int) instead
but notice that the publishTag != version
dbc - the current database contextstructureId - the structure id of the file to readpublishTag - the desired publish tag of the file
CmsDataAccessException - if something goes wrong
int readLastVersion(CmsDbContext dbc,
CmsUUID structureId)
throws CmsDataAccessException
dbc - the current database contextstructureId - the structure ID of the resource
CmsDataAccessException - if something goes wrong
int readMaxPublishTag(CmsDbContext dbc,
CmsUUID resourceId)
throws CmsDataAccessException
dbc - the current database contextresourceId - the id of the resource the get the publish tag for
CmsDataAccessException - if something goes wrongint readNextPublishTag(CmsDbContext dbc)
dbc - the current database context
CmsHistoryPrincipal readPrincipal(CmsDbContext dbc,
CmsUUID principalId)
throws CmsDataAccessException
dbc - the current database contextprincipalId - the id of the principal to retrieve
CmsDataAccessException - if something goes wrong
CmsHistoryProject readProject(CmsDbContext dbc,
CmsUUID projectId)
throws CmsDataAccessException
dbc - the current database contextprojectId - the project id
CmsDataAccessException - is something goes wrong
CmsHistoryProject readProject(CmsDbContext dbc,
int publishTag)
throws CmsDataAccessException
dbc - the current database contextpublishTag - the publish tag
CmsDataAccessException - is something goes wrong
java.util.List readProjectResources(CmsDbContext dbc,
int publishTag)
throws CmsDataAccessException
dbc - the current database contextpublishTag - the publish tag
CmsDataAccessException - if something goes wrong
java.util.List readProjects(CmsDbContext dbc)
throws CmsDataAccessException
dbc - the current database context
CmsHistoryProject objects
with all projects from history.
CmsDataAccessException - if an error occurs
java.util.List readProperties(CmsDbContext dbc,
I_CmsHistoryResource historicalResource)
throws CmsDataAccessException
dbc - the current database contexthistoricalResource - the resource to read the properties from
CmsProperty objects
CmsDataAccessException - if something goes wrong
CmsPropertyDefinition readPropertyDefinition(CmsDbContext dbc,
java.lang.String name)
throws CmsDataAccessException
dbc - the current database contextname - the name of the property definition to read
null if not found
CmsDataAccessException - if something goes wrong
int readPublishTag(CmsDbContext dbc,
long maxdate)
throws CmsDataAccessException
This method is used during the deletion process of older historical data.
dbc - the current database contextmaxdate - the date to compare the historical projects with
CmsDataAccessException - if something goes wrong
I_CmsHistoryResource readResource(CmsDbContext dbc,
CmsUUID structureId,
int version)
throws CmsDataAccessException
dbc - the current database contextstructureId - the structure id of the resource to readversion - the desired version number
CmsDataAccessException - if something goes wrong
void writePrincipal(CmsDbContext dbc,
I_CmsPrincipal principal)
throws CmsDataAccessException
dbc - the current database contextprincipal - the principal to write
CmsDataAccessException - if something goes wrong
void writeProject(CmsDbContext dbc,
int publishTag,
long publishDate)
throws CmsDataAccessException
dbc - the current database contextpublishTag - the publish tagpublishDate - long timestamp when the current project was published
CmsDataAccessException - if something goes wrong
void writeProperties(CmsDbContext dbc,
CmsResource resource,
java.util.List properties,
int publishTag)
throws CmsDataAccessException
dbc - the current database contextresource - the resource of the propertiesproperties - the properties to writepublishTag - the publish tag
CmsDataAccessException - if something goes wrong
void writeResource(CmsDbContext dbc,
CmsResource resource,
java.util.List properties,
int publishTag)
throws CmsDataAccessException
dbc - the current database contextresource - the resource that is written to the historyproperties - the properties of the resourcepublishTag - the publish tag
CmsDataAccessException - if something goes wrong
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||