Class ReportCellDrill.AbstractDrillContextMenuBuilder
- java.lang.Object
-
- com.microstrategy.web.app.transforms.contextmenus.ReportCellDrill.AbstractDrillContextMenuBuilder
-
- All Implemented Interfaces:
ComposedContextMenuBuilder
,OnDemandContextMenuBuilder
,ReportCellDrill.DrillContextMenuBuilder
- Direct Known Subclasses:
ReportCellDrill.HeaderDrillContextMenuBuilder
,ReportCellDrill.RowValueDrillContextMenuBuilder
,ReportCellDrill.TitleDrillContextMenuBuilder
,ReportGraphDrill.GraphAreaContextMenuBuilder
,ReportPageByCellDrill.TitleDrillContextMenuBuilder
- Enclosing class:
- ReportCellDrill
public abstract static class ReportCellDrill.AbstractDrillContextMenuBuilder extends java.lang.Object implements ReportCellDrill.DrillContextMenuBuilder, OnDemandContextMenuBuilder
Abstract base implementation of theReportCellDrill.DrillContextMenuBuilder
class.- Since:
- MicroStrategy Web 8.0.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SYS_DEFAULT_DISABLE_ONDEMAND_DRILLING
system default preference to disable ondemand drilling.
-
Constructor Summary
Constructors Constructor Description AbstractDrillContextMenuBuilder(TransformContext context)
Class constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ContextMenuItem
addDrillMenuItem(WebDrillPath drillPath)
Add a menu option for the drill path providedprotected ContextMenuItem
addDrillMenuItem(WebDrillPath drillPath, ContextMenu subMenu, boolean isAdvanced)
Add a menu option for the drill path providedprotected void
addDrillPathToMenu(WebDrillPath drillPath)
Add a menu option for the drill path providedprotected ContextMenuItem
addGenericMoreOptions()
Creates aContextMenuItem
instance with generic information for displaying "More Options" for drillingprotected boolean
areThereOptions()
boolean
canDrill()
ContextMenu
generateSubMenu()
Method that generates aContextMenu
instance with all the possible sub menu options enabled for the report cell provided.TransformContext
getContext()
java.lang.String
getDescriptor(int key)
Get the descriptor for the given key.protected int
getDisplayMode(WebDrillPath dp)
protected java.lang.String
getDrillParameters(WebDrillPath drillPath, boolean isAdvanced)
Utility method for generating JavaScript arguments corresponding to the drill path requested.protected java.lang.String
getDrillWithin(WebDrillPath drillPath, boolean isAdvanced)
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.protected int
getIntValue(java.lang.String fpName, int defaultValue)
Utility method for obtaining the integer value of a given formal parameterprotected java.lang.String
getJavaScriptFunction()
protected java.lang.String
getMoreOptionsArgs()
protected java.lang.String
getStringValue(java.lang.String fpName, java.lang.String defaultValue)
Utility method for obtaining the string value of a given formal parameterprotected ContextMenu
getSubMenu()
Returns ContextMenu using TransformContext's ContextMenuManager.protected abstract java.lang.String
getSubMenuName()
Gets the submenu Name which helps in creation of dynamic menuitems.protected abstract WebDrillMap
getWebDrillMap()
Utility method for obtaining the drill map information for the current cell indicatedprotected abstract WebTitle
getWebTitle()
Utility method for obtaining the currentWebTitle
instance related to the cell being processedprotected boolean
hasDrillPaths()
Returns true of the builder should have any drillpaths.protected void
internalPopulate()
protected boolean
isAdvancedDrillMenuAvailable()
protected boolean
isCellMetric()
If the cell a metric value or template metric, it should return true otherwise falseprotected boolean
isDrillable(WebDrillPath drillPath)
protected boolean
isFeatureAvailable(java.lang.String featureName)
Utility method for determining if a feature is available or notboolean
isIframeEnabled()
protected boolean
isMetricDrillingEnabled()
static boolean
isOndemandDrillingDisabled()
Returns a boolean true if finds a system default preference value "1" for AdminServersHelper#PROPERTY_DISABLE_ONDEMAND_DRILLING.protected boolean
isRW()
protected boolean
isTestForElements()
protected boolean
isTrue(java.lang.String fpName)
Utility method for obtaining the boolean value of a given formal parameterboolean
isValid()
protected void
populateMoreOptions(WebDrillMap wdm)
Utility method that will generate the More Options for drilling, like browsing to different hierarchies.void
populateOnDemand()
Populates the context menus ondemand.protected void
processAdvancedDrillPathElements(WebDrillMap wdm, ContextMenu subMenu)
Utility method that will generate the advanced drill path options for drilling, like browsing to different hierarchiesprotected void
processDrillPathElements(WebDrillMap wdm)
Method that will generate the base drill options according to the drill map information provided.protected void
setAreThereOptions(boolean value)
Set the boolean value determining if there are drill options that can be rendered by this builder.void
setIframeEnabled(boolean value)
Define if the options to generate will be iframe enabled or notprotected void
setImageType(WebDrillPath drillPath, ContextMenuItem menuItem)
protected boolean
shouldIncludeDrillPath(WebDrillPath drillPath)
Utility method for determining if the drill path information should be included or notprotected 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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microstrategy.web.app.transforms.contextmenus.ComposedContextMenuBuilder
generateSubMenu, isIframeEnabled, setIframeEnabled
-
-
-
-
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. Returnsnull
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 currentWebTitle
instance related to the cell being processed- Returns:
WebTitle
instance related with the cell being processed. Returnsnull
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
-
populateOnDemand
public void populateOnDemand()
Description copied from interface:OnDemandContextMenuBuilder
Populates the context menus ondemand.- Specified by:
populateOnDemand
in interfaceOnDemandContextMenuBuilder
- Since:
- MicroStrategy Web 9.0.0
-
populateMoreOptions
protected void populateMoreOptions(WebDrillMap wdm)
Utility method that will generate the More Options for drilling, like browsing to different hierarchies. Calls forprocessAdvancedDrillPathElements(com.microstrategy.web.objects.WebDrillMap, com.microstrategy.web.app.gui.ContextMenu)
- Parameters:
wdm
-WebDrillMap
instance initialized with the drill information for the current cell being analyzed.
-
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 aString
, 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 nullgetWebTitle()
creates a new ContextMenu registered with the ContextMenuManager. For non-nullgetWebTitle()
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 ContextMenuHelper 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 aContextMenuItem
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 interfaceComposedContextMenuBuilder
- 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 addedisAdvanced
- 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
-
setImageType
protected void setImageType(WebDrillPath drillPath, ContextMenuItem menuItem)
- 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.
-
processDrillPathElements
protected void processDrillPathElements(WebDrillMap wdm)
Method that will generate the base drill options according to the drill map information provided.shouldIncludeDrillPath(com.microstrategy.web.objects.WebDrillPath)
is called to determine which are to be added or not.- Parameters:
wdm
-WebDrillMap
instance initialized with the drill options that will be added.
-
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 interfaceComposedContextMenuBuilder
- Parameters:
value
- boolean value indicating if the options to generate will be iframe enabled or not
-
isIframeEnabled
public boolean isIframeEnabled()
- Specified by:
isIframeEnabled
in interfaceComposedContextMenuBuilder
- Returns:
- boolean value indicating if the options generated by this builder are iframe enabled or not
-
getContext
public TransformContext getContext()
- Returns:
ReportGridDisplayCell.Context
instance with the information about the context (cell, transform, etc) where this menu item will be displayed.
-
generateSubMenu
public ContextMenu generateSubMenu()
Description copied from interface:ComposedContextMenuBuilder
Method that generates aContextMenu
instance with all the possible sub menu options enabled for the report cell provided.- Specified by:
generateSubMenu
in interfaceComposedContextMenuBuilder
- Returns:
ContextMenu
instance with the drilling options that can be displayed to the user
-
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 testdefaultValue
- 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 testdefaultValue
- 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.
-
-