Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

PDF/Download

and
Briefing Books
February 9
th
, 2011
Download Formats
void PortalSubsystemImpl::Go(NQHttpStream& rStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs
& rArgs)
Excel, word, mht
void PortalSubsystemImpl::GoOffice(NQHttpStream& rHttpStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs & rArgs)
void PortalSubsystemImpl::GoMHTMLImpl(NQHttpStream& rStream, saw::Handle<ClientSession> hClientSession, const HttpArgs& rArgs, EMHTMLFlags eFlags)
Powerpoint
void PortalSubsystemImpl::goPowerpoint(NQHttpStream& rStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs & rArgs)
void PortalSubsystemImpl::getXSLFO()
Handle<RPCClientEndPoint> FopProxy::generatePowerpoint()
Pdf
void PortalSubsystemImpl::GoPDF(NQHttpStream& rStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs & rArgs)
void PortalSubsystemImpl::getXSLFO()
Handle<RPCClientEndPoint> FopProxy::generatePDF()
Csv, txt
void PortalSubsystemImpl::GoCSV(NQHttpStream& rStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs & rArgs)
void PortalSubsystemImpl::generateData(NQHttpStream& rStream, const Handle<ClientSession> & hClientSession, const HttpArgs & rArgs)
Xml
void PortalSubsystemImpl::GoXML(NQHttpStream& rStream, const saw::Handle<ClientSession>& hClientSession, const HttpArgs & rArgs)
void PortalSubsystemImpl::generateData(NQHttpStream& rStream, const Handle<ClientSession> & hClientSession, const HttpArgs & rArgs)
Analysis xml -> XSL-FO
<saw:report xmlns:saw="com.siebel.analytics.web/report/v1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlVersion="201008230"
xmlns:sawx="com.siebel.analytics.web/expression/v1.1">
<saw:criteria xsi:type="saw:simpleCriteria" subjectArea="&quot;A - Sample Sales&quot;">
<saw:columns>
<saw:column xsi:type="saw:regularColumn" columnID="c62500ef8d850f43d">
<saw:columnFormula>
<sawx:expr xsi:type="sawx:sqlExpression">"Time"."T01 Per Name
Week"</sawx:expr>
</saw:columnFormula>
</saw:column>
</saw:columns>
</saw:criteria>
<saw:views currentView="0">
<saw:view xsi:type="saw:compoundView" name="compoundView!1">
...
</saw:view>
<saw:view xsi:type="saw:titleView" name="titleView!1"/>
<saw:view xsi:type="saw:tableView" name="tableView!1">
...
</saw:view>
</saw:views>
</saw:report>
<?xml version="1.0"?>
<fo:root xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xdofo="http://xmlns.oracle.com/oxp/fo/extensions">
<fo:layout-master-set>
<fo:simple-page-master desiredWidth="612" master-name="page" page-height="792pt" page-
width="612pt">
<fo:region-body margin-bottom="0pt" margin-left="36pt" margin-right="36pt" margin-
top="0pt"/>
<fo:region-before extent="0pt" margin-left="36pt" margin-right="36pt" margin-top="36pt"/>
<fo:region-after extent="0pt" margin-bottom="36pt" margin-left="36pt" margin-
right="36pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="page">
<fo:static-content flow-name="xsl-region-before">
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:table border-collapse="separate" font-size="9pt" text-align="center">
<fo:table-column column-width="89.688pt" minimumContent="89.688"
desiredWidth="89.688"/>
<fo:table-body>
...
</fo:table-body>
</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>
XSL-FO
XSL-FO stands for Extensible Stylesheet Language Formatting Objects
The <fo:layout-master-set> element contains one or more page templates. Each <fo:simple-page-master> element contains
a single page template. Each template must have a unique name (master-name):
<fo:layout-master-set>
<fo:simple-page-master desiredWidth="612" master-name="page" page-height="792pt" page-width="612pt">
<fo:region-body margin-bottom="0pt" margin-left="36pt" margin-right="36pt" margin-top="0pt"/>
<fo:region-before extent="0pt" margin-left="36pt" margin-right="36pt" margin-top="36pt"/>
<fo:region-after extent="0pt" margin-bottom="36pt" margin-left="36pt" margin-right="36pt"/>
</fo:simple-page-master>
</fo:layout-master-set>
XSL-FO
"Blocks" of content "Flow" into "Pages" of the output media
<fo:page-sequence>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<!-- Output goes here -->
</fo:block>
</fo:flow>
</fo:page-sequence>
Block properties:
Margin-{top, bottom, left, right}
Border-{style, before-style, after-style, start-style, left-style,,,}
Boder-{color, before-color, after-color, bottom-color}
Border-{width, before-width, left-width, right-width}
Padding-{before, after, start, end}
Background-{color, image, repeat, attachment}
Font-{family, weight, style, size, variant}
Text-{align, indent}, wrap-option, break-before,
Pdfstyles: res\s_blafp\b_mozilla_4\pdfstyle.fst
Table, title, CLV container, column selector, filter view, dashboard container, legend view, no result view, header and footer,
funnel chart, grid view,
<fo:table class="TitleTable>
<fo:table-cell class="CVFormatCell" >
XSL-FO
XSL-FO table model is similar to HTML table model. Captions used to create tables:
fo:table-and-caption, fo:table, fo:table-caption, fo:table-column, fo:table-header, fo:table-footer, fo:table-body,
fo:table-row, fo:table-cell
XSL-FO instream-foreign-object
<fo:block>
<fo:instream-foreign-object content-type="image/svg+xml">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="bigraph1_svgRoot" width="638" height="318">

</svg>
</fo:instream-foreign-object>
SVG
<rect x="0" y="0" width="638" height="318" fill="#ffffff" fill-opacity="0.0"/>
<text xml:space="preserve" x="294" y="305" style="font:12px sans-serif" fill="#74779a">T00 Calendar Date</text>
<line x1="65" y1="255" x2="628" y2="255" stroke="#8a8dac"/>
<circle cx="100" cy="50" r="40" stroke="black stroke-width="2" fill="red"/>
<ellipse cx="30" cy="177" rx="17" ry="111" stroke="#ffffff" fill="url(#bigraph1_grad10)"/>
<polygon points="220,100 300,210 170,250 style="fill:#cccccc; stroke:#000000;stroke-width:1"/>
<polyline points="0,0 0,20 20,20 20,40 40,40 40,60 style="fill:white;stroke:red;stroke-width:2"/>
<path d="M475.21,145.57 C477.79,146.03 479.85,160.19 479.85,177.5 C479.851,194.81 477.79,208.97 475.21,209.43 L530.75,199.6
C532.53,199.28 533.96,189.48 533.96,177.5 C533.961,165.52 532.53,155.72 530.75,155.4 L475.21,145.57 Z"
fill="url(#bigraph1_grad9)"/>
M: moveto, C: curveto, L=lineto,
<defs>
<linearGradient id="bigraph1_grad0" gradientUnits="userSpaceOnUse" x1="73" y1="94" x2="120" y2="94">
<stop offset="0.0" stop-color="#26517c"/>

