Thursday, 18 April 2013

Oracle XML Publisher Moving Templates and Data Definintions between EBS Instances


Download
Using this structure we could use the FNDLOAD program to download any XML Publisher object from all data definitions and their associated templates to just an individual template file.
The FNDLOAD command takes the following format:


To download the data definition  

  DOWNLOAD  -- server 1
Sample Code:- ---------------------
FNDLOAD apps/apps O Y DOWNLOAD  $XDO_TOP/patch/115/import/xdotmpl.lct XX_XML_TEMP_DATA.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME='MASAPP' DATA_SOURCE_CODE='MAS_AR_RCPT_RGTR_RPT' TMPL_APP_SHORT_NAME='MASAPP' TEMPLATE_CODE='MAS_AR_RCPT_RGTR_RPT'


Upload
Now we have a file definition of the data definition and template meta data. we can now upload this data to any EBS instance.

FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct XX_XML_TEMP_DATA.ldt



NOTE:-

Move the Data definition and Template LDT to server  -- 2

Move  RTF to server  --2

Step 1:
Run the Data definition LDT

Step 2:
after moving the RTF to server run the java code


java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION mtzdev.mastec.com:1521:MTZDEV \  -- (To be Modified)
-LOB_TYPE TEMPLATE_SOURCE \
-APPS_SHORT_NAME XXMTZ \   -- (To be Modified)
-LOB_CODE XXMTZ_GL_PERIODCLOSE \  -- -- (To be Modified)
-LANGUAGE en \
-TERRITORY US \
-XDO_FILE_TYPE RTF \
-FILE_CONTENT_TYPE 'application/rtf' \
-FILE_NAME XXMTZ_GL_PERIODCLOSE.rtf \    -- (To be Modified)
-NLS_LANG ENGLISH_UNITED STATES.WE8ISO8859P1

(OR)

java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION nsd02.mastec.com:1522:NSD01 \
-LOB_TYPE TEMPLATE_SOURCE \
-APPS_SHORT_NAME XXNS \
-LOB_CODE MASNSISSUEPOREP \
-LANGUAGE en \
-TERRITORY US \
-XDO_FILE_TYPE RTF \
-FILE_CONTENT_TYPE 'application/rtf' \
-FILE_NAME MASNSISSUEPOREP_en_US.rtf \
-NLS_LANG ENGLISH_UNITED STATES.WE8ISO8859P1

====================    *********************   ==========================


Overview
XML Publisher stores all the meta data and physical files for templates and data definition in BLOB columns in its schema. It is therefore time consuming to manually download information from a development instance to a test and then to a production environment especially if there are many templates to manage.
XML Publisher uses the FNDLOAD loader technology and its own XDOLoader to allow you to
move the metadata and physical files for your templates and datasources from one instance to
another.

Managing Metadata
Both templates and data definitions are stored in the database and we can use the FNDLOAD loader to download the metadata for these objects and then upload them to another instance. The FNDLOAD program needs a control file (lct) that the XML Publisher team have provided. Its structure is as follows:
XDO_DS_DEFINITIONS – attributes for data source


Usage

Download

Using this structure we could use the FNDLOAD program to download any XML Publisher object from all data definitions and their associated templates to just an individual template file.
The FNDLOAD command takes the following format:

FNDLOAD usr/pwd@db 0 Y DOWNLOAD|UPLOAD xdotmpl.lct targetldtfile.ldt XMLP
ATTRIBUTES

If we wanted to download all data definitions and templates for Accounts Receivable we would use:

FNDLOAD apps/apps@mydb 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct
XMLPData.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=AR

Notice we had to provide the full path to the xdotmpl.lct file, this is under XDO_TOP under
APPL_TOP. The definitions will be downloaded to XMLPData.ldt. Other examples of the
FNLOAD command might be:

FNDLOAD apps_read_only/apps@seed115 0 Y DOWNLOAD
$XDO_TOP/patch/115/import/xdotmpl.lct XMLPData.ldt XDO_DS_DEFINITIONS
APPLICATION_SHORT_NAME=AR DATA_SOURCE_CODE=ARXCOBLX

To download the data definition (ARXCOBLX) and all of its associated template definitions.

FNDLOAD apps_read_only/apps@seed115 0 Y DOWNLOAD
$XDO_TOP/patch/115/import/xdotmpl.lct XMLPData.ldt XDO_DS_DEFINITIONS
APPLICATION_SHORT_NAME=AR DATA_SOURCE_CODE=ARXCOBLX TMPL_APP_SHORT_NAME=AR
TEMPLATE_CODE=ARLETTER1

