public class

ReportGridCellRowHeaderImpl

extends AbstractReportGridCellHeader
implements ReportGridCellRowHeader
java.lang.Object
   ↳ com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
     ↳ com.microstrategy.web.app.transforms.AbstractReportGridCellHeader
       ↳ com.microstrategy.web.app.transforms.ReportGridCellRowHeaderImpl
Known Direct Subclasses

Class Overview

The ReportGridCellRowHeaderImpl is used to generate the HTML of a cell of that is a value of the row axis.

This class can handle two different types of SDK objects:
  1. WebHeader: used in view mode, this is the SDK object that represents a value of the row axis.
  2. WebTemplateMetric: used in design mode when the metrics are located in the column axis, each metric is represented as a row header.

The ReportGridCellRowHeaderImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

Users who intend to programatically modify the HTML generated for a row header should extend this class. Using this technique developers could define their own rules of the text to display based on the WebHeader content.

The following is an example of a class that extends the generateText(MarkupOutput) method of this class based on the header's semantics:
 public class CustomColHeader extends ReportGridCellRowHeaderImpl {

     public void generateText(MarkupOutput mo) {
         WebHeader header = getWebHeader();

         if (header != null) {
             switch (header.getSemantics()) {
             case EnumDSSXMLBaseFormType.DssXmlBaseFormPicture:
                 mo.append("<IMG SRC=\"");
                 mo.append(getText());
                 mo.append("\" ALT=\"\" BORDER=0 />");
                 break;

             case EnumDSSXMLBaseFormType.DssXmlBaseFormUrl:
             case EnumDSSXMLBaseFormType.DssXmlBaseFormEmail:
                 mo.append("<A HREF=\"");
                 if (header.getSemantics() == EnumDSSXMLBaseFormType.DssXmlBaseFormEmail) mo.append("mailto:");
                 mo.append(getText());
                 mo.append("\">");
                 mo.append(getText());
                 mo.append("</A>");
                 break;

             case EnumDSSXMLBaseFormType.DssXmlBaseFormHTMLTag:
                 mo.append(HTMLHelper.decode(getText()));
                 break;

             default:
                 super.generateText(mo);
                 break;
             }
         } else {
             super.generateText(mo);
         }
     }
 }
 

Summary

[Expand]
Inherited Constants
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
Public Constructors
ReportGridCellRowHeaderImpl()
Constructor used for creating a generic display cell.
Public Methods
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 canMetricFilterOn()
Utility method for determining if the cell object is enabled for displaying the user the option to apply a metric filter 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 canSort()
Utility methood for determining if the cell object is enabled for displaying the user the option to sort it
String getExtraStyle()
Returns the extra style information required for the formatting of the cell as registered by the Transform.
void init(TransformContext context)
Initializes the instance.
void init(TransformContext context, WebTemplateMetric metric)
This method is called to initialize the cell in design mode.
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, 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, WebHeader header, HashMap cachedObjects)
This method is deprecated. please use the interface that receives TransformContext instance instead.
void init(TransformContext context, WebHeader header)
This method is called to initialize the cell in view mode.
void init(WebComponent wc, HashMap cachedObjects)
This method is deprecated. use the init interface that receives a ReportGridTransformImpl.Context 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 init(WebComponent wc, WebTemplateMetric metric, HashMap cachedObjects)
This method is deprecated. please use the interface that receives TransformContext instance instead.
void init(WebComponent wc, WebTemplateUnit unit, FormalParameters formalParas)
This method is deprecated. please use the interface that receives TransformContext instance instead.
boolean isMetric()
determine if the row header is containing a metric
boolean isMetricDrillable(WebHeader header, WebDrillPath drillPath)
return whether the header has a drillable metric
void reset()
Reset all of the instance variables.
void setOutlinemodeRowCount(int OutlinemodeRowCount)
In outline mode, this is used to indicate the cell in which row it is being rendered.
void setOutlinemodeSubTotalName(String OutlineodeSubtotalName)

In outline mode, this is used to indicate the name of the subtotal whose values are being displayed in this row.

void setOutlinemodeWrapHeaderText(boolean isWrap)
Indicates the header text of the outline mode cell need to be wrap up with related html tags.
void setShowOutlinemodeImage(boolean value)
Indicates the cell that this header can be expanded in outline mode and that an image to expand/collapse the header needs to be rendered.
Protected Methods
void appendContextMenuItems(ContextMenu rhMenu)
This method is deprecated. Please use the new approach for generating context menus, see ReportCellRemoveFromGrid, ReportCellMove, etc
void generateDrillCheckBox(MarkupOutput mo)
Obtains the check box tag information for Drill and renders it out.
void generateFilterOnSelectionCheckBox(MarkupOutput mo)
Obtains the check box tag information for Filter On Selection and renders it out.
void generateOutlineModeImage(MarkupOutput mo)
Generate the javascript images for collapse and expand for outline mode.
void generateOutlineSubTotalName(MarkupOutput mo)
Generate the name of the subtotal type next to the header element for outline mode.
Tag generatePivotButton(int type)
void generatePreContent(MarkupOutput mo)

Generates the preContent of the cell.

WebGridData getGridData()
WebTemplate getGridTemplate()
int getOutlinemodeRowCount()
get row count for outline mode
String getOutlinemodeSubTotalName()
get subtotal name for outline mode
boolean getShowOutlinemodeImage()
get whether display outline mode image
String getSortID()
This method return the ID to use for sorting this cell.
WebTemplateUnit getWebTemplateUnit()
Returns the WebTemplateUnit associated with the class.
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.
boolean isDrillAvailable()
boolean isDrillPathAvailable(WebHeader header)
Utility method to determine if the current header has drill information available
void renderContextMenu(MarkupOutput mo)
This method is deprecated. use getContextMenuAttributes() instead
[Expand]
Inherited Methods
From class com.microstrategy.web.app.transforms.AbstractReportGridCellHeader
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
From class java.lang.Object
From interface com.microstrategy.web.app.transforms.ReportGridCellHeader
From interface com.microstrategy.web.app.transforms.ReportGridCellRowHeader
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell

Public Constructors

public ReportGridCellRowHeaderImpl ()

Constructor used for creating a generic display cell. For example, the cssPrefix is needed for the empty cells in design mode.

Public Methods

public 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

Returns
  • boolean value indicating if the manipulation should be enabled

public boolean canMetricFilterOn ()

Utility method for determining if the cell object is enabled for displaying the user the option to apply a metric filter on it

Returns
  • boolean value indicating if the manipulation should be enabled

public boolean canPivot ()

Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it

Returns
  • boolean value indicating if the manipulation should be enabled

public boolean canRemoveFromGrid ()

Utility methood for determining if the cell object is enabled for displaying the user the option to remove it from the grid.

Returns
  • boolean value indicating if the manipulation should be enabled

public boolean canRemoveFromReport ()

Utility methood for determining if the cell object is enabled for displaying the user the option to remove it from the report

Returns
  • boolean value indicating if the manipulation should be enabled

public boolean canSort ()

Utility methood for determining if the cell object is enabled for displaying the user the option to sort it

Returns
  • boolean value indicating if the manipulation should be enabled

public String getExtraStyle ()

Returns the extra style information required for the formatting of the cell as registered by the Transform. This text is assigned to the STYLE attribute of the TD tag.

Returns
  • The extra style info as registered by the Transform.

public void init (TransformContext context)

Initializes the instance.

Parameters
context TransformContext instance that contains a reference to the transform being used to render the overall grid information

public void init (TransformContext context, WebTemplateMetric metric)

This method is called to initialize the cell in design mode. It receives a WebTemplateMetric as the underlying SDK object.

Parameters
context TransformContext instance initialized with the grid's transform information.
metric WebTemplateMetric instance corresponding to the cell to be displayed.

public void init (WebComponent wc, WebTemplateMetric metric, FormalParameters formalParas)

This method is deprecated.
please use the interface that receives TransformContext instance instead.

This method is called to initialize the cell in design mode. It receives a WebTemplateMetric as the underlying SDK object.

Parameters
wc The bean being transformed.
metric The WebTemplateMetric corresponding to this cell.
formalParas all the formal parameters from the report transform. Used to control some output generation.

public 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).

Initializes an ReportGridDisplayCell. This is used to initialize empty cells that have no underlying WebObject.

Parameters
wc associated web component
formalParas all the formal parameters from the report transform. Used to control some output generation.

public void init (WebComponent wc, WebHeader header, HashMap cachedObjects)

This method is deprecated.
please use the interface that receives TransformContext instance instead.

This method is called to initialize the cell in view mode. It receives a WebHeader as the underlying SDK object.

Parameters
wc The bean being transformed.
header The WebHeader corresponding to this cell.
cachedObjects A HashMap populated by the transform and used to store information shared across multiple cells.

public void init (TransformContext context, WebHeader header)

This method is called to initialize the cell in view mode. It receives a WebHeader instance as the underlying SDK object

Parameters
context TransformContext instance initialized with the grid's transform information.
header WebHeader instance coresponding to the cell to be displayed.

public void init (WebComponent wc, HashMap cachedObjects)

This method is deprecated.
use the init interface that receives a ReportGridTransformImpl.Context object

Initializes an ReportGridDisplayCell. This is used to initialize empty cells that have no underlying WebObject.

Parameters
wc associated web component.
cachedObjects a HashMap populated by the transform and used to store information shared across multiple cells.

public 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).

Initializes an ReportGridDisplayCell. This is used to initialize empty cells that have no underlying WebObject.

Parameters
formalParas all the formal parameters from the report transform. Used to control some output generation.

public void init (WebComponent wc, WebTemplateMetric metric, HashMap cachedObjects)

This method is deprecated.
please use the interface that receives TransformContext instance instead.

Initialize this class with the cell information to consider for HTML generation

Parameters
wc WebComponent base instance
metric WebTemplateMetric instance related with the cell to be rendered
cachedObjects HashMap instance with information relevant to this instance for HTML generation.

public void init (WebComponent wc, WebTemplateUnit unit, FormalParameters formalParas)

