01.02.2013 Views

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

Publishing Reports to the Web - Downloads - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SRW.ADD_PARAMETER(myPlist,'SERVER','fooSVR');<br />

SRW.ADD_PARAMETER(myPlist,'CMDKEY','keyvalue');<br />

SRW.ADD_PARAMETER(myPlist,'ExpenseID',:new.ExpID);<br />

myIdent := SRW.RUN_REPORT(myPlist);<br />

END IF;<br />

END;<br />

Integrating with <strong>Oracle</strong> Advanced Queuing<br />

Additionally, if you have defined an advanced distribution model via a distribution<br />

XML file, you can specify that file with <strong>the</strong> DESTINATION parameter. For example:<br />

CREATE TRIGGER EXP_REP_TRG<br />

AFTER INSERT OR UPDATE on EXP_REP FOR EACH ROW<br />

myPlist SRW_PARAMLIST;<br />

myIdent SRW.JOB_IDENT;<br />

BEGIN<br />

IF (:new.ExpStat = 'DONE') THEN<br />

myPlist := SRW_PARAMLIST(SRW_PARAMETER('',''));<br />

SRW.ADD_PARAMETER(myPlist,'GATEWAY','http://…');<br />

SRW.ADD_PARAMETER(myPlist,'SERVER','fooSVR');<br />

SRW.ADD_PARAMETER(myPlist,'REPORT','foo.RDF');<br />

SRW.ADD_PARAMETER(myPlist,'USERID','foo/bar');<br />

SRW.ADD_PARAMETER(myPlist,'DISTRIBUTE','YES');<br />

SRW.ADD_PARAMETER(myPlist,'DESTINATION','filename.xml');<br />

SRW.ADD_PARAMETER(myPlist,'ExpenseID',:new.ExpID);<br />

myIdent := SRW.RUN_REPORT(myPlist);<br />

END IF;<br />

END;<br />

This is one way <strong>to</strong> move this kind of logic from your application in<strong>to</strong> <strong>the</strong> database and<br />

use <strong>the</strong> database as a central s<strong>to</strong>rage for business processes.<br />

Note: You'll find additional examples of <strong>the</strong> Event-Driven<br />

<strong>Publishing</strong> API in action in <strong>the</strong> demo script srw_test.sql,<br />

included with your <strong>Oracle</strong>AS <strong>Reports</strong> Services installation.<br />

17.4 Integrating with <strong>Oracle</strong> Advanced Queuing<br />

<strong>Oracle</strong> Advanced Queuing is a means for building an asynchronous request/response<br />

mechanism around a so-called queue and two processes: ENQUEUE, which puts<br />

MESSAGES in<strong>to</strong> a queue, and DEQUEUE, which reads <strong>the</strong> queue.<br />

Advanced queuing provides sophisticated mechanisms for distributing messages<br />

across queues and for queue subscription. These mechanisms are all built on <strong>to</strong>p of<br />

<strong>the</strong>se basic elements (ENQUEUE, DEQUEUE, and MESSAGES).<br />

With <strong>the</strong> Event-Driven <strong>Publishing</strong> API you can use <strong>the</strong>se queues <strong>to</strong> s<strong>to</strong>re and transmit<br />

report jobs. You can even build your own queuing mechanism if <strong>the</strong> one provided<br />

with <strong>Oracle</strong>AS <strong>Reports</strong> Services does not fit your needs.<br />

17.4.1 Creating a Queue That Holds Messages of Type SRW_PARAMLIST<br />

A queue is a table in <strong>the</strong> database that holds, along with several administrative<br />

columns, an object column that represents a message. In our case <strong>the</strong> message is <strong>the</strong><br />

parameter list.<br />

The dbms_AQadm package, provided with Advanced Queuing, contains all <strong>the</strong><br />

administrative functions required for setting up an advanced queuing system.<br />

Using Event-Driven <strong>Publishing</strong> 17-7

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!