com.sas.servlet.tbeans.olaptableview.html
Class OLAPTableView

com.sas.servlet.tbeans.olaptableview.html.OLAPTableView
All Implemented Interfaces:
ActionProviderViewInterface, HttpActionProviderInterface, HttpActionProviderViewInterface, com.sas.actionprovider.refresh.PartialRefreshActionsInterface, URLTemplateViewInterface, com.sas.beans.PropertyChangeSource, com.sas.collection.ContentsChangedListener, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, com.sas.servlet.tbeans.features.FeatureListInterface, FormViewInterface, HttpConstants, BaseNavigationInterface, ColumnNavigationInterface, RowNavigationInterface, OLAPTableViewStyleKeysInterface, RenderableInterface, ExportAsHyperlinkInterface, TransformationInterface, com.sas.servlet.tbeans.TransformationInterface2, AccurateRowCountInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable, java.util.EventListener, javax.swing.SwingConstants

public class OLAPTableView
implements ComplexStyleInterface, OLAPTableViewStyleKeysInterface, FormViewInterface, ExportAsHyperlinkInterface

The OLAPTableView is a TransformationBean™ that generates the appropriate HTML 4.0 and JavaScript to represent a table of data from the given multidimensional model.

The OLAPTableView is one of several TransformationBeans™ that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean™, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans™ as well as the TransformationBeans™ Style Sheet Reference.

The OLAPTableView is one of several TransformationBeans™ that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The OLAPTableView uses the following JavaScript files:

sas_OLAPTableView.js

Note that the toString() method on this class calls the write method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging

For More Information:

Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.

Examples for this class may be found on the Examples Site.

JSP custom tags provide an alternative to using the TransformationBeans™. Visit the Custom Tag Library Reference for additional information on the sas:OLAPTableView custom tag.

Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .

See Also:
Serialized Form

Field Summary
protected  java.util.Map cacheOfMeasureFormatsForExport
           
protected  java.util.List<java.lang.String> columnHeaderDataItemsToNotEncode
           
protected  java.lang.String currentMeasureUniqueName
           
protected  java.lang.String[] levelNames
           
protected  java.util.List<java.lang.String> rowHeaderDataItemsToNotEncode
           
 
Fields inherited from class com.sas.servlet.tbeans.olaptableview.BaseOLAPTableView
rolap
 
Fields inherited from class com.sas.servlet.tbeans.tableview.AbstractBaseTableView
DEFAULT_EXPORT_NUMERIC_CUSTOM_FORMATED_VALUES_AS_TEXT, MISSING_STYLEINFO, WRAP_ALL, WRAP_NONE, WRAP_PER_COLUMN
 
Fields inherited from interface com.sas.servlet.tbeans.olaptableview.html.OLAPTableViewStyleKeysInterface
OLAPTABLEVIEW_COLUMN_HEADER_STYLE, OLAPTABLEVIEW_COLUMN_MEASURE_HEADER_STYLE, OLAPTABLEVIEW_COLUMN_TITLE_HEADER_STYLE, OLAPTABLEVIEW_DATA_STYLE, OLAPTABLEVIEW_EMPTY_DATA_STYLE, OLAPTABLEVIEW_EMPTY_ROW_TITLE_HEADER_STYLE, OLAPTABLEVIEW_FOOTER_ROW_STYLE, OLAPTABLEVIEW_RAGGED_COLUMN_HEADER_STYLE, OLAPTABLEVIEW_RAGGED_LAST_ROW_HEADER_STYLE, OLAPTABLEVIEW_RAGGED_ROW_HEADER_STYLE, OLAPTABLEVIEW_ROW_HEADER_STYLE, OLAPTABLEVIEW_ROW_MEASURE_HEADER_STYLE, OLAPTABLEVIEW_ROW_TITLE_HEADER_STYLE, OLAPTABLEVIEW_STYLE, OLAPTABLEVIEW_SUBTOTALS_COLUMN_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_SUBTOTALS_COLUMN_HEADER_STYLE, OLAPTABLEVIEW_SUBTOTALS_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_SUBTOTALS_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_SUBTOTALS_HEADER_STYLE, OLAPTABLEVIEW_SUBTOTALS_ROW_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_SUBTOTALS_ROW_HEADER_STYLE, OLAPTABLEVIEW_SUBTOTALS_STYLE, OLAPTABLEVIEW_TITLE_ROW_STYLE, OLAPTABLEVIEW_TOTALS_COLUMN_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_TOTALS_COLUMN_HEADER_STYLE, OLAPTABLEVIEW_TOTALS_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_TOTALS_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_TOTALS_HEADER_STYLE, OLAPTABLEVIEW_TOTALS_ROW_HEADER_FOR_EXPORT_TO_EXCEL_STYLE, OLAPTABLEVIEW_TOTALS_ROW_HEADER_STYLE, OLAPTABLEVIEW_TOTALS_STYLE
 
