We wrote one for Tapestry 3.  We wrote a service and then in our HTML we have 
an IFrame.

    <span jwcid="@Conditional" condition="ognl:page.visit.hasBlobUrl">
            <iframe jwcid="@Any" src="ognl:page.visit.blobUrl" width="0" 
height="0" frameborder="0"/>
    </span>


The code sets up the "blob".  Which when the HTML is displayed automatically 
creates the download.
        /*  one example download */
        DownloadService ds = (DownloadService) 
parent.getCycle().getEngine().getService(DownloadService.SERVICE_NAME);
        ILink blobLink = ds.registerBlob(parent.getCycle(), null, b);
        
        // Save the download link to the visit object so that the next redraw 
of the
        // frame will include an iframe to kick off the download
        parent.getSystemVisit().setBlobUrl(blobLink.getAbsoluteURL());        


        /*  Another example automatic download */
        // Grab our download service and register the generated metadata with it
        DownloadService ds = 
(DownloadService)getCycle().getEngine().getService(DownloadService.SERVICE_NAME);
        ILink blobLink = ds.registerBlob(getCycle(), null, b);

        // Save the download link to the visit object so that the next redraw 
of the
        // frame will include an iframe to kick off the download
        getSystemVisit().setBlobUrl(blobLink.getAbsoluteURL());


We haven't converted it to Tap4 yet.

regards,

Mark

-----Original Message-----
From: Schulte Marcus [mailto:[EMAIL PROTECTED]
Sent: Wed 1/25/2006 6:11 AM
To: 'Tapestry users'
Subject: RE: Wiring up an Export service
 
Your listener could return an ILink which would be a service-link created 
by your service's getLink() method which contains all necessary parameters.

Or you could display a result-page with an appropriate download link to you
service (ServiceLink component)

> -----Original Message-----
> From: Steve Wells [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 25, 2006 10:04 AM
> To: [email protected]
> Subject: Wiring up an Export service
> 
> 
> Like many folks I have a requirement to stream out reports 
> (or whatever)
> in various formats eg pdf, xls 
> 
> Following some threads here I've started writing a Service to handle
> this but am having trouble wiring it into my pages (some basic Tap
> knowledge is eluding me here)
> 
> The basic flow is:
> ReportCriteria page to collect parameters eg. date range, 
> export format
> Form submit listener calls ReportResult page to get the 
> report data and
> spit out to user in selected format...
>   ...OR should the listener call the service, if so how? 
> 
> Any more detailed code examples or tips would be fantastic.  I'm
> starting to feel a bit dumb right now as I can't see how a 
> page talks to
> a service.
> 
> Thanks...
> -- 
>   Steve Wells
>   [EMAIL PROTECTED]
> 
> -- 
> http://www.fastmail.fm - Or how I learned to stop worrying and
>                           love email again
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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


Reply via email to