Fix PNG exporter.

This commit is contained in:
Paulo Gustavo Veiga 2012-02-21 18:47:43 -03:00
parent 1256d0e218
commit 7e59b19fc0
2 changed files with 4 additions and 8 deletions

View File

@ -213,14 +213,10 @@ public class ExporterFactory {
int index = imgUrl.lastIndexOf("/"); int index = imgUrl.lastIndexOf("/");
elem.removeAttribute("href"); elem.removeAttribute("href");
if (index != -1) { 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. :) // Hack for backward compatibility . This can be removed in 2012. :)
String imgPath; String imgPath;
if (imgUrl.contains("images")) { imgPath = imgBaseUrl + "/" + imgUrl;
imgPath = imgBaseUrl + "/../icons/legacy/" + iconName;
} else {
imgPath = imgBaseUrl + "/" + imgUrl;
}
elem.setAttribute("xlink:href", imgPath); elem.setAttribute("xlink:href", imgPath);
elem.appendChild(document.createTextNode(" ")); elem.appendChild(document.createTextNode(" "));
} }

View File

@ -58,7 +58,7 @@ public class TransformView extends AbstractView {
response.setContentType(contentType); response.setContentType(contentType);
// Set file name... // 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); response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
// Write content ... // Write content ...
@ -79,7 +79,7 @@ public class TransformView extends AbstractView {
baseUrl = "http://www.wisemapping.com/images"; baseUrl = "http://www.wisemapping.com/images";
} else { } else {
final ServletContext servletContext = this.getServletContext(); final ServletContext servletContext = this.getServletContext();
baseUrl = "file://" + servletContext.getRealPath("/icons/") + "/"; baseUrl = "file://" + servletContext.getRealPath("/");
} }
properties.setBaseImagePath(baseUrl); properties.setBaseImagePath(baseUrl);
} }