| java.lang.Object dinamica.AbstractModule dinamica.GenericOutput
All known Subclasses: dinamica.DataOutput, dinamica.HGridOutput, dinamica.AbstractExcelOutput, dinamica.BlobOutput, dinamica.MasterDetailOutput, dinamica.AbstractPDFOutput, dinamica.security.MenuOutput, dinamica.ChartOutput, dinamica.BlobOutputPGSQL, dinamica.HGridPagedOutput,
GenericOutput | public class GenericOutput extends AbstractModule implements IRowEvent(Code) | | Base class to create Output classes. This kind of classes
represent the "view" part of this framework MVC mechanism.
This class consumes recordsets published by transactions, which
have been previously executed by the controller.
Creation date: 4/10/2003
Last Update: 4/10/2003
(c) 2003 Martin Cordova
This code is released under the LGPL license
author: Martin Cordova |
Method Summary | |
protected byte[] | getImage(String url, String sessionID, boolean logStdout) Return byte array with the content of a remote binary resource
accessed via HTTP(S).
Parameters: url - URL of the resource Parameters: sessionID - Session ID Parameters: logStdout - If TRUE will print trace log to System.out. | protected byte[] | getImage(String url, boolean logStdout) Return byte array with the content of a remote binary resource
accessed via HTTP(S) - a Cookie header (JSESSIONID) with the current
session ID will be added to the request headers
Parameters: url - URL of the resource Parameters: logStdout - If TRUE will print trace log to System.err. | protected String | getServerBaseURL() Returns base URL for retrieving images from the same host
where the application is running. | protected String | getSessionID() Retrieve the session ID from the request headers
looking for a cookie named JSESSIONID. | public String | onNewRow(Recordset rs, String rowTemplate) Implementation of the interface dinamica.IRowEvent.
This code is used to alternate row colors,
the row template must include the special
field marker ${fld:_rowStyle} which will be replaced
by the style parameters set in web.xml. | public void | print(TemplateEngine te, GenericTransaction data) Generate text-based output using automatic data binding.
This class will consume Recordsets from the "data" object
passed to this method, which is a Transaction that has been
executed before calling the method.
This methods performs the data binding between the templates
and the recordsets, according to the parameters defined in the
config.xml file - it is a kind of VB DataControl, if you will!
All its functionality relies on the TemplateEngine class. | public void | print(GenericTransaction data) This method is called for non text based output (images, binaries, etc.). | protected void | resetRowColor() resets value of private variable rowColor. |
getImage | protected byte[] getImage(String url, String sessionID, boolean logStdout) throws Throwable(Code) | | Return byte array with the content of a remote binary resource
accessed via HTTP(S).
Parameters: url - URL of the resource Parameters: sessionID - Session ID Parameters: logStdout - If TRUE will print trace log to System.out. Byte array with the content of the file throws: Throwable - In case of any HTTP error of if the data cannotbe read for any reason. |
getImage | protected byte[] getImage(String url, boolean logStdout) throws Throwable(Code) | | Return byte array with the content of a remote binary resource
accessed via HTTP(S) - a Cookie header (JSESSIONID) with the current
session ID will be added to the request headers
Parameters: url - URL of the resource Parameters: logStdout - If TRUE will print trace log to System.err. Byte array with the content of the file throws: Throwable - In case of any HTTP error of if the data cannotbe read for any reason. |
getServerBaseURL | protected String getServerBaseURL()(Code) | | Returns base URL for retrieving images from the same host
where the application is running. The programmer will need to
add the rest of the path, like /action/chart or /images/logo.png, etc.
Base URL to retrieve images from current host |
getSessionID | protected String getSessionID()(Code) | | Retrieve the session ID from the request headers
looking for a cookie named JSESSIONID. This method was
implemented because some Servers (WepSphere 5.1) won't
return the real cookie value when the HttpSession.getId()
method is invoked, which causes big trouble when retrieving an
image from an Action using HTTP and the session ID. This problem
was discovered while testing PDF reports with charts on WAS 5.1, it
is specific to WAS 5.1, but this method works well with all tested
servlet engines, including Resin 2.x.
The session ID as stored in the cookie header, or NULL if it can find the cookie. throws: Throwable - |
print | public void print(TemplateEngine te, GenericTransaction data) throws Throwable(Code) | | Generate text-based output using automatic data binding.
This class will consume Recordsets from the "data" object
passed to this method, which is a Transaction that has been
executed before calling the method.
This methods performs the data binding between the templates
and the recordsets, according to the parameters defined in the
config.xml file - it is a kind of VB DataControl, if you will!
All its functionality relies on the TemplateEngine class.
Since this method performs a lot of work, all descendants of this class that
want to reimplement this method, should call super.print(TemplateEngine, Transaction) in the first line
of the reimplemented method in order to reuse all this functionality.
Parameters: te - TemplateEngine containing the text based template ready for data binding Parameters: data - Transaction object that publishes one or more recordsets throws: Throwable - |
print | public void print(GenericTransaction data) throws Throwable(Code) | | This method is called for non text based output (images, binaries, etc.).
Reimplementations of this method MUST write the output
thru the Servlet OutputStream.
Parameters: data - Transaction object throws: Throwable - |
resetRowColor | protected void resetRowColor()(Code) | | resets value of private variable rowColor. This
variable control alternate printing of colors
for tables (print mode="table")
|
|
|