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.DrillContextMenuBuilderclass.- Since:
- MicroStrategy Web 8.0.1
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSYS_DEFAULT_DISABLE_ONDEMAND_DRILLINGsystem 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 ContextMenuItemaddDrillMenuItem(WebDrillPath drillPath)Add a menu option for the drill path providedprotected ContextMenuItemaddDrillMenuItem(WebDrillPath drillPath, ContextMenu subMenu, boolean isAdvanced)Add a menu option for the drill path providedprotected voidaddDrillPathToMenu(WebDrillPath drillPath)Add a menu option for the drill path providedprotected ContextMenuItemaddGenericMoreOptions()Creates aContextMenuIteminstance with generic information for displaying "More Options" for drillingprotected booleanareThereOptions()booleancanDrill()ContextMenugenerateSubMenu()Method that generates aContextMenuinstance with all the possible sub menu options enabled for the report cell provided.TransformContextgetContext()java.lang.StringgetDescriptor(int key)Get the descriptor for the given key.protected intgetDisplayMode(WebDrillPath dp)protected java.lang.StringgetDrillParameters(WebDrillPath drillPath, boolean isAdvanced)Utility method for generating JavaScript arguments corresponding to the drill path requested.protected java.lang.StringgetDrillWithin(WebDrillPath drillPath, boolean isAdvanced)static java.lang.StringgetGridDrillDynamicMenuName(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 intgetIntValue(java.lang.String fpName, int defaultValue)Utility method for obtaining the integer value of a given formal parameterprotected java.lang.StringgetJavaScriptFunction()protected java.lang.StringgetMoreOptionsArgs()protected java.lang.StringgetStringValue(java.lang.String fpName, java.lang.String defaultValue)Utility method for obtaining the string value of a given formal parameterprotected ContextMenugetSubMenu()Returns ContextMenu using TransformContext's ContextMenuManager.protected abstract java.lang.StringgetSubMenuName()Gets the submenu Name which helps in creation of dynamic menuitems.protected abstract WebDrillMapgetWebDrillMap()Utility method for obtaining the drill map information for the current cell indicatedprotected abstract WebTitlegetWebTitle()Utility method for obtaining the currentWebTitleinstance related to the cell being processedprotected booleanhasDrillPaths()Returns true of the builder should have any drillpaths.protected voidinternalPopulate()protected booleanisAdvancedDrillMenuAvailable()protected booleanisCellMetric()If the cell a metric value or template metric, it should return true otherwise falseprotected booleanisDrillable(WebDrillPath drillPath)protected booleanisFeatureAvailable(java.lang.String featureName)Utility method for determining if a feature is available or notbooleanisIframeEnabled()protected booleanisMetricDrillingEnabled()static booleanisOndemandDrillingDisabled()Returns a boolean true if finds a system default preference value "1" for AdminServersHelper#PROPERTY_DISABLE_ONDEMAND_DRILLING.protected booleanisRW()protected booleanisTestForElements()protected booleanisTrue(java.lang.String fpName)Utility method for obtaining the boolean value of a given formal parameterbooleanisValid()protected voidpopulateMoreOptions(WebDrillMap wdm)Utility method that will generate the More Options for drilling, like browsing to different hierarchies.voidpopulateOnDemand()Populates the context menus ondemand.protected voidprocessAdvancedDrillPathElements(WebDrillMap wdm, ContextMenu subMenu)Utility method that will generate the advanced drill path options for drilling, like browsing to different hierarchiesprotected voidprocessDrillPathElements(WebDrillMap wdm)Method that will generate the base drill options according to the drill map information provided.protected voidsetAreThereOptions(boolean value)Set the boolean value determining if there are drill options that can be rendered by this builder.voidsetIframeEnabled(boolean value)Define if the options to generate will be iframe enabled or notprotected voidsetImageType(WebDrillPath drillPath, ContextMenuItem menuItem)protected booleanshouldIncludeDrillPath(WebDrillPath drillPath)Utility method for determining if the drill path information should be included or notprotected voidsortWebDrillMap(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.Contextinstance 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:
WebDrillMapinitialized instance with the drill information. Returnsnullif 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-WebDrillMapinitialized 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 currentWebTitleinstance related to the cell being processed- Returns:
WebTitleinstance related with the cell being processed. Returnsnullif none provided.
-
isDrillable
protected boolean isDrillable(WebDrillPath drillPath)
- Parameters:
drillPath-WebDrillMapinitialized 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:OnDemandContextMenuBuilderPopulates the context menus ondemand.- Specified by:
populateOnDemandin 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-WebDrillMapinstance 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-WebDrillMapinstance initialized with the drill information for the current cell being analyzed.subMenu-ContextMenuinstance 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
Stringcorresponding 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 aContextMenuIteminstance with generic information for displaying "More Options" for drilling- Returns:
ContextMenuIteminstance 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:
isValidin 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-WebDrillPathinstance that will become an option to display to the user for drilling.subMenu-ContextMenuinstance 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:
ContextMenuIteminstance 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-WebDrillPathinstance that will become an option to display to the user for drilling.- Returns:
ContextMenuIteminstance 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-WebDrillPathinstance 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-WebDrillPathfrom 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-WebDrillMapinstance 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-WebDrillMapinstance 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:
setIframeEnabledin interfaceComposedContextMenuBuilder- Parameters:
value- boolean value indicating if the options to generate will be iframe enabled or not
-
isIframeEnabled
public boolean isIframeEnabled()
- Specified by:
isIframeEnabledin interfaceComposedContextMenuBuilder- Returns:
- boolean value indicating if the options generated by this builder are iframe enabled or not
-
getContext
public TransformContext getContext()
- Returns:
ReportGridDisplayCell.Contextinstance with the information about the context (cell, transform, etc) where this menu item will be displayed.
-
generateSubMenu
public ContextMenu generateSubMenu()
Description copied from interface:ComposedContextMenuBuilderMethod that generates aContextMenuinstance with all the possible sub menu options enabled for the report cell provided.- Specified by:
generateSubMenuin interfaceComposedContextMenuBuilder- Returns:
ContextMenuinstance 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.
-
-