You are on page 1of 7

Deployment and

XMLExporter / XMLImporter

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Overview

OA Frameworks extensions come with two toolsets, XMLExporter and XMLImporter, for unloading and loading extensions to the OA Database.
Typically these toolsets are used when one desires to:

a) Export Self-Service content, which includes extensions and personalizations, out of the OA database
b) Import Self-Service XML extensions and personalizations into the OA database

The XMLimporter's primary function is to take new Oracle Applications Self-Service framework extensions and load them to the database. During
database load objects are stored in various tables for rebuilding upon calls from the client.

XMLExporter is generally used for extracting Oracle Applications Self-Service framework personalizations from the database for insertion into a
test, development or production Oracle Applications database Personalizations consist of user changes to a page layout.
Personalizations are stored in the database, not the physical file on disk, and referenced when the page is called for display.

How To Deploy an OA Frameworks page and Import an XML file or package into the MDS repository of a Oracle Applications instance

First, you will need to import the XML to your database. Importing a single XML file or package is fairly straightforward. Importation can be run
from either the PC where your JDeveloper resides or from the database server where Oracle Applications has been installed. Importing involves
writing the import statement and running the import statement. After completion and testing of your new page, follow the below steps to import. As
these steps involve copying and pasting the tnsnames.ora reference for your applications database into the import statement, importing may be
performed by your DBA, depending on defined job roles and system access policies at your organization. In addition, it is an easy process to
create a shell script to store a generic import statement, which could be updated for each import performed. One caveat: the import statement
must be submitted as one long string without line breaks.

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 1


Date: 17-Jun-2005
Import Steps

1) If running from your database server you will need to create a directory on your db server to store the application you wish to deploy and
copy the files to be imported to the new location. This directory can be placed anywhere on your server with no restrictions on naming
conventions, however it is suggested, for ease of configuration management, that a defined directory path is used for all code to be stored
on the server.

Ex: /oracle/apps/fnd/myprojects/oracle

2) Request the complete tnsnames.ora database connect specification from your DBA or cut and paste from your server tnsnames.ora file.
The path to your tnsnames.ora file can be displayed by typing “echo $TNS_ADMIN” at the system prompt on your database server.

3) The XML importer takes the following parameters. Each parameter value, except for the import file path and name, when specified in the
import statement, must be preceded immediately by a dash (-):

Parameter Description Required Comments


Name
Import file Complete directory path and file name to be Yes File import ex: /oracle/apps/fnd/myprojects/oracle/helloworldPG.xml
imported Package import ex: /oracle/apps/fnd/myprojects/oracle
Username DB connect username with permission to Yes
import, typically “apps”
Password Username password Yes
Rootdir Root directory from where the import files are Yes Ex: /oracle/apps/fnd/myprojects
located
Top level Used when importing packages. Defines the No Ex: /oracle/fnd This parameter MUST start with a “/”
dir under root directory for the application module.
root
Database This is the complete tnsnames.ora connect Yes Request specification from your DBA or cut and paste from your
connection string specification for your application tnsnames.ora file. Can also use standard jdbc connection string
database. Ex: <port#:sid>
User id Used to set the Created_By and No Optional for repository table columns
Last_Updated fields in the database

4) Import your xml by issuing the following statement on your database server at the system prompt. The below example imports a single
xml file to an application database:

java oracle.jrad.tools.xml.importer.XMLImporter /oracle/apps/fnd/myprojects/oracle/HelloWorldPG -username apps -password apps


-rootdir /oracle/apps/fnd/myprojects -dbconnection "(description = (address=(protocol=tcp) (host=es0139.oracle.com)(port=1521))
(connect_data=(sid=ES0139)))"

Saving the above command in a script file allows you to edit the script easily for each xml load by changing only the xml file.

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 2


Date: 17-Jun-2005
Second, you need to copy the files from your JDeveloper instance to your server.

a. Generate the project to refresh the *.xml and *.class files.


