|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.workflow.A_CmsWorkflowManager
org.opencms.workflow.CmsDefaultWorkflowManager
org.opencms.workflow.CmsExtendedWorkflowManager
public class CmsExtendedWorkflowManager
The default workflow manager implementation, which supports 2 basic actions, Release and Publish.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.opencms.workflow.CmsDefaultWorkflowManager |
|---|
ACTION_FORCE_PUBLISH, ACTION_PUBLISH, WORKFLOW_PUBLISH |
| Fields inherited from class org.opencms.workflow.A_CmsWorkflowManager |
|---|
m_adminCms, m_parameters |
| Constructor Summary | |
|---|---|
CmsExtendedWorkflowManager()
|
|
| Method Summary | |
|---|---|
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. |
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()
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. |
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. |
java.util.List<CmsPublishResource> |
getWorkflowPublishResources(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options)
Returns the publish resource beans for the given workflow and project. |
java.util.List<CmsResource> |
getWorkflowResources(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options)
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. |
| Methods inherited from class org.opencms.workflow.CmsDefaultWorkflowManager |
|---|
actionForcePublish, actionPublish, getLabel |
| Methods inherited from class org.opencms.workflow.A_CmsWorkflowManager |
|---|
getLocale, getParameter, getParameters, setParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String WORKFLOW_RELEASE
public static final java.lang.String ACTION_RELEASE
public static final java.lang.String PARAM_WORKFLOW_PROJECT_MANAGER_GROUP
public static final java.lang.String PARAM_NOTIFICATION_CONTENT
public static final java.lang.String PARAM_WORKFLOW_PROJECT_USER_GROUP
| Constructor Detail |
|---|
public CmsExtendedWorkflowManager()
| Method Detail |
|---|
public CmsWorkflowResponse executeAction(CmsObject userCms,
CmsWorkflowAction action,
CmsPublishOptions options,
java.util.List<CmsResource> resources)
throws CmsException
I_CmsWorkflowManager
executeAction in interface I_CmsWorkflowManagerexecuteAction in class CmsDefaultWorkflowManageruserCms - the current user's CMS contextaction - the workflow actionoptions - the publish optionsresources - the resources to be processed
CmsException - 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 java.lang.String getWorkflowProjectManagerGroup()
public java.lang.String getWorkflowProjectUserGroup()
public java.util.List<CmsPublishResource> getWorkflowPublishResources(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options)
I_CmsWorkflowManager
getWorkflowPublishResources in interface I_CmsWorkflowManagergetWorkflowPublishResources in class CmsDefaultWorkflowManagercms - the user cms contextworkflow - the workflowoptions - the resource options
CmsDefaultWorkflowManager.getWorkflowPublishResources(org.opencms.file.CmsObject, org.opencms.ade.publish.shared.CmsWorkflow, org.opencms.ade.publish.shared.CmsPublishOptions)
public java.util.List<CmsResource> getWorkflowResources(CmsObject cms,
CmsWorkflow workflow,
CmsPublishOptions options)
I_CmsWorkflowManager
getWorkflowResources in interface I_CmsWorkflowManagergetWorkflowResources in class CmsDefaultWorkflowManagercms - the user cms contextworkflow - the workflowoptions - the resource options
CmsDefaultWorkflowManager.getWorkflowResources(org.opencms.file.CmsObject, org.opencms.ade.publish.shared.CmsWorkflow, org.opencms.ade.publish.shared.CmsPublishOptions)public java.util.Map<java.lang.String,CmsWorkflow> getWorkflows(CmsObject cms)
I_CmsWorkflowManager
getWorkflows in interface I_CmsWorkflowManagergetWorkflows in class CmsDefaultWorkflowManagercms - the user cms context
I_CmsWorkflowManager.getWorkflows(org.opencms.file.CmsObject)public void initialize(CmsObject adminCms)
I_CmsWorkflowManager
initialize in interface I_CmsWorkflowManagerinitialize in class A_CmsWorkflowManageradminCms - 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 released
CmsException - if something goes wrong
protected void checkNewParentsInList(CmsObject userCms,
java.util.List<CmsResource> resources)
throws CmsException
userCms - the user CMS contextresources - the resources to check
CmsException - if the check fails
protected void cleanupEmptyWorkflowProjects(java.util.List<CmsProject> projects)
throws CmsException
projects - the workflow projects to clean up
CmsException - if something goes wrong
protected void cleanupProjectIfEmpty(CmsProject project)
throws CmsException
project - the project
CmsException
protected 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 removed
CmsException - if something goes wrongprotected boolean existsProject(java.lang.String projectName)
projectName - the project name
protected java.lang.String generateProjectDescription(CmsObject userCms)
userCms - the user's current CMS context
protected java.lang.String generateProjectName(CmsObject userCms)
userCms - the user's current CMS context
protected 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 format
protected java.util.List<CmsUser> getNotificationMailRecipients()
protected java.lang.String getNotificationResource()
protected CmsWorkflowResponse getPublishBrokenRelationsResponse(CmsObject userCms,
java.util.List<CmsPublishResource> publishResources)
userCms - the user's CMS contextpublishResources - the resources whose links would be broken
protected CmsWorkflowResponse getSuccessResponse()
protected boolean isProjectEmpty(CmsProject project)
throws CmsException
project - the project which should be checked
CmsException - if something goes wrong
protected boolean isProjectManager(CmsObject userCms)
throws CmsException
userCms - the user CMS Context
CmsException - if something goes wrongprotected void onFinishPublishJob(CmsPublishJobRunning publishJob)
publishJob - the finished published jobprotected void onStartPublishJob(CmsPublishJobEnqueued publishJob)
publishJob - the publish job being started
protected 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
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||