Package com.comalatech.workflow
Interface WorkflowService
public interface WorkflowService
Provides services for manipulating workflows
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateSpaceWorkflow
(com.atlassian.confluence.spaces.Space space, String workflowName) Activate the given space workflowvoid
addWorkflowTemplate
(com.atlassian.confluence.spaces.Space space, String workflowMarkup) Deprecated.void
deactivateSpaceWorflow
(com.atlassian.confluence.spaces.Space space, String workflowName) Deactivate the given space workflow.getActiveWorkflows
(com.atlassian.confluence.core.ContentEntityObject content) returns the workflow that is active on the given Content Object (Page, BlogPost)getCustomThemeWorkflowHtml
(com.atlassian.confluence.core.ContentEntityObject content) Deprecated.Retrieves the version of Ad hoc WorkflowsgetWorkflow
(com.atlassian.confluence.core.ContentEntityObject content) Returns the workflow that is set on a content object (Page, Blogpost).getWorkflow
(com.atlassian.confluence.spaces.Space space, String workflowName) Returns the space workflow with the given name.getWorkflowHtmlElements
(com.atlassian.confluence.core.ContentEntityObject content) Provides the html content to include in a page to allow the Workflow menu and other items to be displayed in a custom theme.getWorkflowHtmlElements
(com.atlassian.confluence.core.ContentEntityObject content, boolean publishedVersion) Provides the html content to include in a page to allow the Workflow menu and other items to be displayed in a custom theme.getWorkflows
(com.atlassian.confluence.spaces.Space space) Returns the workflows for the given space.Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates()
getWorkflowTemplates
(com.atlassian.confluence.spaces.Space space) Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates(Space)
loadWorkflow
(com.atlassian.confluence.core.ContentEntityObject content, String workflowMarkup) Loads the given workflowMarkup into the contentloadWorkflow
(com.atlassian.confluence.spaces.Space space, String workflowMarkup) Loads the given workflowMarkup as a space workflow.void
removeWorkflow
(com.atlassian.confluence.core.ContentEntityObject content) Removes the workflow from a given content objectvoid
removeWorkflow
(com.atlassian.confluence.spaces.Space space, String workflowName) Removes the given workflow from a spacevoid
removeWorkflowTemplate
(com.atlassian.confluence.spaces.Space space, String workflowName) Deprecated.
-
Field Details
-
CUSTOM_THEME_HTML_MENU
- See Also:
-
CUSTOM_THEME_HTML_HEADER
- See Also:
-
CUSTOM_THEME_HTML_FOOTER
- See Also:
-
-
Method Details
-
getVersion
String getVersion()Retrieves the version of Ad hoc Workflows- Returns:
- the version number
-
loadWorkflow
Workflow loadWorkflow(com.atlassian.confluence.core.ContentEntityObject content, String workflowMarkup) throws WorkflowException Loads the given workflowMarkup into the content- Parameters:
content
- the content objectworkflowMarkup
- the workflow markup- Returns:
- the workflow
- Throws:
WorkflowException
- if the markup provided is not valid, or if there is a problem loading the workflow to the content
-
loadWorkflow
Workflow loadWorkflow(com.atlassian.confluence.spaces.Space space, String workflowMarkup) throws WorkflowException Loads the given workflowMarkup as a space workflow.- Parameters:
space
- the space to add the workflow toworkflowMarkup
- the workflow markup- Returns:
- the workflow
- Throws:
WorkflowException
- if the markup provided is not valid, or if there is a problem loading the workflow to the space
-
removeWorkflow
void removeWorkflow(com.atlassian.confluence.core.ContentEntityObject content) Removes the workflow from a given content object- Parameters:
content
- the content object to remove the workflow from
-
removeWorkflow
Removes the given workflow from a space- Parameters:
space
- the space to remove the workflow fromworkflowName
- the name of the workflow to be removed
-
getWorkflow
Returns the workflow that is set on a content object (Page, Blogpost). If there is no workflow set on the given content object null will be returned. Note a content workflow may not be set on a content object, but it may still be subject to a space wide workflow. SeegetActiveWorkflows(ContentEntityObject)
for all applicable workflows on a content object.- Parameters:
content
- the content to get the workflow for- Returns:
- The Workflow for the given content or null if no workflow is set.
-
getActiveWorkflows
returns the workflow that is active on the given Content Object (Page, BlogPost)- Parameters:
content
-- Returns:
- the list of Workflows that apply to the given content.
-
getWorkflow
Returns the space workflow with the given name.- Parameters:
space
- the space where the workflow is setworkflowName
- the name of the workflow to return- Returns:
- the workflow with the given name on the given space, or null if there is no workflow with the given name.
-
getWorkflows
Returns the workflows for the given space.- Parameters:
space
-- Returns:
- a list of space workflows that are set on the given space.
-
activateSpaceWorkflow
Activate the given space workflow- Parameters:
space
-workflowName
- the name of the workflow to activate.
-
deactivateSpaceWorflow
Deactivate the given space workflow.- Parameters:
space
-workflowName
- the name of the workflow to deactivate.
-
getWorkflowTemplates
Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates()
Returns the global workflow templates- Returns:
- a list of workflows templates that are set globally
-
getWorkflowTemplates
Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates(Space)
Returns the workflow templates for a given space- Parameters:
space
- the space to get the workflow templates for- Returns:
- a list of workflow templates that are set on the given space.
-
addWorkflowTemplate
void addWorkflowTemplate(com.atlassian.confluence.spaces.Space space, String workflowMarkup) throws WorkflowException Deprecated.Adds a workflow template to a space- Parameters:
space
- the space to add the workflow template toworkflowMarkup
- the workflow markup to add- Throws:
WorkflowException
- if there was an error with the workflow markup
-
removeWorkflowTemplate
Deprecated.Removes a workflow template from a space.- Parameters:
space
- the space to remove the workflow template fromworkflowName
- the name of the workflow to remove
-
getCustomThemeWorkflowHtml
Deprecated.Provides the html content to include in a page to allow the Workflow menu to work. This content is normally included in the viewpage action by default, this method is only required if you have another custom plugin that overrides the view page action, or a custom theme that bypasses it completely. The custom theme/action still needs to include the workflow webitems in the appropriate location.- Parameters:
content
- the page to get the custom html for- Returns:
- html content that will allow the workflow menu to work
-
getWorkflowHtmlElements
Map<String,String> getWorkflowHtmlElements(com.atlassian.confluence.core.ContentEntityObject content) Provides the html content to include in a page to allow the Workflow menu and other items to be displayed in a custom theme. This content is normally included in the viewpage action by default, this method is only required if you have another custom plugin that overrides the view page action, or a custom theme that bypasses it completely. The custom theme/action still needs to include the workflow webitems in the appropriate location. This method will return the status of the most recent version of the page, equivalent to callinggetWorkflowHtmlElements(ContentEntityObject, boolean)
with the false param.- Parameters:
content
-- Returns:
- Returns a map containing html display elements for the given page. See the static final variables prefixed with CUSTOM_THEME_HTML for valid key values.
-
getWorkflowHtmlElements
Map<String,String> getWorkflowHtmlElements(com.atlassian.confluence.core.ContentEntityObject content, boolean publishedVersion) Provides the html content to include in a page to allow the Workflow menu and other items to be displayed in a custom theme. This content is normally included in the viewpage action by default, this method is only required if you have another custom plugin that overrides the view page action, or a custom theme that bypasses it completely. The custom theme/action still needs to include the workflow webitems in the appropriate location. Use the boolean param to specify if the status display part of the html elements should display the information on the latest workflow state, or the most recently published version (if it exists).- Parameters:
content
-publishedVersion
-- Returns:
- Returns a map containing html display elements for the given page. See the static final variables prefixed with CUSTOM_THEME_HTML for valid key values.
-
WorkflowTemplateManager.addWorkflowTemplate(Space, String)