Module: alfresco/renderers/Indicators

alfresco/renderers/Indicators

This creates a set of icons that indicate the status of the item. Indicators are defined in the Alfresco Share XML configuration to be rendered in the Document Library. When using this renderer in the context of Alfresco Share then the legacyMode should be configured to be true in order to support 3rd party extensions to the Share configuration. By default the widget will attempt to map the indicator "icon" attribute to an image path either in Share (with legacyMode) enabled) or within the Aikau - however, it is also possible to configure an iconMapping to map indicator icons to custom image files.
Author:
  • Dave Draper
  • Martin Doyle
License:
Source:

Examples

Standalone Aikau Client configuration (images expected to be found in "alfresco/renderers/css/images/indicators/"):

{
  name: "alfresco/renderers/Indicators",
}

Alfresco Share configuration (images expected to be found in"components/documentlibrary/indicators/"):

{
  name: "alfresco/renderers/Indicators",
  config: {
    legacyMode: true
  }
}

Custom mapping for EXIF indicator image:

{
  name: "alfresco/renderers/Indicators",
  config: {
    iconMapping: {
      "exif-16.png": "custom/icon/folder/my-exif-icon.png"
    }
  }
}

Members

<protected> _currentIndicators :object[]

This is an auto-populated instance property that holds a cleaned-up array of indicators for the current item.
Type:
  • object[]
Source:

cssRequirements :object[]

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

i18nRequirements :object[]

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

iconMapping :object

An object that can map each icon attribute to a custom source file for the indicator image. All mappings will be appended to the "resource URL" (e.g. in Alfresc Share this prefix would be "share/res/") which give maximum opportunity for finding images anywhere within the application.
Type:
  • object
Since:
  • 1.0.55
Default Value:
  • null
Source:

iconWhiteList :string[]

This is a white list of the icons available in Aikau. If any indicator is configured without iconMapping and is rendering a currentItem that does not map one of these values then legacyMode will automatically be enabled.
Type:
  • string[]
Since:
  • 1.0.71
Source:

legacyMode :boolean

This indicates whether or not to use the root path of "/res/components/documentlibrary/indicators/" for icon images. This would be the path expected when the widget is being used within the Alfresco Share application and all icons would need to be found at this location to satify customization requirements.
Type:
  • boolean
Since:
  • 1.0.55
Default Value:
  • false
Source:

propertyToRender :string

This should be set to the name of the property to render (e.g. "cm:name"). The property is expected to be in the properties map for the item being rendered.
Type:
  • string
Default Value:
  • null
Source:

supportActions :boolean

Indicates whether or not the configured actions for the indicators supported. So if this is configured to be false then no indicator will be clickable regardless of whether or not an action has been provided for it.
Type:
  • boolean
Since:
  • 1.0.72
Default Value:
  • true
Source:

Methods

addIndicator(indicator, index)

Parameters:
Name Type Description
indicator object The indicator configuration to add
index integer The index of the indicator
Source:

createWidgetDom()

Overrides the inherited function to construct the DOM for the widget using native browser capabilities.
Since:
  • 1.0.101
Source:

iconInWhiteList(icon) → {boolean}

Checks the whitelist for the presence of the supplied icon.
Parameters:
Name Type Description
icon string The icon to check the whitelist for
Since:
  • 1.0.71
Source:
Returns:
True if the icon is found and false otherwise
Type
boolean

<protected> normaliseIndicators(currentItem) → {object[]}

Normalise and return the indicators for the current item as an array. This means things such as sorting according to index and respecting the overrides properties on the indicators.
Parameters:
Name Type Argument Description
currentItem object <optional>
The current item, on which the indicators can be found
Source:
Returns:
The indicators.
Type
object[]

onActionClick(indicator)

Parameters:
Name Type Description
indicator object The indicator to generate the action for
Source:

postCreate()

Source:

postMixInProperties()

Set up the attributes to be used when rendering the template.
Source: