Tuesday, January 22, 2008

BI Publisher: XDO Loader

How many times has a developer approached you and said, "I made the changes to my template and put it out on the code tree, but my change isn't being recogonized in 11i." Your response could be two things.

1. You need to upload it into the database using the XML Publisher Administrator responsiblity.
2. Use xdo loader, an example is on ike's blog...

Number 2, is really the best option (he he )....if the template config is already done. When you start browsing and uploading files from your PC or emailing them to your administrator, your opening the door for mistakes, mistakes suck when they happen in production. One of the biggest advantages of using XDO loader is the fact that what's out on the code tree is what will get loaded into the database. The only other workaround for loading templates from unix is samba...

Implementing a solution using XDO Loader in your shop is really easy task. These sample calls are designed to be called from a shell script. They are for existing templates that have been configured in 11i. Essentially, calling this script will automatically, convert your RTF to XSL-FO and upload it in the database.

Static Example:

/opt/java1.5/bin/java oracle.apps.xdo.oa.util.XDOLoader \
UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION sand:1535:NADV \
-LOB_TYPE TEMPLATE_SOURCE \
-APPS_SHORT_NAME VCA \
-LOB_CODE VGMDQCARD \
-LANGUAGE en \
-TERRITORY US \
-XDO_FILE_TYPE RTF \
-FILE_CONTENT_TYPE 'application/rtf' \
-FILE_NAME $VCA_TOP/xml_pub/template/VGMDQCARD.rtf \
-NLS_LANG $NLS_LANG \
-CUSTOM_MODE FORCE \

Dynamic Example:
/opt/java1.5/bin/java oracle.apps.xdo.oa.util.XDOLoader \
UPLOAD \
-DB_USERNAME apps \
-DB_PASSWORD apps \
-JDBC_CONNECTION $1 \
-LOB_TYPE TEMPLATE_SOURCE \
-APPS_SHORT_NAME VCA \
-LOB_CODE $2 \ -LANGUAGE en \
-TERRITORY US \
-XDO_FILE_TYPE RTF \
-FILE_CONTENT_TYPE 'application/rtf' \
-FILE_NAME $VCA_TOP/xml_pub/template/$3 \
-NLS_LANG $NLS_LANG \
-CUSTOM_MODE FORCE

$1 = JDBC Connection string this could be simplified by setting up an environment variable.
$2 = this is the name of the template code (select LOB_CODE from xdo_lobs)
$3 = this is the RTF flatfile

-CUSTOM_MODE FORCE = FORCE the update if a lob already exists, otherwise it will error out....

2 comments:

Kevin Bouwmeester said...

XDOLoader is a really nice tool.

Unfortunately, you need to be careful when you use the XDOLoader for updating templates in E-Business Suite. It seems there is a bug (no: 5525159) that prevents XDOLoader to overwrite templates that have been last-updated-by some other user.

Basically, loading is not possible when the last-updated-by does not equals 2.

Regards,
Kevin

Ike Wiggins said...

I haven't had any issues on 5.6.3, this seems to be a be a release 12 issue.

Kevin did you try to use:

-CUSTOM_MODE FORCE


TST120:ST2: XMLP RTF TEMPLATES ARE NOT UPLOADED CORRECTLY BY XDOLOADER
Hdr: 5525159 VERSION-N/A CATEGORY-XDO UTILITY_VERSION-12.0 STATUS-92 PUB-N PRODID-1479 PORTID-100 RELEASE_ID-92