public class CmsExtendedWorkflowManager extends CmsDefaultWorkflowManager
限定符和类型 | 字段和说明 |
---|---|
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, DEFAULT_RESOURCE_LIMIT, m_virtualProjects, PARAM_RESOURCE_LIMIT, WORKFLOW_PUBLISH
m_adminCms, m_parameters
构造器和说明 |
---|
CmsExtendedWorkflowManager() |
限定符和类型 | 方法和说明 |
---|---|
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()
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.
|
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, getWorkflowResources
getLocale, getParameter, getParameters, setParameters
public 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 I_CmsPublishResourceFormatter createFormatter(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options)
I_CmsWorkflowManager
createFormatter
在接口中 I_CmsWorkflowManager
createFormatter
在类中 CmsDefaultWorkflowManager
cms
- 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_CmsWorkflowManager
executeAction
在接口中 I_CmsWorkflowManager
executeAction
在类中 CmsDefaultWorkflowManager
userCms
- 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_CmsWorkflowManager
getRealOrVirtualProject
在接口中 I_CmsWorkflowManager
getRealOrVirtualProject
在类中 CmsDefaultWorkflowManager
projectId
- the virtual project idCmsDefaultWorkflowManager.getRealOrVirtualProject(org.opencms.util.CmsUUID)
public java.lang.String getWorkflowProjectManagerGroup()
public java.lang.String getWorkflowProjectUserGroup()
public java.util.Map<java.lang.String,CmsWorkflow> getWorkflows(CmsObject cms)
I_CmsWorkflowManager
getWorkflows
在接口中 I_CmsWorkflowManager
getWorkflows
在类中 CmsDefaultWorkflowManager
cms
- the user cms contextI_CmsWorkflowManager.getWorkflows(org.opencms.file.CmsObject)
public void initialize(CmsObject adminCms)
I_CmsWorkflowManager
initialize
在接口中 I_CmsWorkflowManager
initialize
在类中 CmsDefaultWorkflowManager
adminCms
- 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
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 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()
protected 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