Four Ways of Integrating Logi JReport Server
To integrate Logi JReport Server with your application server, you can either create a Logi JReport Server WAR/EAR, or create your WAR/EAR and embed a self-contained Logi JReport Server inside it. For how to create a Logi JReport Server WAR/EAR, see Building a WAR/EAR file to Include a Self-contained Logi JReport Server.
Below is a list of the sections covered in this topic:
- Integrating by Building a Logi JReport Server WAR
- Integrating by Building a Logi JReport Server EAR
- Integrating by Building a User WAR and Embedding a Self-Contained Logi JReport Server
- Integrating by Building a User EAR and Embedding a Self-Contained Logi JReport Server
Integrating by Building a Logi JReport Server WAR
The self-contained Logi JReport Server can be deployed as a single WAR file.
For example, you can create a Logi JReport Server WAR file named Logi JReport.war and the structure of the Logi JReport Server WAR is as follows:
Logi JReport.war
WEB-INF/
web.xml
lib/ -- This folder contains all resources in the Logi JReport Server library.
admin/ -- This folder contains JSP files for the Logi JReport Administration page.
jinfonet/ -- This folder contains JSP files for the Logi JReport Console page.
dhtmljsp/ --This folder contains JSP files for viewing page reports.
The following is a sample of the content in the web.xml file of the Logi JReport Server WAR:
|
Integrating by Building a Logi JReport Server EAR
The self-contained Logi JReport Server can be deployed as a single EAR file.
For example, you can create a Logi JReport Server EAR file named Logi JReport.ear and the structure of the Logi JReport Server EAR is as follows:
Logi JReport.ear
META-INF/application.xml
Logi JReport-lib/ -- This folder contains all resources in the Logi JReport Server library.
Logi JReport.war
META-INF/MANIFEST.MF
WEB-INF/web.xml
admin/
jinfonet/
dhtmljsp/
Following the Java EE standard, you should configure the META-INF/application.xml file before deploying the EAR:
|
The contents in the web.xml of the Logi JReport Server EAR are the same as those in web.xml of the Logi JReport Server WAR.
Since the Logi JReport Server library is included in Logi JReport-lib of the EAR layer, you must specify Class-Path in the META-INF/MANIFEST.MF file. The contents below should be included in the MANIFEST.MF file:
Class-Path: Logi JReport-lib/jrenv.jar Logi JReport-lib/JRESServlets.jar Logi JReport-lib/JREngine.jar ...
Class-Path is a list of all packages in the Logi JReport Server library. Each package name should start with the prefix Logi JReport-lib/, and you should use a blank space to separate package names.
Integrating by Building a User WAR and Embedding a Self-Contained Logi JReport Server
You can embed a self-contained Logi JReport Server into your WAR.
For example, you can create a WAR named MyApp.war, and then embed a self-contained Logi JReport Server inside it. The structure of your WAR may be as follows:
MyApp.war
WEB-INF/
web.xml
lib/ -- This folder contains all resources in the Logi JReport Server library and your other jar files.
classes/ -- This folder contains your servlet classes.
../../asset/images/
jsp/
If you put the Logi JReport WAR related JSPs to a sub folder, for example Logi JReport, and this time the structure of your WAR may be as follows:
MyApp.war
WEB-INF/
web.xml
lib/ -- This folder contains all resources in the Logi JReport Server library and your other jar files.
classes/ -- This folder contains your servlet classes.
../../asset/images/
Logi JReport/
admin/
dhtmljsp/
jinfonet/
...
To run Logi JReport reports, you must add the following into WEB-INF/web.xml:
- Add the following entry:
<context-param>
<param-name>autoDetectServletPath</param-name>
<param-value>false</param-value>
</context-param> Add listener as follows:
<listener>
<listener-class>jet.server.servlets.JRServerContextListener</listener-class>
</listener>
Integrating by Building a User EAR and Embedding a Self-Contained Logi JReport Server
You can embed a self-contained Logi JReport Server into your EAR in order to use Logi JReport Server from EJB.
For example, you can create an EAR named MyApp.ear and then embed a self-contained Logi JReport Server inside it. In the EAR, there is an EJB module used for initializing Logi JReport Server. The structure of your EAR may be as follows:
MyEAR.ear
META-INF/application.xml
Logi JReport-lib/ -- This folder contains all resources in the Logi JReport Server library
MyEjb.jar
META-INF/
MANIFEST.MF
ejb-jar.xml
com/
Following the Java EE standard, you should configure the META-INF/application.xml file before deploying your EAR:
|
Since the Logi JReport Server library is included in the Logi JReport-lib folder of the EAR layer, you must specify Class-Path in the META-INF/MANIFEST.MF file. The contents below should be included in the MANIFEST.MF file:
Class-Path: Logi JReport-lib/jrenv.jar Logi JReport-lib/JRESServlets.jar Logi JReport-lib/JREngine.jar ...
Class-Path is a list of all packages in the Logi JReport Server library. Each package name should start with the prefix Logi JReport-lib/, and you should use a blank space to separate package names.
If you do not want to set the reporthome for the embedded self-contained Logi JReport Server, but instead want to use Logi JReport's default settings, there is no requirement for configuring the ejb-jar.xml. However, if you want to control the reporthome of the Logi JReport Server, or specify a JNDI data source for Logi JReport Server to use, you should first configure the ejb-jar.xml file using the <env-entry></env-entry>
tags. For example:
|