MicroStrategy ONE

WebDisplayHelper and Related Interfaces

The interfaces that support the rendering of the Prompts Display view are discussed in this section.

The WebDisplayHelper interface is a helper for rendering prompts in a selection list or a shopping cart style. It is obtained using the getDisplayHelper method available in the WebPrompt interface. This method has a boolean parameter indication that specifies whether the available display units collection should be populated. The Display Helper object contains default display settings object and a collection of available display units.

The applyDefaultDisplaySettings method applies the following recursive selection and highlighting algorithm to the collection of available display units which is governed by the default display settings of the object properties. Assuming that both UseDefaultSelection and UseDefaultHighlighting properties are set to true, the algorithm can be described by the following pseudo-code:

  1. Obtain a set of currently selected units from the selection object.  

  2. For each unit in the collection of available display units, check if it is present in the selected units collection. If it is present, mark the unit as selected.  

  3. If none of the units in the collection of available display units is highlighted, mark the first non-selected unit. Note that depending on the value of the UseDetailedHighlighting property, the unit is highlighted with or without details. If the unit is an attribute and it is highlighted with details, then the subset of elements obtained from MicroStrategy Intelligence Server is controlled by the DefaultDisplaySetting’s ElementSource object.  

  4. For each display unit with details in the collection of available display units, recursively apply steps 2 through 4.

If the UseDefaultSelection or UseDefaultHighlighting property is false, then the corresponding steps are omitted. If both the properties are false, no default selection/highlighting is applied.

The WebDisplayUnits is a read-write collection of WebDispalyUnit objects. It is populated at the display helper construction. The content of this collection depends on the prompt type and values of certain prompt properties.

Prompt type Available Display units Origin

WebConstantPrompt

None

None

WebElementsPrompt

Collection of elements

From the suggested answers or origin attribute

WebExpressionPrompt

Collection of objects

If the origin is a search

Single attribute or
Single metric or
Single dimension or
Single folder

If the origin is an attribute or
metric or
dimension or
folder

WebObjectsPrompt

Collection of objects, or

From the suggested answer or search object and if the style is not hierarchical

Single folder

If the style is hierarchical

WebDimtyPrompt

Collection of attributes and dimensions

From the suggested answer or search object

The WebDisplayUnits interface provides methods to find a WebDisplayUnit for a given object. This interface is typically used to find objects and then highlight them.

The findAllItems method on the WebDisplayUnits interface returns an interface of type WebDisplayUnits. It is a collection interface with methods to highlight or select a group of WebDispalyUnit objects.

The WebDisplayUnit interface has properties that are relevant to displaying the object. The following table explains some of the important properties of the WebDisplayUnit interface:

Properties Comments

UnitType

This corresponds to EnumWebDependentObjectType. The following UnitTypes are available: WebDisplayUnitDefault, WebDisplayUnitFolder, WebDisplayUnitAttribute, and WebDisplayUnitDimension.

Highlighted

This indicates whether this object is highlighted. The object can be polled to get details while highlighting. By default, this property highlights the unit without details.

Selected

This indicates whether this object is selected.

Details

This helps in getting the object definition. For example, for a folder object, adding details amounts to getting its immediate children.

ChildUnits

For collection objects such as Folder, this property represents a collection of child objects. Usually this collection is full if the object has details.

The WebDefaultDisplaySettings interface supports default highlighting and default selection. The properties of this interface are set to the desired values before calling applyDefaultDisplaySettings or getDesplayXML methods. The following table explains the properties:

Properties Comments

UseDefaultHighlighting

This controls whether the WebDisplayHelper should execute its default-highlighting algorithm. For example, if a folder object is highlighted and none of its elements are highlighted, the default highlighting marks the first element in the folder object as highlighted. Default value for this property is false.

UseDetailedHighlighting

This is used only when UseDefaultHighlighting is true. It controls whether the default-highlighting algorithm uses the addDetails method for the objects it highlights. Default value for this property is true.

UseDefaultSelection

If this is enabled, then based on the current prompt answer, UseDefaultSelection marks certain objects in the available list as selected. Default value for this property is false.

ElementSource

You can configure the element source so that the default highlighting algorithm is used if an attribute object is highlighted with details = true. This is used only if both UseDefaultHighlighting and UseDetailedHighlighting are true and the default-highlighting algorithm happens to highlight a previously non-highlighted attribute object. It ignores the element source configured on the attribute object.