public class

ReportGridCellColHeaderImpl

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

Class Overview

The ReportGridCellColHeaderImpl is used to generate the HTML of a cell of that is a value of the column 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 column axis.
  2. WebTemplateMetric: used in design mode when the metrics are located in the column axis, each metric is represented as a column header.

The ReportGridCellColHeaderImpl extends the AbstractReportGridDisplayCell which controls the exeuction flow.

Users who intend to programatically modify the HTML generated for a column 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 ReportGridCellColHeaderImpl {

     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

Nested Classes
class ReportGridCellColHeaderImpl.ColHeaderPivotButtonInfo Helper class for storing pivot button information - such as JavaScript id, descriptor (tooltip) and image name - based on the action that can be performed given the current selected target. 
[Expand]
Inherited Constants
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
From interface com.microstrategy.web.app.transforms.ReportGridCellColHeader
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell
[Expand]
Inherited Fields
From class com.microstrategy.web.app.transforms.AbstractReportGridDisplayCell
Public Constructors
ReportGridCellColHeaderImpl()
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 canPivot()
Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it
boolean canPivot(int type)
Utility methood for determining if the cell object is enabled for displaying the user the option to pivot it according to the type specified
boolean canSort()
Utility methood for determining if the cell object is enabled for displaying the user the option to sort it
WebEvent getSortEvent(int type)
Get the WebEvent instance with the information for sorting the current cell values
void init(TransformContext context, WebTemplateMetric metric)
This method is called to initialize the cell in design mode.
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, WebTemplateUnit).
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(FormalParameters formalParas)
This method is deprecated. This method is not used by the Transform anymore. To initialize empty cells it now uses init(TransformContext, WebTemplateUnit).
void init(WebComponent wc, WebTemplateMetric metric, HashMap cachedObjects)
This method is deprecated. please use the interface that receives TransformContext instance instead.
boolean isMetricDrillable(WebHeader header, WebDrillPath drillPath)
return whether the header has a drillable metric
boolean isSortAscending()
boolean isSorted()
void reset()
Reset all of the instance variables.
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.
Tag generatePivotButton(int type)
Generate the pivot button tag, according to the type of manipulation that should perform
void generatePivotButtons(MarkupOutput mo)
Calls for generatePivotButton(int) for each one of the buttons this instance normally supports
void generatePreContent(MarkupOutput mo)

Generates the preContent of the cell.

void generateSortButton(MarkupOutput mo)
This method is deprecated. use generateSortButton() instead.
Tag generateSortButton()
Generate the sort button tag information for this object
WebMetric getColHeaderWebMetric(WebHeader header)
This method is deprecated. please refer to the getWebMetric method on the ReportGridCellColHeaderImpl class.
WebTemplate getGridTemplate()
Returns an instance of WebTemplate from the View Bean.
WebEvent getPivotEvent(int type)
Generate the pivot event, according to the type of manipulation that should perform
WebEvent getRemoveEvent()
Get the remove event for the current object.
WebEvent getSortEventByAxis(int axis)
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.
boolean isDrillAvailable()
boolean isDrillPathAvailable(WebHeader header)
Utility method to determine if the current header has drill information available
boolean isHeaderMVJsonMovable()
Fix Issue 418196 for sort in column, if the head cell can be used in sort, it don't use Jsonmap for optimization.
boolean isTotal()
void renderContextMenu(MarkupOutput mo)
This method is deprecated. use getContextMenuAttributes() instead
boolean showRemoveFromReport(int metricSize, int wkSetSize)
Determine if we should show the 'Remove from Report' option depending on the number of metrics and the working set size
[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.ReportGridCellColHeader
From interface com.microstrategy.web.app.transforms.ReportGridCellHeader
From interface com.microstrategy.web.app.transforms.ReportGridDisplayCell

Public Constructors

public ReportGridCellColHeaderImpl ()

Constructor used for creating a generic display cell.

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 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 canPivot (int type)

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

Parameters
type value indicating which type of pivot manipulation is being tested. Values come from the PIVOT_INCREASE_POSITION, PIVOT_DECREASE_POSITION, PIVOT_SWITCH_AXIS, PIVOT_TO_PAGE_BY and PIVOT_REMOVE constants.
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 WebEvent getSortEvent (int type)

Get the WebEvent instance with the information for sorting the current cell values

Parameters
type int value with the identifier for the sort order to generate. Values expected include SORT_TYPE_ASCENDING and SORT_TYPE_DESCENDING
Returns
  • WebEvent

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, FormalParameters formalParas)

