« March 2009 | Main | June 2009 »

April 2009 Archives

April 8, 2009

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.

About April 2009

This page contains all entries posted to A BI Publisher developer's diary... in April 2009. They are listed from oldest to newest.

March 2009 is the previous archive.

June 2009 is the next archive.

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

Powered by
Movable Type and Oracle