Class VisualizationsHelper
- java.lang.Object
-
- com.microstrategy.web.app.transforms.VisualizationsHelper
-
public class VisualizationsHelper extends java.lang.Object
This is a helper class with methods to validate WebVisualizationSettings from different type of beans.- Since:
- MicroStrategy Web 8.0.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VisualizationsHelper.PrepareStringForXMLParser
replace the xml specific charcters, including "&", "<", ">" only replace the content in ""
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_COLUMN_GROUPING
static 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
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addCommonFlashVars(HashList flashVars, AppContext appContext, WebBean bean)
Adds flash vars that are commonstatic void
checkForGroupByAll(RWBean rwb, AppContext appContext)
Checks whether the current groupby selection is supported for visualizations.
ThrowsWebAppRuntimeException
if not supported.
We do not support "All"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)
Checks the visualization settings for the RWBean 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 Block
createVisPropsBlock(HashList<java.lang.String,java.lang.String> visProps, ViewBean viewBean)
static Block
createVisPropsBlock(ViewBean vb)
static RWGridGraphObject
findGridGraphObject(RWUnit unit, java.lang.String key)
Find the GridGraphObject within the tree.static HashList<java.lang.String,java.lang.String>
generateVisPropsList(java.lang.String visPropsString)
Helper method that returns a list that contains the key/value pairs of visualization propertiesstatic ParameterBuilder
getBaseURL(boolean useAbsoluteURL, AppContext appContext, WebBean bean, boolean addSessionState)
Returns aParameterBuilder
object that contains a base URL.static WebVisualizationSettings
getDocVisualizationSettings(RWBean rwb)
static HashList<java.lang.String,HashList<java.lang.String,java.lang.String>>
getGrids(java.lang.String propVal)
static Block
getMapCoordsFromFile(java.lang.String relFilePath, ContainerServices containerServices)
static java.lang.String
getResourceBundleURL(java.lang.String dashboardBundleFilePrefix, ContainerServices cs, int localeID)
static ParameterBuilder
getTaskBaseURL(boolean useAbsoluteURL, AppContext appContext, java.lang.String taskProcessorName)
Returns aParameterBuilder
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, java.lang.String taskProcessorName, java.lang.String contentType)
Returns aParameterBuilder
object that contains a base URL which can be used to invoke a Task on the Tasks infrastructure.static WebVisualizationSettings
getVisualizationSettings(ReportBean rb)
Returns the WebVisualizationSettings for the given ReportBean.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 boolean
isDocInVisualizationMode(RWBean rwb)
static boolean
isGroupBySupported(RWBean rwb)
Whether the current groupby selection is supported for visualizations.static boolean
isValidVisualization(int visMode, java.lang.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 theJsonGenerator
objectstatic java.lang.String
toFlashVarsStr(HashList flashVarsList)
-
-
-
Field Detail
-
VISUALIZATIONS_REPORT_RESULT_FLAGS
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- Since:
- MicroStrategy Web 8.1.0
- See Also:
- Constant Field Values
-
PROPERTY_COLUMN_GROUPING
public static final java.lang.String PROPERTY_COLUMN_GROUPING
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidVisualizationMode
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).
-
isValidVisualization
public static boolean isValidVisualization(int visMode, java.lang.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.
-
getVisualizationSettings
public static WebVisualizationSettings getVisualizationSettings(ReportBean rb)
Returns the WebVisualizationSettings for the given ReportBean.
-
getVisualizationSettings
public static WebVisualizationSettings getVisualizationSettings(RWBean rwb)
Returns the WebVisualizationSettings for the given RWBean.
-
getVisualizationSettings
public static WebVisualizationSettings getVisualizationSettings(ViewBean vb)
Returns the WebVisualizationSettings for the given ViewBean.
-
checkVisualizationSettings
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.
-
checkVisualizationSettings
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.
-
checkForGroupByAll
public static void checkForGroupByAll(RWBean rwb, AppContext appContext) throws WebAppRuntimeException
Checks whether the current groupby selection is supported for visualizations.
ThrowsWebAppRuntimeException
if not supported.
We do not support "All"- Parameters:
rwb
- The RWBeanappContext
- The application context- Throws:
WebAppRuntimeException
- if the current groupby selection is not supported for visualizations
-
isGroupBySupported
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
-
checkVisualizationSettings
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.
-
checkVisualizationSettings
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.
-
checkVisualizationSettings
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:- Visualization settings have not been enabled or are null.
- The visualization mode (visMode) is not defined in the visualizations configuration file.
- The visualization has not been defined in the visualizations configuration file.
-
getResourceBundleURL
public static java.lang.String getResourceBundleURL(java.lang.String dashboardBundleFilePrefix, ContainerServices cs, int localeID)
- Since:
- MicroStrategy Web 9.0.0
-
getBaseURL
public static ParameterBuilder getBaseURL(boolean useAbsoluteURL, AppContext appContext, WebBean bean, boolean addSessionState)
Returns aParameterBuilder
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 argumentEnumWebParameters.WebSessionManagerState
to restore the session.- Parameters:
useAbsoluteURL
- whether to use an absolute URLappContext
- TheAppContext
objectbean
- The bean being transformedaddSessionState
- 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:
- a
ParameterBuilder
object that contains a base URL. - Since:
- MicroStrategy Web 8.1.1
-
getTaskBaseURL
public static ParameterBuilder getTaskBaseURL(boolean useAbsoluteURL, AppContext appContext, java.lang.String taskProcessorName)
Returns aParameterBuilder
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 argumentEnumWebParameters.WebSessionManagerState
to restore the session.- Parameters:
useAbsoluteURL
- wether to use an absolute URLappContext
- TheAppContext
objecttaskProcessorName
- 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. - Since:
- MicroStrategy Web 8.1.1
-
getTaskBaseURL
public static ParameterBuilder getTaskBaseURL(boolean useAbsoluteURL, AppContext appContext, java.lang.String taskProcessorName, java.lang.String contentType)
Returns aParameterBuilder
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 argumentEnumWebParameters.WebSessionManagerState
to restore the session.- Parameters:
useAbsoluteURL
- wether to use an absolute URLappContext
- TheAppContext
objecttaskProcessorName
- The task processor namecontentType
- 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. - Since:
- MicroStrategy Web 8.1.1
-
addCommonFlashVars
public static void addCommonFlashVars(HashList flashVars, AppContext appContext, WebBean bean)
Adds flash vars that are common- Parameters:
flashVars
- the flashvars collectionappContext
- the application contextbean
- The bean being transformed- Since:
- MicroStrategy Web 8.1.1
-
toFlashVarsStr
public static java.lang.String toFlashVarsStr(HashList flashVarsList)
-
setBoneRWVisualizationProperties
public static void setBoneRWVisualizationProperties(JsonGenerator boneProps, RWBean rwb, AppContext appContext) throws WebBeanException, WebObjectsException
Adds all the visualizations related properties to theJsonGenerator
object- Parameters:
boneProps
- the JsonGenerator object where the properties will be addedrwb
- TheRWBean
appContext
- TheAppContext
object- Throws:
WebBeanException
WebObjectsException
-
getDocVisualizationSettings
public static WebVisualizationSettings getDocVisualizationSettings(RWBean rwb) throws WebObjectsException, WebBeanException
- Throws:
WebObjectsException
WebBeanException
-
findGridGraphObject
public static RWGridGraphObject findGridGraphObject(RWUnit unit, java.lang.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.
-
isDocInVisualizationMode
public static boolean isDocInVisualizationMode(RWBean rwb)
-
generateVisPropsList
public static HashList<java.lang.String,java.lang.String> generateVisPropsList(java.lang.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
-
createVisPropsBlock
public static Block createVisPropsBlock(ViewBean vb) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createVisPropsBlock
public static Block createVisPropsBlock(HashList<java.lang.String,java.lang.String> visProps, ViewBean viewBean)
-
getGrids
public static HashList<java.lang.String,HashList<java.lang.String,java.lang.String>> getGrids(java.lang.String propVal)
-
getMapCoordsFromFile
public static Block getMapCoordsFromFile(java.lang.String relFilePath, ContainerServices containerServices) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setAndroidMojoVisProps
public static void setAndroidMojoVisProps(Block gridBlock, ViewBean vb) throws java.lang.Exception, WebObjectsException, WebBeanException
- Throws:
java.lang.Exception
WebObjectsException
WebBeanException
-
-