Installation


Download the files

You can download the files from here and unzip them.

Installation in the J2EE server

We need to install the J2EE application and configure the data sources in this step. The J2EE application has to find various configuration files (e.g. conf/application.propertiesconf/log4j.properties) or the different reports that we can run (e.g. reports/test.jasper).

We have two options here:
  1. Configure the server environment using an operating system environment variable
  2. Configure the setting in the web.xml file of the JasperReportsIntegration.war file
The difference comes into play when you deploy the JasperReportsIntegration.war file multiple times on the same J2EE server or on different J2EE servers on the same machine. When using the operating system environment variable, all instances of the JasperReportsIntegration will use the same configuration and reports.

If you want to use different configurations for your different instances on the same machine (either you deploy different version of the JasperReportsIntegration or you have your development, test and production environment running on the same machine but on different J2EE servers), you would use the direct manipulation of the web.xml file.

1. Configure the server environment using an operating system environment variable

Using the operating system environment variable OC_JASPER_CONFIG_HOME we can configure where these files reside on the filesystem. This directory is the same as the base directory of your downloaded files, i.e. it should at least the subdirectories conf, reports, logs.
Create the required directory structure
First you need to set up the required directory structure in the target directory. Just copy the directories conf, reports and logs to the target directory.
Unix / Linux
On a Unix / Linux system running Tomcat you could for example add this setting to the Tomcat startup script (e.g. /usr/local/tomcat/bin/startup.sh):
Windows
On a Windows machine you could do the same (e.g. c:\program files\apache tomcat\bin\startup.cmd):
or you could modify the system environment of the machine and create the variable OC_JASPER_CONFIG_HOME=c:\JasperReportsIntegration

2. Configure the setting in the web.xml file of the JasperReportsIntegration.war file

You can modify the context-parameter oc.jasper.config.home in the web.xml of the JasperReportsIntegration.war directly. The steps involved are the same for Windows and Unix / Linux.
Create the required directory structure
First you need to set up the required directory structure in the target directory. Just copy the directories conf, reports and logs to the target directory.
Update the web.xml file
       <context-param>
         <param-name>oc.jasper.config.home</param-name>
         <param-value>/Users/daust/oc-jasper</param-value>
       </context-param>
or
       <context-param>
         <param-name>oc.jasper.config.home</param-name>
         <param-value>D:\JasperReportsIntegration</param-value>
       </context-param>

Configure your database access

Edit the file conf/application.properties in your target directory and configure the data source default to connect to your Oracle schema (change the parts in bold to point to the Oracle schema you want to connect to):

#====================================================================
# JDBC datasource configuration
# http://www.orafaq.com/wiki/JDBC#Thin_driver
# type=jdbc|jndi
#====================================================================
[datasource:default]
type=jdbc
name=default
url=jdbc:oracle:thin:@192.168.2.114:1521:XE
username=HR
password=hr_password

Alternatively you could use the native JNDI data source of your application server. See the documentation there on how to configure it. In this configuration file you would have to register just the JNDI datasource you want to use:

#====================================================================
# Native JNDI datasource, to be configured in the application server
# name: jndi_test
#====================================================================
[datasource:jndi_test]
type=jndi
name=jndi_test

Deploy

Take the application server of your choice and deploy the file webapp/JasperReportsIntegration.war to it. Typically you could then reach the JasperReportsIntegration homepage with the URL http://<server>:<port>/JasperReportsIntegration.

Here you will find the included documentation, information about the location of the configuration files, you can test the database connections and run the test reports:



Installation of database objects

The database objects required for the integration will be installed into each application schema that you want to use with the integration. 

The installation instructions will refer to the application schema (in which you install the software) as [application schema]. The password for the application schema will be referred to as [application schema password].

Thus when I use an instruction like sqlplus [application schema]/[application schema password]@[database] please replace that with the actual values of your local installation. For example, if you want to install the integration kit into the schema HR with the password hr1 into your local XE instance (having a TNS entry named xe) then this instruction translates to:

sqlplus hr/hr1@xe

Database installation (SYS)

First of all we need to grant the required privileges to the Oracle user who will own the packages for the integration.

  1. Extract the downloaded zip file.
  2. Open a command shell:
    • e.g. on Windows: Start > Execute : cmd
  3. Go to the subdirectory sql (of where you extracted the file):
    • cd sql
  4. Connect as SYS to the local instance (using sqlplus)
    • sqlplus "sys/[sys password]@[database] as sysdba"
  5. Run the installation script (and pass the name of the target application schema as a parameter)
    • @sys_install.sql [application schema]
  6. [optional] If you are installing on an Oracle Release 11.0 and higher, you have to grant the required network privileges to the application schema. 
    • The  script sys_install_acl.sql allows access to the local machine on port 80 to port 10000. Please adapt the script to suit your needs, especially if the J2EE server is running on a different machine. It needs to be run for each application schema using the integration.
    • @sys_install_acl.sql [application schema]

Database installation (Application Schema)

  1. Open a command shell:
    • e.g. on Windows: Start > Execute : cmd
  2. Go to the subdirectory sql (of where you extracted the file):
    • cd sql
  3. Connect as the application schema to the local instance (using sqlplus)
    • sqlplus [application schema]/[application schema password]@[database]
  4. Run the installation script
    • @user_install.sql

Installation of the test application

The test application will allow for basic testing of the integration with all relevant parts. Install the application file apex\f121_JasperReportsIntegration-Test_x.x.x.x.sql into your workspace.

It will perform checks on the installation and allow you to run the test reports.

Screenshot of application tester