public class CmsProjectDriver extends java.lang.Object implements I_CmsDriver, I_CmsProjectDriver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DBC_ATTR_READ_PROJECT_FOR_RESOURCE
Attribute name for reading the project of a resource.
|
protected CmsDriverManager |
m_driverManager
The driver manager.
|
protected CmsSqlManager |
m_sqlManager
The SQL manager.
|
AND_CONDITION, BEGIN_CONDITION, BEGIN_EXCLUDE_CONDITION, BEGIN_INCLUDE_CONDITION, END_CONDITION, OR_CONDITION
DRIVER_TYPE_ID, SETUP_PROJECT_NAME, TEMP_FILE_PROJECT_NAME
Constructor and Description |
---|
CmsProjectDriver() |
Modifier and Type | Method and Description |
---|---|
CmsProject |
createProject(CmsDbContext dbc,
CmsUUID id,
CmsUser owner,
CmsGroup group,
CmsGroup managergroup,
java.lang.String projectFqn,
java.lang.String description,
int flags,
CmsProject.CmsProjectType type)
Creates a new project.
|
void |
createProjectResource(CmsDbContext dbc,
CmsUUID projectId,
java.lang.String resourcePath)
Creates a new projectResource from a given CmsResource object.
|
void |
createPublishJob(CmsDbContext dbc,
CmsPublishJobInfoBean publishJob)
Inserts an entry for a publish job .
|
protected CmsPublishJobInfoBean |
createPublishJobInfoBean(java.sql.ResultSet res)
Creates a
CmsPublishJobInfoBean from a result set. |
void |
deleteAllStaticExportPublishedResources(CmsDbContext dbc,
int linkType)
Deletes all entries in the published resource table.
|
void |
deleteLog(CmsDbContext dbc,
CmsLogFilter filter)
Deletes log entries matching the given filter.
|
void |
deleteProject(CmsDbContext dbc,
CmsProject project)
Deletes a project from the cms.
|
void |
deleteProjectResource(CmsDbContext dbc,
CmsUUID projectId,
java.lang.String resourceName)
Delete a projectResource from an given CmsResource object.
|
void |
deleteProjectResources(CmsDbContext dbc,
CmsProject project)
Deletes a specified project.
|
void |
deletePublishHistory(CmsDbContext dbc,
CmsUUID projectId,
int maxpublishTag)
Deletes all publish history entries with publish tags >=0 and < the specified max. publish tag.
|
void |
deletePublishHistoryEntry(CmsDbContext dbc,
CmsUUID publishHistoryId,
CmsPublishedResource publishedResource)
Deletes a publish history entry with publish tags >=0 and < the specified max. publish tag.
|
void |
deletePublishJob(CmsDbContext dbc,
CmsUUID publishHistoryId)
Deletes a publish job identified by its history id.
|
void |
deletePublishList(CmsDbContext dbc,
CmsUUID publishHistoryId)
Deletes the publish list assigned to a publish job.
|
void |
deleteStaticExportPublishedResource(CmsDbContext dbc,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter)
Deletes an entry in the published resource table.
|
void |
deleteUserPublishListEntries(CmsDbContext dbc,
java.util.List<CmsUserPublishListEntry> publishListDeletions)
Deletes multiple publish list entries from the database.
|
void |
destroy()
Destroys this driver.
|
void |
fillDefaults(CmsDbContext dbc)
Fills the OpenCms database tables with default values.
|
protected CmsResourceState |
fixMovedResource(CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
CmsUUID publishHistoryId,
int publishTag)
Checks if the given resource (by id) is available in the online project,
if there exists a resource with a different path (a moved file), then the
online entry is moved to the right (new) location before publishing.
|
protected java.lang.String |
getParameterString(java.util.Collection<?> data)
Returns a SQL parameter string for the given data.
|
CmsSqlManager |
getSqlManager()
Returns the SqlManager of this driver.
|
java.util.List<CmsResource> |
getUsersPubList(CmsDbContext dbc,
CmsUUID userId)
Returns the given user's publish list.
|
protected java.util.List<CmsResource> |
getUsersPubListFromLog(CmsDbContext dbc,
CmsUUID userId)
Implementation of reading the user publish list which uses the log table.
|
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 CmsProject |
internalCreateProject(java.sql.ResultSet res)
Creates a new project from the current row of the given result set.
|
protected CmsPublishList |
internalDeserializePublishList(byte[] bytes)
Builds a publish list from serialized data.
|
protected CmsLogEntry |
internalReadLogEntry(java.sql.ResultSet res)
Creates a new
CmsLogEntry object from the given result set entry. |
protected void |
internalResetResourceState(CmsDbContext dbc,
CmsResource resource)
Resets the state to UNCHANGED for a specified resource.
|
protected byte[] |
internalSerializePublishList(CmsPublishList publishList)
Serialize publish list to write it as byte array to the database.
|
protected void |
internalWriteHistory(CmsDbContext dbc,
CmsResource resource,
CmsResourceState state,
java.util.List<CmsProperty> properties,
CmsUUID publishHistoryId,
int publishTag)
Writes the needed history entries.
|
void |
log(CmsDbContext dbc,
java.util.List<CmsLogEntry> logEntries)
Logs the given log entries.
|
protected CmsPair<java.lang.String,java.util.List<I_CmsPreparedStatementParameter>> |
prepareLogConditions(CmsLogFilter filter)
Build the whole WHERE SQL statement part for the given log entry filter.
|
protected void |
publishChangedFile(CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
java.util.Set<CmsUUID> publishedResourceIds,
CmsUUID publishHistoryId,
int publishTag)
Publishes a changed file.
|
protected void |
publishDeletedFile(CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
CmsUUID publishHistoryId,
int publishTag)
Publishes a deleted file.
|
void |
publishDeletedFolder(CmsDbContext dbc,
I_CmsReport report,
int m,
int n,
CmsProject onlineProject,
CmsFolder currentFolder,
CmsUUID publishHistoryId,
int publishTag)
Publishes a deleted folder.
|
void |
publishFile(CmsDbContext dbc,
I_CmsReport report,
int m,
int n,
CmsProject onlineProject,
CmsResource offlineResource,
java.util.Set<CmsUUID> publishedContentIds,
CmsUUID publishHistoryId,
int publishTag)
Publishes a new, changed or deleted file.
|
CmsFile |
publishFileContent(CmsDbContext dbc,
CmsProject offlineProject,
CmsProject onlineProject,
CmsResource offlineResource,
java.util.Set<CmsUUID> publishedResourceIds,
boolean needToUpdateContent,
int publishTag)
Publishes the content record of a file.
|
void |
publishFolder(CmsDbContext dbc,
I_CmsReport report,
int m,
int n,
CmsProject onlineProject,
CmsFolder offlineFolder,
CmsUUID publishHistoryId,
int publishTag)
Publishes a new or changed folder.
|
protected void |
publishNewFile(CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
java.util.Set<CmsUUID> publishedContentIds,
CmsUUID publishHistoryId,
int publishTag)
Publishes a new file.
|
void |
publishProject(CmsDbContext dbc,
I_CmsReport report,
CmsProject onlineProject,
CmsPublishList publishList,
int publishTag)
Publishes a specified project to the online project.
|
java.util.List<CmsLock> |
readLocks(CmsDbContext dbc)
Reads the
that were saved to the database in the previous run of OpenCms. |
java.util.List<CmsLogEntry> |
readLog(CmsDbContext dbc,
CmsLogFilter filter)
Reads log entries matching the given filter.
|
CmsProject |
readProject(CmsDbContext dbc,
CmsUUID id)
Reads a project given the projects id.
|
CmsProject |
readProject(CmsDbContext dbc,
java.lang.String projectFqn)
Reads a project.
|
java.lang.String |
readProjectResource(CmsDbContext dbc,
CmsUUID projectId,
java.lang.String resourcePath)
Reads the project resource path for a given project and resource path,
to validate if a resource path for a given project already exists.
|
java.util.List<java.lang.String> |
readProjectResources(CmsDbContext dbc,
CmsProject project)
Reads the project resources for a specified project.
|
java.util.List<CmsProject> |
readProjects(CmsDbContext dbc,
java.lang.String ouFqn)
Returns all projects in the given organizational unit.
|
java.util.List<CmsProject> |
readProjectsForGroup(CmsDbContext dbc,
CmsGroup group)
Returns all projects, which are accessible by a group.
|
java.util.List<CmsProject> |
readProjectsForManagerGroup(CmsDbContext dbc,
CmsGroup group)
Returns all projects, which are manageable by a group.
|
java.util.List<CmsProject> |
readProjectsForResource(CmsDbContext dbc,
java.lang.String rootPath)
Returns the projects of a given resource.
|
java.util.List<CmsProject> |
readProjectsForUser(CmsDbContext dbc,
CmsUser user)
Reads all projects which are owned by a specified user.
|
java.util.List<CmsPublishedResource> |
readPublishedResources(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the resources that were published during a publish process for a given publish history ID.
|
CmsPublishJobInfoBean |
readPublishJob(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads a single publish job identified by its publish history id.
|
java.util.List<CmsPublishJobInfoBean> |
readPublishJobs(CmsDbContext dbc,
long startTime,
long endTime)
Reads all publish jobs finished in the given time range.
|
CmsPublishList |
readPublishList(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the publish list assigned to a publish job.
|
byte[] |
readPublishReportContents(CmsDbContext dbc,
CmsUUID publishHistoryId)
Reads the publish report assigned to a publish job.
|
java.lang.String |
readStaticExportPublishedResourceParameters(CmsDbContext dbc,
java.lang.String rfsName)
Returns the parameters of a resource in the table of all published template resources.
|
java.util.List<java.lang.String> |
readStaticExportResources(CmsDbContext dbc,
int parameterResources,
long timestamp)
Returns a list of all template resources which must be processed during a static export.
|
void |
setDriverManager(CmsDriverManager driverManager)
Sets the driver manager for this driver if possible.
|
void |
setSqlManager(CmsSqlManager manager)
Sets the SQL manager for this driver if possible.
|
void |
unmarkProjectResources(CmsDbContext dbc,
CmsProject project)
Removes the project id from all resources within a project.
|
void |
writeLocks(CmsDbContext dbc,
java.util.List<CmsLock> locks)
Writes the
to the database for reuse in the next run of OpenCms. |
void |
writeProject(CmsDbContext dbc,
CmsProject project)
Writes an already existing project.
|
void |
writePublishHistory(CmsDbContext dbc,
CmsUUID publishId,
CmsPublishedResource resource)
Inserts an entry in the publish history for a published VFS resource.
|
void |
writePublishJob(CmsDbContext dbc,
CmsPublishJobInfoBean publishJob)
Writes a publish job.
|
void |
writePublishReport(CmsDbContext dbc,
CmsUUID publishId,
byte[] content)
Writes a publish report for a publish job.
|
void |
writeStaticExportPublishedResource(CmsDbContext dbc,
java.lang.String resourceName,
int linkType,
java.lang.String linkParameter,
long timestamp)
Inserts an entry in the published resource table.
|
void |
writeUserPublishListEntries(CmsDbContext dbc,
java.util.List<CmsUserPublishListEntry> publishListAdditions)
Writes multiple user publish list entries to the database.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
public static final java.lang.String DBC_ATTR_READ_PROJECT_FOR_RESOURCE
protected CmsDriverManager m_driverManager
protected CmsSqlManager m_sqlManager
public CmsProjectDriver()
public CmsProject createProject(CmsDbContext dbc, CmsUUID id, CmsUser owner, CmsGroup group, CmsGroup managergroup, java.lang.String projectFqn, java.lang.String description, int flags, CmsProject.CmsProjectType type) throws CmsDataAccessException
I_CmsProjectDriver
createProject
in interface I_CmsProjectDriver
dbc
- the current database contextid
- the project idowner
- the owner of the projectgroup
- the group for the projectmanagergroup
- the manager group for the projectprojectFqn
- the name of the project to createdescription
- the description for the projectflags
- the flags for the projecttype
- the type for the projectCmsProject
instanceCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.createProject(org.opencms.db.CmsDbContext, CmsUUID, org.opencms.file.CmsUser, org.opencms.file.CmsGroup, org.opencms.file.CmsGroup, java.lang.String, java.lang.String, int, CmsProject.CmsProjectType)
public void createProjectResource(CmsDbContext dbc, CmsUUID projectId, java.lang.String resourcePath) throws CmsDataAccessException
I_CmsProjectDriver
createProjectResource
in interface I_CmsProjectDriver
dbc
- the current database contextprojectId
- The project in which the resource will be usedresourcePath
- The resource to be written to the CmsCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.createProjectResource(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String)
public void createPublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsDataAccessException
I_CmsProjectDriver
createPublishJob
in interface I_CmsProjectDriver
dbc
- the current database contextpublishJob
- the publish job dataCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.createPublishJob(org.opencms.db.CmsDbContext, org.opencms.publish.CmsPublishJobInfoBean)
public void deleteAllStaticExportPublishedResources(CmsDbContext dbc, int linkType) throws CmsDataAccessException
I_CmsProjectDriver
deleteAllStaticExportPublishedResources
in interface I_CmsProjectDriver
dbc
- the current database contextlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deleteAllStaticExportPublishedResources(org.opencms.db.CmsDbContext, int)
public void deleteLog(CmsDbContext dbc, CmsLogFilter filter) throws CmsDataAccessException
I_CmsProjectDriver
deleteLog
in interface I_CmsProjectDriver
dbc
- the database contextfilter
- the log entry filterCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deleteLog(org.opencms.db.CmsDbContext, org.opencms.db.log.CmsLogFilter)
public void deleteProject(CmsDbContext dbc, CmsProject project) throws CmsDataAccessException
I_CmsProjectDriver
Therefore it deletes all files, resources and properties.
deleteProject
in interface I_CmsProjectDriver
dbc
- the current database contextproject
- the project to deleteCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deleteProject(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject)
public void deleteProjectResource(CmsDbContext dbc, CmsUUID projectId, java.lang.String resourceName) throws CmsDataAccessException
I_CmsProjectDriver
deleteProjectResource
in interface I_CmsProjectDriver
dbc
- the current database contextprojectId
- id of the project in which the resource is usedresourceName
- name of the resource to be deleted from the CmsCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deleteProjectResource(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String)
public void deleteProjectResources(CmsDbContext dbc, CmsProject project) throws CmsDataAccessException
I_CmsProjectDriver
deleteProjectResources
in interface I_CmsProjectDriver
dbc
- the current database contextproject
- the project to be deletedCmsDataAccessException
- if operation was not succesfulI_CmsProjectDriver.deleteProjectResources(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject)
public void deletePublishHistory(CmsDbContext dbc, CmsUUID projectId, int maxpublishTag) throws CmsDataAccessException
I_CmsProjectDriver
deletePublishHistory
in interface I_CmsProjectDriver
dbc
- the current database contextprojectId
- the ID of the current projectmaxpublishTag
- entries with publish tags >=0 and < this max. publish tag get deletedCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deletePublishHistory(org.opencms.db.CmsDbContext, CmsUUID, int)
public void deletePublishHistoryEntry(CmsDbContext dbc, CmsUUID publishHistoryId, CmsPublishedResource publishedResource) throws CmsDataAccessException
I_CmsProjectDriver
deletePublishHistoryEntry
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- the id of the history to delete the entry frompublishedResource
- the entry to deleteCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deletePublishHistoryEntry(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.db.CmsPublishedResource)
public void deletePublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
deletePublishJob
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deletePublishJob(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public void deletePublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
deletePublishList
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deletePublishList(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public void deleteStaticExportPublishedResource(CmsDbContext dbc, java.lang.String resourceName, int linkType, java.lang.String linkParameter) throws CmsDataAccessException
I_CmsProjectDriver
deleteStaticExportPublishedResource
in interface I_CmsProjectDriver
dbc
- the current database contextresourceName
- The name of the resource to be deleted in the static exportlinkType
- the type of resource deleted (0= non-paramter, 1=parameter)linkParameter
- the parameters of the resourceCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.deleteStaticExportPublishedResource(org.opencms.db.CmsDbContext, java.lang.String, int, java.lang.String)
public void deleteUserPublishListEntries(CmsDbContext dbc, java.util.List<CmsUserPublishListEntry> publishListDeletions) throws CmsDbSqlException
I_CmsProjectDriver
deleteUserPublishListEntries
in interface I_CmsProjectDriver
dbc
- the current database contextpublishListDeletions
- the publish list entries to remove from the databaseCmsDbSqlException
I_CmsProjectDriver.deleteUserPublishListEntries(org.opencms.db.CmsDbContext, java.util.List)
public void destroy() throws java.lang.Throwable
I_CmsProjectDriver
destroy
in interface I_CmsProjectDriver
java.lang.Throwable
- if something goes wrongI_CmsProjectDriver.destroy()
public void fillDefaults(CmsDbContext dbc) throws CmsDataAccessException
I_CmsProjectDriver
fillDefaults
in interface I_CmsProjectDriver
dbc
- the current database contextCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.fillDefaults(org.opencms.db.CmsDbContext)
public CmsSqlManager getSqlManager()
I_CmsProjectDriver
getSqlManager
in interface I_CmsProjectDriver
I_CmsProjectDriver.getSqlManager()
public java.util.List<CmsResource> getUsersPubList(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
I_CmsProjectDriver
getUsersPubList
in interface I_CmsProjectDriver
dbc
- the database contextuserId
- the user's idCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.getUsersPubList(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public void init(CmsDbContext dbc, CmsConfigurationManager configurationManager, java.util.List<java.lang.String> successiveDrivers, CmsDriverManager driverManager)
I_CmsDriver
init
in interface I_CmsDriver
dbc
- the current database contextconfigurationManager
- the configuration managersuccessiveDrivers
- a list of successive drivers to be initializeddriverManager
- the initialized OpenCms driver managerI_CmsDriver.init(CmsDbContext, CmsConfigurationManager, List, CmsDriverManager)
public CmsSqlManager initSqlManager(java.lang.String classname)
I_CmsProjectDriver
To obtain JDBC connections from different pools, further {online|offline|history} pool Urls have to be specified.
initSqlManager
in interface I_CmsProjectDriver
classname
- the classname of the SQL managerI_CmsProjectDriver.initSqlManager(String)
public void log(CmsDbContext dbc, java.util.List<CmsLogEntry> logEntries) throws CmsDbSqlException
I_CmsProjectDriver
log
in interface I_CmsProjectDriver
dbc
- the database contextlogEntries
- the log entries to writeCmsDbSqlException
I_CmsProjectDriver.log(org.opencms.db.CmsDbContext, java.util.List)
public void publishDeletedFolder(CmsDbContext dbc, I_CmsReport report, int m, int n, CmsProject onlineProject, CmsFolder currentFolder, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
I_CmsProjectDriver
publishDeletedFolder
in interface I_CmsProjectDriver
dbc
- the current database contextreport
- the report to log the output tom
- the number of the folder to publishn
- the number of all folders to publishonlineProject
- the online projectcurrentFolder
- the offline folder to publishpublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.publishDeletedFolder(org.opencms.db.CmsDbContext, org.opencms.report.I_CmsReport, int, int, org.opencms.file.CmsProject, org.opencms.file.CmsFolder, org.opencms.util.CmsUUID, int)
public void publishFile(CmsDbContext dbc, I_CmsReport report, int m, int n, CmsProject onlineProject, CmsResource offlineResource, java.util.Set<CmsUUID> publishedContentIds, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
I_CmsProjectDriver
publishFile
in interface I_CmsProjectDriver
dbc
- the current database contextreport
- the report to log the output tom
- the number of the file to publishn
- the number of all files to publishonlineProject
- the online projectofflineResource
- the offline file to publishpublishedContentIds
- contains the UUIDs of already published content recordspublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.publishFile(org.opencms.db.CmsDbContext, org.opencms.report.I_CmsReport, int, int, org.opencms.file.CmsProject, org.opencms.file.CmsResource, java.util.Set, org.opencms.util.CmsUUID, int)
public CmsFile publishFileContent(CmsDbContext dbc, CmsProject offlineProject, CmsProject onlineProject, CmsResource offlineResource, java.util.Set<CmsUUID> publishedResourceIds, boolean needToUpdateContent, int publishTag) throws CmsDataAccessException
I_CmsProjectDriver
The content record is only published unless it's UUID is not contained in publishedContentIds. The calling method has to take care about whether an existing content record has to be deleted before or not.
The intention of this method is to get overloaded in a project driver for a specific DB server to shift the binary content from the offline into the online table in a more sophisticated way than in the generic ANSI-SQL implementation of this interface.
publishFileContent
in interface I_CmsProjectDriver
dbc
- the current database contextofflineProject
- the offline project to read dataonlineProject
- the online project to write dataofflineResource
- the offline header of the file of which the content gets publishedpublishedResourceIds
- a Set with the UUIDs of the already published content recordsneedToUpdateContent
- true
if the content record has to be updatedpublishTag
- the publish tagCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.publishFileContent(CmsDbContext, CmsProject, CmsProject, CmsResource, Set, boolean, int)
public void publishFolder(CmsDbContext dbc, I_CmsReport report, int m, int n, CmsProject onlineProject, CmsFolder offlineFolder, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
I_CmsProjectDriver
publishFolder
in interface I_CmsProjectDriver
dbc
- the current database contextreport
- the report to log the output tom
- the number of the folder to publishn
- the number of all folders to publishonlineProject
- the online projectofflineFolder
- the offline folder to publishpublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.publishFolder(org.opencms.db.CmsDbContext, org.opencms.report.I_CmsReport, int, int, org.opencms.file.CmsProject, org.opencms.file.CmsFolder, org.opencms.util.CmsUUID, int)
public void publishProject(CmsDbContext dbc, I_CmsReport report, CmsProject onlineProject, CmsPublishList publishList, int publishTag) throws CmsException
I_CmsProjectDriver
publishProject
in interface I_CmsProjectDriver
dbc
- the current database contextreport
- an I_CmsReport instance to print output messagesonlineProject
- the online projectpublishList
- a Cms publish listpublishTag
- the publish tagCmsException
- if something goes wrongI_CmsProjectDriver.publishProject(org.opencms.db.CmsDbContext, org.opencms.report.I_CmsReport, org.opencms.file.CmsProject, org.opencms.db.CmsPublishList, int)
public java.util.List<CmsLock> readLocks(CmsDbContext dbc) throws CmsDataAccessException
I_CmsProjectDriver
List
<CmsLock
;>
that were saved to the database in the previous run of OpenCms.readLocks
in interface I_CmsProjectDriver
dbc
- the current database contextList
<CmsLock
;>
that were saved to the database in the previous run of OpenCms.CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readLocks(org.opencms.db.CmsDbContext)
public java.util.List<CmsLogEntry> readLog(CmsDbContext dbc, CmsLogFilter filter) throws CmsDataAccessException
I_CmsProjectDriver
readLog
in interface I_CmsProjectDriver
dbc
- the database contextfilter
- the log entry filterCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readLog(org.opencms.db.CmsDbContext, org.opencms.db.log.CmsLogFilter)
public CmsProject readProject(CmsDbContext dbc, CmsUUID id) throws CmsDataAccessException
I_CmsProjectDriver
readProject
in interface I_CmsProjectDriver
dbc
- the current database contextid
- the id of the projectCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProject(org.opencms.db.CmsDbContext, CmsUUID)
public CmsProject readProject(CmsDbContext dbc, java.lang.String projectFqn) throws CmsDataAccessException
I_CmsProjectDriver
readProject
in interface I_CmsProjectDriver
dbc
- the current database contextprojectFqn
- the name of the projectCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProject(org.opencms.db.CmsDbContext, java.lang.String)
public java.lang.String readProjectResource(CmsDbContext dbc, CmsUUID projectId, java.lang.String resourcePath) throws CmsDataAccessException
I_CmsProjectDriver
readProjectResource
in interface I_CmsProjectDriver
dbc
- the current database contextprojectId
- the ID of the project for which the resource path is readresourcePath
- the project's resource pathCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjectResource(org.opencms.db.CmsDbContext, CmsUUID, java.lang.String)
public java.util.List<java.lang.String> readProjectResources(CmsDbContext dbc, CmsProject project) throws CmsDataAccessException
I_CmsProjectDriver
readProjectResources
in interface I_CmsProjectDriver
dbc
- the current database contextproject
- the project for which the resource path is readCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjectResources(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject)
public java.util.List<CmsProject> readProjects(CmsDbContext dbc, java.lang.String ouFqn) throws CmsDataAccessException
I_CmsProjectDriver
readProjects
in interface I_CmsProjectDriver
dbc
- the current database contextouFqn
- the fully qualified name of the organizational unit to get the projects forCmsProject
CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjects(org.opencms.db.CmsDbContext, String)
public java.util.List<CmsProject> readProjectsForGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
I_CmsProjectDriver
readProjectsForGroup
in interface I_CmsProjectDriver
dbc
- the current database contextgroup
- the requesting groupCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjectsForGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)
public java.util.List<CmsProject> readProjectsForManagerGroup(CmsDbContext dbc, CmsGroup group) throws CmsDataAccessException
I_CmsProjectDriver
readProjectsForManagerGroup
in interface I_CmsProjectDriver
dbc
- the current database contextgroup
- The requesting groupCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjectsForManagerGroup(org.opencms.db.CmsDbContext, org.opencms.file.CmsGroup)
public java.util.List<CmsProject> readProjectsForResource(CmsDbContext dbc, java.lang.String rootPath) throws CmsDataAccessException
dbc
- the database contextrootPath
- the resource root pathCmsDataAccessException
- if something goes wrongpublic java.util.List<CmsProject> readProjectsForUser(CmsDbContext dbc, CmsUser user) throws CmsDataAccessException
I_CmsProjectDriver
readProjectsForUser
in interface I_CmsProjectDriver
dbc
- the current database contextuser
- the userCmsProject
CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readProjectsForUser(org.opencms.db.CmsDbContext, org.opencms.file.CmsUser)
public java.util.List<CmsPublishedResource> readPublishedResources(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
readPublishedResources
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- unique int ID to identify the publish process in the publish historyCmsPublishedResource
objectsCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readPublishedResources(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public CmsPublishJobInfoBean readPublishJob(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
readPublishJob
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- unique id to identify the publish job in the publish historyCmsPublishJobInfoBean
CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readPublishJob(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public java.util.List<CmsPublishJobInfoBean> readPublishJobs(CmsDbContext dbc, long startTime, long endTime) throws CmsDataAccessException
I_CmsProjectDriver
If (0L, 0L)
is passed as time range, all pending jobs are returned.
readPublishJobs
in interface I_CmsProjectDriver
dbc
- the current database contextstartTime
- the start of the time range for finish timeendTime
- the end of the time range for finish timeCmsPublishJobInfoBean
CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readPublishJobs(org.opencms.db.CmsDbContext, long, long)
public CmsPublishList readPublishList(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
readPublishList
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readPublishList(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public byte[] readPublishReportContents(CmsDbContext dbc, CmsUUID publishHistoryId) throws CmsDataAccessException
I_CmsProjectDriver
readPublishReportContents
in interface I_CmsProjectDriver
dbc
- the current database contextpublishHistoryId
- the history id identifying the publish jobCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readPublishReportContents(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID)
public java.lang.String readStaticExportPublishedResourceParameters(CmsDbContext dbc, java.lang.String rfsName) throws CmsDataAccessException
I_CmsProjectDriver
readStaticExportPublishedResourceParameters
in interface I_CmsProjectDriver
dbc
- the current database contextrfsName
- the rfs name of the resourceCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readStaticExportPublishedResourceParameters(org.opencms.db.CmsDbContext, java.lang.String)
public java.util.List<java.lang.String> readStaticExportResources(CmsDbContext dbc, int parameterResources, long timestamp) throws CmsDataAccessException
I_CmsProjectDriver
readStaticExportResources
in interface I_CmsProjectDriver
dbc
- the current database contextparameterResources
- flag for reading resources with parameters (1) or without (0)timestamp
- the time stamp informationString
objectsCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.readStaticExportResources(org.opencms.db.CmsDbContext, int, long)
public void setDriverManager(CmsDriverManager driverManager)
I_CmsProjectDriver
setDriverManager
in interface I_CmsProjectDriver
driverManager
- the new driver managerI_CmsProjectDriver.setDriverManager(org.opencms.db.CmsDriverManager)
public void setSqlManager(CmsSqlManager manager)
I_CmsProjectDriver
setSqlManager
in interface I_CmsProjectDriver
manager
- the new SQL managerI_CmsProjectDriver.setSqlManager(org.opencms.db.CmsSqlManager)
public void unmarkProjectResources(CmsDbContext dbc, CmsProject project) throws CmsDataAccessException
I_CmsProjectDriver
This must be done when a project will deleted
unmarkProjectResources
in interface I_CmsProjectDriver
dbc
- the current database contextproject
- the project to deleteCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.unmarkProjectResources(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject)
public void writeLocks(CmsDbContext dbc, java.util.List<CmsLock> locks) throws CmsDataAccessException
I_CmsProjectDriver
List
<CmsLock
;>
to the database for reuse in the next run of OpenCms.This method must only be called at startup or the in-memory locking will overwritten.
writeLocks
in interface I_CmsProjectDriver
dbc
- the current database contextlocks
- the List
<CmsLock
;>
that
currently exist in OpenCms (CmsLockManager
)CmsDataAccessException
- if something goes wrongI_CmsProjectDriver.writeLocks(org.opencms.db.CmsDbContext, java.util.List)
public void writeProject(CmsDbContext dbc, CmsProject project) throws CmsDataAccessException
I_CmsProjectDriver
The project id has to be a valid OpenCms project id.
The project with the given id will be completely overriden
by the given data.
writeProject
in interface I_CmsProjectDriver
dbc
- the current database contextproject
- the project that should be writtenCmsDataAccessException
- if operation was not successfulI_CmsProjectDriver.writeProject(org.opencms.db.CmsDbContext, org.opencms.file.CmsProject)
public void writePublishHistory(CmsDbContext dbc, CmsUUID publishId, CmsPublishedResource resource) throws CmsDataAccessException
I_CmsProjectDriver
writePublishHistory
in interface I_CmsProjectDriver
dbc
- the current database contextpublishId
- the ID of the current publishing processresource
- the state of the resource *before* it was publishedCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.writePublishHistory(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, org.opencms.db.CmsPublishedResource)
public void writePublishJob(CmsDbContext dbc, CmsPublishJobInfoBean publishJob) throws CmsDataAccessException
I_CmsProjectDriver
writePublishJob
in interface I_CmsProjectDriver
dbc
- the current database contextpublishJob
- the publish job to writeCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.writePublishJob(org.opencms.db.CmsDbContext, org.opencms.publish.CmsPublishJobInfoBean)
public void writePublishReport(CmsDbContext dbc, CmsUUID publishId, byte[] content) throws CmsDataAccessException
I_CmsProjectDriver
writePublishReport
in interface I_CmsProjectDriver
dbc
- the current database contextpublishId
- the ID of the current publishing processcontent
- the report outputCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.writePublishReport(org.opencms.db.CmsDbContext, org.opencms.util.CmsUUID, byte[])
public void writeStaticExportPublishedResource(CmsDbContext dbc, java.lang.String resourceName, int linkType, java.lang.String linkParameter, long timestamp) throws CmsDataAccessException
I_CmsProjectDriver
This is done during static export.
writeStaticExportPublishedResource
in interface I_CmsProjectDriver
dbc
- the current database contextresourceName
- The name of the resource to be added to the static exportlinkType
- the type of resource exported (0= non-paramter, 1=parameter)linkParameter
- the parameters added to the resourcetimestamp
- a timestamp for writing the data into the dbCmsDataAccessException
- if something goes wrongI_CmsProjectDriver.writeStaticExportPublishedResource(org.opencms.db.CmsDbContext, java.lang.String, int, java.lang.String, long)
public void writeUserPublishListEntries(CmsDbContext dbc, java.util.List<CmsUserPublishListEntry> publishListAdditions) throws CmsDbSqlException
I_CmsProjectDriver
writeUserPublishListEntries
in interface I_CmsProjectDriver
dbc
- the current database contextpublishListAdditions
- the user publish list entries to writeCmsDbSqlException
I_CmsProjectDriver.writeUserPublishListEntries(org.opencms.db.CmsDbContext, java.util.List)
protected CmsPublishJobInfoBean createPublishJobInfoBean(java.sql.ResultSet res) throws java.sql.SQLException
CmsPublishJobInfoBean
from a result set.res
- the result setCmsPublishJobInfoBean
java.sql.SQLException
- if something goes wrongprotected CmsResourceState fixMovedResource(CmsDbContext dbc, CmsProject onlineProject, CmsResource offlineResource, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
dbc
- the db contextonlineProject
- the online projectofflineResource
- the offline resource to checkpublishHistoryId
- the publish history idpublishTag
- the publish tagtrue
if the resource has actually been movedCmsDataAccessException
- if something goes wrongprotected java.lang.String getParameterString(java.util.Collection<?> data)
data
- the dataprotected java.util.List<CmsResource> getUsersPubListFromLog(CmsDbContext dbc, CmsUUID userId) throws CmsDataAccessException
This is the old implementation of the user publish list and can get pretty slow.
dbc
- the current database contextuserId
- the id of the user for which we want the user publish listCmsDataAccessException
- if something goes wrongprotected CmsProject internalCreateProject(java.sql.ResultSet res) throws java.sql.SQLException
res
- the result setjava.sql.SQLException
- is something goes wrongprotected CmsPublishList internalDeserializePublishList(byte[] bytes) throws java.io.IOException, java.lang.ClassNotFoundException
bytes
- the byte array containing the serailized data for the publish listjava.io.IOException
- if deserialization failsjava.lang.ClassNotFoundException
- if deserialization failsprotected CmsLogEntry internalReadLogEntry(java.sql.ResultSet res) throws java.sql.SQLException
CmsLogEntry
object from the given result set entry.res
- the result setCmsLogEntry
objectjava.sql.SQLException
- if something goes wrongprotected void internalResetResourceState(CmsDbContext dbc, CmsResource resource) throws CmsDataAccessException
dbc
- the current database contextresource
- the Cms resourceCmsDataAccessException
- if something goes wrongprotected byte[] internalSerializePublishList(CmsPublishList publishList) throws java.io.IOException
publishList
- the publish listjava.io.IOException
- if something goes wrongprotected void internalWriteHistory(CmsDbContext dbc, CmsResource resource, CmsResourceState state, java.util.List<CmsProperty> properties, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
dbc
- the current database contextresource
- the offline resourcestate
- the state to store in the publish history entryproperties
- the offline propertiespublishHistoryId
- the current publish process idpublishTag
- the current publish process tagCmsDataAccessException
- if something goes wrongprotected CmsPair<java.lang.String,java.util.List<I_CmsPreparedStatementParameter>> prepareLogConditions(CmsLogFilter filter)
filter
- the filterprotected void publishChangedFile(CmsDbContext dbc, CmsProject onlineProject, CmsResource offlineResource, java.util.Set<CmsUUID> publishedResourceIds, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
dbc
- the current database contextonlineProject
- the online projectofflineResource
- the resource to publishpublishedResourceIds
- contains the UUIDs of already published content recordspublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- is something goes wrongprotected void publishDeletedFile(CmsDbContext dbc, CmsProject onlineProject, CmsResource offlineResource, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
dbc
- the current database contextonlineProject
- the online projectofflineResource
- the resource to publishpublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- is something goes wrongprotected void publishNewFile(CmsDbContext dbc, CmsProject onlineProject, CmsResource offlineResource, java.util.Set<CmsUUID> publishedContentIds, CmsUUID publishHistoryId, int publishTag) throws CmsDataAccessException
dbc
- the current database contextonlineProject
- the online projectofflineResource
- the resource to publishpublishedContentIds
- contains the UUIDs of already published content recordspublishHistoryId
- the publish history idpublishTag
- the publish tagCmsDataAccessException
- is something goes wrong