+

Search Tips   |   Advanced Search

Access list-rendering attributes and list properties

To generate the list designs with IBM Digital Data Connector, we can access individual list-rendering context attributes and list properties.

When we set a new list-rendering context, use the attribute parameter to add arbitrary name-value pairs to that list-rendering context. We can then extract these name-value pairs from the list-rendering context at other places using the [Plugin:ListRenderingContext action="getAttribute"] tag. If we use this technique in nested contexts, it always addresses the currently active list-rendering context. For example, we can establish a list-rendering context such as the following one:

[Plugin:ListRenderingContext action="set" extension-id="ibm.portal.ddc.xml"
   profile="ibm.portal.atom"
   attribute="source=https://www.ibm.com/connections/communities/service/atom/catalog/public"
   attribute="myKey=myValue" compute=“always“]
If we do so, we can retrieve the values for the source and myValue properties later in the design as follows:
[Plugin:ListRenderingContext action="getAttribute" key="source"]
[Plugin:ListRenderingContext action="getAttribute" key="myKey"]
Use this mechanism to pass information from a parent list-rendering context into a nested list-rendering context. After a nested list-rendering context has been established, information from the parent list-rendering context is not available via the [AttributeResource] tag. Therefore, when we set a nested list-rendering context, we can make parent attributes available to the nested context as follows:
[Plugin:ListRenderingContext action="set" extension-id="ibm.portal.ddc.xml"
     profile="ibm.portal.atom"
     attribute="source=[AttributeResource key=“catalogItemDetailsLink“]
     attribute="myKey=[AttributeResource key=“catalogItemFromParentContext“]“       compute=“always“]

We can also use the [Plugin:ListRenderingContext] plug-in to access individual list properties based on the information that is loaded by the addressed DDC plug-in. We do so by specifying the value getListProperty for the action parameter. Example: To retrieve the list property nextLink from the bean list that is loaded for the current list-rendering context, use the following tag:

    [Plugin:ListRenderingContext action="getListProperty" key="nextLink"]

When we write list-rendering context attributes or bean list properties to the markup, use the parameters format, separator, and escape to control the transformation into markup:

  • The format and separator parameters work the same way as they do with the [AttributeResource] tag. For more information, read Set the list-rendering context.

  • To conform to the surrounding markup type, use the escape parameter to escape the string the plug-in returns. Supported values are xml, json, javascript, and none.


Parent The list-rendering context

Related tasks:

Set the list-rendering context