Defined within the DocumentLibrary config section, status indicators are small icons typically used to indicate the presence of a marker aspect, or whether a document is in a particular state, for example checked out for editing.
Indicator images by default are referenced by id: /res/components/documentlibrary/indicators/{id}-16.png unless the name is overridden by the “icon” attribute. Tooltip labels are also defaulted by id: status.{id} and can be overridden by the label attribute.
The status indicators are located in the <indicators> config container element with the following structure:
<indicatorid (index) (icon) (label)> <evaluator /> <labelParam index /> <override /> </indicator>
where:
-
<indicator>: Status indicator element with the following attributes:
- id: Unique indicator id
- index: Determines display order of this indicator
- icon: Icon filename; if not specified, id is used
- label: Tooltip i18 label; if not specified, id is used
- <evaluator>: Bean id of evaluator that determines the visibility of the image. The Evaluator extends org.alfresco.web.evaluator.BaseEvaluator
-
<labelParam>: Allows placeholder values within i18n label to be replace
at runtime with node properties. The value is the replacement string or dot notation
path to a node property. The attribute is:
- index: Index of placeholder value with i18n message.
- <override>: Allows this indicator to override (hide) other indicators that would otherwise be visible. The value is the id of another indicator to override.
Example config
<configevaluator="string-compare"condition="DocumentLibrary"> ... <indicator id="google-docs-locked" index="10"> <evaluator>evaluator.doclib.indicator.googleDocsLocked</evaluator> <labelParam index="0">{jsNode.properties.owner.displayName}</labelParam> <labelParam index="1">{jsNode.properties.owner.userName}</labelParam> <override>locked</override> </indicator> </config>
A note about the labelParam value: refactoring on the client-side (JavaScript code) means that a common helper object is available for each node within the Document Library during the rendering cycle, namely jsNode. A full reference for this new resource is in jsNode Reference.