Class WorkflowStepsClientSideElement

  • All Implemented Interfaces:
    ClientSideElement, MenuClientSideElement, LogEnabled, PluginAware, Configurable, Serviceable
    Direct Known Subclasses:
    FormEntriesWorkflowStepsClientSideElement

    public class WorkflowStepsClientSideElement
    extends StaticFileImportsClientSideElement
    implements MenuClientSideElement
    This element creates multiple toggle buttons representing a workflow. A menu represent workflow actions. The awaited configuration is: <workflow name="WORKFLOWNAME"> <action> <menu-1-label>I18N_KEY</menu-1-label> </action> <workflow-actions mode="exclude"> <action>22</action> <action>222</action> </workflow-actions> <workflow-steps mode="include"> <step>1</step> <step>2</step> </workflow-steps> <steps> <step id="1"> <workflow-actions mode="include"> <action>2</action> </workflow-actions> <comments mode="include"> <action>3</action> </comments> <action> <menu-1-label /> </action> </step> </steps> </workflow> Where WORKFLOWNAME is the name of the workflow such as 'content'. MANDATORY Where <action> is optional to override the default configuration of every step button and step menu The attribute name="..." is optional to specify the JS class used. Where <workflow-actions< is optional to restrict the available actions in the menu. Default value is <workflow-actions mode="exclude"/> The attribute mode="include" indicates that the list of actions ids will replace the one automatically determined (even if it only can by a sublist). Listing ids here ensure that no new actions will appear in this menu if the workflow is modified. The attribute mode="exclude" (default value) indicates that the list of actions ids will be removed from the one automatically determined (it only can by a sublist of it). Listing ids here ensure that when the workflow has a new action it will be added here. Where <steps> is optional and allows you to configure each step specifically. The <step> id attribute is MANDATORY The <workflow-actions> is identical to the one at the root of <workflow> but only for this specific step Where <comments< is identical to <workflow-actions< but to display to the user a dialog box to enter comments. The workflow has to support comments on that action. To avoid comments, set <comments mode="include"/> The <action> is identical to the one at the root of <workflow> but only for this specific step Here is a declaration sample in a plugin.xml file <extension id="org.ametys.web.workflow.WorkflowSteps" point="org.ametys.core.ui.RibbonControlsManager" class="org.ametys.cms.clientsideelement.WorkflowStepsClientSideElement"> <workflow name="content"> <steps> <step id="1"> <!-- Draft --> <workflow-actions mode="exclude"> <action>2</action><!-- Edit --> </workflow-actions> <comments mode="include"> <action>3</action><!-- propose --> </comments> </step> </steps> </workflow> </extension> Default configuration is proposed upon the StaticFileImportsClientSideElement. - default js class is "Ametys.plugins.cms.content.controller.WorkflowMenu" - default js files are loaded : /plugins/cms/resources/js/Ametys/plugins/cms/content/controller/WorkflowMenu.js and /plugins/cms/resources/js/Ametys/plugins/cms/content/actions/WorkflowAction.js - default js parameters are - label (to the i18nkey application:WORFKLOW_STEP_NAME) - description (to the i18nkey application:WORFKLOW_STEP_NAME_DESCRIPTION) - footerDescription (to the i18nkey application:WORFKLOW_STEP_NAME_FOOTER) - selection-target-id (to ^content$) - icon-small, icon-medium, icon-large (to /plugins/cms/resources_workflow/WORFKLOW_STEP_NAME-small.png for an application i18nkey, or /plugins/PLUGINNAME/resources/img/workflow/WORFKLOW_STEP_NAME-small.png for a plugin i18nkey) - workflow-step (tp the value configured avove) - workflow-name (to the value configured above) - selection-enable-multiselection (true) - selection-description-empty : i18nkey plugin.cms:CONTENT_WORKFLOW_NOSELECTION_DESCRIPTION - selection-description-nomatch : i18nkey plugin.cms:CONTENT_WORKFLOW_NOMATCH_DESCRIPTION - selection-description-multiselectionforbidden : i18nkey plugin.cms:CONTENT_WORKFLOW_NOMULTISELECT_DESCRIPTION - additionnal js parameters are - noaction-available-description : i18nkey for description when no actions are available, plugin.cms:CONTENT_WORKFLOW_NOACTIONAVAILABLE_DESCRIPTION - refreshing-description : i18nkey for description when refreshing, plugin.cms:CONTENT_WORKFLOW_REFRESH_DESCRIPTION - contentselected-start-description : i18nkey for description of the current content selection (start of the description) : plugin.cms:CONTENT_WORKFLOW_DESCRIPTION_BEGIN - contentselected-end-description : i18nkey for description of the current content selection (end of the description) : plugin.cms:CONTENT_WORKFLOW_DESCRIPTION_END - editing-description : i18nkey for description when the content is beeing edited : plugin.cms:CONTENT_WORKFLOW_EDITING_DESCRIPTION So there is no need to define a <class> by default or import js files. Additionnal i18nkeys used are plugin.cms:CONTENT_WORKFLOW_DESCRIPTION and plugin.cms:CONTENT_WORKFLOW_LOCKED_DESCRIPTION