public class

VisualizationsHelper

extends Object
java.lang.Object
   ↳ com.microstrategy.web.app.transforms.VisualizationsHelper

Class Overview

This is a helper class with methods to validate WebVisualizationSettings from different type of beans.

Summary

Nested Classes
class VisualizationsHelper.PrepareStringForXMLParser replace the xml specific charcters, including "&", "<", ">" only replace the content in ""  
Constants
String PROPERTY_COLUMN_GROUPING
int VISUALIZATIONS_REPORT_RESULT_FLAGS These are the report result flags that are necessary to generate the XML necessary for visualizations (8790560) Note: also set on the pageConfig.xml
Public Methods
static void addCommonFlashVars(HashList flashVars, AppContext appContext, WebBean bean)
Adds flash vars that are common
static void checkForGroupByAll(RWBean rwb, AppContext appContext)
Checks whether the current groupby selection is supported for visualizations.
static void checkVisualizationSettings(int visMode, WebVisualizationSettings settings, AppContext appContext, int scope)
Checks the visualization settings are correct and throws a WebAppRuntimeException if it finds any of the settings are incorrect.
static void checkVisualizationSettings(ReportBean rb, AppContext appContext)
Checks the visualization settings for the ReportBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.
static void checkVisualizationSettings(RWBean rwb, AppContext appContext, int scope)
Checks the visualization settings for the RWBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.
static void checkVisualizationSettings(ViewBean vb, AppContext appContext)
Checks the visualization settings for the ViewBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.
static void checkVisualizationSettings(RWBean rwb, AppContext appContext)
Checks the visualization settings for the RWBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.
static Block createVisPropsBlock(HashList<String, String> visProps, ViewBean viewBean)
static Block createVisPropsBlock(ViewBean vb)
static RWGridGraphObject findGridGraphObject(RWUnit unit, String key)
Find the GridGraphObject within the tree.
static HashList<String, String> generateVisPropsList(String visPropsString)
Helper method that returns a list that contains the key/value pairs of visualization properties
static ParameterBuilder getBaseURL(boolean useAbsoluteURL, AppContext appContext, WebBean bean, boolean addSessionState)
Returns a ParameterBuilder object that contains a base URL.
static WebVisualizationSettings getDocVisualizationSettings(RWBean rwb)
static HashList<String, HashList<String, String>> getGrids(String propVal)
static Block getMapCoordsFromFile(String relFilePath, ContainerServices containerServices)
static String getResourceBundleURL(String dashboardBundleFilePrefix, ContainerServices cs, int localeID)
static ParameterBuilder getTaskBaseURL(boolean useAbsoluteURL, AppContext appContext, String taskProcessorName, String contentType)
Returns a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.
static ParameterBuilder getTaskBaseURL(boolean useAbsoluteURL, AppContext appContext, String taskProcessorName)
Returns a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.
static WebVisualizationSettings getVisualizationSettings(RWBean rwb)
Returns the WebVisualizationSettings for the given RWBean.
static WebVisualizationSettings getVisualizationSettings(ViewBean vb)
Returns the WebVisualizationSettings for the given ViewBean.
static WebVisualizationSettings getVisualizationSettings(ReportBean rb)
Returns the WebVisualizationSettings for the given ReportBean.
static boolean isDocInVisualizationMode(RWBean rwb)
static boolean isGroupBySupported(RWBean rwb)
Whether the current groupby selection is supported for visualizations.
static boolean isValidVisualization(int visMode, String visName, AppContext appContext, int scope)
Returns whether the visualization is defined for the current visualization mode, scope and project.
static boolean isValidVisualizationMode(int visMode, AppContext appContext)
Returns whether the view mode is valid.
static void setAndroidMojoVisProps(Block gridBlock, ViewBean vb)
static void setBoneRWVisualizationProperties(JsonGenerator boneProps, RWBean rwb, AppContext appContext)
Adds all the visualizations related properties to the JsonGenerator object
static String toFlashVarsStr(HashList flashVarsList)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String PROPERTY_COLUMN_GROUPING

Constant Value: "cg"

public static final int VISUALIZATIONS_REPORT_RESULT_FLAGS

These are the report result flags that are necessary to generate the XML necessary for visualizations (8790560) Note: also set on the pageConfig.xml

Constant Value: 8790560 (0x00862220)

Public Methods

public static void addCommonFlashVars (HashList flashVars, AppContext appContext, WebBean bean)

Adds flash vars that are common

Parameters
flashVars the flashvars collection
appContext the application context
bean The bean being transformed

public static void checkForGroupByAll (RWBean rwb, AppContext appContext)

Checks whether the current groupby selection is supported for visualizations.
Throws WebAppRuntimeException if not supported.
We do not support "All"

Parameters
rwb The RWBean
appContext The application context
Throws
WebAppRuntimeException if the current groupby selection is not supported for visualizations

public static void checkVisualizationSettings (int visMode, WebVisualizationSettings settings, AppContext appContext, int scope)

Checks the visualization settings are correct and throws a WebAppRuntimeException if it finds any of the settings are incorrect. This method will throw an Exception if:

  1. Visualization settings have not been enabled or are null.
  2. The visualization mode (visMode) is not defined in the visualizations configuration file.
  3. The visualization has not been defined in the visualizations configuration file.

