MicroStrategy ONE
Style Maps
By default all MicroStrategy reports are displayed in MicroStrategy Web to all user groups using the ReportGridStyle style. Now, you might want users that belong to the Accounting user group to see the same MicroStrategy Reports in the ReportGridStyle-ForGridGraphMode style instead that uses the Accounting auto style. This customization can be achieved by using style maps.
A style map allows you to map a particular style to another style based on some condition being satisfied. Based on the previous customization example, so long as the condition that the user belongs to the Accounting user group is satisfied, the ReportGridStyle-ForGridGraphMode style will be used for all reports instead of the default ReportGridStyle.
A style map comprises the following parts:
- Style that is being mapped
- Style to which the style above is being mapped
- Style mapper that contains the mapping condition
Style maps are created using the Web Customization Editor. The following topics provide information on using the Style Map Creation Wizard and the Style Mapper Creation Wizard.
Style maps created by the Web Customization Editor as well as the default style maps provided by MicroStrategy Web are defined in the Style Catalog Configuration file (styleCatalog.xml located in WEB-INF/xml).
...
<MapperDefns>
<MapperDefn name="PromptsContainerGUIMapper" class="com.microstrategy.web.app.transforms.PromptsContainerGUIStyleMapper" description="This mapper compares the output mode against the specified addl_data string." />
...
...
</MapperDefns>
<StyleMaps>
<StyleMap from_style="PromptsTransformClassic">
<MapCondition mapper="PromptsContainerGUIMapper" addl_data="2" to_style="PromptsContainerStyle_Widget" />
</StyleMap>
...
...
</StyleMaps>
...
The <MapperDefn> node specifies information about the style mapper. This style mapper class contains the logic for the mapping condition. The style mapper PromptsContainerGUIMapper (see example above) checks for the display mode of MicroStrategy Web—whether it is HTML or DHTML mode. The values for HTML and DHTML modes are defined as 1 and 2 in the style mapper and obtained from the addl_data parameter (described below) of a style map.
The <StyleMaps> node specifies the style that is being mapped, style mapper to be used and the style to be used when the mapping condition is satisfied. The <StyleMap> node contains a parameter called addl_data which is used to specify a string that the style mapper can use to check the mapping condition.
See also: