The templating and component systems within Tapestry are geared towards XML/HTML/XHTML production ... in fact, pretty heavily towards HTML/XHTML. However, it's possible to leverage the machinery to seemlessly integrate some of these other use cases, where XML or HTML isn't the right thing.
If you look at the Workbench on the Chart page, you see a Tapestry component that generates a Chart. How is this accomplished? When the page containing the chart renders, it includes a URL for the chart. The URL is created by a Tapestry engine service. Services are the way that Tapestry bridges between the world of Servlets and URLs and the world of Tapestry pages and components. Tapestry defines several services: direct, page. action, asset, home, external, reset and restart. The Workbench adds a new service, chart. Implementing a service is somewhat like implement a Servlet, except you have to implement two methods: One method is for constructing URLs, the other is more traditional, for handling requests triggered by those very same URLs. In the chart service's case, it generates URLs that encode encough information that it can produce the chart as a jpeg stream when triggered. Somehow, I came up with the name "Gesture" for the class that combines the URL with any query parameters. I may change that soon, the name really doesn't make any sense. The URL actually encodes the identify of a component that will ultimately create the chart (just as the page service encodes the name of the page that will render the response). The chart service then simply streams the chart jpeg back to the client. What's extra neat is that there's an implementation of IAsset for charts; the end result is that the asset can be used with an existing Image component. It's just a Tapestry thing ... IAsset implementations (which are normally images from the classpath or the Servlet context) know how to localize themselves and/or generate a URL to represent themselves. Of course, what they really do is find the right service and have it generate the URL. Again, take a peek at the code. It'll show you how to encode infromation into a URL, how to decode that information and how to use it to do the right thing for your use case. ----- Original Message ----- From: "Juan Alvarez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 13, 2002 2:55 PM Subject: Re: [Tapestry-developer] PDF or XLS generation > I dont know what happen? my english isnt clear? =) > > Or maybe I one of the guys that dont read the documentation? > > Is tapestry only for hackers? or for users too? > > On Thu, Dec 12, 2002 at 05:05:19PM -0500, Juan Alvarez wrote: > > I need, some of my users click on the submit on a form and then go to > > some dynamic generated PDF (jasperreports). I read some previous post > > about the inheritance over the ResponseOutputStream, but not anything > > clear. > > > > Some howard response to this thread, say the need to construct > > something similar to the ChartService in the workbench tutorial. > > > > If i want to do some dynamic XLS, i need to make a XLSService? > > > > TIA > > > > -- > > Juan Alvarez Fluidsignal Group S.A. > > mailto:[EMAIL PROTECTED] http://www.fluidsignal.com/ > > Key fingerprint: 15C4 0986 A174 862A B607 8EEA 934F 8649 07E2 EA40 > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: > > With Great Power, Comes Great Responsibility > > Learn to use your power at OSDN's High Performance Computing Channel > > http://hpc.devchannel.org/ > > _______________________________________________ > > Tapestry-developer mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/tapestry-developer > > -- > Juan Alvarez Fluidsignal Group S.A. > mailto:[EMAIL PROTECTED] http://www.fluidsignal.com/ > Key fingerprint: 15C4 0986 A174 862A B607 8EEA 934F 8649 07E2 EA40 > > > ------------------------------------------------------- > This sf.net email is sponsored by: > With Great Power, Comes Great Responsibility > Learn to use your power at OSDN's High Performance Computing Channel > http://hpc.devchannel.org/ > _______________________________________________ > Tapestry-developer mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/tapestry-developer > ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ Tapestry-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/tapestry-developer
