[seam-commits] Seam SVN: r7510 - in trunk/src/pdf/org/jboss/seam/pdf: ui and 1 other directory.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Wed Mar 5 13:47:08 EST 2008
Author: norman.richards at jboss.com
Date: 2008-03-05 13:47:08 -0500 (Wed, 05 Mar 2008)
New Revision: 7510
Modified:
trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
Log:
JBSEAM-2605
Modified: trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-03-05 17:26:25 UTC (rev 7509)
+++ trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-03-05 18:47:08 UTC (rev 7510)
@@ -10,6 +10,7 @@
String baseName;
String disposition = "inline";
+ String fileName;
public DocumentData(String baseName, DocumentType documentType, byte[] data) {
super();
@@ -17,8 +18,8 @@
this.documentType = documentType;
this.baseName = baseName;
}
-
-
+
+
public byte[] getData() {
return data;
}
@@ -29,14 +30,23 @@
return baseName;
}
+
+ public void setFilename(String fileName) {
+ this.fileName = fileName;
+ }
+
public String getFileName() {
- return getBaseName() + "." + getDocumentType().getExtension();
+ if (fileName == null) {
+ return getBaseName() + "." + getDocumentType().getExtension();
+ } else {
+ return fileName;
+ }
}
-
+
public void setDisposition(String disposition) {
this.disposition = disposition;
}
-
+
public String getDisposition() {
return disposition;
}
Modified: trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java
===================================================================
--- trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-03-05 17:26:25 UTC (rev 7509)
+++ trunk/src/pdf/org/jboss/seam/pdf/ui/UIDocument.java 2008-03-05 18:47:08 UTC (rev 7510)
@@ -40,7 +40,6 @@
DocumentType documentType;
- String disposition;
String type;
String title;
String subject;
@@ -53,6 +52,9 @@
String margins;
Boolean marginMirroring;
+ String disposition;
+ String fileName;
+
boolean sendRedirect = true;
UISignature signatureField;
@@ -60,6 +62,10 @@
public void setDisposition(String disposition) {
this.disposition = disposition;
}
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
public void setType(String type) {
this.type = type;
@@ -283,6 +289,11 @@
documentData.setDisposition(dispositionValue);
}
+ String fileNameValue = (String) valueBinding(context, "fileName", fileName);
+ if (fileNameValue != null) {
+ documentData.setFilename(fileNameValue);
+ }
+
if (sendRedirect) {
DocumentStore store = DocumentStore.instance();
String id = store.newId();
More information about the seam-commits
mailing list