public static void checkVisualizationSettings (ReportBean rb, AppContext appContext)

Checks the visualization settings for the ReportBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.

public static void checkVisualizationSettings (RWBean rwb, AppContext appContext, int scope)

Checks the visualization settings for the RWBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.

public static void checkVisualizationSettings (ViewBean vb, AppContext appContext)

Checks the visualization settings for the ViewBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.

public static void checkVisualizationSettings (RWBean rwb, AppContext appContext)

Checks the visualization settings for the RWBean and throws a WebAppRuntimeException if it finds any of the settings are incorrect.

public static Block createVisPropsBlock (HashList<String, String> visProps, ViewBean viewBean)

public static Block createVisPropsBlock (ViewBean vb)

Throws
Exception

public static RWGridGraphObject findGridGraphObject (RWUnit unit, String key)

Find the GridGraphObject within the tree.

Parameters
unit The unit to start with.
key The node key to search.
Returns
  • The GridGraphObject if found. It returns null otherwise.

public static HashList<String, String> generateVisPropsList (String visPropsString)

Helper method that returns a list that contains the key/value pairs of visualization properties

Parameters
visPropsString the VisProps String (XML format)
Returns
  • a list that contains the key/value pairs of visualization properties

public static ParameterBuilder getBaseURL (boolean useAbsoluteURL, AppContext appContext, WebBean bean, boolean addSessionState)

Returns a ParameterBuilder object that contains a base URL.
This object is initialized with the TargetBase, TargetPrefix and contains the session manager state which is used in URLs as argument WebSessionManagerState to restore the session.

Parameters
useAbsoluteURL whether to use an absolute URL
appContext The AppContext object
bean The bean being transformed
addSessionState whether to add the session state to the URL. Only relevant if useAbsoluteURL is true as with relative paths, the session state info is not necessary
Returns

public static WebVisualizationSettings getDocVisualizationSettings (RWBean rwb)

public static HashList<String, HashList<String, String>> getGrids (String propVal)

public static Block getMapCoordsFromFile (String relFilePath, ContainerServices containerServices)

Throws
Exception

public static String getResourceBundleURL (String dashboardBundleFilePrefix, ContainerServices cs, int localeID)

public static ParameterBuilder getTaskBaseURL (boolean useAbsoluteURL, AppContext appContext, String taskProcessorName, String contentType)

Returns a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.
This object is initialized with the TargetBase, TargetPrefix and contains the session manager state which is used in URLs as argument WebSessionManagerState to restore the session.

Parameters
useAbsoluteURL wether to use an absolute URL
appContext The AppContext object
taskProcessorName The task processor name
contentType the type of data expected (xml, json, html)
Returns
  • a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.

public static ParameterBuilder getTaskBaseURL (boolean useAbsoluteURL, AppContext appContext, String taskProcessorName)

Returns a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.
This object is initialized with the TargetBase, TargetPrefix and contains the session manager state which is used in URLs as argument WebSessionManagerState to restore the session.

Parameters
useAbsoluteURL wether to use an absolute URL
appContext The AppContext object
taskProcessorName The task processor name
Returns
  • a ParameterBuilder object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.

public static WebVisualizationSettings getVisualizationSettings (RWBean rwb)

Returns the WebVisualizationSettings for the given RWBean.

public static WebVisualizationSettings getVisualizationSettings (ViewBean vb)

Returns the WebVisualizationSettings for the given ViewBean.

public static WebVisualizationSettings getVisualizationSettings (ReportBean rb)

Returns the WebVisualizationSettings for the given ReportBean.

public static boolean isDocInVisualizationMode (RWBean rwb)

public static boolean isGroupBySupported (RWBean rwb)

Whether the current groupby selection is supported for visualizations.
We do not support "All"

Parameters
rwb The RWBean
Returns
  • Whether the current groupby selection is supported for visualizations

public static boolean isValidVisualization (int visMode, String visName, AppContext appContext, int scope)

Returns whether the visualization is defined for the current visualization mode, scope and project. if the visualization mode is 0 it returns false as 0 refers to normal view modes; if it's not 0 it checks first if the visualization mode is defined at all, and if so, it returns true only if the visualization is defined for that view mode and scope.

public static boolean isValidVisualizationMode (int visMode, AppContext appContext)

Returns whether the view mode is valid. If visMode is 0, then this method returns true as all "normal" view modes are valid, if it's not 0, then it returns true only if the visualizationMode is defined in the visualizations list (that is, in the visualizations configuration file).

public static void setAndroidMojoVisProps (Block gridBlock, ViewBean vb)

public static void setBoneRWVisualizationProperties (JsonGenerator boneProps, RWBean rwb, AppContext appContext)

Adds all the visualizations related properties to the JsonGenerator object

Parameters
boneProps the JsonGenerator object where the properties will be added
rwb The RWBean
appContext The AppContext object
Throws
WebBeanException
WebObjectsException
WebBeanException

public static String toFlashVarsStr (HashList flashVarsList)