miercuri, 21 mai 2014

How to install Apache FOP and print PDF, CSV from Oracle APEX

First, you have to install the JDK. Download the <version>-linux-x64.bin file from oracle.com and just install it, by providing the above command:

./<version>-linux-x64.bin

It will install in usr/java. Just keep in mind the location and proceed further.

Download the oc4j software from here:

http://www.oracle.com/technetwork/middleware/ias/downloads/utilsoft-090603.html

And unzip it somewhere on the server, of course, keeping in mind the location.

Now make two files:

(Every step you'll make from now, pay attention at the custom parts of your commands, paths, etc.)

vi envoc.sh

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/oc4j
export OC4J_HOME=$ORACLE_HOME
export JAVA_HOME=$ORACLE_BASE/jdk1.6.0_45
export J2EE_HOME=$ORACLE_HOME/j2ee/home
export PATH=$JAVA_HOME/bin:$PATH:/opt/oracle/oc4j/bin


vi startoc4j.sh

. envoc.sh

java -jar /u01/app/oracle/oc4j/j2ee/home/oc4j.jar

Run the startoc4j.sh.
Now the instance will start for the first time and will prompt you for the admin password. 

Next step, installing the war file:

go to    http://localhost:8888/em/

>> applications tab

>> deploy button

>> Select archive 

then

>> Archive is already present on the server where Application Server Control is running.
and provide the path to the fop.war file, on the server

>>next

Clear the <context root> field and click next, then click deploy.

Now you have to make some settings in APEX.
Go to

localhost:8080/apex/apex_admin

>>manage instance >> instance settings >> report printing
print server = standard
print server protocol could be even https if you like
print server host address = localhost
print server port = 8888
print server script = /fop/apex_fop.jsp

Now everything is fine, except the network services in database:

BEGIN

DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl => 'www.xml',


description => 'APEX FOP',


principal => 'APEX_030200'


is_grant => true,


privilege => 'connect');



DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'www.xml',


principal => 'APEX_030200',


is_grant => true,


privilege => 'resolve');



DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl => 'www.xml',


host => 'localhost');


END;


/
COMMIT;

Just pay attention at the custom part of this script above, the name of the apex user.

Niciun comentariu:

Trimiteți un comentariu