cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pierpaolo Fumagalli <>
Subject Printing [Was: Re: Project Coordination]
Date Sat, 08 Apr 2000 00:56:04 GMT
Stefano Mazzocchi wrote:
> "Corda, Ugo" wrote:
> >
> > I would like to make sure that Cocoon 2 will include support for XML
> > printing (as I discussed last month on this list).
> >
> > Just to summarize, here is what I was asking. I would like to be able to ask
> > Cocoon that a particular XML document be rendered to a printer, as opposed
> > to the browser client. This could be achieved by appropriate use of the
> > sitemap mechanism to specify the request, and by taking advantage of FOP's
> > capability to render to a printer the formatted areas derived from the
> > XSL-FO tree.
> >
> > Maybe this capability is already implied by one of the items in the list
> > below. I just wanted to mention it explicitly so that it doesn't get lost in
> > the end.
> Great, I like that feature... now I need you to make a solid proposal
> that we can discuss on.
> Something like "add this method to this interface" or such.

I was thinking about that... And I believe that no architectural changes
are nedeed... Just let's consider to have a filter, in the pipeline,
wich is configured to basically "nest" as serializer...

Let's have this example:

<process uri="test" source="test.xml">
  <generator name="file"/>
  <filter name="xslt">
    <parameter name="stylesheet" value="test2fo.xsl" />
  <filter name="print">
    <parameter name="printer" value="" />
    <parameter name="serializer" value="fop" />
  <filter name="xslt">
    <parameter name="stylesheet" value="print2html.xsl" />
  <serializer name="html">

What happens here?

1) the client requests ""
2) the file generator parses the "test.xml" file
3) the xml data gets translated into FO using XSLT and the 

4) the printer filter gets the "fop" serializer thru the component
   manager. it opens a network connection to the printer (port
   8100 is HP JetDirect's RAW DATA port, I can send Postscript there).
   The printer filter streams the XML data using the configured "fop"
   serializer to the printer (so it sends a PDF...) and sends in the
   pipeline, to the next component configured in the sitemap something

   <printer name="">
     <job number="100" size="100000"/>
     .... blablabla queue status, balbalba...

5) we get the printer queue data, whatever the filter generates and
   we translate it into nice HTML with the given "print2html.xsl"
6) we serialize that document to the client (HTTP)...

Using such a mechanism, we can, for example, send faxes, send print
jobs, send emails, and have the status of that operation sent back to
the client...
It's kinda stretching the "filter" idea, but I believe we can do it...
Comments :????? :)

	Pier (going home...)

pier: stable structure erected over water to allow docking of seacraft
<>      <>

View raw message