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

        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:
        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:
        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)
      • isJavascriptInUrlAllowed

        public static boolean isJavascriptInUrlAllowed​(java.lang.String url)
      • redirectToDisplayError

        protected static void redirectToDisplayError​(MarkupOutput out,
                                                     RWBean rwBean,
                                                     AppContext appContext,
                                                     EventManager eventManager,
                                                     java.lang.String errorMessage)
        Since MicroStrategy Web 10.6 This method is used to jump to a new "Error page" to show error messages.