This method is deprecated.
please use the interface that receives TransformContext instance instead.

This method is called to initialize the cell in design mode. It receives a WebTemplateUnit as the underlying SDK object.

Parameters
wc The bean being transformed.
unit The WebTemplateUnit corresponding to this cell.
formalParas all the formal parameters from the report transform. Used to control some output generation.

public boolean isMetric ()

determine if the row header is containing a metric

Returns
  • whether the cell is containing a metric

public boolean isMetricDrillable (WebHeader header, WebDrillPath drillPath)

return whether the header has a drillable metric

Parameters
header the header object
drillPath the drill path
Returns
  • whether the header has a drillable metric

public void reset ()

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.

public void setOutlinemodeRowCount (int OutlinemodeRowCount)

In outline mode, this is used to indicate the cell in which row it is being rendered. This information needs to be added to the cell's tag to enable expanding/collapsing of its child rows.

Parameters
OutlinemodeRowCount The row number this cell is being rendered in.

public void setOutlinemodeSubTotalName (String OutlineodeSubtotalName)

In outline mode, this is used to indicate the name of the subtotal whose values are being displayed in this row.

In outline mode, the Transform automatically shows the values of the first subtotal for the current level. This enables users to analize the data even if the level is collapsed. The cell should display the name of this subtotal.

Parameters
OutlineodeSubtotalName String with the subtotal's name.

public void setOutlinemodeWrapHeaderText (boolean isWrap)

Indicates the header text of the outline mode cell need to be wrap up with related html tags.

Parameters
isWrap If set to true, the header text need to do format converting.

public void setShowOutlinemodeImage (boolean value)

Indicates the cell that this header can be expanded in outline mode and that an image to expand/collapse the header needs to be rendered.

Parameters
value If set to true, the cell needs to include the image to expand/collapse the cell

Protected Methods

protected void appendContextMenuItems (ContextMenu rhMenu)

This method is deprecated.
Please use the new approach for generating context menus, see ReportCellRemoveFromGrid, ReportCellMove, etc

protected void generateDrillCheckBox (MarkupOutput mo)

Obtains the check box tag information for Drill and renders it out.

Parameters
mo MarkupOutput instance where the HTML content generated by this method will be saved

protected void generateFilterOnSelectionCheckBox (MarkupOutput mo)

Obtains the check box tag information for Filter On Selection and renders it out.

Parameters
mo MarkupOutput instance where the HTML content generated by this method will be saved

protected void generateOutlineModeImage (MarkupOutput mo)

Generate the javascript images for collapse and expand for outline mode.

Parameters
mo the output object

protected void generateOutlineSubTotalName (MarkupOutput mo)

Generate the name of the subtotal type next to the header element for outline mode.

Parameters
mo the output object

protected Tag generatePivotButton (int type)

protected void generatePreContent (MarkupOutput mo)

Generates the preContent of the cell. The pre-Content means the html content before the core content of the cell. An example would be a checkbox before the text.
By default, this method generates images for grids in outline mode, drilling checkboxes and filter on selection checkboxes.

Developers can either use the setPreContent(String) method to set any text they want to display before the contents of the cell or override this method to inherit its functionality and build on top of it.

For example, the following code could be used to extend this method to add a <LI> tag before the cell content in any of the classes that extend AbstractReportGridDisplayCell:
 public void generatePreContent(MarkupOutput mo) {
     super.generatePreContent(mo);

     mo.append("<LI>");
 }
 

Parameters
mo the output object

protected WebGridData getGridData ()

protected WebTemplate getGridTemplate ()

protected int getOutlinemodeRowCount ()

get row count for outline mode

Returns
  • row count for outline mode

protected String getOutlinemodeSubTotalName ()

get subtotal name for outline mode

Returns
  • subtotal name for outline mode

protected boolean getShowOutlinemodeImage ()

get whether display outline mode image

Returns
  • whether display outline mode image

protected String getSortID ()

This method return the ID to use for sorting this cell.

Returns
  • The ID to use for sorting this cell.

protected WebTemplateUnit getWebTemplateUnit ()

Returns the WebTemplateUnit associated with the class.

Returns

protected boolean hasWebObject ()

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.

Returns
  • true if the cell has underlying WebObject.

protected void initCell ()

Initialize the cell title information

protected void initDNDForDesignMode (DragAndDropItem item)

This method initializes properties used in javascript for drag and drop in design mode.

Parameters
item DragAndDropItem

protected void initDNDForExecuteMode (DragAndDropItem item)

This method initializes properties used in javascript for drag and drop in view mode.

Parameters
item DragAndDropItem

protected boolean isDrillAvailable ()

protected boolean isDrillPathAvailable (WebHeader header)

Utility method to determine if the current header has drill information available

Parameters
header WebHeader instance to analyze
Returns
  • boolean value indicating if there is drill path information available or not, for the specified title.

protected void renderContextMenu (MarkupOutput mo)

This method is deprecated.
use getContextMenuAttributes() instead

Render the context menu's trigger for this cell.

Parameters
mo the output object