Module: alfresco/renderers/Item

alfresco/renderers/Item

This widget provides a way in which data can be asynchronously loaded by configuring a loadItemPublishTopic to publish when created. There is full support for the standard payload construction options provided by the _PublishPayloadMixin when requesting the data through the configuration of:

A widgets model should be configured to render the loaded data, this model can be processed by configuring the widgetModelModifiers that are applied.

Since:
  • 1.0.86
Author:
  • Dave Draper
License:
Source:

Example

Sample configuration to load an render a user

{
  name: "alfresco/renderers/Item",
  config: {
    loadItemPublishTopic: "ALF_GET_USER",
    loadItemPublishPayload: {
      userName: "admin"
    },
    itemProperty: "user",
    widgets: [
      {
        name: "alfresco/renderers/Property",
        config: {
          propertyToRender: "displayName"
        }
      }
    ]
  }
}

Members

itemProperty :string

This is a dot-notation property that can be set to look up a specific location in the response.
Type:
  • string
Default Value:
  • null
Source:

loadItemPublishGlobal :boolean

Whether or not to publish globally when requesting an item to render.
Type:
  • boolean
Default Value:
  • false
Source:

loadItemPublishPayload :object

The payload to publish when requesting an item to render.
Type:
  • object
Default Value:
  • null
Source:

loadItemPublishPayloadItemMixin :boolean

Indicates whether or not the currentItem should be mixed into the payload published when requesting an item to render.
Type:
  • boolean
Default Value:
  • false
Source:

loadItemPublishPayloadModifiers :string[]

The modifiers to apply to the payload published when requesting an item to render (only applies when the loadItemPublishPayloadType is configured to be "PROCESS").
Type:
  • string[]
Default Value:
  • false
Source:

loadItemPublishPayloadType :string

The type of payload being published when requesting an item to render.
Type:
  • string
Since:
  • 1.0.86
Default Value:
  • null
Source:

loadItemPublishScope :string[]

A custom scope to publish on when requesting an item to render.
Type:
  • string[]
Default Value:
  • null
Source:

loadItemPublishToParent :boolean

Whether or not to publish on the global scope when requesting an item to render.
Type:
  • boolean
Default Value:
  • false
Source:

loadItemPublishTopic :string

The topic published to request an item to render.
Type:
  • string
Default Value:
  • null
Source:

widgetModelModifiers :string[]

The modifiers to apply to the widget model before rendering.
Type:
  • string[]
Source:

widgets :object[]

The widgets processed by AlfDocument should all be designed to work with a "currentItem" attribute.
Type:
  • object[]
Default Value:
  • null
Source:

Methods

createWidgetDom()

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

destroyWidget(widget, index)

Recursive destroy the supplied widget.
Parameters:
Name Type Description
widget object The widget to destroy
index number The index of the widget
Source:

onItemLoaded(payload)

Parameters:
Name Type Description
payload object The details of the document that have been provided.
Source:

postCreate()

If no current item is set but a nodeRef has been provided then publish a request to get the document with that nodeRef.
Source:

postMixInProperties()

Subscribes to the document load topic
Source:

renderItem()

Source: