[seam-commits] Seam SVN: r9130 - in trunk: src/excel/org/jboss/seam/excel/ui and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Sep 24 01:39:20 EDT 2008


Author: nickarls
Date: 2008-09-24 01:39:19 -0400 (Wed, 24 Sep 2008)
New Revision: 9130

Modified:
   trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
   trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java
Log:
Support for setting filename for workbook

Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml	2008-09-23 21:12:52 UTC (rev 9129)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml	2008-09-24 05:39:19 UTC (rev 9130)
@@ -332,6 +332,14 @@
                               is a boolean.
                            </para>
                         </listitem>
+                        <listitem>
+                           <para>
+                              <literal>filename</literal>
+                              &#8212;The filename to use for the download. The value
+                              is a string. Please not that if you map the DocumentServlet
+                              to some pattern, this file extension must also match.
+                           </para>
+                        </listitem>
                      </itemizedlist>
                      <para>
                         <emphasis>Child elemenents</emphasis>

Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java	2008-09-23 21:12:52 UTC (rev 9129)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java	2008-09-24 05:39:19 UTC (rev 9130)
@@ -51,7 +51,18 @@
    private Boolean useTemporaryFileDuringWrite;
    private Boolean workbookProtected;
    private String exportKey;
+   private String filename;
 
+   public String getFilename()
+   {
+      return (String) valueOf("filename", filename);
+   }
+
+   public void setFilename(String filename)
+   {
+      this.filename = filename;
+   }
+
    public String getExportKey()
    {
       return (String) valueOf("exportKey", exportKey);
@@ -317,6 +328,7 @@
       String baseName = baseNameForViewId(viewId);
 
       DocumentData documentData = new DocumentData(baseName, type, bytes);
+      documentData.setFilename(getFilename());
 
       if (getExportKey() != null) {
          Contexts.getEventContext().set(getExportKey(), documentData);




More information about the seam-commits mailing list