Fields inherited from interface com.sas.servlet.tbeans.tableview.ExportAsHyperlinkInterface
DEFAULT_VALUE_FOR_CURRENT_VALUE_TO_ENCODE
 
Fields inherited from interface com.sas.servlet.tbeans.HttpConstants
ALL, BASELINE, CHAR, COL, COLGROUP, JUSTIFY, MULTIPLE, NONE, ROW, ROWGROUP, SINGLE
 
Constructor Summary
OLAPTableView()
          Construct a new Table object
OLAPTableView(java.lang.String name, OLAPDataSetInterface model)
          Construct a new Table object
OLAPTableView(java.lang.String name, OLAPDataSetInterface model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Construct a new Table object
 
Method Summary
 java.util.HashMap getAdditionalParameters()
          Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the table.
 int getCurrentHeaderIndex()
          Get the current index within the header, usually the tupleElementIndex for the current header.
 Form getDefaultFormObject()
          Returns the FORM object used if no FORM object is specifed.
 Form getFormObject()
          Returns the FORM Object used to execute commands.
 java.util.List<java.lang.String> getHeaderDataItemsToNotEncode(java.lang.String[] uniqueLvlNames, TupleInterface tuple)
           
 boolean isCurrentValueToEncode()
           
 boolean isFormEnabled()
          Determines if the tbean should render its formObject.
 void setAdditionalParameter(java.lang.String name, java.lang.String value)
          Sets an additional parameter to be added to the form used to perform the various actions on the table.
 void setAdditionalParameters(java.util.HashMap map)
          Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the table.
 void setCellRenderer(OLAPTableFormatArea cellArea, TableCellRenderer renderer)
           
 void setFormEnabled(boolean value)
          Sets whether the tbean should render its formObject.
 void setFormObject(Form formObject)
          Returns the FORM Object used to execute commands.
 void setModel(OLAPDataSetInterface model)
          Sets the model on the viewer.
 void writeColumnHeader(java.io.PrintWriter out)
          Writes the column headings of the table.
 void writeEmptyTable(java.io.PrintWriter out)
          Writes an empty table when a model in not attached
 void writeRows(java.io.PrintWriter out)
          Writes the row headings and contents of the table.
 void writeTableFooter(java.io.PrintWriter out)
          Writes the footer tag for the tableview.
 void writeTableHeader(java.io.PrintWriter out)
          Writes the table header
 
Methods inherited from class com.sas.servlet.tbeans.olaptableview.BaseOLAPTableView
columnNumbersAreValid, contentsChanged, getColumnCount, getModel, getRowCount, gotoColumn, gotoRow, initialize, initializeColumnNumbers, initializeRowNumbers, isAccurateRowCountAvailable, isGotoColumnSupported, isGotoRowSupported, rowNumbersAreValid, setActionProvider, toString
 
Methods inherited from class com.sas.servlet.tbeans.tableview.AbstractBaseTableView
addFeature, addMoveMenu, firstColumn, firstRow, getBorderWidth, getCaption, getCellPadding, getCellSpacing, getColumnPageSize, getColumnScrollSize, getEndColumn, getEndRow, getFormName, getHorizontalAlignment, getRowPageSize, getRulesContext, getStartColumn, getStartRow, getStyleMap, getSummary, getTextWrapping, getWidth, getWidthPercentage, isAllActionsVisible, isColumnHeaderVisible, isColumnsResizable, isFirstColumnSupported, isFirstRowSupported, isLastColumnSupported, isLastRowSupported, isNextColumnSupported, isNextRowSupported, isPageBackwardColumnsSupported, isPageBackwardRowsSupported, isPageForwardColumnsSupported, isPageForwardRowsSupported, isPreviousColumnSupported, isPreviousRowSupported, isRowHeaderVisible, lastColumn, lastRow, nextColumn, nextRow, pageBackwardColumns, pageBackwardRows, pageForwardColumns, pageForwardRows, previousColumn, previousRow, removeLastBorder, setAllActionsVisible, setBorderWidth, setCaption, setCellPadding, setCellSpacing, setColumnHeaderVisible, setColumnPageSize, setColumnsResizable, setEndColumn, setEndRow, setHorizontalAlignment, setPageSize, setRowHeaderVisible, setRowPageSize, setRulesContext, setStartColumn, setStartRow, setSummary, setTextWrapping, setWidth, setWidthPercentage, writeColumnHeader, writeColumnHeader, writeEmptyTable, writeEmptyTable, writeFeatures, writeRows, writeRows, writeTableFooter, writeTableFooter, writeTableHeader, writeTableHeader, writeTableTFoot
 
Methods inherited from class com.sas.servlet.tbeans.BaseActionTransformation
dispose, getActionProvider, getActionSupportType, getUniqueId, isActionVisible, listActionTypes, listAreaTypes, setActionSupportType, setActionVisible, setUniqueId
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setId, setInputTransform, setLocale, setLocaleDependentProperties, setName, setObjectData, setObjectDataProperty, setOutputTransform, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, write, write, write
 
Methods inherited from interface com.sas.servlet.tbeans.ComplexStyleInterface
getStyleMap
 
Methods inherited from interface com.sas.actionprovider.URLTemplateViewInterface
getURLTemplate, setURLTemplate
 
Methods inherited from interface com.sas.servlet.tbeans.TransformationInterface
getCustomAttributes, getDescription, getId, getLocale, getName, getRequest, getResponse, getTagEpilog, getTagProlog, isVisible, setCustomAttributes, setDescription, setId, setLocale, setName, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderViewInterface
getRequest, setRequest
 

Field Detail

columnHeaderDataItemsToNotEncode

protected java.util.List<java.lang.String> columnHeaderDataItemsToNotEncode

rowHeaderDataItemsToNotEncode

protected java.util.List<java.lang.String> rowHeaderDataItemsToNotEncode

levelNames

protected java.lang.String[] levelNames

currentMeasureUniqueName

protected java.lang.String currentMeasureUniqueName

cacheOfMeasureFormatsForExport

protected java.util.Map cacheOfMeasureFormatsForExport
Constructor Detail

OLAPTableView

public OLAPTableView()
Construct a new Table object


OLAPTableView

public OLAPTableView(java.lang.String name,
                     OLAPDataSetInterface model)
Construct a new Table object

Parameters:
name - The field name
model - The model used for this viewer

OLAPTableView

public OLAPTableView(java.lang.String name,
                     OLAPDataSetInterface model,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
Construct a new Table object

Parameters:
name - The field name
model - The model used for this viewer
request - The HttpServletRequest object
response - the HttpServletResponse object
Method Detail

setModel

public void setModel(OLAPDataSetInterface model)
Sets the model on the viewer.

Overrides:
setModel in class BaseOLAPTableView
Parameters:
model - an instance of the OLAPDataSetInterface

writeEmptyTable

public void writeEmptyTable(java.io.PrintWriter out)
                     throws java.io.IOException
Writes an empty table when a model in not attached

Specified by:
writeEmptyTable in class AbstractBaseTableView
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeTableHeader

public void writeTableHeader(java.io.PrintWriter out)
                      throws java.io.IOException
Writes the table header

Specified by:
writeTableHeader in class AbstractBaseTableView
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeTableFooter

public void writeTableFooter(java.io.PrintWriter out)
                      throws java.io.IOException
Writes the footer tag for the tableview.

Specified by:
writeTableFooter in class AbstractBaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeColumnHeader

public void writeColumnHeader(java.io.PrintWriter out)
                       throws java.io.IOException
Writes the column headings of the table.

Specified by:
writeColumnHeader in class AbstractBaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeRows

public void writeRows(java.io.PrintWriter out)
               throws java.io.IOException
Writes the row headings and contents of the table.

Specified by:
writeRows in class AbstractBaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

getDefaultFormObject

public Form getDefaultFormObject()
Returns the FORM object used if no FORM object is specifed.

Specified by:
getDefaultFormObject in interface FormViewInterface
Returns:
FORM object
See Also:
getFormObject()

getFormObject

public Form getFormObject()
Returns the FORM Object used to execute commands.

Specified by:
getFormObject in interface FormViewInterface
Returns:
FORM object
See Also:
setFormObject(com.sas.servlet.tbeans.form.html.Form)

setFormObject

public void setFormObject(Form formObject)
Returns the FORM Object used to execute commands.

Specified by:
setFormObject in interface FormViewInterface
Parameters:
formObject - The form object
See Also:
setFormObject(com.sas.servlet.tbeans.form.html.Form)

getAdditionalParameters

public java.util.HashMap getAdditionalParameters()
Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the table. The default value is null. In the html version, each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
getAdditionalParameters in interface FormViewInterface
Returns:
an HashMap containing additional parameters that should be added to the form
See Also:
HashMap

setAdditionalParameters

public void setAdditionalParameters(java.util.HashMap map)
Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the table. The default value is null. In the html version, each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
setAdditionalParameters in interface FormViewInterface
Parameters:
map - HashMap object
See Also:
HashMap

setAdditionalParameter

public void setAdditionalParameter(java.lang.String name,
                                   java.lang.String value)
Sets an additional parameter to be added to the form used to perform the various actions on the table. In the html version, Each parameter will be added to the form as a hidden field using the name of the item as the name= parameter on the <input> tag and the value of the item as the value= parameter on the input tag.

Specified by:
setAdditionalParameter in interface FormViewInterface
Parameters:
name - name of the list item
value - value of the list item
See Also:
HashMap

isFormEnabled

public boolean isFormEnabled()
Determines if the tbean should render its formObject. If true, then the tbean is responsible for rendering the formObject via the formObject's writeHeader and writeFooter methods. If false then the tbean does not render the formObject and the user is responsible for rendering the formObject.

Specified by:
isFormEnabled in interface FormViewInterface
Returns:
true if the tbean should render its formObject

setFormEnabled

public void setFormEnabled(boolean value)
Sets whether the tbean should render its formObject. If so, then set to true. If set to false, the the user is responsible for rendering the formObject via its writeHeader and writeFooter methods.

Specified by:
setFormEnabled in interface FormViewInterface
Parameters:
value - true if the formObject should be rendered by the tbean

setCellRenderer

public void setCellRenderer(OLAPTableFormatArea cellArea,
                            TableCellRenderer renderer)

getCurrentHeaderIndex

public int getCurrentHeaderIndex()
Get the current index within the header, usually the tupleElementIndex for the current header.

Returns:

isCurrentValueToEncode

public boolean isCurrentValueToEncode()
Specified by:
isCurrentValueToEncode in interface ExportAsHyperlinkInterface
Returns:
true if the value of the data cell being exported has to be encoded. False otherwise.
See Also:
ExportAsHyperlinkInterface

getHeaderDataItemsToNotEncode

public java.util.List<java.lang.String> getHeaderDataItemsToNotEncode(java.lang.String[] uniqueLvlNames,
                                                                      TupleInterface tuple)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.