Package com.microstrategy.web.app.beans
Class GraphFormatHelper
- java.lang.Object
-
- com.microstrategy.web.app.beans.GraphFormatHelper
-
public class GraphFormatHelper extends java.lang.Object
This class provides a series of methods that aid on the manipulation of graph formatting properties.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description static int
LocalShowGraphAttributeID
Enum for undefined graph propertystatic int
SHOW_MAXIMUM_INDEX
Index value pointing to the place where it indicates if the maximum property should be shown or not.static int
SHOW_MINIMUM_INDEX
Index value pointing to the place where it indicates if the minimum property should be shown or not.static int
VALUE_MAXIMUM_INDEX
Index value pointing to the place where the maximum value is located.static int
VALUE_MINIMUM_INDEX
Index value pointing to the place where the minimum value is located.
-
Constructor Summary
Constructors Constructor Description GraphFormatHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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, java.lang.String paramNamePrefix, java.lang.String currentValue, java.lang.String selectedCss)
Generate a series ofTag
objects corresponding to images for the graph major type picker requested.static Tag
generateMinorGraphTypesCombo(WebComponent bean, AppContext appContext, ShortcutList minorTypePicker, java.lang.String paramName, java.lang.String currentValue)
Generate aTag
instance with all the information required for displaying the user the different options for graph minor type.static GraphTitleInformation[]
getApplicableAxisTitles()
Deprecated.please usegetGraphAxisTargets()
andgetGraphTitleTargets()
insteadstatic GraphTitleInformation[]
getApplicableAxisTitles(int majorType)
Deprecated.Please use the interface that receives both major and minor types as arguments.static GraphTitleInformation[]
getApplicableAxisTitles(int majorType, int minorType)
Deprecated.please usegetGraphAxisTargets()
andgetGraphTitleTargets()
insteadstatic 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)
Utility method taht based on the objectID sent as parameter, get the corresponding attribute ID for its show flagstatic int
getGraphAttributeID(int objectID, int seriesID)
Utility method that based on the objectID sent as parameter, get the corresponding attribute ID for its show flagstatic 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 attributestatic int
getGraphNumFormatObjectID(int objectID)
Utility method that adjust the objectID for Graph number format attributestatic java.lang.String
getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID)
Retrieves the requested property from the graphstatic java.lang.String
getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID, int seriesID)
Retrieves the requested property from the graphstatic java.util.ArrayList
getGraphSeries(int maxSeries, WebGraphProperties graphProperties)
Based on the graph properties provided, returns anArrayList
instance withWebGraphProperty
elements of all the series available.static GraphSeriesInformation[]
getGraphSeriesColorTargets(int major, int minor)
static java.util.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 graphstatic java.util.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 graphstatic 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 graphstatic java.util.ArrayList
getGraphSeriesLabelTargets(AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)
static GraphSeriesTargetInfo
getGraphSeriesTargetInfo(WebGraph graphObj, boolean isRWBean)
static GraphTitleInformation[]
getGraphTitleTargets()
static int
getMaxGraphSeries(WebGraph graphObj)
static java.lang.String
getPropertyValue(WebGraphProperties graphProperties, int objectId, int attributeId)
static java.lang.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 itstatic int
getSupportPropertyId(int attributeID)
Returns the grouping category id for an attribute idstatic java.lang.String
getValueForAllSeriesLabelTarget(WebGraphProperties graphProperties, java.util.ArrayList graphSeries, int orgAttributeId, WebComponent bean)
This method is designed to compute the related property value for "All Data Label" target.static java.lang.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 typestatic boolean
isLegendSupported(int majorType)
Determines given the major graph type if Legends are supported or notstatic boolean
isTargetForAll(int graphTargetID)
This method determines whether the graph target is a place holder for All items (e.g.static java.lang.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 java.lang.String
obtainMajorTypesFilter(java.util.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, java.lang.String imgSourcePath, java.lang.String majorTypeParam, AppContext appContext)
Deprecated.static void
renderMinorGraphTypes(MarkupOutput out, int currentGraphType, int currentMinorType, java.lang.String minorTypeParam, AppContext appContext, java.lang.String extraParameters)
Deprecated.static java.lang.String
retrieveIntervalValues(java.lang.String interval)
Processes the interval property value obtained from the metadatastatic java.lang.String[]
retrieveMinMaxFromScale(java.lang.String scale)
Based on the Scale string, retrieve the values of the properties to use
-
-
-
Field Detail
-
SHOW_MINIMUM_INDEX
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.- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
SHOW_MAXIMUM_INDEX
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.- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
VALUE_MINIMUM_INDEX
public static final int VALUE_MINIMUM_INDEX
Index value pointing to the place where the minimum value is located.- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
VALUE_MAXIMUM_INDEX
public static final int VALUE_MAXIMUM_INDEX
Index value pointing to the place where the maximum value is located.- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
LocalShowGraphAttributeID
public static final int LocalShowGraphAttributeID
Enum for undefined graph property- Since:
- MicroStrategy Web 9.0.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateMajorGraphTypesImages
public static Tag[] generateMajorGraphTypesImages(WebComponent bean, AppContext appContext, ShortcutList majorTypePicker, java.lang.String paramNamePrefix, java.lang.String currentValue, java.lang.String selectedCss)
Generate a series ofTag
objects corresponding to images for the graph major type picker requested.- Parameters:
bean
-WebComponent
base bean from whereMessages
and features can be askedappContext
-AppContext
instance from whereMessages
can be retrievedmajorTypePicker
-ShortcutList
instance with the information of the major types to renderparamNamePrefix
- String value with the prefix name for the resulting image tags.currentValue
- String value with the current major type selectedselectedCss
- 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 - Since:
- MicroStrategy Web 8.0.0
-
generateMinorGraphTypesCombo
public static Tag generateMinorGraphTypesCombo(WebComponent bean, AppContext appContext, ShortcutList minorTypePicker, java.lang.String paramName, java.lang.String currentValue)
Generate aTag
instance with all the information required for displaying the user the different options for graph minor type.- Parameters:
bean
-WebComponent
base bean from whereMessages
and features can be askedappContext
-AppContext
instance from whereMessages
can be retrievedminorTypePicker
-ShortcutList
instance with the information of the minor types to renderparamName
- String value with the name the resulting select box tag will havecurrentValue
- 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.- Since:
- MicroStrategy Web 8.0.0
-
isGraph3D
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 theEnumDSSXMLMajorGraphTypes
enumeration- Returns:
- a
True
if the graph representation is 3D. Otherwise returnsFalse
.
-
getGraphAttributeID
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:
- an element of the
EnumDSSXMLGraphAttributeID
enumeration corresponding to the show flag for the object requested - Since:
- MicroStrategy Web 8.0.0
-
getGraphAttributeID
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 analyzedseriesID
- the series being analyzed- Returns:
- an element of the
EnumDSSXMLGraphAttributeID
enumeration corresponding to the show flag for the object requested - Since:
- MicroStrategy Web 8.1.1
-
getGraphNumFormatObjectID
public static int getGraphNumFormatObjectID(int objectID)
Utility method that adjust the objectID for Graph number format attribute- Parameters:
objectID
- the object being analyzed- Returns:
- an element of the
EnumDSSXMLGraphObjectID
enumeration used in Graph number format - Since:
- MicroStrategy Web 9.0.0
-
getGraphNumFormatAttributeID
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:
- an element of the
EnumDSSXMLGraphAttributeID
enumeration corresponding to Graph number format attribute - Since:
- MicroStrategy Web 9.0.0
-
getApplicableAxisTitles
@Deprecated public static GraphTitleInformation[] getApplicableAxisTitles()
Deprecated.please usegetGraphAxisTargets()
andgetGraphTitleTargets()
instead- Returns:
- an array of
GraphTitleInformation
instances that contain the information of the axis titles that can be shown to the user. - Since:
- MicroStrategy Web 8.0.0
-
getApplicableAxisTitles
@Deprecated public static GraphTitleInformation[] getApplicableAxisTitles(int majorType, int minorType)
Deprecated.please usegetGraphAxisTargets()
andgetGraphTitleTargets()
insteadGiven 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 theEnumDSSXMLMajorGraphTypes
enumerationminorType
- 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. - Since:
- MicroStrategy Web 8.0.0
-
isLegendSupported
public static boolean isLegendSupported(int majorType)
Determines given the major graph type if Legends are supported or not- Parameters:
majorType
- an element of theEnumDSSXMLMajorGraphTypes
enumeration- Returns:
True
if this graph type supports Legends. Otherwise, returnsFalse
-
getApplicableAxisValues
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 theEnumDSSXMLMajorGraphTypes
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 propertiesEnumDSSXMLGraphObjectID.DssXmlObjectIDNull
should be used, that's why this method doesn't include this value.
-
retrieveIntervalValues
public static java.lang.String retrieveIntervalValues(java.lang.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)- Since:
- MicroStrategy Web 8.0.0
-
retrieveMinMaxFromScale
public static java.lang.String[] retrieveMinMaxFromScale(java.lang.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
- Since:
- MicroStrategy Web 8.0.0
-
getGraphProperty
public static java.lang.String getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID)
Retrieves the requested property from the graph- Parameters:
graphProperties
- aWebGraphProperties
initialized instanceobjectID
- a valid objectID for the propertyattributeID
- a valid attributeID for the property- Returns:
- the value of the property requested, or a null if the property was not found.
-
getGraphSeries
public static java.util.ArrayList getGraphSeries(int maxSeries, WebGraphProperties graphProperties)
Based on the graph properties provided, returns anArrayList
instance withWebGraphProperty
elements of all the series available.- Parameters:
graphProperties
-WebGraphProperties
initialized instance- Returns:
ArrayList
initialized instance, withWebGraphProperty
elements corresponding to each one of the visible series available on the graph.- Since:
- MicroStrategy Web 9.0.0
-
getGraphProperty
public static java.lang.String getGraphProperty(WebGraphProperties graphProperties, int objectID, int attributeID, int seriesID)
Retrieves the requested property from the graph- Parameters:
graphProperties
- aWebGraphProperties
initialized instanceobjectID
- a valid objectID for the propertyattributeID
- a valid attributeID for the propertyseriesID
- a valid seriesID for the property- Returns:
- the value of the property requested, or a null if the property was not found.
- Since:
- MicroStrategy Web 8.0.1
-
obtainMajorTypesFilter
public static java.lang.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 theincludeValues
parameter will be added to the resulting filter string. - Since:
- MicroStrategy Web 8.0.0
-
generateMacroInformationTag
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.- Since:
- MicroStrategy Web 8.0.1
-
obtainMajorTypesFilter
public static java.lang.String obtainMajorTypesFilter(java.util.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 theexceptValues
parameter will not be included on the resulting filter string. - Since:
- MicroStrategy Web 8.0.0
-
getGraphFormatTargets
public static GraphTitleInformation[] getGraphFormatTargets()
- Since:
- MicroStrategy Web 8.0.1
-
getGraphLabelTargets
public static GraphTitleInformation[] getGraphLabelTargets()
- Since:
- MicroStrategy Web 8.0.1
-
getGraphTitleTargets
public static GraphTitleInformation[] getGraphTitleTargets()
- Since:
- MicroStrategy Web 8.0.1
-
getGraphAxisTargets
public static GraphTitleInformation[] getGraphAxisTargets()
- Since:
- MicroStrategy Web 8.0.1
-
isTargetForAll
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 theEnumDSSXMLGraphObjectID
enumeration- Returns:
- a
True
if the graph target is a place holder indicating a All "X" item. Otherwise returnsFalse
. - Since:
- MicroStrategy Web 9.0.0
-
getGraphSeriesColorTargets
public static GraphSeriesInformation[] getGraphSeriesColorTargets(int major, int minor)
- Since:
- MicroStrategy Web 8.0.1
-
getGraphSeriesColorTargets
public static java.util.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 instancegraphProperties
- WebGraphProperties instance related to the graph to analyze- Returns:
- ArrayList instance of
GraphSeriesInformation
instances with the applicable series color targets - Since:
- MicroStrategy Web 8.0.1
-
getGraphSeriesColorTargets
public static java.util.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 instancegraphProperties
- WebGraphProperties instance related to the graph to analyze- Returns:
- ArrayList instance of
GraphSeriesInformation
instances with the applicable series label targets - Since:
- MicroStrategy Web 9.0.0
-
getGraphSeriesLabelTargets
public static java.util.ArrayList getGraphSeriesLabelTargets(AppContext appContext, WebGraphProperties graphProperties, GraphSeriesTargetInfo gstInfo)
- Since:
- MicroStrategy Web 9.0.0
-
getGraphSeriesLabelTargets
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 typeminor
- int value with the graph minor type- Returns:
- GraphSeriesInformation[] array with the applicable series labels targets
- Since:
- MicroStrategy Web 8.0.1
-
renderMajorGraphTypes
@Deprecated public static void renderMajorGraphTypes(MarkupOutput out, int availableGraphTypes, int currentGraphType, java.lang.String imgSourcePath, java.lang.String majorTypeParam, AppContext appContext)
Deprecated.Displays the images that correspond to the graph types available given the flag of available graph types- Parameters:
out
- instance ofMarkupOutput
that will hold the HTML output of this methodavailableGraphTypes
- 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
- aAppContext
instance.
-
renderMinorGraphTypes
@Deprecated public static void renderMinorGraphTypes(MarkupOutput out, int currentGraphType, int currentMinorType, java.lang.String minorTypeParam, AppContext appContext, java.lang.String extraParameters)
Deprecated.Displays the combo box that corresponds to the minor graph types available given the current graph major types- Parameters:
out
- instance ofMarkupOutput
that will hold the HTML output of this methodcurrentGraphType
- 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
- aAppContext
instance.extraParameters
- any other attributes that should be added to the Select control to be rendered.
-
getApplicableAxisTitles
@Deprecated public static GraphTitleInformation[] getApplicableAxisTitles(int majorType)
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 theEnumDSSXMLMajorGraphTypes
enumeration- Returns:
- an array of
GraphTitleInformation
instances that contain the information of the axis titles applicable given the graph major type.
-
getSupportPropertyId
public static int getSupportPropertyId(int attributeID)
Returns the grouping category id for an attribute id- Parameters:
attributeID
-- Since:
- MicroStrategy Web 9.0.0
-
getGraphSeriesTargetInfo
public static GraphSeriesTargetInfo getGraphSeriesTargetInfo(WebGraph graphObj, boolean isRWBean)
- Since:
- MicroStrategy Web 9.0.0
-
getMaxGraphSeries
public static int getMaxGraphSeries(WebGraph graphObj)
- Since:
- MicroStrategy Web 9.0.0
-
getRiserObjectID
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- Parameters:
orgRiserID
-- Since:
- MicroStrategy Web 9.0.0
-
isCombinableAttr
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- Parameters:
attributeId
-- Since:
- MicroStrategy Web 9.0.0
-
hasPrivilegesForTitle
public static boolean hasPrivilegesForTitle(WebComponent bean, int objectId)
This method can check if user has format privilege on giving title item.- Parameters:
bean
-objectId
-- Since:
- MicroStrategy Web 9.0.0
-
getValueForAllTitleTarget
public static java.lang.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- Parameters:
graphProperties
-availableTitles
-objectId
-attributeId
-bean
-- Since:
- MicroStrategy Web 9.0.0
-
getValueForAllSeriesLabelTarget
public static java.lang.String getValueForAllSeriesLabelTarget(WebGraphProperties graphProperties, java.util.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- Parameters:
graphProperties
-graphSeries
-orgAttributeId
-bean
-- Since:
- MicroStrategy Web 9.0.0
-
getPropertyValue
public static java.lang.String getPropertyValue(WebGraphProperties graphProperties, int objectId, int attributeId, int seriesId)
- Since:
- MicroStrategy Web 9.0.0
-
getPropertyValue
public static java.lang.String getPropertyValue(WebGraphProperties graphProperties, int objectId, int attributeId)
- Since:
- MicroStrategy Web 9.0.0
-
-