« Bursting... | Main | Bursting & Translation »

Bursting: Conditional delivery

This is in response to arvind’s question on how we can set the conditional delivery based on the user preference available in xml data file. Here is an example.

<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
 <xapi:globalData location="stream">
 </xapi:globalData >
    <xapi:request select="/DATA/LIST_DEPT/DEPT/LIST_EMPLOYEE/EMPLOYEE">
 <xapi:delivery>
  <xapi:email server="${EMAIL_SERVER}" port="${EMAIL_PORT}"
 from="${FROM_EMAIL_ADDRESS}" 
   reply-to ="${REPL_TO_ADDRESS}">
   <xapi:message id="email1"  to="${TO_EMAIL_ADDRESS}"  cc="${CC_EMAIL_ADDRESS}"   
 attachment="true" content-type="html/text" 
subject="Employee Report for Empno ${EMPNO}">
   Dear ${ENAME}, Please review the attached document.</xapi:message>
  </xapi:email>
  <xapi:filesystem id="file1"
  output="C:\burst\sample\${EMPNO}_${ENAME}_${MGR}_PRINT.pdf"/>
  <xapi:print id="print1"  printer="${PRINT_URL}" copies="2"
   orientation-requested="3" />
 </xapi:delivery>
 <xapi:document key="${EMPNO}" 
  output-type="pdf" delivery="email1">
    <xapi:template type="rtf" location="${TEMPLATE_LOC}"
    filter=".//EMPLOYEE[DEL_CHANNEL='EMAIL']" >
    </xapi:template>
  </xapi:document>
  <xapi:document key="${EMPNO}"   output-type="pdf" delivery="print1">
    <xapi:template type="rtf" location="${TEMPLATE_LOC}"
    filter=".//EMPLOYEE[DEL_CHANNEL='PRINT']" >
    </xapi:template>
  </xapi:document>
 <xapi:document key="${EMPNO}"   output-type="pdf" delivery="file1">
    <xapi:template type="rtf" location="${TEMPLATE_LOC}"
    filter=".//EMPLOYEE[DEL_CHANNEL='FILE_SYSTEM']" >
    </xapi:template>
  </xapi:document>
 </xapi:request>
</xapi:requestset>  

We need to define multiple document sections corresponding to each delivery channel and the filter condition to deliver the output based on user preference. Here DEL_CHANNEL is the element in xml data file, which define the user delivery preference.

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/11149

Comments (4)

Glen:

Ashish,

Thanks for posting that, it looks like a really cool feature of the bursting control file that could come in handy. For clarity, though, could you post a sample of an XML data file that would go with that config file?

Thanks,
Glen

Kevin Woodrow:

Great tip!

Thanks

Kevin

devendar gandra:

Hi,

I tried this technique and it is working fine when I hard code the location of the template as /eb_rdo0/applmgr/pnappl/xxgis/11.5.0/reports/US/abc.rtf. But when I try the method $TEMP_LOC it is failing. Bursting logic is throwing an error as java.io.FileNotFoundException.

Is there any setting we need to make ??

sanjai misra:

i have done few xml publisher reports and did little bit bursting. However, your example made me understand bursting better.

Thanks,

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on April 8, 2009 9:41 AM.

The previous post in this blog was Bursting....

The next post in this blog is Bursting & Translation.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle