fixing print and export

This commit is contained in:
Pablo Luna 2011-04-06 20:36:57 +01:00
parent 1a69d0b3c3
commit 5318e29df5
3 changed files with 9 additions and 8 deletions

View File

@ -150,6 +150,7 @@ public class ExportController extends BaseMultiActionController {
exportImage(response, mapSvg, bos, false); exportImage(response, mapSvg, bos, false);
} catch (Throwable e) { } catch (Throwable e) {
logger.error("Unexpexted error generating the image", e); logger.error("Unexpexted error generating the image", e);
logger.error("map: "+mapSvg);
} }
BASE64Encoder encoder = new BASE64Encoder(); BASE64Encoder encoder = new BASE64Encoder();
@ -164,11 +165,11 @@ public class ExportController extends BaseMultiActionController {
} }
public ModelAndView image(HttpServletRequest request, HttpServletResponse response) throws TranscoderException, IOException, JAXBException { public ModelAndView image(HttpServletRequest request, HttpServletResponse response) throws TranscoderException, IOException, JAXBException {
try {
logger.info("Export Controller: generating image WiseMap action"); logger.info("Export Controller: generating image WiseMap action");
final String mapIdStr = request.getParameter(MAP_ID_PARAMETER); final String mapIdStr = request.getParameter(MAP_ID_PARAMETER);
final String mapSvg = request.getParameter(MAP_SVG_PARAMETER); final String mapSvg = request.getParameter(MAP_SVG_PARAMETER);
try {
final ServletOutputStream outputStream = response.getOutputStream(); final ServletOutputStream outputStream = response.getOutputStream();
exportImage(response, mapSvg, outputStream, true); exportImage(response, mapSvg, outputStream, true);
@ -176,6 +177,7 @@ public class ExportController extends BaseMultiActionController {
} catch (Throwable e) { } catch (Throwable e) {
logger.error("Unexpexted error generating the image", e); logger.error("Unexpexted error generating the image", e);
logger.error("map: "+mapSvg);
} }
return null; return null;
} }

View File

@ -286,8 +286,7 @@ public class ExporterFactory {
// Add namespace... // Add namespace...
result = result.replaceFirst("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" "); result = result.replaceFirst("<svg ", "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ");
result = result.replaceAll("<image([^>]+)>", "<image$1/>"); result = result.replaceAll("/<image([^>]+)//?>/", "<image$1></image>");
result = result.replaceAll("<image([^>]+)//+>", "<image$1></image>");
return result.toCharArray(); return result.toCharArray();
} }

View File

@ -220,9 +220,9 @@
rel="moodalbox 600px 400px" title="<spring:message code="EXPORT_DETAILS"/>"> rel="moodalbox 600px 400px" title="<spring:message code="EXPORT_DETAILS"/>">
<spring:message code="EXPORT"/> <spring:message code="EXPORT"/>
</a>--%> </a>--%>
<a href="javascript:printMap(${mindmap.id});"> <%--<a href="javascript:printMap(${mindmap.id});">
<spring:message code="PRINT"/> <spring:message code="PRINT"/>
</a> </a>--%>
</div> </div>
</div> </div>
</td> </td>