Title: [waffle-scm] [647] trunk/waffle-distribution/src/site/content: Added documentation for file downloading.
Revision
647
Author
mauro
Date
2008-04-21 11:31:04 -0500 (Mon, 21 Apr 2008)

Log Message

Added documentation for file downloading.

Modified Paths


Added Paths

Diff

Added: trunk/waffle-distribution/src/site/content/file-download.html (0 => 647)

--- trunk/waffle-distribution/src/site/content/file-download.html	                        (rev 0)
+++ trunk/waffle-distribution/src/site/content/file-download.html	2008-04-21 16:31:04 UTC (rev 647)
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+  <head>
+    <title>File Download</title>
+  </head>
+  <body>
+
+  <h2>File Download</h2>
+
+  <p>
+    Waffle provides a simple and effective mechanism for downloading files, using Waffle's 
+    <a href=""  
+  </p>
+  <p>
+    As usual, an example is the best way to learn.  The key point is the controller ActionMethod must return an <code>ExportView</code>,
+    which specifies the content type, the content and the filename.  A common usecase, is to download some content as CSV.  In this case,
+    we'd have something like:
+
+  <textarea class="java:nogutter:nocontrols" name="code">
+    public class DownloadController {
+
+      @ActionMethod(asDefault=true)
+      public View download(){ 
+        byte[] content = "one,two,three".getBytes();// the byte[] content can come from any source
+        return new ExportView(this, "text/csv", content, "download.csv");
+      }
+
+    }
+  </textarea>
+    
+    It's as simple as that!
+  </p>
+  </body>
+</html>

Modified: trunk/waffle-distribution/src/site/content/file-upload.html (646 => 647)

--- trunk/waffle-distribution/src/site/content/file-upload.html	2008-04-21 16:17:51 UTC (rev 646)
+++ trunk/waffle-distribution/src/site/content/file-upload.html	2008-04-21 16:31:04 UTC (rev 647)
@@ -14,7 +14,7 @@
     Waffle provides a <a href="" implementation</a>.        
   </p>
   <p>
-    Let's walk through an example.  The controller would simply decare the dependency:
+    Let's walk through an example.  The controller would simply declare the dependency:
 
   <textarea class="java:nogutter:nocontrols" name="code">
     public class UploadController {

Modified: trunk/waffle-distribution/src/site/content/sitemap.xml (646 => 647)

--- trunk/waffle-distribution/src/site/content/sitemap.xml	2008-04-21 16:17:51 UTC (rev 646)
+++ trunk/waffle-distribution/src/site/content/sitemap.xml	2008-04-21 16:31:04 UTC (rev 647)
@@ -21,6 +21,7 @@
     <page>validation.html</page>
     <page>lifecycle.html</page>
     <page>monitors.html</page>
+    <page>file-download.html</page>
     <page>file-upload.html</page>
     <page>webxml.html</page>
     <page>webapp-structure.html</page>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to