Class ReportCellDrill.AbstractDrillContextMenuBuilder

    • Field Detail

      • SYS_DEFAULT_DISABLE_ONDEMAND_DRILLING

        public static final java.lang.String SYS_DEFAULT_DISABLE_ONDEMAND_DRILLING
        system default preference to disable ondemand drilling. When this is present in sys_defaults.xml, ondemand drilling is disabled.
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractDrillContextMenuBuilder

        public AbstractDrillContextMenuBuilder​(TransformContext context)
        Class constructor
        Parameters:
        context - ReportGridDisplayCell.Context instance with the information about the context (cell, transform, etc) where this menu item will be displayed.
        Since:
        MicroStrategy Web 9.0.0
    • Method Detail

      • getWebDrillMap

        protected abstract WebDrillMap getWebDrillMap()
        Utility method for obtaining the drill map information for the current cell indicated
        Returns:
        WebDrillMap initialized instance with the drill information. Returns null if not supported
      • getSubMenuName

        protected abstract java.lang.String getSubMenuName()
        Gets the submenu Name which helps in creation of dynamic menuitems. This name is used to store the ContextMenu (submenu) with the ContextMenuManager.

        Eventually this method could become part of the parent ComposedContextMenuBuilder interface if the ondemand dynamicMenus is also needed for other non-drill context menus.

        Returns:
        a name of the ContextMenu (subMenu)
        Since:
        MicroStrategy Web 9.0.0
      • shouldIncludeDrillPath

        protected boolean shouldIncludeDrillPath​(WebDrillPath drillPath)
        Utility method for determining if the drill path information should be included or not
        Parameters:
        drillPath - WebDrillMap initialized instance with the drill information for the current cell.
        Returns:
        boolean value indicating if the drill path information shall be included or not.
      • getWebTitle

        protected abstract WebTitle getWebTitle()
        Utility method for obtaining the current WebTitle instance related to the cell being processed
        Returns:
        WebTitle instance related with the cell being processed. Returns null if none provided.
      • isDrillable

        protected boolean isDrillable​(WebDrillPath drillPath)
        Parameters:
        drillPath - WebDrillMap initialized instance with the drill information for the current cell.
        Returns:
        boolean value indicating if the current cell is drillable or not
      • isRW

        protected boolean isRW()
        Since:
        MicroStrategy Web 9.0.0
      • processAdvancedDrillPathElements

        protected void processAdvancedDrillPathElements​(WebDrillMap wdm,
                                                        ContextMenu subMenu)
        Utility method that will generate the advanced drill path options for drilling, like browsing to different hierarchies
        Parameters:
        wdm - WebDrillMap instance initialized with the drill information for the current cell being analyzed.
        subMenu - ContextMenu instance where the options to be shown will be added
      • getDescriptor

        public java.lang.String getDescriptor​(int key)

        Get the descriptor for the given key.

        The key is searched exactly as given in the Messages bundle.

        If a descriptor is not found for the given key it returns [na]
        Parameters:
        key - input key as a String, for example, mstrWeb.1 *
        Returns:
        descriptor as a String corresponding to the key sent in as parameter, for example, Home.
        Since:
        MicroStrategy Web 9.0.0
      • getSubMenu

        protected ContextMenu getSubMenu()
        Returns ContextMenu using TransformContext's ContextMenuManager. For null getWebTitle() creates a new ContextMenu registered with the ContextMenuManager. For non-null getWebTitle() the ContextMenu associated with a #getSubMenuName method is returned
        Returns:
        the ContextMenu
        Since:
        MicroStrategy Web 8.0.2
      • getGridDrillDynamicMenuName

        public static java.lang.String getGridDrillDynamicMenuName​(WebTitle title)
        Gets the name of the Dynamic ContextMenu which contains all the ContextMenuItems pertaining to a WebTitle The name is based on WebTitle. The cells with same WebTitle will have the same Dynamic ContextMenu

        Helper method used in #getSubMenuName method

        Parameters:
        title - WebTitle
        Returns:
        a name for the ContextMenu ("Drill" Submenu")
        Since:
        MicroStrategy Web 9.0.0
      • internalPopulate

        protected void internalPopulate()
      • isAdvancedDrillMenuAvailable

        protected boolean isAdvancedDrillMenuAvailable()
        Since:
        MicroStrategy Web 9.0.0
      • addGenericMoreOptions

        protected ContextMenuItem addGenericMoreOptions()
        Creates a ContextMenuItem instance with generic information for displaying "More Options" for drilling
        Returns:
        ContextMenuItem instance initialized that will provide the user the option to browse "More Options" for drilling
      • areThereOptions

        protected boolean areThereOptions()
        Returns:
        boolean value determining if there are drill options that can be rendered by this builder. The builder has to be populated before this method can be called to provide accurate information
      • getMoreOptionsArgs

        protected java.lang.String getMoreOptionsArgs()
        Since:
        MicroStrategy Web 9.0.1
      • setAreThereOptions

        protected void setAreThereOptions​(boolean value)
        Set the boolean value determining if there are drill options that can be rendered by this builder. The populate method on this builder defines this information
        Parameters:
        value - boolean value indicating if there are options to display as part of this drill menu.
      • isTestForElements

        protected boolean isTestForElements()
        Returns:
        boolean value indicating if the populate will be called only for testing if there are elements that can be rendered by this menu builder.
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface ComposedContextMenuBuilder
        Returns:
        boolean value that indicates if drilling on the current cell shall be enabled to the user
      • isMetricDrillingEnabled

        protected boolean isMetricDrillingEnabled()
        Since:
        MicroStrategy Web 9.0.0
      • canDrill

        public boolean canDrill()
        Since:
        MicroStrategy Web 9.0.0
      • addDrillMenuItem

        protected ContextMenuItem addDrillMenuItem​(WebDrillPath drillPath,
                                                   ContextMenu subMenu,
                                                   boolean isAdvanced)
        Add a menu option for the drill path provided
        Parameters:
        drillPath - WebDrillPath instance that will become an option to display to the user for drilling.
        subMenu - ContextMenu instance where the option is to be added
        isAdvanced - Indicates if this drill path is from the more options drill menu (which is the second level of drill paths grouped by set names)
        Returns:
        ContextMenuItem instance that was added to the menu options, if further modifications are required
        Since:
        MicroStrategy Web 9.0.0
      • getJavaScriptFunction

        protected java.lang.String getJavaScriptFunction()
        Since:
        MicroStrategy Web 9.0.0
      • addDrillMenuItem

        protected ContextMenuItem addDrillMenuItem​(WebDrillPath drillPath)
        Add a menu option for the drill path provided
        Parameters:
        drillPath - WebDrillPath instance that will become an option to display to the user for drilling.
        Returns:
        ContextMenuItem instance that was added to the menu options, if further modifications are required
      • addDrillPathToMenu

        protected void addDrillPathToMenu​(WebDrillPath drillPath)
        Add a menu option for the drill path provided
        Parameters:
        drillPath - WebDrillPath instance that will become an option to display to the user for drilling.
      • getDrillParameters

        protected java.lang.String getDrillParameters​(WebDrillPath drillPath,
                                                      boolean isAdvanced)
        Utility method for generating JavaScript arguments corresponding to the drill path requested.
        Parameters:
        drillPath - WebDrillPath from where the JavaScript arguments will be generated
        Returns:
        String value with the JavaScript information that should be included on the code generated for this drill path option.
        Since:
        MicroStrategy Web 9.0.0
      • getDisplayMode

        protected int getDisplayMode​(WebDrillPath dp)
        Since:
        MicroStrategy Web 9.0.0
      • getDrillWithin

        protected java.lang.String getDrillWithin​(WebDrillPath drillPath,
                                                  boolean isAdvanced)
        Since:
        MicroStrategy Web 9.0.0
      • sortWebDrillMap

        protected void sortWebDrillMap​(WebDrillMap wdm)
        According to the formal parameters defined on the transform that calls for this context menu, determine if the contents of the drill map should be sorted or not.
        Parameters:
        wdm - WebDrillMap instance to be sorted.
      • hasDrillPaths

        protected boolean hasDrillPaths()
        Returns true of the builder should have any drillpaths.
        Since:
        MicroStrategy Web 9.0.0
      • isCellMetric

        protected boolean isCellMetric()
        If the cell a metric value or template metric, it should return true otherwise false
        Since:
        MicroStrategy Web 9.0.0
      • isOndemandDrillingDisabled

        public static boolean isOndemandDrillingDisabled()
        Returns a boolean true if finds a system default preference value "1" for AdminServersHelper#PROPERTY_DISABLE_ONDEMAND_DRILLING. otherwise returns a false.
        Returns:
        a boolean
        Since:
        MicroStrategy Web 9.0.0
      • setIframeEnabled

        public void setIframeEnabled​(boolean value)
        Define if the options to generate will be iframe enabled or not
        Specified by:
        setIframeEnabled in interface ComposedContextMenuBuilder
        Parameters:
        value - boolean value indicating if the options to generate will be iframe enabled or not
      • isIframeEnabled

        public boolean isIframeEnabled()
        Specified by:
        isIframeEnabled in interface ComposedContextMenuBuilder
        Returns:
        boolean value indicating if the options generated by this builder are iframe enabled or not
      • isFeatureAvailable

        protected boolean isFeatureAvailable​(java.lang.String featureName)
        Utility method for determining if a feature is available or not
        Parameters:
        featureName - String value with the name of the feature to test
        Returns:
        boolean value indicating if the feature is available or not.
      • isTrue

        protected boolean isTrue​(java.lang.String fpName)
        Utility method for obtaining the boolean value of a given formal parameter
        Parameters:
        fpName - String value with the name of the formal parameter to test
        Returns:
        boolean value of the formal parameter requested. If not found or the formal parameter is not of type boolean, it will return false.
      • getIntValue

        protected int getIntValue​(java.lang.String fpName,
                                  int defaultValue)
        Utility method for obtaining the integer value of a given formal parameter
        Parameters:
        fpName - String value with the name of the formal parameter to test
        defaultValue - value to return if the process of querying the formal parameter fails.
        Returns:
        value of the formal parameter requested. If not found or the formal parameter is not of type integer, it will return the default value provided.
      • getStringValue

        protected java.lang.String getStringValue​(java.lang.String fpName,
                                                  java.lang.String defaultValue)
        Utility method for obtaining the string value of a given formal parameter
        Parameters:
        fpName - String value with the name of the formal parameter to test
        defaultValue - value to return if the process of querying the formal parameter fails.
        Returns:
        value of the formal parameter requested. If not found or the formal parameter is not of type string, it will return the default value provided.