Module: alfresco/renderers/_ActionsMixin

alfresco/renderers/_ActionsMixin

This module can be mixed into other modules to generate menu items representing Alfresco document or folder actions generated for a specific node or an entirely custom action list. It exists as mixin to support multipe ways of rendering actions (e.g. either in a menu bar or in a context menu)

.
Author:
  • Dave Draper
License:
Source:

Members

allowedActions :array

Array containing a list of allowed actions This is used to filter out actions that the actions API returns, but haven't yet been implemented. TODO: Remove this once all actions have been implemented by the actions service. Currently - all actions of type link and pagelink should work.
Type:
  • array
Default Value:
  • null
Source:

allowedActionsString :array

A stringified array containing a list of allowed actions. This has been added to support token replacement within JSON models. It will override any allowedActions configuration.
Type:
  • array
Default Value:
  • null
Source:

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/_ActionsMixin.css"}]
Source:

customActions :object[]

An array of action configuration objects to render in the action menu. This array will take precedence over any actions defined on the "currentItem" unless the mergeActions) attribute is configured to be true (in which case both the actions defined on the "currentItem" will be rendered along with the actions defined in this array).
Type:
  • object[]
Default Value:
  • null
Source:

filterActions :boolean

Indicates whether or not actions should be filtered according to the allowedActions array.
Type:
  • boolean
Default Value:
  • false
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/_ActionsMixin.properties"}]
Source:

mergeActions :boolean

This indicates that both actions defined on the "currentItem" as well as actions defined by the customActions and widgetsForActions will be rendered.
Type:
  • boolean
Default Value:
  • false
Source:

widgetsForActions :object[]

This is array of actions to render if no customActions are defined or no actions are found in the currentItem. The list of actions does not currently reflect all the actions that will eventually be available, additional actions will be added in future releases as support is provided for them.
Type:
  • object[]
Source:

Methods

addAction(action, (integer})

Parameters:
Name Type Description
action object The configuration for the action to add
(integer} index The index of the action
Source:

addActions()

Add the actions provided by the current item.
Source:

allWidgetsProcessed(widgets)

This overrides the inherited extension point to add each created action menu item to the menu.
Parameters:
Name Type Description
widgets object[] The widgets created (this is expected to be a single item)
Source:

createDropDownMenu(callback)

Parameters:
Name Type Description
callback function The function to call to display the drop-down
Since:
  • 1.0.62
Source:

createEmptyMenu()

Since:
  • 1.0.62
Source:

isLoaded()

Since:
  • 1.0.62
Source:

loadDropDown(callback)

Parameters:
Name Type Description
callback function The function to call to display the drop-down
Since:
  • 1.0.62
Source:

postCreate()

Handles parsing of allowedActionsString if configured to override allowedActions.
Source:

processWidgetsForActions()

This function handles the creation of actions based on the widgetsForActions array. This aims to provide a sensible set of default actions based on the metadata of the current node.
Source: