cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corda, Ugo" <Ugo.Co...@usa.xerox.com>
Subject RE: XML printing in Cocoon
Date Thu, 16 Mar 2000 04:52:16 GMT
		>Anyway, the real problem is that you want the output based
on properties
		>other than the requestor's.

Yes, that's the important part. In particular, Cocoon should be able to use
information about the printer (specified in the client request) in order to
select: 

-	the appropriate stylesheet 
-	the appropriate formatter: typically FOP, but within FOP I might
also want to choose either direct PDF generation or Java Printing (via
AWT/Java2D FOP viewer), depending on the capability of the target printer
(e.g. a PDF printer vs. a Postscript printer vs. some other strange type of
printer for which a printer driver exists for Java Print to use)

Would the sitemap mechanism be able to support the specification of all
these choices? (Of course I don't expect the sitemap mechanism to know
anything about printing devices. That is up to whoever writes the sitemap
itself).

Also, what would be the best way for the client to specify the additional
request information (i.e. some type of printer identifier in addition to the
XML document URL) so that it falls nicely within the Apache/Cocoon way of
acquiring information from the client through an HTTP request?

		>Now, instead of using the HTTPServlet flavor of Cocoon, I
think it's
		>more reasonable to use the MailServlet flavor. So, you send
a mail to
		>"laser-printer@apache.org" with the FO attatched and Cocoon
will handle
		>it by printing the generated PDF.

This part is not clear to me (and anyway I am not familiar with the
MailServlet flavor to start with -- where can I get more information?). I
only want to point out that the original request should not have to specify
the stylesheet/FO for Cocoon to use. That selection should happen
automatically inside Cocoon based on the printer info specified in the
request and the sitemap matching mechanism.

Ugo

		-----Original Message-----
		From:	Stefano Mazzocchi [mailto:stefano@apache.org]
		Sent:	March 15, 2000 3:15 AM
		To:	cocoon-dev@xml.apache.org
		Subject:	Re: XML printing in Cocoon

		"Corda, Ugo" wrote:
		> 
		> I have been thinking about a scenario where a browser asks
Cocoon to publish
		> an XML document on a specified printer. In other words,
instead of getting
		> the document returned to my browser, I want the document
to be directly
		> printed on a printer I specify. The stylesheet to
associate with the XML
		> document should be chosen by Cocoon based on the specified
printer, instead
		> of on the browser that issues the request.
		> 
		> Let me give an example of what I am talking about. I ask
Cocoon (using some
		> appropriate HTTP request) to print the document mydoc.xml
on the network
		> printer at http://myserver/myprinter. Cocoon selects an
appropriate FO-based
		> stylesheet using a predefined association between the type
of printing
		> device specified and a list of stylesheets. Cocoon also
selects the
		> appropriate formatter (e.g. a PDF formatter or a PS
formatter) based on the
		> type of printing device specified. After these
transformations take place,
		> Cocoon sends the output file (PDF or PS) to the specified
printer.
		> 
		> I would like to understand whether:
		> 
		> 1)      this can already be done in Cocoon, or is planned
to be supported in
		> Cocoon 2
		> 2)      this could be done via a fairly simple
modification of the Cocoon
		> engine
		> 3)      this would require a substantial rework of the
Cocoon engine.

		Hmmm, good question.

		As Donald wisely says, the "printing" is not the real
effect, but a side
		effect of your request. This because you _must_ return
something to the
		client when using HTTP.

		Now, instead of using the HTTPServlet flavor of Cocoon, I
think it's
		more reasonable to use the MailServlet flavor. So, you send
a mail to
		"laser-printer@apache.org" with the FO attatched and Cocoon
will handle
		it by printing the generated PDF.

		Anyway, the real problem is that you want the output based
on properties
		other than the requestor's.

		Then, the answer is 1): Cocoon2 already addresses this with
the sitemap.

		-- 
		Stefano Mazzocchi      One must still have chaos in oneself
to be
		                          able to give birth to a dancing
star.
		<stefano@apache.org>                             Friedrich
Nietzsche
	
--------------------------------------------------------------------
		 Come to the first official Apache Software Foundation
Conference!  
		------------------------- http://ApacheCon.Com
---------------------
		

Mime
View raw message