Should be reasonably simple 
- most of the steps are reasonably simple
- you may need to spend some time on XSL-FO to fine-tune you output

The best way is to start with the samples and just keep modifying the pages.
Also it's good to check you outputs along the way 
- first get from database to XML (have a separate pipeline for this)
- then pass from XML to PDF



Here's some key steps you could use:
---------------------------------------------------------------------------------
Assuming you have a database up and running (I'm using MYSQL).
.....say called mydatabase.....with a table called mytable.....with 2 
fields.....myfield1 and myfield2

---------------------------------------------------------------------------------
1       Edit COCOON.XCONF as follows

<jdbc name="mydatabase" logger="core.datasources.basedata">
<pool-controller min="5" max="10"/>
<auto-commit>false</auto-commit>
<dburl>jdbc:mysql://localhost:3306/mydatabase</dburl>
<user>root</user>
<password/>
</jdbc>

---------------------------------------------------------------------------------
2       Create an XSP page such as below [mydatabasequery.xsp]

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
  xmlns:xsp="http://apache.org/xsp"; xmlns:esql="http://apache.org/cocoon/SQL/v2";
  xmlns:xsp-session="http://apache.org/xsp/session/2.0"; 
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>

<page><title>mydatabasequery</title>
<content>
<esql:connection>
<esql:pool>mydatabase</esql:pool>
<esql:execute-query><esql:query>select * from mytable</esql:query><esql:results>
        <esql:row-results>
        <field1><esql:get-string column="myfield1"/><field1>
        <field2><esql:get-string column="myfield2"/><field2>
        </esql:row-results>
</esql:results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xsp:page>

---------------------------------------------------------------------------------
3       Call from the sitemap and pass results to an FO stylesheet

<map:match pattern="mydatabasequery">
        <map:generate type="serverpages" src="mydatabasequery.xsp"/>
        <map:transform src="simple-page2fo.xsl"/>
        <map:serialize type="fo2pdf"/>
</map:match>





_____________________________________________
Kieran Kirwan
Executive Transportation Planner
Transportation Modelling Department
 
Dublin Transportation Office
Hainault House,
69/71 St. Stephen's Green,
Dublin 2,
Ireland.
Tel: +353 (0)1 4778113
Fax: +353 (0) 1 478 5935
website: www.dto.ie <http://www.dto.ie/>  
 



-----Original Message-----
From: Leonard Sitongia [mailto:[EMAIL PROTECTED]
Sent: 27 November 2003 16:54
To: [EMAIL PROTECTED]
Subject: Advice using Cocoon for my application?


Hi,

I'm thinking of using Cocoon for a simple database-driven address book 
application where the critical part is being able to print address labels for 
envelopes.  I'm wondering if XSL:FO would be reasonable to use to produce the 
pages of labels to send to the printer.

I appreciate your advice and the benefits of your experience.  Thank you.

-- 
==Leonard E. Sitongia           
  Visualization and Enabling Technologies / Scientific Computing Division
  National Center for Atmospheric Research
  P.O. Box 3000 Boulder CO 80307  USA
  [EMAIL PROTECTED]    voice: (303)497-2454   fax: (303)497-1239


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
Mail Marshal for the presence of computer viruses.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to