Package org.opencastproject.workflow.api
Class WorkflowDefinitionImpl
java.lang.Object
org.opencastproject.workflow.api.WorkflowDefinitionImpl
- All Implemented Interfaces:
Comparable<WorkflowDefinition>,WorkflowDefinition
A JAXB-annotated implementation of
WorkflowDefinition-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from interface org.opencastproject.workflow.api.WorkflowDefinition
FAILURE_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(WorkflowOperationDefinition operation) Appends the operation to the workflow definition.voidadd(WorkflowOperationDefinition operation, int position) Inserts the operation at the given position into the workflow definition.voidTags the workflow definition with the given tag.voidRemoves all tags associated with this workflow definitionintcompareTo(WorkflowDefinition workflowDefinition) booleancontainsTag(String tag) Returnstrueif the workflow definition contains the given tag.booleancontainsTag(Collection<String> tags) Returnstrueif the workflow definition contains at least one of the given tags.get(int position) Returns the operation at the given position.A XML String describing the configuration parameter/panel for this WorkflowDefinition.A JSON String describing the configuration parameter/panel for this WorkflowDefinition.A longer description of this workflow definitionintAn integer describing the display order for this workflow definition.getId()The short title of this workflow definitionThe operations, listed in order, that this workflow definition includes.Gets the organization associated with this workflow (ornull, if it's global)getRoles()Returns the roles for this workflow definitionThe custom state mappings to use for this workflow.String[]getTags()Returns the tags for this workflow definition or an empty array if there are no tags.getTitle()The title for this workflow definitionremove(int position) Removes the workflow operation at the indicated position and returns it.voidRemoves the tag from the workflow definition.voidsetConfigurationPanel(String panelXML) Sets the configuration panel for this workflow.voidsetConfigurationPanelJson(String panelJson) Sets the configuration panel for this workflow.voidsetDescription(String description) Sets the descriptionvoidsetDisplayOrder(int displayOrder) Set the display ordervoidSets the identifiervoidSets the titletoString()static WorkflowDefinitionImplSince we are posting workflow definitions as one post parameter in a multi-parameter post, we can not rely on "automatic" JAXB deserialization.
-
Field Details
-
tags
-
roles
-
-
Constructor Details
-
WorkflowDefinitionImpl
public WorkflowDefinitionImpl()Constructor to be used by JAXB only.
-
-
Method Details
-
getId
The short title of this workflow definition- Specified by:
getIdin interfaceWorkflowDefinition- See Also:
-
setId
Sets the identifier- Specified by:
setIdin interfaceWorkflowDefinition- Parameters:
id- the workflow definition identifier- See Also:
-
getDescription
A longer description of this workflow definition- Specified by:
getDescriptionin interfaceWorkflowDefinition- See Also:
-
setDescription
Sets the description- Specified by:
setDescriptionin interfaceWorkflowDefinition- Parameters:
description- the workflow definition description- See Also:
-
getDisplayOrder
public int getDisplayOrder()An integer describing the display order for this workflow definition. The display order is supposed to define the order workflow lists as displayed to users. Default is 0.- Specified by:
getDisplayOrderin interfaceWorkflowDefinition- See Also:
-
setDisplayOrder
public void setDisplayOrder(int displayOrder) Set the display order- Specified by:
setDisplayOrderin interfaceWorkflowDefinition- Parameters:
displayOrder- the workflow definition display order- See Also:
-
setConfigurationPanel
Sets the configuration panel for this workflow.- Parameters:
panelXML- the xml for the configuration panel
-
getConfigurationPanel
A XML String describing the configuration parameter/panel for this WorkflowDefinition.- Specified by:
getConfigurationPanelin interfaceWorkflowDefinition- See Also:
-
setConfigurationPanelJson
Sets the configuration panel for this workflow.- Parameters:
panelJson- the json for the configuration panel
-
getConfigurationPanelJson
A JSON String describing the configuration parameter/panel for this WorkflowDefinition.- Specified by:
getConfigurationPanelJsonin interfaceWorkflowDefinition- See Also:
-
getOperations
The operations, listed in order, that this workflow definition includes.- Specified by:
getOperationsin interfaceWorkflowDefinition- See Also:
-
getStateMappings
Description copied from interface:WorkflowDefinitionThe custom state mappings to use for this workflow.- Specified by:
getStateMappingsin interfaceWorkflowDefinition
-
get
Returns the operation at the given position.- Specified by:
getin interfaceWorkflowDefinition- Parameters:
position- the operation's position- Throws:
IndexOutOfBoundsException- ifpositionis larger than the number of operations- See Also:
-
add
Appends the operation to the workflow definition.- Specified by:
addin interfaceWorkflowDefinition- Parameters:
operation- the operation- See Also:
-
add
Inserts the operation at the given position into the workflow definition.- Specified by:
addin interfaceWorkflowDefinition- Parameters:
operation- the operationposition- the position to add the workflow operation to- See Also:
-
remove
Removes the workflow operation at the indicated position and returns it.- Specified by:
removein interfaceWorkflowDefinition- Parameters:
position- the operation's position- Returns:
- the removed workflow operation
- Throws:
IndexOutOfBoundsException- ifpositionis larger than the number of operations- See Also:
-
addTag
Description copied from interface:WorkflowDefinitionTags the workflow definition with the given tag.- Specified by:
addTagin interfaceWorkflowDefinition- Parameters:
tag- the tag- See Also:
-
removeTag
Description copied from interface:WorkflowDefinitionRemoves the tag from the workflow definition.- Specified by:
removeTagin interfaceWorkflowDefinition- Parameters:
tag- the tag- See Also:
-
containsTag
Description copied from interface:WorkflowDefinitionReturnstrueif the workflow definition contains the given tag.- Specified by:
containsTagin interfaceWorkflowDefinition- Parameters:
tag- the tag- Returns:
trueif the element is tagged- See Also:
-
containsTag
Description copied from interface:WorkflowDefinitionReturnstrueif the workflow definition contains at least one of the given tags. If there are no tags contained in the set, then the definition is considered to match as well.- Specified by:
containsTagin interfaceWorkflowDefinition- Parameters:
tags- the set of tag- Returns:
trueif the element is tagged accordingly- See Also:
-
getTags
Description copied from interface:WorkflowDefinitionReturns the tags for this workflow definition or an empty array if there are no tags.- Specified by:
getTagsin interfaceWorkflowDefinition- Returns:
- the tags
- See Also:
-
clearTags
public void clearTags()Description copied from interface:WorkflowDefinitionRemoves all tags associated with this workflow definition- Specified by:
clearTagsin interfaceWorkflowDefinition- See Also:
-
valueOf
Since we are posting workflow definitions as one post parameter in a multi-parameter post, we can not rely on "automatic" JAXB deserialization. We therefore need to provide a static valueOf(String) method to transform an XML string into a WorkflowDefinition.- Parameters:
xmlString- The xml describing the workflow- Returns:
- A
WorkflowDefinitionImplinstance based on xmlString - Throws:
Exception- If there is a problem marshalling theWorkflowDefinitionImplfrom XML.
-
compareTo
- Specified by:
compareToin interfaceComparable<WorkflowDefinition>
-
getTitle
Description copied from interface:WorkflowDefinitionThe title for this workflow definition- Specified by:
getTitlein interfaceWorkflowDefinition- Returns:
- the title
-
setTitle
Description copied from interface:WorkflowDefinitionSets the title- Specified by:
setTitlein interfaceWorkflowDefinition- Parameters:
title- the title to set
-
getOrganization
Description copied from interface:WorkflowDefinitionGets the organization associated with this workflow (ornull, if it's global)- Specified by:
getOrganizationin interfaceWorkflowDefinition- Returns:
- the organization
-
getRoles
Description copied from interface:WorkflowDefinitionReturns the roles for this workflow definition- Specified by:
getRolesin interfaceWorkflowDefinition- Returns:
- the tags
-
toString
-