Package org.opencms.workflow
Class CmsDefaultWorkflowManager
java.lang.Object
org.opencms.workflow.A_CmsWorkflowManager
org.opencms.workflow.CmsDefaultWorkflowManager
- All Implemented Interfaces:
I_CmsWorkflowManager
- Direct Known Subclasses:
CmsExtendedWorkflowManager
The default implementation of the workflow manager interface, which offers only publish functionality.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The forced publish workflow action.static final String
The publish workflow action.static final String
If a request context attribute of this name is set, some internal methods used to collect lists of resources for publishing will 'give up' and throw an exception when the number of resources exceeds the resource limit of the workflow manager.static int
Default value for the maximum number of resources in the initial publish list.protected Map<CmsUUID,
I_CmsVirtualProject> The map of registered virtual projects.static final String
The parameter name for the resource limit.static final String
The name for the publish action.Fields inherited from class org.opencms.workflow.A_CmsWorkflowManager
m_adminCms, m_parameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected CmsWorkflowResponse
actionForcePublish
(CmsObject userCms, CmsPublishOptions options, List<CmsResource> resources) The implementation of the "forcepublish" workflow action.protected CmsWorkflowResponse
actionPublish
(CmsObject userCms, CmsPublishOptions options, List<CmsResource> resources) The implementation of the "publish" workflow action.protected List<CmsResource>
cleanUpInvalidResourcesFromUserPublishList
(CmsObject cms, List<CmsResource> resources) Removes invalid publish resources (those that are unchanged, or can't be found) from the user's publish list, and only returns those which are not invalid.createFormatter
(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options) Creates the formatter for formatting the resources to be displayed to the user.static CmsProjectBean
createProjectBeanFromProject
(CmsObject cms, CmsProject project) Creates a project bean from a real project.executeAction
(CmsObject cms, CmsWorkflowAction action, CmsPublishListToken token) Executes a workflow action for a publish list token instead of a resource list.executeAction
(CmsObject userCms, CmsWorkflowAction action, CmsPublishOptions options, List<CmsResource> resources) Executes a workflow action in the context of the current user.Gets the localized label for a given CMS context and key.getManageableProjects
(CmsObject cms, Map<String, String> params) Returns the current user's manageable projects.protected static String
getOuAwareName
(CmsObject cms, String name) Returns the simple name if the ou is the same as the current user's ou.getPublishListToken
(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options) Gets a publish list token for the given parameters which can be used later to reconstruct the publish list.getRealOrVirtualProject
(CmsUUID projectId) Gets the virtual project object identified by the given id.int
Gets the resource limit.getWorkflowForWorkflowProject
(CmsUUID projectId) Gets the workflow id which should be used for a given workflow project.getWorkflowResources
(CmsObject cms, CmsWorkflow workflow, CmsPublishOptions options, boolean canOverride, boolean ignoreLimit) Returns the resources for the given workflow and project.getWorkflows
(CmsObject cms) Returns the available workflows for the current user.void
initialize
(CmsObject adminCms) Initializes this workflow manager instance.Methods inherited from class org.opencms.workflow.A_CmsWorkflowManager
getLocale, getParameter, getParameters, setParameters
-
Field Details
-
ACTION_FORCE_PUBLISH
The forced publish workflow action.- See Also:
-
ACTION_PUBLISH
The publish workflow action.- See Also:
-
DEFAULT_RESOURCE_LIMIT
Default value for the maximum number of resources in the initial publish list. -
PARAM_RESOURCE_LIMIT
The parameter name for the resource limit.- See Also:
-
WORKFLOW_PUBLISH
The name for the publish action.- See Also:
-
ATTR_CHECK_PUBLISH_RESOURCE_LIMIT
If a request context attribute of this name is set, some internal methods used to collect lists of resources for publishing will 'give up' and throw an exception when the number of resources exceeds the resource limit of the workflow manager.- See Also:
-
m_virtualProjects
The map of registered virtual projects.
-
-
Constructor Details
-
CmsDefaultWorkflowManager
public CmsDefaultWorkflowManager()Constructor.
-
-
Method Details
-
createProjectBeanFromProject
Creates a project bean from a real project.- Parameters:
cms
- the CMS contextproject
- the project- Returns:
- the bean containing the project information
-
getOuAwareName
Returns the simple name if the ou is the same as the current user's ou.- Parameters:
cms
- the CMS contextname
- the fully qualified name to check- Returns:
- the simple name if the ou is the same as the current user's ou
-
getLabel
Gets the localized label for a given CMS context and key.- Parameters:
cms
- the CMS contextkey
- the localization key- Returns:
- the localized label
-
getManageableProjects
Description copied from interface:I_CmsWorkflowManager
Returns the current user's manageable projects.- Parameters:
cms
- the CMS context to useparams
- the publish parameters- Returns:
- the current user's manageable projects
- See Also:
-
getRealOrVirtualProject
Description copied from interface:I_CmsWorkflowManager
Gets the virtual project object identified by the given id.- Parameters:
projectId
- the virtual project id- Returns:
- the virtual project object
- See Also:
-
getResourceLimit
Description copied from interface:I_CmsWorkflowManager
Gets the resource limit.Publish lists which exceed this limit (counted before adding any related resources, siblings etc.) are not displayed to the user.
- Returns:
- the resource limit
- See Also:
-
getWorkflowForWorkflowProject
Description copied from interface:I_CmsWorkflowManager
Gets the workflow id which should be used for a given workflow project.- Parameters:
projectId
- the project id- Returns:
- the workflow id for the project
- See Also:
-
getWorkflows
Description copied from interface:I_CmsWorkflowManager
Returns the available workflows for the current user.- Parameters:
cms
- the user cms context- Returns:
- the available workflows
- See Also:
-
initialize
Description copied from interface:I_CmsWorkflowManager
Initializes this workflow manager instance.- Specified by:
initialize
in interfaceI_CmsWorkflowManager
- Overrides:
initialize
in classA_CmsWorkflowManager
- Parameters:
adminCms
- the CMS context with admin privileges- See Also:
-
cleanUpInvalidResourcesFromUserPublishList
protected List<CmsResource> cleanUpInvalidResourcesFromUserPublishList(CmsObject cms, List<CmsResource> resources) Removes invalid publish resources (those that are unchanged, or can't be found) from the user's publish list, and only returns those which are not invalid.- Parameters:
cms
- the CMS contextresources
- the resources to filter- Returns:
- the valid resources to publish
-