Package com.comalatech.workflow
Interface WorkflowService
-
public interface WorkflowService
Provides services for manipulating workflows
-
-
Field Summary
Fields Modifier and Type Field Description static String
CUSTOM_THEME_HTML_FOOTER
static String
CUSTOM_THEME_HTML_HEADER
static String
CUSTOM_THEME_HTML_MENU
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
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.List<Workflow>
getActiveWorkflows(com.atlassian.confluence.core.ContentEntityObject content)
returns the workflow that is active on the given Content Object (Page, BlogPost)String
getCustomThemeWorkflowHtml(com.atlassian.confluence.core.ContentEntityObject content)
Deprecated.String
getVersion()
Retrieves the version of Ad hoc WorkflowsWorkflow
getWorkflow(com.atlassian.confluence.core.ContentEntityObject content)
Returns the workflow that is set on a content object (Page, Blogpost).Workflow
getWorkflow(com.atlassian.confluence.spaces.Space space, String workflowName)
Returns the space workflow with the given name.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.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.List<Workflow>
getWorkflows(com.atlassian.confluence.spaces.Space space)
Returns the workflows for the given space.List<Workflow>
getWorkflowTemplates()
Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates()
List<Workflow>
getWorkflowTemplates(com.atlassian.confluence.spaces.Space space)
Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates(Space)
Workflow
loadWorkflow(com.atlassian.confluence.core.ContentEntityObject content, String workflowMarkup)
Loads the given workflowMarkup into the contentWorkflow
loadWorkflow(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 Detail
-
CUSTOM_THEME_HTML_MENU
static final String CUSTOM_THEME_HTML_MENU
- See Also:
- Constant Field Values
-
CUSTOM_THEME_HTML_HEADER
static final String CUSTOM_THEME_HTML_HEADER
- See Also:
- Constant Field Values
-
CUSTOM_THEME_HTML_FOOTER
static final String CUSTOM_THEME_HTML_FOOTER
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
void removeWorkflow(com.atlassian.confluence.spaces.Space space, String workflowName)
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
Workflow getWorkflow(com.atlassian.confluence.core.ContentEntityObject content)
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
List<Workflow> getActiveWorkflows(com.atlassian.confluence.core.ContentEntityObject content)
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
Workflow getWorkflow(com.atlassian.confluence.spaces.Space space, String workflowName)
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
List<Workflow> getWorkflows(com.atlassian.confluence.spaces.Space space)
Returns the workflows for the given space.- Parameters:
space
-- Returns:
- a list of space workflows that are set on the given space.
-
activateSpaceWorkflow
void activateSpaceWorkflow(com.atlassian.confluence.spaces.Space space, String workflowName)
Activate the given space workflow- Parameters:
space
-workflowName
- the name of the workflow to activate.
-
deactivateSpaceWorflow
void deactivateSpaceWorflow(com.atlassian.confluence.spaces.Space space, String workflowName)
Deactivate the given space workflow.- Parameters:
space
-workflowName
- the name of the workflow to deactivate.
-
getWorkflowTemplates
List<Workflow> getWorkflowTemplates()
Deprecated.from 1.3 useWorkflowTemplateManager.getWorkflowTemplates()
Returns the global workflow templates- Returns:
- a list of workflows templates that are set globally
-
getWorkflowTemplates
List<Workflow> getWorkflowTemplates(com.atlassian.confluence.spaces.Space space)
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
void removeWorkflowTemplate(com.atlassian.confluence.spaces.Space space, String workflowName)
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
String getCustomThemeWorkflowHtml(com.atlassian.confluence.core.ContentEntityObject content)
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.
-
-