|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.inet.report.Listener
public class Listener
This class implements the listener that is listening for a connection to be made to this socket by a client. If the
connection is accepted, then a new client socket will be created. The port number for the server socket, on which the
listener is to be waiting for new connections, is specified in the i-net Clear Reports configuration. The default
port number is 9000.
With the help of the Listener, the ReportSocket creates a report through the following steps:
1. A client send a report requests with the following report URL:
http://<servername>:9000?report=file:c:/report1.rpt&prompt0=1&sf=true&hasexportbutton=false
2. A properties object is created which contains the pairs (report .
http://<servername>:9000?report=file:c:/report1.rpt&prompt0=1&SF=1=1), (prompt0 . 1), (SF . true)
(hasexportbutton . false).
3. A HTML page is created according to the properties object. You can use the checkHtmlPageProperties() callback
(implemented by the default com.inet.report.Listener or your own listener class if you do not want to use the default
listener) and the properties object to modify the HTML code. For example if you do not want to load the viewer from
<servername>:80, you can change the parameters archive and codebase to:
props.put(archive,"http://<servername>:81/core_V/ReportViewer.jar"); This corresponds to the request URL
props.put(codebase,"http://<servername>:81/client_V");
http://<servername>:9000?report=...&archive=http://<servername>:81/core_V/ReportViewer.jar&codebase=http://<servername>:81/client_V and will load the Java viewer file ReportViewer.jar from http://<servername>:81/core_V instead.
4. The Java viewer starts in the client's HTML page and pass the report URL above back to the report server
(Listener).
5. The report server reads the report URL passed to it from the Java viewer and converts it into key/value pairs and
stores them into a newly allocated properties object. The object contains the entries: (report .
http://<servername>:9000?report=file:c:/report1.rpt&prompt0=1&SF=true), (prompt0 . 1), (SF . true).
Please note that the entry (hasexportbutton . false) is not in the properties object. This entry is
an applet parameter for the java viewer bean and has been consumed by the code that has created the HTML page above.
6. The checkProperties() callback is called which you can use to modify the report parameters.
7. The report template is examined, an engine object is created.
8. The checkProperties() callback with an engine parameter is run. You can use this callback to examine or change the
report using RDC. For example you can examine and change the parameter fields, the formulas etc.
9. The report is executed, the report socket requests the data from the engine using engine.getData() and sends back
the binary data to the Java viewer running in the client's HTML page.
| Constructor Summary | |
|---|---|
Listener()
Creates a new server socket and binds it to the local port number specified in the i-net Clear Reports configuration or to the default port number 9000. |
|
Listener(boolean standalone)
Creates a new server socket and binds it to the local port number that is specified in the i-net Clear Reports configuration or to the default port number 9000. |
|
Listener(int port)
Creates a new server socket and binds it to the local port number, that was specified in parameter port. |
|
Listener(int port,
boolean throwException)
Creates a new server socket and binds it to the local port number, that was specified in parameter port. |
|
Listener(boolean standalone,
int port)
Creates a new server socket and binds it to the local port number, that is specified in parameter port. |
|
Listener(boolean standalone,
int port,
boolean throwException)
Creates a new server socket and binds it to the local port number, that was specified in parameter port. |
|
| Method Summary | |
|---|---|
void |
checkHtmlPageProperties(java.util.Properties props)
This callback is called before the report server creates and sends back a HTML page with the viewer embedded. |
void |
checkProperties(java.util.Properties props)
This method is called by checkProperties(Properties, Object) and is equivalent to
checkProperties(props, null) if i-net Clear Reports does not run as servlet. |
void |
checkProperties(java.util.Properties props,
java.lang.Object req)
This callback is called right before the engine examines the report file. |
void |
checkProperties(Engine engine,
java.util.Properties prop)
This method is called by checkProperties(Engine, Properties, Object) and is equivalent to
checkProperties(engine, prop, null). |
void |
checkProperties(Engine engine,
java.util.Properties prop,
java.lang.Object req)
This callback is called right after the engine has examined the report file. |
int |
getPort()
Returns tcp/ip port number where the i-net Clear Reports application is listening for report requests. |
java.lang.String |
getUrlString()
Returns the hostname and the tcp/ip port number where the i-net Clear Reports application is listening for report requests. |
static void |
main(java.lang.String[] argv)
Starts the i-net Clear Reports server standalone. |
void |
stop()
Stops the Listener thread and closes the server socket. |
| Constructor Detail |
|---|
public Listener()
public Listener(boolean standalone)
standalone - If true, this is the listener of a standalone application (can search for a free port);
otherwise it is not (this means that it cannot look for a free port).public Listener(int port)
port - the default port of the server socket, if 0 then the port specified in i-net Clear Reports
configuration or the default value 9000 will be used.
public Listener(int port,
boolean throwException)
throws java.io.IOException
port - the default port of the server socket, if it is 0 then the port specified in the i-net Clear Reports
configuration or the default value 9000 will be used.throwException - If true, then an exception will be thrown if the socket could not be created, e.g. because
of a BindException.
java.io.IOException - If the port is in use.
public Listener(boolean standalone,
int port)
standalone - If true, this is the listener of a standalone application (can search for a free port);
otherwise it is not (this means that it cannot look for a free port).port - the default port of the server socket, if it is 0 then the port specified in the i-net Clear Reports
configuration or the default value 9000 will be used.
public Listener(boolean standalone,
int port,
boolean throwException)
throws java.io.IOException
standalone - If true, this is the listener of a standalone application (can search for a free port);
otherwise it is not (this means that it cannot look for a free port).port - the default port of the server socket, if it is 0 then the port specified in the i-net Clear Reports
configuration or the default value 9000 will be used.throwException - If true, then an exception will be thrown if standalone is false and the socket could not
be created, e.g. because of a BindException.
java.io.IOException - If the port is in use.| Method Detail |
|---|
public static void main(java.lang.String[] argv)
argv - Command line arguments are currently not supported.public java.lang.String getUrlString()
public int getPort()
public void checkProperties(java.util.Properties props)
throws ReportException
checkProperties(Properties, Object) and is equivalent to
checkProperties(props, null) if i-net Clear Reports does not run as servlet.
props - The user properties.
ReportException - If an error occurred during checking the supplied properties with the current
PropertiesChecker. The ReportException will be send to the client and displayed in the Java viewer.checkProperties(Properties, Object)
public void checkProperties(java.util.Properties props,
java.lang.Object req)
throws ReportException
if(...) props.put("report", "file:///c:/my-report.rpt");
checkProperties in interface PropertiesCheckerprops - The user properties. All keys are lowercase.req - The HTTP servlet request, either null or HttpServlet
ReportException - If an error occurred during checking the
supplied properties with the current PropertiesChecker.
The ReportException will be send to the client and displayed in the Java viewer.PropertiesChecker.checkProperties(Engine engine, Properties prop, Object req)
public void checkProperties(Engine engine,
java.util.Properties prop)
throws ReportException
checkProperties(Engine, Properties, Object) and is equivalent to
checkProperties(engine, prop, null).EngineFactoryImpl(recommended) or implement
EngineFactory
EngineFactory yourFactory;
Cache.setEngineFactory(yourFactory);
EngineFactory.getKey(Properties)EngineFactory.createEngine(Properties)
engine - The initialized engine that have parsed the rpt file already.prop - The user properties.
ReportException - If an error occurred during checking the supplied properties with the current
PropertiesChecker. The ReportException will be send to the client and displayed in the Java viewer.EngineFactory,
EngineFactoryImpl,
Cache.setEngineFactory(EngineFactory),
checkProperties(Engine, Properties, Object)
public void checkProperties(Engine engine,
java.util.Properties prop,
java.lang.Object req)
throws ReportException
engine.setSchema(...);engine.setProperty(...);
checkProperties in interface PropertiesCheckerengine - The initialized engine that have parsed the rpt file already.prop - The user properties. All keys are lowercase.req - The HTTP servlet request, either null or HttpServlet
ReportException - If an error occurred during checking the
supplied properties with the current PropertiesChecker.
The ReportException will be send to the client and displayed in the Java viewer.
public void checkHtmlPageProperties(java.util.Properties props)
throws ReportException
checkHtmlPageProperties in interface PropertiesCheckerprops - The properties of the html page. Any change to this properties object itself has absolutely no effect. All keys are lowercase.
See Example MyReportServlet_withMyHTMLProperties.java.
ReportException - If an error occurred during checking the
supplied properties with the current PropertiesChecker.PropertiesChecker.checkProperties(Engine engine, Properties prop, Object req),
PropertiesChecker.checkProperties(Properties prop, Object req)
public void stop()
throws java.io.IOException
java.io.IOException - if an I/O error occurs when closing the socket.Engine.stop(),
Engine.stop(String),
Engine.stopAll()
|
i-net Clear Reports | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||