| author | ning.zhang | 2012-05-11 04:43:49 (EDT) |
|---|---|---|
| committer | dgao | 2012-05-11 04:43:49 (EDT) |
| commit | 65cf69ec4c30e3cdb93b72eae71cbb688e83548a (patch) (side-by-side diff) | |
| tree | 18f47ecbf50fcc31f5c32403ed2c893dea7e4ece | |
| parent | 61916076fecf00d1341c0deef3a1183d56881bd0 (diff) | |
| download | org.eclipse.birt-65cf69ec4c30e3cdb93b72eae71cbb688e83548a.zip org.eclipse.birt-65cf69ec4c30e3cdb93b72eae71cbb688e83548a.tar.gz org.eclipse.birt-65cf69ec4c30e3cdb93b72eae71cbb688e83548a.tar.bz2 | |
Set the response header "Content-Disposition: Attachment" for doc and docx files. Other types such as PPT/PPTX and Open Document formats are treated as well.
| -rw-r--r-- | viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java b/viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java index ca0d555..a20cb17 100644 --- a/viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java +++ b/viewer/org.eclipse.birt.report.viewer/src/org/eclipse/birt/report/viewer/utilities/WebViewer.java @@ -57,11 +57,25 @@ public class WebViewer public final static String PDF = "pdf"; //$NON-NLS-1$ /** - * DOC format name + * DOC/DOCX format names */ public final static String DOC = "doc"; //$NON-NLS-1$ + public final static String DOCX = "docx"; //$NON-NLS-1$ /** + * PPT/PPTX format names + */ + public final static String PPT = "ppt"; //$NON-NLS-1$ + public final static String PPTX = "pptx"; //$NON-NLS-1$ + + /** + * Open document format names + */ + public final static String ODP = "odp"; //$NON-NLS-1$ + public final static String ODS = "ods"; //$NON-NLS-1$ + public final static String ODT = "odt"; //$NON-NLS-1$ + + /** * POSTSCRIPT format name */ public final static String POSTSCRIPT = "postscript"; //$NON-NLS-1$ @@ -660,10 +674,17 @@ public class WebViewer encodedResourceFolder = ""; //$NON-NLS-1$ } - // workaround for postscript format, force "Content-Disposition" as + // workaround for postscript/doc/docx/ppt/pptx/odp/ods/odt formats, force "Content-Disposition" as // "attachment" String asattachment = null; - if ( POSTSCRIPT.equalsIgnoreCase( format ) ) + if ( POSTSCRIPT.equalsIgnoreCase( format ) + || DOC.equalsIgnoreCase( format ) + || DOCX.equalsIgnoreCase( format ) + || PPT.equalsIgnoreCase( format ) + || PPTX.equalsIgnoreCase( format ) + || ODP.equalsIgnoreCase( format ) + || ODS.equalsIgnoreCase( format ) + || ODT.equalsIgnoreCase( format )) { asattachment = "&__asattachment=true"; //$NON-NLS-1$ } |

