Class AbstractInboxContextMenuItemBuilder
- java.lang.Object
-
- com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
-
- com.microstrategy.web.app.transforms.contextmenus.AbstractInboxContextMenuItemBuilder
-
- All Implemented Interfaces:
ContextMenuItemBuilder
- Direct Known Subclasses:
InboxDelete
,InboxDetails
,InboxExport
,InboxPDF
,InboxRename
,InboxUnread
public abstract class AbstractInboxContextMenuItemBuilder extends ContextMenu.DefaultContextMenuItemBuilder
This class is used by Microstrategy Web as a base class for those used to populate context-menus used in the History List page.
New context-menus-builders can be created simply by extending this class and implementing three methods:
- getContextMenuFlag(): Used to maintain backwards compatibility, these builders
check for the
contextMenuFlags
FormalParameter to make sure they can enabled. New builders should return in this method the flag associated with the context-menu-item, for example, a "copy" context-menu would returnInboxListXHTMLTransform.LEVEL_EXPORT_EXCEL
. - isActionEnabled(): Besides checking the context-menu flag, this method enables the builder to check for other conditions to enable the action. For example, to check whether the user has enough privileges/access control. Subclasses can ultimately delegate this logic to the transform.
- getEvent(): This method returns the
WebEvent
to execute when this menu item is selected. Also in this case, subclasses can ultimately delegate this logic to the transform.
- Since:
- MicroStrategy Web 9.0.0
-
-
Constructor Summary
Constructors Constructor Description AbstractInboxContextMenuItemBuilder(Shortcut definition)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ContextMenuItem
createItem(TransformContext context)
Creates the item and sets its javascript to submit the corresponding event using the iFrame.protected java.lang.String
getBoneID(TransformContext context)
Returns the bone-id used with this context-menuprotected abstract WebEvent
getEvent(TransformContext context)
Provides the abstract class with the corresponding event to execution with this item.protected java.lang.String
getJSCode(TransformContext context)
Returns the javascript code to use with this context-menu-itemprotected InboxListXHTMLTransform
getTransform(TransformContext context)
Helper method to retrieve the InboxListXHTMLTransform from the context.protected WebMessage
getWebMessage(TransformContext context)
Helper method to retrieve the WebObjectInfo from the context.protected java.lang.String
iframeParam(InboxListXHTMLTransform transform)
protected abstract boolean
isActionEnabled(TransformContext context)
Indicates the abstract class if the corresponding action of this item is available.boolean
isItemAvailable(TransformContext context)
Returnstrue
if the underlyingShortcut
used as definition is available (based on the features defined on the <shortcut> xml.-
Methods inherited from class com.microstrategy.web.app.gui.ContextMenu.DefaultContextMenuItemBuilder
createItem, getDefinition, getItemKey, getScript
-
-
-
-
Constructor Detail
-
AbstractInboxContextMenuItemBuilder
public AbstractInboxContextMenuItemBuilder(Shortcut definition)
-
-
Method Detail
-
isItemAvailable
public boolean isItemAvailable(TransformContext context)
Description copied from class:ContextMenu.DefaultContextMenuItemBuilder
Returns
true
if the underlyingShortcut
used as definition is available (based on the features defined on the <shortcut> xml.If this method returns
false
the context-menu-item should not be included as part of the available options in the menu.- Specified by:
isItemAvailable
in interfaceContextMenuItemBuilder
- Overrides:
isItemAvailable
in classContextMenu.DefaultContextMenuItemBuilder
- Parameters:
context
- TransformContext with context information.- Returns:
true
if the context-menu-item is available and should be included.
-
isActionEnabled
protected abstract boolean isActionEnabled(TransformContext context)
Indicates the abstract class if the corresponding action of this item is available.
-
createItem
public ContextMenuItem createItem(TransformContext context)
Creates the item and sets its javascript to submit the corresponding event using the iFrame.- Specified by:
createItem
in interfaceContextMenuItemBuilder
- Overrides:
createItem
in classContextMenu.DefaultContextMenuItemBuilder
- Parameters:
context
- TransformContext with context information.- Returns:
- a new instance of a
ContextMenuItem
.
-
getJSCode
protected java.lang.String getJSCode(TransformContext context)
Returns the javascript code to use with this context-menu-item
-
iframeParam
protected java.lang.String iframeParam(InboxListXHTMLTransform transform)
-
getTransform
protected InboxListXHTMLTransform getTransform(TransformContext context)
Helper method to retrieve the InboxListXHTMLTransform from the context.
-
getWebMessage
protected WebMessage getWebMessage(TransformContext context)
Helper method to retrieve the WebObjectInfo from the context.
-
getBoneID
protected java.lang.String getBoneID(TransformContext context)
Returns the bone-id used with this context-menu
-
getEvent
protected abstract WebEvent getEvent(TransformContext context)
Provides the abstract class with the corresponding event to execution with this item.
-
-