public class

GraphFormatHelper

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.beans.GraphFormatHelper

Class Overview

This class provides a series of methods that aid on the manipulation of graph formatting properties.

Summary

Constants
int LocalShowGraphAttributeID Enum for undefined graph property
int SHOW_MAXIMUM_INDEX Index value pointing to the place where it indicates if the maximum property should be shown or not.
int SHOW_MINIMUM_INDEX Index value pointing to the place where it indicates if the minimum property should be shown or not.
int VALUE_MAXIMUM_INDEX Index value pointing to the place where the maximum value is located.
int VALUE_MINIMUM_INDEX Index value pointing to the place where the minimum value is located.
Public Constructors
GraphFormatHelper()
Public Methods
static ImageTag generateMacroInformationTag(WebComponent wc)
Generates an information image tag with tooltip details about how macros can be used on text fields for content properties on a graph.
static Tag[] generateMajorGraphTypesImages(WebComponent bean, AppContext appContext, ShortcutList majorTypePicker, String paramNamePrefix, String currentValue, String selectedCss)
Generate a series of Tag objects corresponding to images for the graph major type picker requested.
static Tag generateMinorGraphTypesCombo(WebComponent bean, AppContext appContext, ShortcutList minorTypePicker, String paramName, String currentValue)
Generate a Tag instance with all the information required for displaying the user the different options for graph minor type.
static GraphTitleInformation[] getApplicableAxisTitles(int majorType, int minorType)
This method is deprecated. please use getGraphAxisTargets() and getGraphTitleTargets() instead
static GraphTitleInformation[] getApplicableAxisTitles()
This method is deprecated. please use getGraphAxisTargets() and getGraphTitleTargets() instead
static GraphTitleInformation[] getApplicableAxisTitles(int majorType)
This method is deprecated. Please use the interface that receives both major and minor types as arguments. The logic for validating which axis are applicable depend on these two properties.
static GraphAxisInformation[] getApplicableAxisValues(int majorType)
Given the graph major type, it gets the list of axis that should be enabled to be modified and included as arguments for the formatting event to handle axis values.
static int getGraphAttributeID(int objectID, int seriesID)
Utility method that based on the objectID sent as parameter, get the corresponding attribute ID for its show flag
static int getGraphAttributeID(int objectID)
Utility method taht based on the objectID sent as parameter, get the corresponding attribute ID for its show flag
static GraphTitleInformation[] getGraphAxisTargets()
static GraphTitleInformation[] getGraphFormatTargets()
static GraphTitleInformation[] getGraphLabelTargets()
static int getGraphNumFormatAttributeID(int objectID)
Utility method that based on the objectID sent as parameter, get the corresponding attribute ID used for Graph number format attribute
static int getGraphNumFormatObjectID(int objectID)
Utility method that adjust the objectID for Graph number format attribute
static String getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID)
Retrieves the requested property from the graph
static String getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID, int seriesID)
Retrieves the requested property from the graph
static ArrayList getGraphSeries(int maxSeries, WebGraphProperties graphProperties)
Based on the graph properties provided, returns an ArrayList instance with WebGraphProperty elements of all the series available.
static ArrayList getGraphSeriesColorTargets(AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)
Get the information about the applicable series label targets, depending on the major and minor types currently associated with the graph
static ArrayList getGraphSeriesColorTargets(AppContext appContext, WebGraphProperties graphProperties)
Get the information about the applicable series color targets, depending on the major and minor types currently associated with the graph
static GraphSeriesInformation[] getGraphSeriesColorTargets(int major, int minor)
static GraphSeriesInformation[] getGraphSeriesLabelTargets(int major, int minor)
Get the information about the applicable series label targets, depending on the major and minor types currently associated with the graph
static ArrayList getGraphSeriesLabelTargets(AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)
static GraphSeriesTargetInfo getGraphSeriesTargetInfo(WebGraph graphObj, boolean isRWBean)
static GraphTitleInformation[] getGraphTitleTargets()
static int getMaxGraphSeries(WebGraph graphObj)
static String getPropertyValue(WebGraphProperties graphProperties, int objectId, int attributeId)
static String getPropertyValue(WebGraphProperties graphProperties, int objectId, int attributeId, int seriesId)
static int getRiserObjectID(int orgRiserID)
This method is to transform some special riser id to the common riser id If the original id is not a valid riser object id, just maintain it
static int getSupportPropertyId(int attributeID)
Returns the grouping category id for an attribute id
static String getValueForAllSeriesLabelTarget(WebGraphProperties graphProperties, ArrayList graphSeries, int orgAttributeId, WebComponent bean)
This method is designed to compute the related property value for "All Data Label" target.
static String getValueForAllTitleTarget(WebGraphProperties graphProperties, GraphTitleInformation[] availableTitles, int objectId, int attributeId, WebComponent bean)
This method is designed to compute the related property value for those "all" target, such as: All Text, All Titles, All Axes We check values of sub targets for each "all" target.
static boolean hasPrivilegesForTitle(WebComponent bean, int objectId)
This method can check if user has format privilege on giving title item.
static boolean isCombinableAttr(int attributeId)
For some attribute, we can't directly get property value for "All" target.
static boolean isGraph3D(int majorType)
This method determines if the graph major type sent as parameter corresponds to a 3D graph type
static boolean isLegendSupported(int majorType)
Determines given the major graph type if Legends are supported or not
static boolean isTargetForAll(int graphTargetID)
This method determines whether the graph target is a place holder for All items (e.g.
static String obtainMajorTypesFilter(int[] includeValues)
Utility method to generate a filter that will be used for determining which objects will be shown or not to the user, based on the graph major type currently selected.
static String obtainMajorTypesFilter(Hashtable exceptValues)
Utility method to generate a filter that will be used for determining which objects will be shown or not to the user, based on the graph major type currently selected.
static void renderMajorGraphTypes(MarkupOutput out, int availableGraphTypes, int currentGraphType, String imgSourcePath, String majorTypeParam, AppContext appContext)
This method is deprecated. No replacement.
static void renderMinorGraphTypes(MarkupOutput out, int currentGraphType, int currentMinorType, String minorTypeParam, AppContext appContext, String extraParameters)
This method is deprecated. No replacement.
static String retrieveIntervalValues(String interval)
Processes the interval property value obtained from the metadata
static String[] retrieveMinMaxFromScale(String scale)
Based on the Scale string, retrieve the values of the properties to use
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int LocalShowGraphAttributeID

Enum for undefined graph property

Constant Value: -1 (0xffffffff)

public static final int SHOW_MAXIMUM_INDEX

Index value pointing to the place where it indicates if the maximum property should be shown or not.

Constant Value: 1 (0x00000001)

public static final int SHOW_MINIMUM_INDEX

Index value pointing to the place where it indicates if the minimum property should be shown or not.

Constant Value: 0 (0x00000000)

public static final int VALUE_MAXIMUM_INDEX

Index value pointing to the place where the maximum value is located.

Constant Value: 3 (0x00000003)

public static final int VALUE_MINIMUM_INDEX

Index value pointing to the place where the minimum value is located.

Constant Value: 2 (0x00000002)

Public Constructors

public GraphFormatHelper ()

Public Methods

public static ImageTag generateMacroInformationTag (WebComponent wc)

Generates an information image tag with tooltip details about how macros can be used on text fields for content properties on a graph.

Parameters
wc WebComponent initialized instance
Returns
  • ImageTag instance initialized as an image with the macro information to display to the user as its tooltip.

public static Tag[] generateMajorGraphTypesImages (WebComponent bean, AppContext appContext, ShortcutList majorTypePicker, String paramNamePrefix, String currentValue, String selectedCss)

Generate a series of Tag objects corresponding to images for the graph major type picker requested.

Parameters
bean WebComponent base bean from where Messages and features can be asked
appContext AppContext instance from where Messages can be retrieved
majorTypePicker ShortcutList instance with the information of the major types to render
paramNamePrefix String value with the prefix name for the resulting image tags.
currentValue String value with the current major type selected
selectedCss String value with the css class to assign to the currently selected graph major type image.
Returns
  • Tag[] an array of Tag instances including each one of the images of the major types to render to the user

public static Tag generateMinorGraphTypesCombo (WebComponent bean, AppContext appContext, ShortcutList minorTypePicker, String paramName, String currentValue)

Generate a Tag instance with all the information required for displaying the user the different options for graph minor type.

Parameters
bean WebComponent base bean from where Messages and features can be asked
appContext AppContext instance from where Messages can be retrieved
minorTypePicker ShortcutList instance with the information of the minor types to render
paramName String value with the name the resulting select box tag will have
currentValue String value with the current minor type selected
Returns
  • Tag instance initialized with all the information and options to present to the user as graph minor types available.

public static GraphTitleInformation[] getApplicableAxisTitles (int majorType, int minorType)

This method is deprecated.
please use getGraphAxisTargets() and getGraphTitleTargets() instead

Given the graph major and minor type, it gets the list of titles that should be enabled to be modified and included as arguments for the formatting event to handle axis titles.

Parameters
majorType an element of the EnumDSSXMLMajorGraphTypes enumeration
minorType the minor type selected
Returns
  • an array of GraphTitleInformation instances that contain the information of the axis titles applicable given the graph major and minor type.

public static GraphTitleInformation[] getApplicableAxisTitles ()

This method is deprecated.
please use getGraphAxisTargets() and getGraphTitleTargets() instead

Returns
  • an array of GraphTitleInformation instances that contain the information of the axis titles that can be shown to the user.

public static GraphTitleInformation[] getApplicableAxisTitles (int majorType)

This method is deprecated.
Please use the interface that receives both major and minor types as arguments. The logic for validating which axis are applicable depend on these two properties.

Given the graph major type, it gets the list of axis that should be enabled to be modified and included as arguments for the formatting event to handle axis titles.

Parameters
majorType an element of the EnumDSSXMLMajorGraphTypes enumeration
Returns
  • an array of GraphTitleInformation instances that contain the information of the axis titles applicable given the graph major type.

public static GraphAxisInformation[] getApplicableAxisValues (int majorType)

Given the graph major type, it gets the list of axis that should be enabled to be modified and included as arguments for the formatting event to handle axis values.

Parameters
majorType an element of the EnumDSSXMLMajorGraphTypes enumeration
Returns
  • an array of GraphAxisInformation instances containing the information of the axis titles applicable given the graph major type. For the ObjectID related with this axis, for these properties EnumDSSXMLGraphObjectID.DssXmlObjectIDNull should be used, that's why this method doesn't include this value.

public static int getGraphAttributeID (int objectID, int seriesID)

Utility method that based on the objectID sent as parameter, get the corresponding attribute ID for its show flag

Parameters
objectID the object being analyzed
seriesID the series being analyzed
Returns

public static int getGraphAttributeID (int objectID)

Utility method taht based on the objectID sent as parameter, get the corresponding attribute ID for its show flag

Parameters
objectID the object being analyzed
Returns

public static GraphTitleInformation[] getGraphAxisTargets ()

public static GraphTitleInformation[] getGraphFormatTargets ()

public static GraphTitleInformation[] getGraphLabelTargets ()

public static int getGraphNumFormatAttributeID (int objectID)

Utility method that based on the objectID sent as parameter, get the corresponding attribute ID used for Graph number format attribute

Parameters
objectID the object being analyzed
Returns

public static int getGraphNumFormatObjectID (int objectID)

Utility method that adjust the objectID for Graph number format attribute

Parameters
objectID the object being analyzed
Returns

public static String getGraphProperty (WebGraphProperties graphProperties, int objectID, int attributeID)

Retrieves the requested property from the graph

Parameters
graphProperties a WebGraphProperties initialized instance
objectID a valid objectID for the property
attributeID a valid attributeID for the property
Returns
  • the value of the property requested, or a null if the property was not found.

public static String getGraphProperty (WebGraphProperties graphProperties, int objectID, int attributeID, int seriesID)

Retrieves the requested property from the graph

Parameters
graphProperties a WebGraphProperties initialized instance
objectID a valid objectID for the property
attributeID a valid attributeID for the property
seriesID a valid seriesID for the property
Returns
  • the value of the property requested, or a null if the property was not found.

public static ArrayList getGraphSeries (int maxSeries, WebGraphProperties graphProperties)

Based on the graph properties provided, returns an ArrayList instance with WebGraphProperty elements of all the series available.

Parameters
graphProperties WebGraphProperties initialized instance
Returns
  • ArrayList initialized instance, with WebGraphProperty elements corresponding to each one of the visible series available on the graph.

public static ArrayList getGraphSeriesColorTargets (AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)

Get the information about the applicable series label targets, depending on the major and minor types currently associated with the graph

Parameters
appContext AppContext instance
graphProperties WebGraphProperties instance related to the graph to analyze
Returns

public static ArrayList getGraphSeriesColorTargets (AppContext appContext, WebGraphProperties graphProperties)

Get the information about the applicable series color targets, depending on the major and minor types currently associated with the graph

Parameters
appContext AppContext instance
graphProperties WebGraphProperties instance related to the graph to analyze
Returns

public static GraphSeriesInformation[] getGraphSeriesColorTargets (int major, int minor)

public static GraphSeriesInformation[] getGraphSeriesLabelTargets (int major, int minor)

Get the information about the applicable series label targets, depending on the major and minor types currently associated with the graph

Parameters
major int value with the graph major type
minor int value with the graph minor type
Returns
  • GraphSeriesInformation[] array with the applicable series labels targets

public static ArrayList getGraphSeriesLabelTargets (AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)

public static GraphSeriesTargetInfo getGraphSeriesTargetInfo (WebGraph graphObj, boolean isRWBean)

public static GraphTitleInformation[] getGraphTitleTargets ()

public static int getMaxGraphSeries (WebGraph graphObj)

public static String getPropertyValue (WebGraphProperties graphProperties, int objectId, int attributeId)

public static String getPropertyValue (WebGraphProperties graphProperties, int objectId, int attributeId, int seriesId)

public static int getRiserObjectID (int orgRiserID)

This method is to transform some special riser id to the common riser id If the original id is not a valid riser object id, just maintain it

public static int getSupportPropertyId (int attributeID)

Returns the grouping category id for an attribute id

public static String getValueForAllSeriesLabelTarget (WebGraphProperties graphProperties, ArrayList graphSeries, int orgAttributeId, WebComponent bean)

This method is designed to compute the related property value for "All Data Label" target. We check values of sub targets for each series label. If values are same, set it to "all" target; If not, set empty to "all" target

public static String getValueForAllTitleTarget (WebGraphProperties graphProperties, GraphTitleInformation[] availableTitles, int objectId, int attributeId, WebComponent bean)

This method is designed to compute the related property value for those "all" target, such as: All Text, All Titles, All Axes We check values of sub targets for each "all" target. If value are same, set it to "all" target; If not, set empty to "all" target

public static boolean hasPrivilegesForTitle (WebComponent bean, int objectId)

This method can check if user has format privilege on giving title item.

public static boolean isCombinableAttr (int attributeId)

For some attribute, we can't directly get property value for "All" target. This method can help to check out these attributes

public static boolean isGraph3D (int majorType)

This method determines if the graph major type sent as parameter corresponds to a 3D graph type

Parameters
majorType an element of the EnumDSSXMLMajorGraphTypes enumeration
Returns
  • a True if the graph representation is 3D. Otherwise returns False.

public static boolean isLegendSupported (int majorType)

Determines given the major graph type if Legends are supported or not

Parameters
majorType an element of the EnumDSSXMLMajorGraphTypes enumeration
Returns
  • True if this graph type supports Legends. Otherwise, returns False

public static boolean isTargetForAll (int graphTargetID)

This method determines whether the graph target is a place holder for All items (e.g. All Texts, All Titles) For those place holders, their fontStyle values should be depending on the contained individual items instead of the values from their own

Parameters
graphTargetID an element of the EnumDSSXMLGraphObjectID enumeration
Returns
  • a True if the graph target is a place holder indicating a All "X" item. Otherwise returns False.

public static String obtainMajorTypesFilter (int[] includeValues)

Utility method to generate a filter that will be used for determining which objects will be shown or not to the user, based on the graph major type currently selected.

Parameters
includeValues array of integer values to be included on the string
Returns
  • a String value with the different major type values separated by commas. Those values included on the includeValues parameter will be added to the resulting filter string.

public static String obtainMajorTypesFilter (Hashtable exceptValues)

Utility method to generate a filter that will be used for determining which objects will be shown or not to the user, based on the graph major type currently selected.

Parameters
exceptValues hash table with the values not to include on the resulting filter
Returns
  • a String value with the different major type values separated by commas. Those values included on the exceptValues parameter will not be included on the resulting filter string.

public static void renderMajorGraphTypes (MarkupOutput out, int availableGraphTypes, int currentGraphType, String imgSourcePath, String majorTypeParam, AppContext appContext)

This method is deprecated.
No replacement.

Displays the images that correspond to the graph types available given the flag of available graph types

Parameters
out instance of MarkupOutput that will hold the HTML output of this method
availableGraphTypes flag from the Report Data that indicates which major graph types are available to a given report.
currentGraphType major type used currently for a given report.
imgSourcePath source path where images to be displayed are located.
majorTypeParam prefix name to use for the controls to be displayed.
appContext a AppContext instance.

public static void renderMinorGraphTypes (MarkupOutput out, int currentGraphType, int currentMinorType, String minorTypeParam, AppContext appContext, String extraParameters)

This method is deprecated.
No replacement.

Displays the combo box that corresponds to the minor graph types available given the current graph major types

Parameters
out instance of MarkupOutput that will hold the HTML output of this method
currentGraphType major type used currently for a given graph.
currentMinorType minor type used currently for a given graph.
minorTypeParam name to use for the control to be displayed.
appContext a AppContext instance.
extraParameters any other attributes that should be added to the Select control to be rendered.

public static String retrieveIntervalValues (String interval)

Processes the interval property value obtained from the metadata

Parameters
interval String value of the graph property
Returns
  • null if the interval option was not selected. Otherwise, returns the value saved in the metadata (meaning the option is checked)

public static String[] retrieveMinMaxFromScale (String scale)

Based on the Scale string, retrieve the values of the properties to use

Parameters
scale a String with the information of the graph's scale property saved on the metadata
Returns
  • an array with four values. The indexes to use for accessing this information are SHOW_MAXIMUM_INDEX, SHOW_MINIMUM_INDEX, VALUE_MINIMUM_INDEX and VALUE_MAXIMUM_INDEX