Professional Documents
Culture Documents
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.
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 (-):
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:
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.
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:
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;
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('*******************************************************');
mzPathParent := mzDocData.path_owner_docid;
dbms_output.put('Full File path (reversed) is ": ');
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.
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 (-):
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.
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.)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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’