Class RWTransformHelper


  • public class RWTransformHelper
    extends java.lang.Object
    Since:
    MicroStrategy Web 8.0.0
    • Constructor Detail

      • RWTransformHelper

        public RWTransformHelper()
    • 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 the RWBean object passed as parameter.
        Parameters:
        rwb - ReportWriter Bean
        propertyGroupName - the name of the property group to analyze
        propertyName - 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 the RWBean 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 Bean
        propertyGroupName - the name of the property group to analyze
        propertyName - the name of the property in the property group to analyze
        defaultValue - 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,
                                                       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)
        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 collection
        locale - the desired locale used to compare the name of RWDataSetItem
        typeRestriction - 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)
      • 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 string
        rwb - - 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

        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.