Re: Best to strategy to have a Wicket page returns a binary content by default
You don't have to do this from the pages. You can create your own simple IRequestTargetUrlCodingStrategy that resolves to your request target and mount the strategy. -Matej On Tue, Sep 23, 2008 at 12:45 PM, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Guys, I'm using Wicket to create pdf content using Apache FOP. The idea is to have a FopPage that extends the root wicket Page component and declares fo as marketType. The FopPage parses FOP markup instead HTML markup. I'm able to manage the fop to pdf binary conversion using a custom PdfRequestTarget, but it requires to specify it explicitly, invoking RequestCycle.get().setRequestTarget(new PdfRequestTarget(this)); every time. So the question: is there a way to make a custom RequestTarget the default to certain pages? Or exists a better strategy to override the default render strategy to return a content different from HTML ? Thank you, -- Paolo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best to strategy to have a Wicket page returns a binary content by default
Interesting .. so I could extend QueryStringUrlCodingStrategy overriding the decode() method to return my PdfRequestTarget. Cool! Thank you, -- Paolo On Tue, Sep 23, 2008 at 3:04 PM, Matej Knopp [EMAIL PROTECTED] wrote: You don't have to do this from the pages. You can create your own simple IRequestTargetUrlCodingStrategy that resolves to your request target and mount the strategy. -Matej On Tue, Sep 23, 2008 at 12:45 PM, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Guys, I'm using Wicket to create pdf content using Apache FOP. The idea is to have a FopPage that extends the root wicket Page component and declares fo as marketType. The FopPage parses FOP markup instead HTML markup. I'm able to manage the fop to pdf binary conversion using a custom PdfRequestTarget, but it requires to specify it explicitly, invoking RequestCycle.get().setRequestTarget(new PdfRequestTarget(this)); every time. So the question: is there a way to make a custom RequestTarget the default to certain pages? Or exists a better strategy to override the default render strategy to return a content different from HTML ? Thank you, -- Paolo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Best to strategy to have a Wicket page returns a binary content by default
Why don't you use the DownloadLink component? Just create a file in the java.tmp.dir and setDeleteAfterDownload (true); http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/link/DownloadLink.html Regards, Bruno On Sep 23, 2008 11:30am, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Interesting .. so I could extend QueryStringUrlCodingStrategy overriding the decode() method to return my PdfRequestTarget. Cool! Thank you, -- Paolo On Tue, Sep 23, 2008 at 3:04 PM, Matej Knopp wrote: You don't have to do this from the pages. You can create your own simple IRequestTargetUrlCodingStrategy that resolves to your request target and mount the strategy. -Matej On Tue, Sep 23, 2008 at 12:45 PM, Paolo Di Tommaso wrote: Guys, I'm using Wicket to create pdf content using Apache FOP. The idea is to have a FopPage that extends the root wicket Page component and declares fo as marketType. The FopPage parses FOP markup instead HTML markup. I'm able to manage the fop to pdf binary conversion using a custom PdfRequestTarget, but it requires to specify it explicitly, invoking RequestCycle.get().setRequestTarget(new PdfRequestTarget(this)); every time. So the question: is there a way to make a custom RequestTarget the default to certain pages? Or exists a better strategy to override the default render strategy to return a content different from HTML ? Thank you, -- Paolo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Best to strategy to have a Wicket page returns a binary content by default
Because, I want to use Wicket to render PDF content in a trasparent way - just extending a base page - as normally it is done for a WebPage. -- Paolo On Tue, Sep 23, 2008 at 6:08 PM, [EMAIL PROTECTED] wrote: Why don't you use the DownloadLink component? Just create a file in the java.tmp.dir and setDeleteAfterDownload (true); http://wicket.apache.org/docs/wicket-1.3.2/wicket/apidocs/org/apache/wicket/markup/html/link/DownloadLink.html Regards, Bruno On Sep 23, 2008 11:30am, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Interesting .. so I could extend QueryStringUrlCodingStrategy overriding the decode() method to return my PdfRequestTarget. Cool! Thank you, -- Paolo