New PlantUML.jar

Display Version in the header
Add links "View as SVG", "View as ASCII Art"
This commit is contained in:
Arnaud Roques
2011-04-21 19:52:50 +02:00
parent e71536f634
commit 85afd8196e
3 changed files with 8 additions and 5 deletions

Binary file not shown.

View File

@@ -1,4 +1,5 @@
<div id="footer"> <div id="footer">
<p>PlantUML Server @timestamp@ <p>PlantUML Server @timestamp@ / version <%= net.sourceforge.plantuml.version.Version.version() %>
</p> </p>
</div> </div>

View File

@@ -6,11 +6,15 @@ String host = "http://" + request.getServerName() + ":" + request.getServerPort(
String encoded = ""; String encoded = "";
String umltext = ""; String umltext = "";
String imgurl = ""; String imgurl = "";
String svgurl = "";
String txturl = "";
Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded"); Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded");
if (encodedAttribute != null) { if (encodedAttribute != null) {
encoded = encodedAttribute.toString(); encoded = encodedAttribute.toString();
if (!encoded.isEmpty()) { if (!encoded.isEmpty()) {
imgurl = host + contextRoot + "/img/" + encoded; imgurl = host + contextRoot + "/img/" + encoded;
svgurl = host + contextRoot + "/svg/" + encoded;
txturl = host + contextRoot + "/txt/" + encoded;
} }
} }
Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded"); Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded");
@@ -57,10 +61,8 @@ if (decodedAttribute != null) {
</form> </form>
<% if ( !imgurl.isEmpty()) { %> <% if ( !imgurl.isEmpty()) { %>
<hr/> <hr/>
<p>You can use the following URL: <a href="<%=svgurl%>"/>View as SVG</a>&nbsp;
<br/> <a href="<%=txturl%>"/>View as ASCII Art</a>
<a href="<%=imgurl %>"><code>&lt;img src="<%=imgurl %>" /&gt;</code></a>
</p>
<p id="diagram"> <p id="diagram">
<img src="<%=imgurl %>" alt="PlantUML diagram"/> <img src="<%=imgurl %>" alt="PlantUML diagram"/>
</p> </p>