cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cocoon.er...@besonet.ch
Subject Re: How to set filename of csv file
Date Wed, 01 Apr 2009 08:01:17 GMT
  BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }Hi
Thomas, 
 this works fine, 
 Tank you.
 Mike
 On Wed 01/04/09 08:57 , Thomas Markus t.markus@proventis.net sent:
 Hi,
 sure you can. Set a special http-header. fi:
 Content-Disposition: attachment; filename=MyFileName.csv
 use attachment to force 'save as...' dialog or inline for default 
 browser integration. filename has a special encoding. see 
 http://www.ietf.org/rfc/rfc2231.txt and
http://www.ietf.org/rfc/rfc2184.txt [1]
 regards
 thomas
 cocoon.erard@besonet.ch [2] schrieb:
 > Hello,
 >
 > in my application if a page, where a search can be performed and
the 
 > result is shown on the same page in form of a list.
 >
 > On the page, the user has a button (action widget) that returns
him 
 > the search result as a csv file. That's not a problem, this works.
The 
 > problem I have is the filename. The file is named as the current
page 
 > is. Somesing crypted with continuation id and .continue at die
end. 
 > Can I set the name of the file, the csv is serialized to the user?
 >
 > Here my current code:
 >
 > flowscript:
 >
 > list() {
 >
 >       //some code
 >
 >     
 >       var form = new Form("pages/form/list_model.xml");
 >       form.createBinding("pages/form/list_binding.xml");
 >
 >       while(true) {
 >             form.load(to);
 >             form.showForm("list.form", {
 >                   itemList:itemList
 >             });
 >             form.save(to);
 >            
 >             var action = form.submitId;
 >             if ("search".equals(action)) {
 >                   itemList = 
 > BridgeFactory.getInstance().getDummyBridge().search(context, to);
 >             } else if ("resetButton".equals(action)) {
 >                   to = new SearchTO();
 >                   itemList = null;
 >             } else if ("csv".equals(action)) {
 >                   cocoon.sendPage("list.csv",
{itemList:itemList});
 >                   break;
 >             }
 >       }
 > }
 >
 > sitemap:
 >
 > 
 > src="org.apache.cocoon.serialization.TextSerializer">
 >     ISO-8859-1
 >     yes
 > 
 >
 >
 > 
 >    
 >    
 >    
 >    
 >       
 >    
 >    
 > 
 >
 > Thanks,
 >
 > Mike
 -- 
 Thomas Markus
 ====================================================
 proventis GmbH | Zimmerstr. 79-81 | D-10117 Berlin |
 Tel +49 (0)30 2936399-22 | Fax -50 | t.markus@proventis.net [3]
 -----------------------------------------------------------------
 Geschäftsführer: Norman Frischmuth | Sitz: Berlin
 Handelsregister: AG Berlin-Charlottenburg, HR 82917
 -----------------------------------------------------------------
 Blue Ant-webbasiertes Projektmanagement - aktuelle Termine 2008:
 http://www.proventis.net/website/live/blueant/veranstaltungen.html
 ====================================================

---------------------------------------------------------------------
 To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org [4]
 For additional commands, e-mail: users-help@cocoon.apache.org [5]
 

Links:
------
[1] http://www.ietf.org/rfc/rfc2184.txt
[2] mailto:cocoon.erard@besonet.ch
[3] mailto:t.markus@proventis.net
[4] mailto:users-unsubscribe@cocoon.apache.org
[5] mailto:users-help@cocoon.apache.org

Mime
View raw message