|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.opensubsystems.core.www.PageElementCacheTag
org.opensubsystems.patterns.listdata.www.ListTag
public abstract class ListTag
Custom tag to construct all required elements of scrollable and browsable table of data objects. It is mainly used by datalist.jsp layout.
| Field Summary | |
|---|---|
protected static int |
CHECKBOX_COLUMN_WIDTH
Constant defining length in percentage of the row width that will be used for checkbox column width if the flag specifying to display checkboxes in each row is set. |
protected static java.lang.String |
FUNCTION_BODY
Function parameter for getting body. |
protected static java.lang.String |
FUNCTION_COLS
Function parameter for getting columns. |
protected static java.lang.String |
FUNCTION_FILTER
Function parameter for getting init data for filter |
protected static java.lang.String |
FUNCTION_HEADINGS
Function parameter for getting headings. |
protected static java.lang.String |
FUNCTION_MESSAGES
Function parameter for getting init data for messages |
protected static java.lang.String |
FUNCTION_SORT
Function parameter for getting init data for sorting |
protected int[] |
m_arrDefaultListColumns
Array of columns specifying what columns to display in a list by default and in what order. |
protected int[] |
m_arrDefaultOrderColumns
Array of columns specifying what columns should be used to sort by default on gui. |
protected java.lang.String[] |
m_arrDefaultOrderDirections
Array of ListDefinition.ORDER_XXX constants specifying the default directions for the default list of columns used for sorting. |
protected boolean |
m_bLink
Flag if the list should contain a link. |
protected java.util.Map |
m_mapColumnDefinitions
Map defining what columns are available for this list. |
protected java.lang.String |
m_strCheck
Flag if the list should contain a checkboxes included in each row. |
protected java.lang.String |
m_strCheckDefault
Default value for m_strCheck. |
protected java.lang.String |
m_strData
Name of the attribute which identifies the list of data objects. |
protected java.lang.String |
m_strDataTypeName
Identificator of type of data shown in table. |
protected java.lang.String |
m_strFunction
Name of the function (element), which should be created by this tag. |
protected java.lang.String |
m_strLimit
Number specified limit for assigned items within the table. |
protected java.lang.String |
m_strOptions
Name of the attribute which identifies ListOptions object. |
protected java.lang.String |
m_strSortable
Flag if the list should be sorted. |
protected java.lang.String |
m_strSortableDefault
Default value for m_strSortable. |
protected java.lang.String |
m_strTableId
Id of the table. |
protected static ColumnDefinition |
UNKNOWN_COLUMN
This definition will be used whenever code specified to use unknown column so that we do not present error on the screen. |
| Fields inherited from class org.opensubsystems.core.www.PageElementCacheTag |
|---|
CACHE_INDICATOR, CSS_ELEMENT, JS_ELEMENT, m_strCacheas, m_strId, PAGE_ELEMENTS_CACHE, SCRIPT_ELEMENT |
| Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
bodyContent |
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
|---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
|---|
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
ListTag(java.lang.String strDataTypeName,
int[] arrDefaultListColumns,
int[] arrDefaultOrderColumns,
java.lang.String[] arrDefaultOrderDirections,
java.util.Map mapColumnDefinitions)
Constructor for custom tag. |
|
| Method Summary | |
|---|---|
int |
doEndTag()
Evaluate the remainder of the current page normally. |
int |
doStartTag()
Perform the test required for this particular tag, and either evaluate or skip the body of this tag. |
protected void |
generateTableCell(java.lang.StringBuffer sbBuffer,
java.lang.String strText,
int iLimit,
java.lang.String strLink,
java.lang.String strClass)
Generate the HTML for the table cell (<td> tag body) |
protected abstract void |
getBodyDefinition(int iColumnId,
int iCounter,
int iItemCounter,
java.lang.Object objListItem,
java.lang.StringBuffer sbHtml)
Generate the HTML for the body definition |
java.lang.String |
getCheck()
Get the flag if the list should contain a checkboxes included in each row. |
protected ColumnDefinition |
getColumnDefinition(int iColumnId,
int iCounter,
java.lang.String strFunction)
Generate the HTML for the column definition |
protected void |
getColumnDefinition(int iColumnId,
int iCounter,
java.lang.String strFunction,
ColumnDefinition outDefinition)
Generate the HTML for the column definition |
java.lang.String |
getData()
Get the name of the attribute which identifies the list of data objects. |
protected java.lang.String |
getDataTypeName()
Get identificator of type of data shown in table. |
protected int[] |
getDefaultListColumns()
Get array of columns specifying what columns to display in a list by default and in what order. |
protected int[] |
getDefaultOrderColumns()
Get array of columns specifying what columns should be used to sort by default on gui. |
protected java.lang.String[] |
getDefaultOrderDirections()
Get default directions for the default list of columns used for sorting. |
java.lang.String |
getFunction()
Get the name of the function (element), which should be created by this tag. |
boolean |
getLink()
Get the flag if the list should contain a link. |
java.lang.String |
getOptions()
Get the name of the attribute which identifies ListOptions object. |
protected java.lang.String |
getRowId(java.lang.Object objListItem)
Get row id String for data object row. |
boolean |
isCheckActive()
|
protected boolean |
isFilter()
Function returns flag signaling if there is used filter list or not. |
boolean |
isSortableActive()
|
protected void |
processFunction(java.lang.String strFunction)
Method process particular function |
void |
release()
Release all allocated resources. |
void |
setCheck(java.lang.String strCheck)
Set flag if the list should contain a checkboxes included in each row. |
void |
setData(java.lang.String strData)
Set the name of the attribute which identifies the list of data objects. |
void |
setFunction(java.lang.String strFunction)
Sets the name of the function (element), which should be created by this tag. |
void |
setLink(boolean bLink)
Set the flag if the list should contain a link. |
void |
setOptions(java.lang.String strName)
Sets the name of the attribute which identifies ListOptions object. |
| Methods inherited from class org.opensubsystems.core.www.PageElementCacheTag |
|---|
cache, getCacheas, getCachedContent, getCachedContent, getCachedContent, getCachedContentElements, getId, setCacheas, setId |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
|---|
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
getParent, setPageContext, setParent |
| Field Detail |
|---|
protected static final int CHECKBOX_COLUMN_WIDTH
protected static final java.lang.String FUNCTION_HEADINGS
protected static final java.lang.String FUNCTION_COLS
protected static final java.lang.String FUNCTION_SORT
protected static final java.lang.String FUNCTION_FILTER
protected static final java.lang.String FUNCTION_MESSAGES
protected static final java.lang.String FUNCTION_BODY
protected static final ColumnDefinition UNKNOWN_COLUMN
protected java.lang.String m_strOptions
protected java.lang.String m_strData
protected java.lang.String m_strFunction
protected java.lang.String m_strCheck
protected java.lang.String m_strCheckDefault
protected java.lang.String m_strSortable
protected java.lang.String m_strSortableDefault
protected java.lang.String m_strTableId
protected boolean m_bLink
protected java.lang.String m_strLimit
protected java.lang.String m_strDataTypeName
protected int[] m_arrDefaultListColumns
protected int[] m_arrDefaultOrderColumns
protected java.lang.String[] m_arrDefaultOrderDirections
protected java.util.Map m_mapColumnDefinitions
| Constructor Detail |
|---|
public ListTag(java.lang.String strDataTypeName,
int[] arrDefaultListColumns,
int[] arrDefaultOrderColumns,
java.lang.String[] arrDefaultOrderDirections,
java.util.Map mapColumnDefinitions)
strDataTypeName - - id of type of data shown in table. This should be
constant that can be safely used to generate
JavaScript identificators and should be also
convertible to data type code using the methods
in DataConstant class.arrDefaultListColumns - - array of columns specifying what columns to
display in a list by default and in what
order.arrDefaultOrderColumns - - array of columns specifying what columns
should be used to sort by default on gui.arrDefaultOrderDirections - - array of ListDefinition.ORDER_XXX
constants specifying the default
directions for the default list of
columns used for sorting. The array has
to have the same length as the one
specified in arrDefaultOrderColumns
where the order for column specified at
index i will be specified at the same
index.mapColumnDefinitions - - map of column definition where key is the
identification of the column (Integer constant)
and value is ColumnDefinition object.| Method Detail |
|---|
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class org.opensubsystems.core.www.PageElementCacheTagjavax.servlet.jsp.JspException - if a JSP exception occurs
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class org.opensubsystems.core.www.PageElementCacheTagjavax.servlet.jsp.JspException - if a JSP exception occurspublic void release()
release in interface javax.servlet.jsp.tagext.Tagrelease in class javax.servlet.jsp.tagext.BodyTagSupportpublic java.lang.String getOptions()
public void setOptions(java.lang.String strName)
strName - - name of the attribute which identifies ListOptions objectpublic java.lang.String getData()
public void setData(java.lang.String strData)
strData - - name of the attribute which identifies the list of data objectspublic java.lang.String getFunction()
public void setFunction(java.lang.String strFunction)
strFunction - - function that will be setpublic boolean getLink()
public void setLink(boolean bLink)
bLink - - Flag if the list should contain a linkpublic java.lang.String getCheck()
public void setCheck(java.lang.String strCheck)
strCheck - - name of the attribute which identifies the flag
protected void getColumnDefinition(int iColumnId,
int iCounter,
java.lang.String strFunction,
ColumnDefinition outDefinition)
iColumnId - - column code of the specific tableiCounter - - counter for the position of the column width in the float arraystrFunction - - the type of the function (headings, cols, body)outDefinition - - definition of the column is output parameter which
will be filled out so that we optimize the performance
protected ColumnDefinition getColumnDefinition(int iColumnId,
int iCounter,
java.lang.String strFunction)
iColumnId - - column code of the specific tableiCounter - - counter for the position of the column width in the float arraystrFunction - - the type of the function (headings, cols, body)
protected abstract void getBodyDefinition(int iColumnId,
int iCounter,
int iItemCounter,
java.lang.Object objListItem,
java.lang.StringBuffer sbHtml)
iColumnId - - column code of the specific tableiCounter - - counter for the position of the column width in the float arrayiItemCounter - - counter of actual processed itemobjListItem - - particular object from the listsbHtml - - out HTML string bufferprotected java.lang.String getRowId(java.lang.Object objListItem)
objListItem - - particular object from the list
protected int[] getDefaultListColumns()
protected int[] getDefaultOrderColumns()
protected java.lang.String[] getDefaultOrderDirections()
protected java.lang.String getDataTypeName()
protected void generateTableCell(java.lang.StringBuffer sbBuffer,
java.lang.String strText,
int iLimit,
java.lang.String strLink,
java.lang.String strClass)
sbBuffer - - StringBuffer to add table cell code tostrText - - full length text to addiLimit - - limit of length to show (0 - no limit)strLink - - href for <a> tag (null - no link)strClass - - class of <td> tag (null - no class)
protected void processFunction(java.lang.String strFunction)
throws javax.servlet.jsp.JspException
strFunction - - function that has to be processed
javax.servlet.jsp.JspException - - error occuredpublic boolean isCheckActive()
public boolean isSortableActive()
protected boolean isFilter()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||