b. “Zip up” files under \myclasses\ that contain the required *.class and *.xml files for the model and controller files.
c. Copy the *.zip file to the corresponding directory under $JAVA_TOP in binary mode.
d. Unzip the *.zip file into the proper subdirectory.
e. If you have extended any BC4J objects, create and import the substitutions as well.

After Importing you will need to add a menu entry to a defined menu to allow users to select the new form.

Export Steps

1) Query the database to determine the full MDS reference path for the object that will be extracted. The following code will extract
personalization details and full MDS, in reverse order, for the object queried. Please Note: this code is for reference purposes only and is
not guaranteed to work on all systems:

set echo off


set feedback off
set pagesize 66
set linesize 132
set serveroutput on
spool JRADMetaData.txt

DECLARE
mzDOCidRef integer;
mzPathParent integer;
mzPathName VARCHAR2(60);

cursor mzDOCID is
SELECT p.path_docid, p.path_name, p.path_owner_docid,
p.path_type
FROM JDR_PATHS p
WHERE upper(p.path_name) = ('<object name in full caps. Ex: ICXPORCRQPG’>);

cursor mzATTR is
SELECT att_name, att_value
FROM JDR_ATTRIBUTES
WHERE att_comp_docid = mzDOCidRef
ORDER BY att_seq;
mzattrData mzATTR%ROWTYPE;

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 3


Date: 17-Jun-2005
cursor mzCOMP is
SELECT comp_element, comp_ref
FROM jdr_components
WHERE comp_docid = mzDOCidRef;
mzCompData mzCOMP%ROWTYPE;

cursor mzATL is
SELECT atl_lang, atl_comp_ref, atl_name, atl_value
FROM jdr_attributes_trans
WHERE atl_comp_docid = mzDOCidRef;
mzAtlData mzATL%ROWTYPE;

BEGIN
dbms_output.enable(buffer_size=> 1000000);
FOR mzDocData in mzDOCID LOOP
dbms_output.put_line('*******************************************************');

dbms_output.put_line('Information for PATH_DOCID ' || mzDocData.path_docid);


dbms_output.put_line('Path Name : '||mzDocData.path_name);
dbms_output.put_line('Owner DocID : '||mzDocData.path_owner_docid);
dbms_output.put_line('Path Type : '||mzDocData.path_type);
dbms_output.put_line('.');

mzPathParent := mzDocData.path_owner_docid;
dbms_output.put('Full File path (reversed) is ": ');

WHILE mzPathParent != 0 LOOP


SELECT path_owner_docid, path_name
INTO mzPathParent, mzPathname
FROM JDR_PATHS
WHERE path_docid = mzPathParent;
dbms_output.put('.' || mzPathName);
END LOOP;
dbms_output.new_line;
dbms_output.put_line('.');

dbms_output.put_line(' ** Attribute Information **');


dbms_output.put_line('.');
mzDOCidRef := mzDocData.path_docid;
FOR mzAttrData in mzATTR LOOP
dbms_output.put(mzAttrData.Att_name);

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 4


Date: 17-Jun-2005
dbms_output.put(' : ' || mzAttrData.att_value);
dbms_output.new_line;
END LOOP;
dbms_output.put_line('.');

dbms_output.put_line(' ** Component Information **');


dbms_output.put_line('.');

FOR mzAtlData in mzATL LOOP


dbms_output.put(mzAtlData.atl_lang);
dbms_output.put(' : ' || mzAtlData.atl_comp_ref);
dbms_output.put(' : ' || mzAtlData.atl_name);
dbms_output.put(' : ' || mzAtlData.atl_value);
dbms_output.new_line;
END LOOP;

END LOOP;
END;
/

spool off
set echo on
set feedback on
REM END OF SQL

The following is an excerpt from the output returned from the database. Note the path reference. This path is needed when writing the
XMLExporter statement or recreating the object code.

Information for PATH_DOCID 236


Path Name : IcxPorCrqPG
Owner DocID : 235
Path Type : DOCUMENT
.
Full File path (reversed) is ": .webui.cancelreq.por.icx.apps.oracle
.
** Attribute Information **
.
xmlns:jrad : http://xmlns.oracle.com/jrad
…….

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 5


Date: 17-Jun-2005
2) After determining the full MDS path for the database XML object, you can recreate the object, from the database, by running the following
code. This code takes as a parameter the reverse of the full MDS path, returned in step #1 above, with the object name appended at the
end. This step is not necessary however it is provided as an example of using JDR_UTILS.printDocument.