To download the data definition (ARXCOBLX) and one of its associated templates (ARLETTER1)
from that datasource.

Upload

Now we have a file definition of the data definition and template meta data we can now upload this data to any EBS instance. The FNDLOAD command is similar to before except we use the
UPLOAD switch.

If we wanted to upload all of our data definitions and templates we could use:

FNDLOAD apps/apps@mydb 0 Y UPLOAD $XDO_TOP/patch/115/import/xdotmpl.lct
XMLPData.ldt

If we only wanted to load certain data definitions or templates we could use attributes similar to the DOWNLOAD options

FNDLOAD apps/apps@mydb 0 Y DOWNLOAD $XDO_TOP/patch/115/import/xdotmpl.lct
XMLPData.ldt XDO_DS_DEFINITIONS APPLICATION_SHORT_NAME=AR
This command will upload all data definitions and templates from the AR application that appear in our ldt file.
Loading template and sample data files

XML Publisher provides a java based command line program to load template (RTF, PDF and
XSLFO), XML and XSD files to the XML Publisher tables. The program can be used to download
files from one instance and load to another.

The loader has two modes:-

· File download only mode : With this mode, you can download files from the XDO_LOBS
table. You need to specify the target LOB_CODE, APPS_SHORT_NAME, LOB_TYPE
then it will download all files that match the criteria. You can also specify LANGUAGE and
TERRITORY.

· File download and LDT/DRVX generation mode : With this mode, you can download files
from the XDO_LOBS table. It also creates LDT and DRVX files for these downloaded files,
for your purposes you do not need the drvx file. This is used by Oracle development to load
templates during a patch application. You need to specify APPS_SHORT_NAME, it will
download all files (including template files, data definition files and sample xml files) that
have the same application short name. You can also specify DS_CODE to select files that
are related to the the specific data source definition.
Usage
Download
Firstly you need to ensure you have setup your environment for your session ie setting APPL_TOP,
CLASSPATH, etc.

DOWNLOAD usage (file download only mode):

% java oracle.apps.xdo.oa.util.XDOLoader DOWNLOAD \
-DB_USERNAME \
-DB_PASSWORD \
-JDBC_CONNECTION \
-LOB_TYPE \
-APPS_SHORT_NAME \
-LOB_CODE \
-LANGUAGE \
-TERRITORY \
-LOG_FILE


This mode will create the template or data files, one LDT file, one DRVX file and one log file.
Sample usage as follows:
% java oracle.apps.xdo.oa.util.XDOLoader \
DOWNLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION ap000sun:1521:apps115 \
-APPS_SHORT_NAME XDO \
-LCT_FILE ${XDO_TOP}/patch/115/import/xdotmpl.lct \
-DS_CODE XDODS1
In this mode the ldt file can then be used with the FNDLOAD utility to upload the metadata for te downloaded templates.

Upload
UPLOAD usage :
% java oracle.apps.xdo.oa.util.XDOLoader UPLOAD \
-DB_USERNAME \
-DB_PASSWORD \
-JDBC_CONNECTION \
-LOB_TYPE \
-APPS_SHORT_NAME \
-LOB_CODE \
-LANGUAGE \
-TERRITORY \
-XDO_FILE_TYPE \
-NLS_LANG \
-FILE_CONTENT_TYPE \
-FILE_NAME \
-OWNER \
-CUSTOM_MODE [FORCE|NOFORCE] \
-LOG_FILE


Sample usage is following.

% java oracle.apps.xdo.oa.util.XDOLoader \
UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION ap000sun:1521:apps115 \
-LOB_TYPE TEMPLATE \
-APPS_SHORT_NAME XDO \
-LOB_CODE XDOTMPL1 \
-LANGUAGE ja \
-TERRITORY JP \
-XDO_FILE_TYPE PDF \
-FILE_CONTENT_TYPE ‘aplication/pdf’ \
-FILE_NAME $XDO_TOP/patch/115/publisher/templates/XDOTMPL1_ja_JP.pdf
-NLS_LANG JAPANESE_JAPAN.JA16EUC

The loader can be used before or after the FNDLOAD command. The files will be loaded with its
LOB_CODE, this will join to the main metadata loaded using the TEMPLATE_CODE or
DATA_SOURCE_CODE mapping to the LOB_CODE.




No comments:

Post a Comment