Class RWTransformHelper
- java.lang.Object
-
- com.microstrategy.web.app.transforms.RWTransformHelper
-
public class RWTransformHelper extends java.lang.Object
- Since:
- MicroStrategy Web 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description static long
TR_A_AND_M
static long
TR_A_AND_NDE
static long
TR_ATTRIBUTE
static long
TR_METRIC
static long
TR_NDE
-
Constructor Summary
Constructors Constructor Description RWTransformHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
addCSRFIntoURL(java.lang.String url, AppContext appContext)
Add the CSRF token into URL string if neededstatic java.lang.String
addCSRFIntoURL(java.lang.String orgURL, java.lang.String servletPath, ParameterBuilder urlPB)
Deprecated.static boolean
getAllowHtmlExecution(RWBean rwb)
evaluate if the AllowHtmlExecution property is set on the RSD instancestatic int
getAvailableViewMedia(RWBean rwb)
static java.util.HashMap<java.lang.String,java.lang.Boolean>
getConflictedNameMap(java.util.ArrayList<RWDataSetItem> list)
Returns a HashMap for checking if item name is conflicted in a RWDataSetItem list.static JsonGenerator
getDatasetsInfos(RWBean rwb)
static int
getDefaultViewMediaMode(RWBean rwb)
static java.lang.String
getLayoutName(RWLayoutSectionDef layout, java.lang.String label)
static java.util.ArrayList<RWDataSetItem>
getOrderdRWDataSetItems(RWDataSets dataSets, java.util.Locale locale, long typeRestriction)
Returns a list contains ordered RWDataSetItem from all data sets.static java.lang.String
getRWPropertyValue(RWBean rwb, java.lang.String propertyGroupName, java.lang.String propertyName)
Given the group and property specified as parameters, find and return its value according to theRWBean
object passed as parameter.static java.lang.String
getRWPropertyValue(RWBean rwb, java.lang.String propertyGroupName, java.lang.String propertyName, java.lang.String defaultValue)
Given the group and property specified as parameters, find and return its value according to theRWBean
object passed as parameter.static java.lang.String
getSectionTitle(RWBean rwBean, AbstractAppTransform transform, RWSectionDef sectionDef)
static java.lang.String
getSectionTitle(RWBean rwBean, Messages messages, RWSectionDef sectionDef)
static JsonGenerator
getWorkingSetInfos(WebWorkingSet wws, Messages messages)
static boolean
isJavascriptInUrlAllowed(java.lang.String url)
static boolean
isJavascriptInUrlAllowed(java.lang.String url, RWBean rwb)
This function evaluates if the javascript is allowed in the url.static boolean
isOnlyDetailsHeaderVisible(java.util.List visibleSections)
static boolean
isSingleSourceGrid(RWBean rwb)
static boolean
isUserDocumentOwner(RWBean rwb)
check if the current user is the owner of the RSDprotected static void
redirectToDisplayError(MarkupOutput out, RWBean rwBean, AppContext appContext, EventManager eventManager, int errorCode)
Since MicroStrategy Web 10.6 This method is used to jump to a new "Error page" to show error messages based on error code.protected static void
redirectToDisplayError(MarkupOutput out, RWBean rwBean, AppContext appContext, EventManager eventManager, java.lang.String errorMessage)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Field Detail
-
TR_METRIC
public static final long TR_METRIC
- See Also:
- Constant Field Values
-
TR_ATTRIBUTE
public static final long TR_ATTRIBUTE
- See Also:
- Constant Field Values
-
TR_NDE
public static final long TR_NDE
- See Also:
- Constant Field Values
-
TR_A_AND_M
public static final long TR_A_AND_M
- See Also:
- Constant Field Values
-
TR_A_AND_NDE
public static final long TR_A_AND_NDE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRWPropertyValue
public static java.lang.String getRWPropertyValue(RWBean rwb, java.lang.String propertyGroupName, java.lang.String propertyName)
Given the group and property specified as parameters, find and return its value according to theRWBean
object passed as parameter.- Parameters:
rwb
- ReportWriter BeanpropertyGroupName
- the name of the property group to analyzepropertyName
- the name of the property in the property group to analyze- Returns:
- the property value found for the object requested
-
getRWPropertyValue
public static java.lang.String getRWPropertyValue(RWBean rwb, java.lang.String propertyGroupName, java.lang.String propertyName, java.lang.String defaultValue)
Given the group and property specified as parameters, find and return its value according to theRWBean
object passed as parameter. If there is any error or the property or group cannot be found or default is used, the default value passed as parameter will be returned.- Parameters:
rwb
- ReportWriter BeanpropertyGroupName
- the name of the property group to analyzepropertyName
- the name of the property in the property group to analyzedefaultValue
- the value to return if anything failed during the process- Returns:
- the property value found for the object requested, or the default value if the process could not be completed
-
getSectionTitle
public static java.lang.String getSectionTitle(RWBean rwBean, AbstractAppTransform transform, RWSectionDef sectionDef)
- Since:
- MicroStrategy Web 8.1.0
-
getSectionTitle
public static java.lang.String getSectionTitle(RWBean rwBean, Messages messages, RWSectionDef sectionDef)
- Since:
- MicroStrategy Web 8.1.0
-
getLayoutName
public static java.lang.String getLayoutName(RWLayoutSectionDef layout, java.lang.String label)
- Since:
- MicroStrategy Web 9.0.0
-
isOnlyDetailsHeaderVisible
public static boolean isOnlyDetailsHeaderVisible(java.util.List visibleSections)
- Since:
- MicroStrategy Web 8.1.0
-
getAvailableViewMedia
public static int getAvailableViewMedia(RWBean rwb)
- Since:
- MicroStrategy Web 9.0.0
-
getDefaultViewMediaMode
public static int getDefaultViewMediaMode(RWBean rwb)
- Since:
- MicroStrategy Web 9.0.0
-
addCSRFIntoURL
@Deprecated public static java.lang.String addCSRFIntoURL(java.lang.String orgURL, java.lang.String servletPath, ParameterBuilder urlPB)
Deprecated.Add the CSRF token into URL string if needed- Parameters:
orgURL
- the original URL string which needed to be dealed- Returns:
- the URL with CSRF token
- Since:
- MicroStrategy Web 9.2.2
-
addCSRFIntoURL
public static java.lang.String addCSRFIntoURL(java.lang.String url, AppContext appContext)
Add the CSRF token into URL string if needed- Parameters:
url
- the original URL string which needed to be dealed- Returns:
- the URL with CSRF token
- Since:
- MicroStrategy Web 9.2.2
-
getOrderdRWDataSetItems
public static java.util.ArrayList<RWDataSetItem> getOrderdRWDataSetItems(RWDataSets dataSets, java.util.Locale locale, long typeRestriction)
Returns a list contains ordered RWDataSetItem from all data sets.These items are grouped by category (Attribute, Metric and User Metric), and then sorted by alphabetical within each category.
The valid restriction type are com.microstrategy.webapi.EnumDSSXMLObjectTypes.DssXmlTypeAttribute and com.microstrategy.webapi.EnumDSSXMLObjectTypes.DssXmlTypeMetric.
- Parameters:
dataSets
- a data set collectionlocale
- the desired locale used to compare the name of RWDataSetItemtypeRestriction
- a list of object types.- Returns:
- a list contains the required RWDataSetItem.
-
getConflictedNameMap
public static java.util.HashMap<java.lang.String,java.lang.Boolean> getConflictedNameMap(java.util.ArrayList<RWDataSetItem> list)
Returns a HashMap for checking if item name is conflicted in a RWDataSetItem list.- Parameters:
list
- a list contains RWDataSetItem- Returns:
- a HashMap for checking if item name is conflicted in the list. If item name is conflicted, the value associated with it should be Boolean.TRUE. Otherwise, the value is Boolean.FALSE.
-
isSingleSourceGrid
public static boolean isSingleSourceGrid(RWBean rwb)
-
getDatasetsInfos
public static JsonGenerator getDatasetsInfos(RWBean rwb) throws WebObjectsException, WebBeanException
- Throws:
WebObjectsException
WebBeanException
-
getWorkingSetInfos
public static JsonGenerator getWorkingSetInfos(WebWorkingSet wws, Messages messages) throws WebObjectsException, WebBeanException
- Throws:
WebObjectsException
WebBeanException
-
isUserDocumentOwner
public static boolean isUserDocumentOwner(RWBean rwb)
check if the current user is the owner of the RSD- Parameters:
rwb
- - RWBean associated with the RSD- Returns:
- - True if current user is the owner of RSD false otherwise
-
getAllowHtmlExecution
public static boolean getAllowHtmlExecution(RWBean rwb)
evaluate if the AllowHtmlExecution property is set on the RSD instance- Parameters:
rwb
- - RWBean associated with the RSD- Returns:
- True if the property is set false otherwise
-
isJavascriptInUrlAllowed
public static boolean isJavascriptInUrlAllowed(java.lang.String url, RWBean rwb)
This function evaluates if the javascript is allowed in the url.- Parameters:
url
- - url stringrwb
- - RWBean associated with the RSD- Returns:
- - True is javascript in the url is allowed if it is javascript: and any preference is set to not allowHtmlExecution return false
-
isJavascriptInUrlAllowed
public static boolean isJavascriptInUrlAllowed(java.lang.String url)
-
redirectToDisplayError
@Deprecated(since="11.3.8", forRemoval=true) protected static void redirectToDisplayError(MarkupOutput out, RWBean rwBean, AppContext appContext, EventManager eventManager, java.lang.String errorMessage)
Deprecated, for removal: This API element is subject to removal in a future version.Since MicroStrategy Web 10.6 This method is used to jump to a new "Error page" to show error messages.
-
redirectToDisplayError
protected static void redirectToDisplayError(MarkupOutput out, RWBean rwBean, AppContext appContext, EventManager eventManager, int errorCode)
Since MicroStrategy Web 10.6 This method is used to jump to a new "Error page" to show error messages based on error code.
-
-