REM START OF SQL

set serveroutput on
spool output.txt
exec JDR_UTILS.printDocument('/oracle/apps/icx/por/cancelreq/webui/IcxPorCrqPG');
spool off
REM END OF SQL

3) To extract, the full MDS path as defined in #2 and the tnsnames reference for the database, will be needed. Again, as in the XMLImporter,
the command statement must be written as a single text string. Note: Extraction is similar, but not the same, as using AKLOAD. During
export data will be written to a user named directory with sub-directories created in the same MDS path as stored in the database. The
XMLExporter takes the following parameters. Each parameter value, except for the export file path and name, when specified in the
export statement, must be preceded immediately by a dash (-):

Parameter Description Required Comments


Name
export file Personalization document name Yes Ex: /oracle/apps/icx/por/cancelreq/webui/IcxPorCrqPG
Username DB connect username with permission to Yes
import, typically “apps”
Password Username password Yes
Rootdir Root directory from where the export files will Yes Output directory. Ex: /oracle/apps/fnd/myprojects
be written.
Database This is the complete tnsnames.ora connect Yes Request specification from your DBA or cut and paste from your tnsnames.ora file.
connection string specification for your application Can also use standard jdbc connection string ex: <port#:sid>
database.

Ex: java oracle.jrad.tools.xml.exporter.XMLExporter /oracle/apps/icx/por/cancelreq/webui/IcxPorCrqPG -username apps -password apps


rootdir /home/user1/myprojects -dbconnection "(description=(address=(protocol=tcp)(host=es0139.oracle.com)
(port=1521))(connect_data=(sid=ES0139)))"

You can create the above command as a *.cmd file to be run from any directory on your development environment or as a *.sh file on your
server, depending on where you need to run it.

4) Move the extracted page *.xml into your project by clicking the “Add to …” button on the System Navigator’s toolbar.

5) Copy the model and controller files into a zip file from your server based on the directory paths determined from the code above.

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 6


Date: 17-Jun-2005
6) Move the zipped model and controller files to your \myclasses\ directory in your JDeveloper environment.

7) Restructure the directories so that \oracle\ is directly under \myclasses\, and delete any unneeded directory structures.

8) Copy the files that you will be extending into your project by selecting your project in JDeveloper and clicking on the “Add to…” button on
the System Navigator’s toolbar. Find the server.xml file under \myclasses\…\server (not \myprojects\…\server). You will be asked if you
want to “Add the following package as a Business Component”. Select “Yes”.

9) When you look at the BC4J objects in your System Navigator you will see *.xml files but not *Impl.java files. This is because you do not
need the object source code to extend from it.

10) Copy the controller files that need to be extended into your project by selecting your project in JDeveloper and clicking on the “Add to…”
button on the System Navigator. Find the *CO.class file under \myclasses\. (Note: at this time, extension of controllers is not supported.)

You should now be able to execute exported pages from JDeveloper.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

References

Metalink - OA Framework Personalizations & Extensibility Guide, Note 236618.1 (OA Framework Personalization and Extensibility Guide: Version
5.7+)
Metalink – How to Remove an OA Framework Personalization, Note 304570.1
Metalink – About OA Framework Integrated Development Environment (Jdeveloper9i OA Extension), Note 286082.1
Oracle University – 11i Extending Oracle Applications: OA Framework, Volume 3, Chapter 16, ‘Deploying an OA Framework Page’

Author: Barbara Waddoups, Senior Principal Instructor, Oracle University 7


Date: 17-Jun-2005

You might also like