|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.enterprise.tabularresults.TabularQueryResultsService
TabularQueryResultsService is a mapping from the HTML template calls and the services of a subclass of BasicQueryService, subclass of TableFormatService, and a subclass of DataFormatService. Ideally, this subclass should be used for presenting the results of a query in a table in an HTML webpage. However, the services of the subclass of BasicQueryService, subclass of TableFormatService, and a subclass of DataFormatService can be used for other purposes. To use TabularQueryResultsService to present the results of a query in a table in an HTML webpage, you need to do the following steps.
Field Summary | |
private static String |
CODEBASE
|
protected Object |
contextObj
This is the context object that the call to the subclass of BaseQueryService will use to generate the query results |
protected DataFormatService |
dataFormatService
|
protected String |
dataFormatServiceName
|
protected static String |
DEFAULT_DATAFORMAT_SERVICE
|
protected static String |
DEFAULT_QUERY_SERVICE
|
protected static String |
DEFAULT_TABLEFORMAT_SERVICE
|
protected Object[] |
queryResults
This is the array that the query results are cached into |
protected String |
queryServiceName
|
private static String |
RESOURCE
|
protected TableFormatService |
tableFormatService
|
protected String |
tableFormatServiceName
|
private static boolean |
VERBOSE
|
Constructor Summary | |
TabularQueryResultsService()
|
Method Summary | |
void |
addColumn(Properties parameters,
Locale locale,
OutputStream os)
This call will add a column to the table to be presented, only after the table initialized ( i.e. |
void |
deleteColumn(Properties parameters,
Locale locale,
OutputStream os)
This call will delete an existing column that is to be presented in the table. |
Object |
getContextObj()
Supported API: false |
DataFormatService |
getDataFormatService()
Supported API: false |
private PrintWriter |
getPrintWriter(OutputStream os,
Locale locale)
|
void |
getQuery(Properties parameters,
Locale locale,
OutputStream os)
This call arrives from the HTML template and should have the form "getQuery QueryName=nameOfSubClass" The value of nameOfSubClass can either be a full path name to a subclass of BaseQueryService or the name of the subclass. |
Object[] |
getQueryResults()
Supported API: false |
TableFormatService |
getTableFormatService()
Supported API: false |
boolean |
hasColumn(String columnID)
Supported API: false |
Object |
loadClass(String className)
Supported API: false |
void |
printFailedTableMessage(Throwable t,
String key,
Object[] params,
Locale locale,
OutputStream os)
This method will be used to handle all exception error printing. |
void |
printTable(Properties parameters,
Locale locale,
OutputStream os)
This is the call that actually prints out the table to the HTML template. |
void |
setAllColumnsProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in each column currently defined . |
void |
setAllHeadersProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in each column currently defined as header attributes. |
void |
setColumnProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in the column defined by the ID tag. |
void |
setContextObj(Object context)
Supported API: false |
void |
setDataFormatServiceName(String new_data_format_service_name)
Supported API: false |
void |
setHeader(Properties parameters,
Locale locale,
OutputStream os)
If the header of the column is to be set explicitly and the standard method of initializing the column header text is to overriden with the value specified in this call. |
void |
setHeaderProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in the column defined by the ID tag as header attributes. |
void |
setQueryServiceName(String new_query_service_name)
Supported API: false |
void |
setRowProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in each rowProperties object . |
void |
setTableFormatServiceName(String new_table_format_service_name)
Supported API: false |
void |
setTableProperties(Properties parameters,
Locale locale,
OutputStream os)
This call will read any number of name value pairs and places them in tableProperties. |
void |
TabularQueryResultsService()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static String CODEBASE
private static boolean VERBOSE
private static final String RESOURCE
protected static String DEFAULT_QUERY_SERVICE
protected static String DEFAULT_TABLEFORMAT_SERVICE
protected static String DEFAULT_DATAFORMAT_SERVICE
protected String tableFormatServiceName
protected String queryServiceName
protected String dataFormatServiceName
protected TableFormatService tableFormatService
protected DataFormatService dataFormatService
protected Object[] queryResults
protected Object contextObj
Constructor Detail |
public TabularQueryResultsService()
Method Detail |
public void TabularQueryResultsService()
public void setTableFormatServiceName(String new_table_format_service_name)
public void setQueryServiceName(String new_query_service_name)
public void setDataFormatServiceName(String new_data_format_service_name)
public TableFormatService getTableFormatService()
public DataFormatService getDataFormatService()
public void setContextObj(Object context)
public Object getContextObj()
public Object[] getQueryResults()
public boolean hasColumn(String columnID)
public void getQuery(Properties parameters, Locale locale, OutputStream os) throws WTException
WTException
public void addColumn(Properties parameters, Locale locale, OutputStream os) throws WTException
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
WTException
public void deleteColumn(Properties parameters, Locale locale, OutputStream os) throws WTException
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
WTException
public void setTableProperties(Properties parameters, Locale locale, OutputStream os)
tag. Note, only entries that match the
the set of supported HTML attributes are retrieved from tableProperties.
Invalid table attributes are ignored.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
setColumnProperties
public void setColumnProperties(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
- This call will read any number of name value pairs and places them
in the column defined by the ID tag. If the ID tag is not specified
or there is NOT any column with that ID an exception is thrown and
printStackTrace is called and an error message is printed to the web
page. If column ID is valid, the properties are then given to the
column specified. These properties are then used in the
tag if they match any of the supported
HTML attributes for TD and any parameters to be passed to the subclass
of DataFormatService being used are passed in the same properties
object.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
- Throws:
WTException
setAllColumnsProperties
public void setAllColumnsProperties(Properties parameters,
Locale locale,
OutputStream os)
- This call will read any number of name value pairs and places them
in each column currently defined . These properties are then used in the
tag if they match any of the supported
HTML attributes for TD and any parameters to be passed to the subclass
of DataFormatService being used are passed in the same properties
object.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
setHeaderProperties
public void setHeaderProperties(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
- This call will read any number of name value pairs and places them
in the column defined by the ID tag as header attributes. That is,
the attributes will only be used in the display of the header, but
not any of the row after the header. If the ID tag is not specified
or there is NOT any column with that ID an exception is thrown and
printStackTrace is called and an error message is printed to the web
page. If column ID is valid, the properties are then given to the
column specified. These properties are then used in the
tag if they match any of the supported
HTML attributes for TH and any parameters to be passed to the subclass
of DataFormatService being used are passed in the same properties
object.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
- Throws:
WTException
setAllHeadersProperties
public void setAllHeadersProperties(Properties parameters,
Locale locale,
OutputStream os)
- This call will read any number of name value pairs and places them
in each column currently defined as header attributes. That is,
the attributes will only be used in the display of the header, but
not any of the row after the header. These properties are then used in the
tag if they match any of the supported
HTML attributes for TH and any parameters to be passed to the subclass
of DataFormatService being used are passed in the same properties
object.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
setHeader
public void setHeader(Properties parameters,
Locale locale,
OutputStream os)
throws WTException
- If the header of the column is to be set explicitly and the
standard method of initializing the column header text is to
overriden with the value specified in this call. If the ID tag is not specified
or there is NOT any column with that ID an exception is thrown and
printStackTrace is called and an error message is printed to the web
page.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
- Throws:
WTException
setRowProperties
public void setRowProperties(Properties parameters,
Locale locale,
OutputStream os)
- This call will read any number of name value pairs and places them
in each rowProperties object . These properties are then used in the
tag if they match any of the supported
HTML attributes for TR.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
printTable
public void printTable(Properties parameters,
Locale locale,
OutputStream os)
- This is the call that actually prints out the table to the HTML template.
It goes through the process of initializing the tags that will
appear in the table ( e.g. the TABLE, TR, TH, and TD tags ) and
then loops over the entries in the array that was returned from the
query. For element in the array from the query, a row is generated
by looping over the rows ( both default and those added in the
WindChill script ) and printing out a table cell for each column
in each row. The entry in the table cell is determined by the
column attributes, the context of the query result, and the DataFormatService
used.
Supported API: false
- Parameters:
parameters
- The parameters read from the WindChill scriptlocale
- The locale to use when generating location specific textos
- The output stream to the HTML page
loadClass
public Object loadClass(String className)
- Supported API: false
printFailedTableMessage
public void printFailedTableMessage(Throwable t,
String key,
Object[] params,
Locale locale,
OutputStream os)
- This method will be used to handle all exception error printing. It
will print the stackTrace of the exception and it will also print
a localized message to the web page.
Supported API: false
- Parameters:
t
- The actual exception that was thrownkey
- The "key" for getting the localized message from the resource bundlelocale
- The locale object to be used to localize the message for the browseros
- The output stream to the HTML template page
getPrintWriter
private PrintWriter getPrintWriter(OutputStream os,
Locale locale)
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD