public class CmsExtendedWorkflowManager extends CmsDefaultWorkflowManager
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_RELEASE
The release workflow action.
|
static java.lang.String |
PARAM_NOTIFICATION_CONTENT
The parameter which points to the XML content used for notifications.
|
static java.lang.String |
PARAM_WORKFLOW_PROJECT_MANAGER_GROUP
The key for the configurable workflow project manager group.
|
static java.lang.String |
PARAM_WORKFLOW_PROJECT_USER_GROUP
The key for the configurable workflow project user group.
|
static java.lang.String |
WORKFLOW_RELEASE
The key for the 'release' workflow.
|
ACTION_FORCE_PUBLISH, ACTION_PUBLISH, ATTR_CHECK_PUBLISH_RESOURCE_LIMIT, DEFAULT_RESOURCE_LIMIT, m_virtualProjects, PARAM_RESOURCE_LIMIT, WORKFLOW_PUBLISHm_adminCms, m_parameters| Constructor and Description |
|---|
CmsExtendedWorkflowManager() |
| Modifier and Type | Method and Description |
|---|---|
protected CmsWorkflowResponse |
actionRelease(CmsObject userCms,
java.util.List<CmsResource> resources)
Implementation of the 'release' workflow action.
|
protected void |
checkNewParentsInList(CmsObject userCms,
java.util.List<CmsResource> resources)
Checks that the parent folders of new resources which are released are either not new or are also released.
|
protected void |
cleanupEmptyWorkflowProjects(java.util.List<CmsProject> projects)
Cleans up empty workflow projects.
|
protected void |
cleanupProjectIfEmpty(CmsProject project)
Removes a project if there are no longer any resources which have been last modified in that project.
|
protected void |
clearLocks(CmsProject project,
java.util.List<CmsResource> resources)
Ensures that the resources to be released are unlocked.
|
I_CmsPublishResourceFormatter |
createFormatter(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options)
Creates the formatter for formatting the resources to be displayed to the user.
|
CmsWorkflowResponse |
executeAction(CmsObject userCms,
CmsWorkflowAction action,
CmsPublishOptions options,
java.util.List<CmsResource> resources)
Executes a workflow action in the context of the current user.
|
protected boolean |
existsProject(java.lang.String projectName)
Helper method to check whether a project exists.
|
protected java.lang.String |
generateProjectDescription(CmsObject userCms)
Generates the description for a new workflow project based on the user for whom it is created.
|
protected java.lang.String |
generateProjectName(CmsObject userCms)
Generates the name for a new workflow project based on the user for whom it is created.
|
protected java.lang.String |
generateProjectName(CmsObject userCms,
boolean shortTime)
Generates the name for a new workflow project based on the user for whom it is created.
|
protected java.util.List<CmsUser> |
getNotificationMailRecipients()
Gets the list of recipients for the notifications.
|
protected java.lang.String |
getNotificationResource(CmsObject cms)
Gets the resource notification content path.
|
protected CmsWorkflowResponse |
getPublishBrokenRelationsResponse(CmsObject userCms,
java.util.List<CmsPublishResource> publishResources)
Helper method for generating the workflow response which should be sent when publishing the resources would break relations.
|
I_CmsVirtualProject |
getRealOrVirtualProject(CmsUUID projectId)
Gets the virtual project object identified by the given id.
|
protected CmsWorkflowResponse |
getSuccessResponse()
Gets the workflow response which should be sent when the resources have successfully been published.
|
java.lang.String |
getWorkflowProjectManagerGroup()
Gets the name of the group which should be used as the 'manager' group for newly created workflow projects.
|
java.lang.String |
getWorkflowProjectUserGroup()
Gets the name of the group which should be used as the 'user' group for newly created workflow projects.
|
CmsWorkflowResources |
getWorkflowResources(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options,
boolean canOverrideWorkflow,
boolean ignoreLimit)
Returns the resources for the given workflow and project.
|
java.util.Map<java.lang.String,CmsWorkflow> |
getWorkflows(CmsObject cms)
Returns the available workflows for the current user.
|
void |
initialize(CmsObject adminCms)
Initializes this workflow manager instance.
|
protected boolean |
isProjectEmpty(CmsProject project)
Checks whether there are resources which have last been modified in a given project.
|
protected boolean |
isProjectManager(CmsObject userCms)
Checks whether the user for a given CMS context can manage workflow projects.
|
protected void |
onFinishPublishJob(CmsPublishJobRunning publishJob)
Handles finished publish jobs by removing projects of resources in the publish job if they are empty workflow projects.
|
protected void |
onStartPublishJob(CmsPublishJobEnqueued publishJob)
This is called when a publish job is started.
|
protected void |
sendNotification(CmsObject userCms,
CmsUser recipient,
CmsProject workflowProject,
java.util.List<CmsResource> resources)
Sends the notification for released resources.
|
actionForcePublish, actionPublish, createProjectBeanFromProject, executeAction, getLabel, getManageableProjects, getOuAwareName, getPublishListToken, getResourceLimit, getWorkflowForWorkflowProjectgetLocale, getParameter, getParameters, setParameterspublic static final java.lang.String ACTION_RELEASE
public static final java.lang.String PARAM_NOTIFICATION_CONTENT
public static final java.lang.String PARAM_WORKFLOW_PROJECT_MANAGER_GROUP
public static final java.lang.String PARAM_WORKFLOW_PROJECT_USER_GROUP
public static final java.lang.String WORKFLOW_RELEASE
public CmsExtendedWorkflowManager()
public I_CmsPublishResourceFormatter createFormatter(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options)
I_CmsWorkflowManagercreateFormatter in interface I_CmsWorkflowManagercreateFormatter in class CmsDefaultWorkflowManagercms - the CMS context to useworkflow - the current workflowoptions - the publish optionsCmsDefaultWorkflowManager.createFormatter(org.opencms.file.CmsObject, org.opencms.ade.publish.shared.CmsWorkflow, org.opencms.ade.publish.shared.CmsPublishOptions)public CmsWorkflowResponse executeAction(CmsObject userCms, CmsWorkflowAction action, CmsPublishOptions options, java.util.List<CmsResource> resources) throws CmsException
I_CmsWorkflowManagerexecuteAction in interface I_CmsWorkflowManagerexecuteAction in class CmsDefaultWorkflowManageruserCms - the current user's CMS contextaction - the workflow actionoptions - the publish optionsresources - the resources to be processedCmsException - if something goes wrongCmsDefaultWorkflowManager.executeAction(org.opencms.file.CmsObject, org.opencms.ade.publish.shared.CmsWorkflowAction, org.opencms.ade.publish.shared.CmsPublishOptions, java.util.List)public I_CmsVirtualProject getRealOrVirtualProject(CmsUUID projectId)
I_CmsWorkflowManagergetRealOrVirtualProject in interface I_CmsWorkflowManagergetRealOrVirtualProject in class CmsDefaultWorkflowManagerprojectId - the virtual project idCmsDefaultWorkflowManager.getRealOrVirtualProject(org.opencms.util.CmsUUID)public java.lang.String getWorkflowProjectManagerGroup()
public java.lang.String getWorkflowProjectUserGroup()
public CmsWorkflowResources getWorkflowResources(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options, boolean canOverrideWorkflow, boolean ignoreLimit)
I_CmsWorkflowManagergetWorkflowResources in interface I_CmsWorkflowManagergetWorkflowResources in class CmsDefaultWorkflowManagercms - the user cms contextworkflow - the workflowoptions - the resource optionscanOverrideWorkflow - flag to indicate whether the workflow manager should be able to override the selected workflowignoreLimit - true if the workflow manager's resource limit should be ignoredCmsDefaultWorkflowManager.getWorkflowResources(org.opencms.file.CmsObject, org.opencms.ade.publish.shared.CmsWorkflow, org.opencms.ade.publish.shared.CmsPublishOptions, boolean, boolean)public java.util.Map<java.lang.String,CmsWorkflow> getWorkflows(CmsObject cms)
I_CmsWorkflowManagergetWorkflows in interface I_CmsWorkflowManagergetWorkflows in class CmsDefaultWorkflowManagercms - the user cms contextI_CmsWorkflowManager.getWorkflows(org.opencms.file.CmsObject)public void initialize(CmsObject adminCms)
I_CmsWorkflowManagerinitialize in interface I_CmsWorkflowManagerinitialize in class CmsDefaultWorkflowManageradminCms - the CMS context with admin privilegesA_CmsWorkflowManager.initialize(org.opencms.file.CmsObject)protected CmsWorkflowResponse actionRelease(CmsObject userCms, java.util.List<CmsResource> resources) throws CmsException
userCms - the current user's CMS contextresources - the resources which should be releasedCmsException - if something goes wrongprotected void checkNewParentsInList(CmsObject userCms, java.util.List<CmsResource> resources) throws CmsException
userCms - the user CMS contextresources - the resources to checkCmsException - if the check failsprotected void cleanupEmptyWorkflowProjects(java.util.List<CmsProject> projects) throws CmsException
projects - the workflow projects to clean upCmsException - if something goes wrongprotected void cleanupProjectIfEmpty(CmsProject project) throws CmsException
project - the projectCmsException - if something goes wrongprotected void clearLocks(CmsProject project, java.util.List<CmsResource> resources) throws CmsException
project - the project in which to operateresources - the resources for which the locks should be removedCmsException - if something goes wrongprotected boolean existsProject(java.lang.String projectName)
projectName - the project nameprotected java.lang.String generateProjectDescription(CmsObject userCms)
userCms - the user's current CMS contextprotected java.lang.String generateProjectName(CmsObject userCms)
userCms - the user's current CMS contextprotected java.lang.String generateProjectName(CmsObject userCms, boolean shortTime)
userCms - the user's current CMS contextshortTime - if true, the short time format will be used, else the medium time formatprotected java.util.List<CmsUser> getNotificationMailRecipients()
protected java.lang.String getNotificationResource(CmsObject cms)
cms - the cms contextprotected CmsWorkflowResponse getPublishBrokenRelationsResponse(CmsObject userCms, java.util.List<CmsPublishResource> publishResources)
userCms - the user's CMS contextpublishResources - the resources whose links would be brokenprotected CmsWorkflowResponse getSuccessResponse()
protected boolean isProjectEmpty(CmsProject project) throws CmsException
project - the project which should be checkedCmsException - if something goes wrongprotected boolean isProjectManager(CmsObject userCms) throws CmsException
userCms - the user CMS ContextCmsException - if something goes wrongprotected void onFinishPublishJob(CmsPublishJobRunning publishJob)
publishJob - the finished published jobprotected void onStartPublishJob(CmsPublishJobEnqueued publishJob)
publishJob - the publish job being startedprotected void sendNotification(CmsObject userCms, CmsUser recipient, CmsProject workflowProject, java.util.List<CmsResource> resources)
userCms - the user's CMS contextrecipient - the OpenCms user to whom the notification should be sentworkflowProject - the workflow project whichresources - the resources which have been affected by a workflow action