R12: CDATA in Context XML file

Hi Everyone!!

Sometime we need to use CDATA XML syntax in context xml to preserve multiple values for a single context variable. For example Prepending/Appending multiple custom classpath's. Prepend classpath is used to prepend custom zip and jars to your existing oacore classpaths.
In R12, custom prepend and append classpaths are mentioned by the variables s_oacore_prepend_classpath and s_oacore_append_classpath respectively.

In R12, prepend classpath changes will be propagated to orion-application.xml from the template file orion_applicatoin_xml_1013.tmp

Before changing prepend/append classpaths orion_application.xml looks like


When you add multiple prepend/append classpaths you need to make the XML Parser bypassing the parsing of the strings that you add by CDATA. For example I have my custom AP, AR classes which need to be prepended are in /R12/applmgr/apps/apps_st/appl/xx_customap and /R12/applmgr/apps/apps_st/appl/xx_customar

I have add these two as a prepend classpath in my context XML. Adding a single custom prepend classpath is normal. But when you make multiple you have to use CDATA xml syntax.
Its basically instructing the parser not to parse the code that you add as <> symbols are added in the data field of the tag/variable s_oacore_prepend_classpath .

What is CDATA:

From w3schools website

CDATA - (Unparsed) Character Data - A CDATA section starts with "". Characters like "<" and "&" are illegal in XML elements."<" will generate an error because the parser interprets it as the start of a new element. "&" will generate an error because the parser interprets it as the start of an character entity. Everything inside a CDATA section is ignored by the parser. After changing the multiple prepend classpath, context XML looks like


Running autoconfig will propagate the changes to orion-applicaiton.xml
instantiated orion-applicaiton.xml file looks like the one mentioned below




Hopefully this information will help you, not to modify the autoconfig template file. Leave your comments(fuels) to run this blog. Its been quite different environment I am facing in USA than India. I will try my best to put my R12 learnings in this blog as much as I can.

Will see you all in next technical article. Happy Learning!!!

16 comments:

Atul Kumar said...

Good One .

http://onlineappsdba.com

Suresh Lakshmanan said...

Thanks Atul.

Anonymous said...

Hi Suresh,

You are posting great stuffs!!

Keep going!!

Thanks
Ram

Suresh Lakshmanan said...

Thanks Ram!!

Anonymous said...

Your post is good but you need to explain newbie and sometime to very less experience Apps DBA what is CDATA. As a new comer they don't know what is CDATA. You Should give brief background so that the post is understandable. Having experience is in technology doesn't mean you are a good author. I hope after my feedback you will improve your post.

Suresh Lakshmanan said...

Hi Anonymous,

Thanks for your open comment. I appreciate it. I try my best to improve my writing when doing posts.
specify your name when you drop a comment to address you answering. :)

-Suresh

Bob Berrigan said...

Hi Suresh,

I came across your blog entry entitled "R12: CDATA in Context XML
file" when I was searching for a solution to add append multiple
library_path entries to "orion-application.xml". Thank you for
spending the time to document helpful entries!

I definitely understand your instructions about using CDATA in the
"s_oacore_prepend_classpath" entry, but I wasn't able to get it to
work.

After modifying the entry in the CONTEXT_FILE (I manually modified the
CONTEXT_FILE on the file system - not via OAM) and running AutoConfig,
the AutoConfig process modified by "s_oacore_prepend_classpath" entry
from:

<oacore_append_classpath
oa_var="s_oacore_append_classpath"><![CDATA[/oracle/R12/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/ExcelToXML.jar"/><library
path="/oracle/R12/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/PDF.jar]]></oacore_append_classpath>

To:

<oacore_append_classpath
oa_var="s_oacore_append_classpath">/oracle/CIT3/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/ExcelToXML.jar"/><library
path="/oracle/CIT3/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/PDF.jar</oacore_append_classpath>

The change to "orion-application.xml" reflects the change it made to
the CONTEXT_FILE:

<library path="/oracle/CIT3/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/ExcelToXML.jar"/><library
path="/oracle/CIT3/apps/apps_st/comn/java/classes/oracle/apps/xsui/lib/PDF.jar"
/>

From your blog entry, it's apparent the AutoConfig process didn't
change the entry like it did in my environment. My environment is
12.0.4.

Do you have any ideas why it didn't work for me?

Thanks,

Bob Berrigan

Suresh Lakshmanan said...

Hi Bob,
As per your mail I understand that the end configuration file orion-application.xml is having the double entries which you are trying to add after autoconfig. never worry about context file. if the end configuration file gets generated as expected you are good. if end configuration file is not getting generated as expected you might have to customize the $FND_TOP/admin/template file. i believe you are understanding my wordings. let me know if you need any more.
happy sharing. thank you.

thanks
Suresh

Bob Berrigan said...

Thanks, Suresh. It's very nice of you to have the blog entries and to
be willing to respond to emails.

I did end up adding the entries to the
"orion_application_xml_1013.tmp" file. I had been hoping the "CDATA"
entry in the CONTEXT_FILE would work (since there's a possiblity the
"orion_application_xml_1013.tmp" could be overwritten by a patch) but
it didn't.

Suresh Lakshmanan said...

Hi Bob,

Cool. You have ultimately fixed your need.
That is what i need. :)

happy sharing,
Suresh

Suresh Lakshmanan said...

Hi Bob,

good evening. You should take the copy of orion_application_xml_1013.tmp in custom direcetory and do a change. that way autoconfig will inform you if there is a new template which comes in as a part of patch. refer metalink note for auotoconfig customization for R12. Begin and end customizations are old style. I hope you are already following the method. thank you.

Thanks
Suresh

Anonymous said...

Hi Atul,

We developed a custom jsp page in oracle istore R12 application it uses a jar file that need to deployed in server. May i know the lcoation where we can place jar files, its given apache commons-codec-1.4.jar.

we cant compile the jsp page since we are getting compilation error of jar file

Suresh Lakshmanan said...

Hi ,

Make sure you have added the jar file in classpath variable, run autoconfig.

Suresh

Anonymous said...

Hi Suresh,

We've lots of entries in the orion_application_xml. I'm having the same issue which Bob also faced. After modifying the context file with CDATA and executing autoconfig, CDATA section vanishes from context file.

How to get over this? Also, if I modify the context file or template file in production, will the clone take care in non-production instances? Do I need to do anything extra as part of cloning process for the customization to take effect?

Please let me know if there is a way to handle customization to orion-web.xml.

Thanks in advance.

Suresh Lakshmanan said...

Hi,

Please customize the orion-web.xml template file.

Thanks
Suresh

Anonymous said...

Hi Suresh,

Thanks for the response. I've already customized the template files.

Also,I'm unable to have the custom entries in appsweb.cfg template to reflect after running autoconfig.Is there anything specific which needs to be done for the default parameter values to reflect in $INST_TOP/ora/10.1.2/forms/server/appsweb.cfg.

Thanks,
Harish