This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells it now uses init(TransformContext, WebTemplateUnit).

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 (FormalParameters formalParas)

This method is deprecated.
This method is not used by the Transform anymore. To initialize empty cells it now uses init(TransformContext, WebTemplateUnit).

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 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 boolean isSortAscending ()

public boolean isSorted ()

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.

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. If a check box is rendered, an empty line is also added to the final HTML output.

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. If a check box is rendered, an empty line is also added to the final HTML output.

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

protected Tag generatePivotButton (int type)

Generate the pivot button tag, according to the type of manipulation that should perform

Parameters
type integer value that indicates which type of pivot action it should execute. Values come from the PIVOT_INCREASE_POSITION, PIVOT_DECREASE_POSITION and PIVOT_REMOVE constants.
Returns
  • Tag initialized instance with the information for the pivot manipulation. It will return null if not supported. It might return a simple IMG tag in case the manipulation shall be processed in JavaScript, or an INPUT of type IMAGE if it will be processed as part of a FORM, or an A anchor tag with an IMG inside if it's to be a button link.

protected void generatePivotButtons (MarkupOutput mo)

Calls for generatePivotButton(int) for each one of the buttons this instance normally supports

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

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 void generateSortButton (MarkupOutput mo)

This method is deprecated.
use generateSortButton() instead.

Generate the HTML for the sort button

Parameters
mo MarkupOutput instnace where the HTML generated will be saved

protected Tag generateSortButton ()

Generate the sort button tag information for this object

Returns
  • Tag instance initialized if sort is supported.

protected WebMetric getColHeaderWebMetric (WebHeader header)

This method is deprecated.
please refer to the getWebMetric method on the ReportGridCellColHeaderImpl class.

get the metric object for the column header

Parameters
header the column header
Returns

protected WebTemplate getGridTemplate ()

Returns an instance of WebTemplate from the View Bean.

Returns
Throws
WebBeanException
WebObjectsException
WebBeanException

protected WebEvent getPivotEvent (int type)

Generate the pivot event, according to the type of manipulation that should perform

Parameters
type integer value that indicates which type of pivot action it should execute. Values come from the PIVOT_INCREASE_POSITION, PIVOT_DECREASE_POSITION PIVOT_SWITCH_AXIS and PIVOT_TO_PAGE_BY constants.
Returns
  • WebEvent initialized instance with the information for the pivot manipulation. It will return null if not supported.

protected WebEvent getRemoveEvent ()

Get the remove event for the current object. This only supports objects that are metrics.

Returns
  • WebEvent initialized instance if manipulation is supported, otherwise returns null.

protected WebEvent getSortEventByAxis (int axis)

Parameters
axis specifies the axis EnumViewBeanEvents on which the sort is defined

protected String getSortID ()

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

Returns
  • The ID to use for sorting this cell.

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 boolean isHeaderMVJsonMovable ()

Fix Issue 418196 for sort in column, if the head cell can be used in sort, it don't use Jsonmap for optimization.

Returns
  • boolean value indicating if the Jsonmap should be used

protected boolean isTotal ()

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

protected boolean showRemoveFromReport (int metricSize, int wkSetSize)

Determine if we should show the 'Remove from Report' option depending on the number of metrics and the working set size

Parameters
metricSize number of metrics
wkSetSize working set size
Returns
  • true if working set is not empty or if the working set size is greater than the metrics size.