From bedc5b49ce96c0f113bad29296c0b9dc5c9a1bc4 Mon Sep 17 00:00:00 2001 From: Maxime Sinclair Date: Wed, 14 Aug 2013 09:44:19 +0200 Subject: [PATCH] [FEATURE] Design evolution of the map service Map implementation is still an empty stub --- .../plantuml/servlet/DiagramResponse.java | 31 ++++++++++++++----- .../plantuml/servlet/MapServlet.java | 31 ++++++++++++++++--- .../plantuml/servlet/UmlDiagramService.java | 3 +- .../sourceforge/plantuml/servlet/package.html | 2 +- 4 files changed, 53 insertions(+), 14 deletions(-) diff --git a/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java b/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java index ef0a0c0..a0e02a0 100644 --- a/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java +++ b/src/main/java/net/sourceforge/plantuml/servlet/DiagramResponse.java @@ -57,21 +57,36 @@ class DiagramResponse { } void sendDiagram(String uml) throws IOException { - long today = System.currentTimeMillis(); if (StringUtils.isDiagramCacheable(uml)) { - // Add http headers to force the browser to cache the image - response.addDateHeader("Expires", today + 31536000000L); - // today + 1 year - response.addDateHeader("Last-Modified", 1261440000000L); - // 2009 dec 22 constant date in the past - response.addHeader("Cache-Control", "public"); + addHeaderForCache(); } response.setContentType(getContentType()); SourceStringReader reader = new SourceStringReader(uml); reader.generateImage(response.getOutputStream(), new FileFormatOption(format)); response.flushBuffer(); } - + + void sendMap(String uml) throws IOException { + /* SourceStringReader reader = new SourceStringReader(uml); + String map = reader.generateImage(response.getOutputStream(), new FileFormatOption(FileFormat.PNG)); + response.flushBuffer(); + System.out.println( "map !!!" + map + "!!!"); + String[] mapLines = map.split("[\\r\\n]"); + for (int i=2; (i+1)
Structure of the service part of the PlantUmlServer:
- +

\ No newline at end of file