From 7e59b19fc0b6171d2cd958df048aaed3590fb542 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 21 Feb 2012 18:47:43 -0300 Subject: [PATCH] Fix PNG exporter. --- .../java/com/wisemapping/exporter/ExporterFactory.java | 8 ++------ .../java/com/wisemapping/rest/view/TransformView.java | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java index 21073695..9313c633 100644 --- a/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java +++ b/wise-webapp/src/main/java/com/wisemapping/exporter/ExporterFactory.java @@ -213,14 +213,10 @@ public class ExporterFactory { int index = imgUrl.lastIndexOf("/"); elem.removeAttribute("href"); if (index != -1) { - final String iconName = imgUrl.substring(index+1); + final String iconName = imgUrl.substring(index + 1); // Hack for backward compatibility . This can be removed in 2012. :) String imgPath; - if (imgUrl.contains("images")) { - imgPath = imgBaseUrl + "/../icons/legacy/" + iconName; - } else { - imgPath = imgBaseUrl + "/" + imgUrl; - } + imgPath = imgBaseUrl + "/" + imgUrl; elem.setAttribute("xlink:href", imgPath); elem.appendChild(document.createTextNode(" ")); } diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java index 144db7e2..6b75a502 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/view/TransformView.java @@ -58,7 +58,7 @@ public class TransformView extends AbstractView { response.setContentType(contentType); // Set file name... - final String fileName = (filename != null ? filename : "map" + ".") + exportFormat.getFileExtension(); + final String fileName = (filename != null ? filename : "map") + "." + exportFormat.getFileExtension(); response.setHeader("Content-Disposition", "attachment;filename=" + fileName); // Write content ... @@ -79,7 +79,7 @@ public class TransformView extends AbstractView { baseUrl = "http://www.wisemapping.com/images"; } else { final ServletContext servletContext = this.getServletContext(); - baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/"; + baseUrl = "file://" + servletContext.getRealPath("/"); } properties.setBaseImagePath(baseUrl); }