# HG changeset patch # User Ingo Weinzierl # Date 1267085921 0 # Node ID b21fc750275084943aa4fdb0dc155f65a5fcc1d9 # Parent a634d5ee961dcbcf38df6cecb7fa870448fec429 Fixed issue 178. Export modes CSV and ODV work again. gnv/trunk@709 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r a634d5ee961d -r b21fc7502750 gnv/ChangeLog --- a/gnv/ChangeLog Wed Feb 24 14:38:36 2010 +0000 +++ b/gnv/ChangeLog Thu Feb 25 08:18:41 2010 +0000 @@ -1,3 +1,10 @@ +2010-02-25 Ingo Weinzierl + + Issue178 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added a code + path for export actions, where no export mode is given. + 2010-02-24 Ingo Weinzierl * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added diff -r a634d5ee961d -r b21fc7502750 gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Wed Feb 24 14:38:36 2010 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Thu Feb 25 08:18:41 2010 +0000 @@ -114,6 +114,36 @@ outputStream.flush(); outputStream.close(); } + else if (exportMode == null) { + Collection inputParameter = outputMode + .getOutputParameters(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, + values); + ips.add(ip); + } + } + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + this.setHeaders(target, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput(sm.getSelectedArtifactFactory(), sm + .getCurrentArtifact(), outputStream, target, mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } else { if (outputMode == null) { log.error("Outputmode is not supported.");