</linearGradient>
</defs>
External-graphic
The <fo:external-graphic> object is used for a graphic where the graphics data resides outside of the <fo:element> tree
<fo:block xml:space="preserve">
<fo:external-graphic
src="url(&#39;http://130.35.50.177:8080/v/res/sk_blafp/b_mo
zilla_4/oracle_logo.png&#39;)" width="133" height="18"/>
</fo:block>
<fo:block xml:space="preserve">
<fo:external-graphic
src="url(&#39;http://130.35.50.177:8080/v/res/sk_blafp/b_mo
zilla_4/oracle_logo.png&#39;)" width="600" height="600"/>
</fo:block>
XSL-Fo Classes
Webmarkup\fostream.cpp
Another stream object derived from NQHttpStream, contains fo-elements,
Page size, orientation, style, processor format (pdf/ppt)
Keeps track of current element so we can track of its dimensions
All fo* classes take fostream
Webmarkup\fotable.cpp
Min/max/desired widths, table-body, table-header, table- footer, table-row,
table-cell, fo-block, fo-text, fo-inline, fo-basic-link
FoCell renders the <fo:table-cell> element and sets its width to the width of
the max children block width
Webmarkup\fopage.cpp
Generates header&footer, calculate page/border/margin/header&footer widths
Webmarkup\foelement.cpp
Represents xml element
Element dimensions, font type/size, style, padding, borders
XSL-Fo Classes
Webmarkup\foblock.cpp
Set font size/style, sets widths and heights of blocks, padding,
borders
Webmarkup\foblockstream.cpp
Handle external-graphic&fo-inline, set font size/style,
Webmarkup\fotags.cpp
Generates root, layout/page-master, flow, static-content, region-
*, page-number, basic-link, leader, margin-*, page-* tag,
Webmarkup\fosetwidth.cpp
Calculates widths of every word and figures out block widths
Webmarkup\foutils.cpp
Validates fo tags
Sample Execution Flow
void PortalSubsystemImpl::Go()
void PortalSubsystemImpl::GoPDF(
void PortalSubsystemImpl::getXSLFO()
FoStream::FoStream()
PDFPage::PDFPage()
void PDFPage::PageProps::init()
FoElement::FoElement()
...
FoStream::FoStream()
FoTable::FoTable()
FoElement::FoElement()

void XslFoPostProcessor::postProcess()
Handle<RPCClientEndPoint> FopProxy::generatePDF()
Handle<RPCClientEndPoint>
FopProxy::generateOutput()
void PortalSubsystemImpl::transmitPDFImpl()
Post-processing
If width is set as percentage we need to stretch columns to fill available width or balance
columns to use percentage value. When widths of columns are extended they need to
account for padding.
Children elements alignments taking into consideration parent alignments.
Donwload external-graphic, assign dimensions.
Fo Processor Engine is written in Java.
Fo Engine is used to transform xsl-fo into PPT and well as PDF and in future release we will be
supporting Excel as well.
Analytics_web\main\java\classes\com\siebel\analytics\web\javahostrpccalls\xmlp\*.java
analytics_web\main\java\projects\nansvs\lib\xdo.jar
<fo:table-cell text-align="center" number-columns-spanned="1" number-rows-spanned="1">
<fo:table-column column-width="76.710pt" minimumContent="76.710" desiredWidth="76.710"/>
<fo:table-cell class="CVFormatCell" text-align="center">
<fo:table-column column-width="76.710pt" minimumContent="76.710" desiredWidth="76.710"/>
<fo:table-cell text-align="center" number-columns-spanned="1" number-rows-spanned="1"
padding-start="1pt" padding-end="1pt">
<fo:table-column column-width="87.000pt" minimumContent="76.710" desiredWidth="76.710"/>
<fo:table-cell class="CVFormatCell" text-align="center" padding-start="1pt" padding-end="1pt">
<fo:table-column column-width="85.000pt" minimumContent="76.710" desiredWidth="76.710"/>
Briefing books
collection of static or updatable snapshots of
dashboard pages, individual analyses, and BI Publisher
reports.
Add content of dashboard pages
Edit them to reorder/delete content, change content
type, navigation link properties
Download in pdf or mhtml
Update, schedule, deliver them using agents
Pdf version contains table of contents
Navigation links to dashboard pages
(instanceconfig.xml parameter
BriefingBook/MaxFollowLinks)
Demo
Adding content to new or existing briefing
books
Updatable vs snapshot
Download
Use agent to deliver briefing book
Briefing Book Object
Snapshots are saved under (xslfo & mht): root\system\briefingbooksnapshots
<sawb:mhtSnapshotToken>
<sawb:snapshot stream="+d2uhUn5ADP+1az1CNc66w" rootContentID="1adc5ae8"/>
</sawb:mhtSnapshotToken>
<sawb:xslfoSnapshotToken>
<sawb:snapshot stream="56mvuO5xsHBSSorZlqk8nw" caption="korhan (2/8/2011 4:14:07 PM)"/>
</sawb:xslfoSnapshotToken>
<sawb:timestamp>2/8/2011 4:14:07 PM</sawb:timestamp>
Entry points
Entry points are in websubsystems\briefingbook.cpp:
void RemoteSubsystemImpl::SaveToBriefbook()
bool RemoteSubsystemImpl::handleSaveAsSnapshot()
void RemoteSubsystemImpl::getBriefingBookPages()
void RemoteSubsystemImpl::downloadBookPDF()
void RemoteSubsystemImpl::downloadBookMHT()
void RemoteSubsystemImpl::deleteBriefingBook()
void RemoteSubsystemImpl::editBriefbook()
void RemoteSubsystemImpl::changeToSnapshot(
save
If snapshot, generate the whole book now, nothing is generated if updatable
Download
Snaphost has stored xslfo document, for updatable generate content each time
Pdf: Output xsl-fo to disk in order, then stream them to javahost, where xmlp merges them into one
pdf document
References
http://www.w3schools.com/
http://www.w3.org/TR/2001/REC-xsl-20011015/

You might also like