java.lang.Object | ||
↳ | com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell | |
↳ | com.microstrategy.web.app.transforms.ReportGridCellMetricValueImpl |
![]() |
The ReportGridCellMetricValue
is used to generate the HTML of a cell value of the report data.
It uses a WebRowValue
as the
underlying SDK
objects to retrieve the information from.
The ReportGridCellColTitleImpl
extends the AbstractReportGridDisplayCell
which controls the exeuction flow.
Users who intend to programatically modify the HTML generated for a metric value should
extend this class. Using this technique developers could define their own rules of the text to
display based on the WebTitle
content.
generateText(MarkupOutput)
method
of this class based on the title's template unit type:
public class CustomMetricValueextends ReportGridCellMetricValueImpl { public void generateText(MarkupOutput mo) { WebRowValue rowValue = getWebRowValue(); if (rowValue != null) { String spanPrefix = ""; String spanPostfix = ""; switch (rowValue.getSemantics()) { case EnumDSSXMLBaseFormType.DssXmlBaseFormPicture: case EnumDSSXMLBaseFormType.DssXmlBaseFormUrl: //For threshold images Tag imgTag = TagsFactory.getInstance().newTag("img"); imgTag.setAttribute(EnumHTMLTags.ATT_SRC, rowValue.getValue()); imgTag.render(mo); break; case EnumDSSXMLBaseFormType.DssXmlBaseFormSymbol: //For thresholds quick symbols generateThresholdSymbol(mo, Integer.parseInt(rowValue.getValue())); break; case EnumDSSXMLBaseFormType.DssXmlBaseFormHTMLTag: mo.append(HTMLHelper.decode(rowValue.getValue())); break; default: super.generateText(mo); } } else { super.generateText(mo); }
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ReportGridCellMetricValueImpl()
Constructor used for creating a generic display cell.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
canDrill()
Utility methood for determining if the cell object is enabled for displaying the user
the option to drill on it
| ||||||||||
boolean |
canDrillAdvanced()
Utility methood for determining if the cell object is enabled for displaying the user
the option for advanced drilling on it
| ||||||||||
boolean |
canFilterOn()
Utility methood for determining if the cell object is enabled for displaying the user
the option to filter on it
| ||||||||||
boolean |
canFormat()
Utility methood for determining if the cell object is enabled for displaying the user
the option to format it
| ||||||||||
boolean | canHaveDerivedElements() | ||||||||||
boolean |
canHyperLink()
Utility method for determining if the cell object is enabled for displaying the
user the option to navigate to custom hyperlinks
| ||||||||||
boolean |
canInsertShortcutMetric()
Utility methood for determining if the cell object is enabled for displaying the user
the option to insert shortcut metrics based on it
| ||||||||||
boolean |
canModifyAttributeForm()
Utility methood for determining if the cell object is enabled for displaying the user
the option to modify the attribute forms on it
| ||||||||||
boolean |
canPivot()
Utility methood for determining if the cell object is enabled for displaying the user
the option to pivot it
| ||||||||||
boolean |
canRemoveFromGrid()
Utility methood for determining if the cell object is enabled for displaying the user
the option to remove it from the grid.
| ||||||||||
boolean |
canRemoveFromReport()
Utility methood for determining if the cell object is enabled for displaying the user
the option to remove it from the report
| ||||||||||
boolean |
canRename()
Utility methood for determining if the cell object is enabled for displaying the user
the option to rename it
| ||||||||||
boolean |
canSort()
Utility methood for determining if the cell object is enabled for displaying the user
the option to sort it
| ||||||||||
void |
generateText(MarkupOutput mo)
Generates the text of the cell. | ||||||||||
int |
getCellType()
This method is deprecated.
The cell type is not significant anymore for the application.
| ||||||||||
WebEvent | getDerivedElementsEvent() | ||||||||||
WebDrillPath |
getDrillPathWithHighImportance()
generate drilling url parameters for row value in DHTML mode
| ||||||||||
WebEvent |
getFilterOnEvent()
Get the event for filter on the cell header instance
| ||||||||||
int | getKey() | ||||||||||
WebEvent |
getRenameEvent()
Get the event for renaming the current cell
| ||||||||||
String |
getStyle()
Returns the css class name associated with the cell as registered
by the Transform.
| ||||||||||
WebRowValue |
getWebRowValue()
Returns the underlying
SDK object associated with this cell. | ||||||||||
WebTemplateMetric |
getWebTemplateMetric()
return the WebTemplateMetric object associated with this cell
| ||||||||||
void |
init(WebComponent wc, FormalParameters formalParas)
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses
init(TransformContext) . | ||||||||||
void |
init(WebComponent wc, WebTemplateMetric metric, FormalParameters formalParas)
This method is deprecated.
please use the interface that receives
TransformContext instance instead. | ||||||||||
void |
init(WebComponent wc, WebRowValue rowValue, HashMap cachedObjects)
This method is deprecated.
please use the interface that receives
TransformContext instance instead. | ||||||||||
void |
init(TransformContext context, WebRowValue rowValue)
This method is called to initialize the cell with the corresponding
WebRowValue
as the underlying SDK object | ||||||||||
void |
init(FormalParameters formalParas)
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses
init(TransformContext) .
| ||||||||||
void |
reset()
Reset all of the instance variables.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addContextMenuAttributes(Map atts)
Obtain the tag attributes that should be added to the cell's definition for
processing context menus
| ||||||||||
void | addToHeaderMetricValueJsonMap(String key, String value) | ||||||||||
void |
appendContextMenuItems(ContextMenu rhMenu)
This method is deprecated.
Please use the new approach for generating context menus, see
ReportCellRemoveFromGrid , ReportCellMove , etc | ||||||||||
boolean |
cellNeedsLink()
Utility method for determining if the current cell being displayed needs to be a link or
not, for example, in case of drilling available.
| ||||||||||
boolean |
encodeMetricValue()
Whether to HTML-encode metric values (based on the preference value)
| ||||||||||
void |
generateContent(MarkupOutput mo)
Extends
generateContent by adding a URL link to the cell's text. | ||||||||||
AnchorTag |
generateDrillAnchor()
Utility method for generating the
AnchorTag instance with all the drill information
if available for the current cell being displayed by this instance. | ||||||||||
AnchorTag | generateHyperLinkAnchor() | ||||||||||
Tag | generatePivotButton(int type) | ||||||||||
void |
generateThresholdSymbol(MarkupOutput out, int thresholdValue)
Generates the HTML when the metric value is a "quick symbol" threshold.
| ||||||||||
String |
generateTooltipContent()
Generates the string with the tooltip information to be assigned to the
TITLE attribute of the cell tag for this instance
| ||||||||||
void | getCellAttributes(Map attributes) | ||||||||||
void |
getCellLevelAttributes(Map cell)
CTY indicates the cell type
UTP indicates the template unit that it belongs to, in the format of "axis,position"
| ||||||||||
String | getParentElementIndex() | ||||||||||
String | getParentFormValueIndex() | ||||||||||
String |
getRowValueForURL()
Returns the value of the current row.
| ||||||||||
String |
getSortID()
This method return the ID to use for sorting this cell.
| ||||||||||
boolean |
hasWebObject()
This method allows the abstract class to identify whether the cell
has been initialized with a valid WebObject.
| ||||||||||
void |
initCell()
Initialize the cell title information
| ||||||||||
void |
initDNDForDesignMode(DragAndDropItem item)
This method initializes properties used in javascript for drag and drop
in design mode.
| ||||||||||
void |
initDNDForExecuteMode(DragAndDropItem item)
This method initializes properties used in javascript for drag and drop in view mode.
| ||||||||||
void | initRowValueInformation(WebRowValue rowValue) | ||||||||||
boolean |
isDrillPathAvailable(WebRowValue rowValue)
Utility method to determine if the current row value has drill information available
| ||||||||||
boolean | isHeaderMVJsonMovable() | ||||||||||
void |
renderContextMenu(MarkupOutput mo)
This method is deprecated.
use
getContextMenuAttributes() instead |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Constructor used for creating a generic display cell.
Utility methood for determining if the cell object is enabled for displaying the user the option to drill on it
Utility methood for determining if the cell object is enabled for displaying the user the option for advanced drilling on it
Utility methood for determining if the cell object is enabled for displaying the user the option to filter on it
Utility methood for determining if the cell object is enabled for displaying the user the option to format it
Utility method for determining if the cell object is enabled for displaying the user the option to navigate to custom hyperlinks
Utility methood for determining if the cell object is enabled for displaying the user the option to insert shortcut metrics based on it
Utility methood for determining if the cell object is enabled for displaying the user the option to modify the attribute forms on it
Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it
Utility methood for determining if the cell object is enabled for displaying the user the option to remove it from the grid.
Utility methood for determining if the cell object is enabled for displaying the user the option to remove it from the report
Utility methood for determining if the cell object is enabled for displaying the user the option to rename it
Utility methood for determining if the cell object is enabled for displaying the user the option to sort it
Generates the text of the cell. This is the the text that gets displayed by the browser.
Developers can either use the setText(String)
method to set any text they want
to display for the cell or override this method
to inherit its functionality and build on top of it.
public void generateText(MarkupOutput mo) { String text = getText(); if ("".equals(text) || " ".equals(text)) { mo.append("-"); } else { super.generateText(mo); } }
mo | the output object |
---|
This method is deprecated.
The cell type is not significant anymore for the application.
Returns the cell type, a value from the EnumReportGridDisplayCellTypes
enumeration.
generate drilling url parameters for row value in DHTML mode
Get the event for filter on the cell header instance
WebEvent
instance initialized for filtering on the information of this cellGet the event for renaming the current cell
WebEvent
instance initialized with the information for renaming the current
cell.Returns the css class name associated with the cell as registered
by the Transform.
If set, this is the one assigned to the CLASS
attribute of the TD
tag
to control its formatting.
Returns the underlying SDK
object associated with this cell.
It should always return null
if the instance represents an empty cell.
return the WebTemplateMetric object associated with this cell
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext)
.
Initializes an ReportGridDisplayCell
. This is used to initialize
empty cells that have no underlying WebObject
.
wc | associated web component |
---|---|
formalParas | all the formal parameters from the report transform. Used to control some output generation. |
This method is deprecated.
please use the interface that receives TransformContext
instance instead.
This method is deprecated.
please use the interface that receives TransformContext
instance instead.
This method is called to initialize the cell with the corresponding
WebRowValue
as the underlying SDK object.
wc | The bean being transformed. |
---|---|
rowValue | The WebRowValue corresponding to this cell. |
cachedObjects | A HashMap populated by the transform and
used to store information shared across multiple cells. |
This method is called to initialize the cell with the corresponding WebRowValue
as the underlying SDK object
context | TransformContext instance initialized with the grid's
transform information. |
---|---|
rowValue | WebRowValue instance corresponding to the cell to be displayed. |
This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells
it now uses init(TransformContext)
.
Initializes an ReportGridDisplayCell
. This is used to initialize
empty cells that have no underlying WebObject
.
formalParas | all the formal parameters from the report transform. Used to control some output generation. |
---|
Reset all of the instance variables. This method is very important when improve the memory performance: we create only one instance for a particular cell type and reuse it instead of creating a new instance for each concrete grid cell. Therefore, it saves a lot of memory. For implementation of this method, please follow the workflow of how all the instance variables are initialized in the class hierarchy when a new instance is created: superclass instance variables are initialized first, subclass instance variables are initialized second. Note: for the purpose of cell reuse.
Obtain the tag attributes that should be added to the cell's definition for processing context menus
atts | Map where attributes will be appended. |
---|
This method is deprecated.
Please use the new approach for generating context menus, see
ReportCellRemoveFromGrid
, ReportCellMove
, etc
Utility method for determining if the current cell being displayed needs to be a link or not, for example, in case of drilling available.
Whether to HTML-encode metric values (based on the preference value)
Extends generateContent
by adding a URL link to the cell's text.
Developers can either use the setContent(String)
method to set any text they want
to display as the cell's contents or override this method
to inherit its functionality and build on top of it.
As an example, the following code could be used to extend this method to add a <BR> tag
after cell's content:
public void generateContent(MarkupOutput mo) { super.generateContent(mo); mo.append("<br>"); }
mo | the output object |
---|
Generates the HTML when the metric value is a "quick symbol" threshold.
out | the output object |
---|---|
thresholdValue | the threshold id. A value from EnumDSSXMLSymbol .
|
Generates the string with the tooltip information to be assigned to the TITLE attribute of the cell tag for this instance
CTY indicates the cell type UTP indicates the template unit that it belongs to, in the format of "axis,position"
canHyperLink()
returns false
canHyperLink()
returns false
Returns the value of the current row.
This method return the ID to use for sorting this cell.
This method allows the abstract class to identify whether the cell has been initialized with a valid WebObject. Some cells are created empty (with no underlying web object), they usually represent empty cells (like the ones used in design mode for metric values or row headers); in these cases some functionality needs to be disabled (liek context-menus or dnd), this method allow us to identify these cells.
WebObject
.Initialize the cell title information
This method initializes properties used in javascript for drag and drop in design mode.
item | DragAndDropItem |
---|
This method initializes properties used in javascript for drag and drop in view mode.
item | DragAndDropItem |
---|
Utility method to determine if the current row value has drill information available
rowValue | value WebRowValue instance to analyze |
---|
This method is deprecated.
use getContextMenuAttributes()
instead
Render the context menu's trigger for this cell.
mo | the output object |
---|