Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ExportPanel.java @ 4912:94b95e002fb9
Added filename to export url.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Wed, 30 Jan 2013 15:14:32 +0100 |
parents | b67af5b44d68 |
children | 2c31625d4e6a |
comparison
equal
deleted
inserted
replaced
4911:da89bb3243d3 | 4912:94b95e002fb9 |
---|---|
69 | 69 |
70 for (Facet facet: facets) { | 70 for (Facet facet: facets) { |
71 if (name.equals("fix_wq_curve_at_export")) { | 71 if (name.equals("fix_wq_curve_at_export")) { |
72 continue; | 72 continue; |
73 } | 73 } |
74 layout.addMember(createExportButton(name, facet.getName())); | 74 String filename = name; |
75 if (name.equals("computed_dischargecurve_at_export")) { | |
76 filename = "dischargecurve"; | |
77 } | |
78 layout.addMember(createExportButton( | |
79 name, | |
80 facet.getName(), | |
81 filename)); | |
75 } | 82 } |
76 } | 83 } |
77 | 84 |
78 return layout; | 85 return layout; |
79 } | 86 } |
86 * @param name The name of the export. | 93 * @param name The name of the export. |
87 * @param facet The name of the export type (e.g. CSV, WST). | 94 * @param facet The name of the export type (e.g. CSV, WST). |
88 * | 95 * |
89 * @return an image with click handler. | 96 * @return an image with click handler. |
90 */ | 97 */ |
91 protected Canvas createExportButton(String name, String facet) { | 98 protected Canvas createExportButton( |
92 String url = getExportUrl(name, facet); | 99 String name, |
100 String facet, | |
101 String filename | |
102 ) { | |
103 String url = getExportUrl(name, facet, filename); | |
93 String iUrl = GWT.getHostPageBaseURL() + MSG.imageSave(); | 104 String iUrl = GWT.getHostPageBaseURL() + MSG.imageSave(); |
94 | 105 |
95 ImgLink link = new ImgLink(iUrl, url, 30, 30); | 106 ImgLink link = new ImgLink(iUrl, url, 30, 30); |
96 link.setTooltip(getTooltipText(name, facet)); | 107 link.setTooltip(getTooltipText(name, facet)); |
97 | 108 |
105 * @param name The name of the export. | 116 * @param name The name of the export. |
106 * @param facet The name of the export type (e.g. CSV, WST). | 117 * @param facet The name of the export type (e.g. CSV, WST). |
107 * | 118 * |
108 * @return the export URL. | 119 * @return the export URL. |
109 */ | 120 */ |
110 protected String getExportUrl(String name, String facet) { | 121 protected String getExportUrl(String name, String facet, String filename) { |
111 Config config = Config.getInstance(); | 122 Config config = Config.getInstance(); |
112 | 123 |
113 String url = GWT.getModuleBaseURL(); | 124 String url = GWT.getModuleBaseURL(); |
114 url += "export"; | 125 url += "export"; |
115 url += "?uuid=" + c.identifier(); | 126 url += "?uuid=" + c.identifier(); |
127 url += "&name=" + filename; | |
116 url += "&mode=" + name; | 128 url += "&mode=" + name; |
117 url += "&type=" + facet; | 129 url += "&type=" + facet; |
118 url += "&server=" + config.getServerUrl(); | 130 url += "&server=" + config.getServerUrl(); |
119 url += "&locale=" + config.getLocale(); | 131 url += "&locale=" + config.getLocale(); |
120 | 132 |