# HG changeset patch # User Jaroslav Tulach # Date 1252992737 -7200 # Node ID a3be2be0112fea944ca1604482bb04067dd592e2 # Parent 96f80f14cfcdf1e0e41c0128b83c196d7311be1d Adding identification of version diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Tue Sep 15 07:32:17 2009 +0200 @@ -35,11 +35,14 @@ import com.sun.jersey.api.view.Viewable; import com.sun.net.httpserver.HttpServer; import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.net.URI; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.MissingResourceException; +import java.util.Properties; import java.util.ResourceBundle; import java.util.concurrent.Callable; import javax.ws.rs.DefaultValue; @@ -63,6 +66,19 @@ */ @Path("/") public final class UI { + private static final String version; + static { + Properties p = new Properties(); + try { + InputStream is = FreemarkerProcessor.class.getResourceAsStream("/META-INF/maven/org.apidesign/freemarkerdor/pom.properties"); // NOI18N + if (is != null) { + p.load(is); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + version = p.getProperty("version", "unknown"); // NOI18N + } private static WebResource base; @Context @@ -274,6 +290,7 @@ map.put("user", user); map.put("bundle", rb); map.put("now", System.currentTimeMillis()); + map.put("version", version); for (int i = 0; i < more.length; i += 2) { map.put((String)more[i],more[i + 1]); } diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Tue Sep 15 07:32:17 2009 +0200 @@ -1,5 +1,5 @@ TITLE=Quoridor Community Server - +copyright=Quoridor Community Server, Version {0}, (c) Jaroslav Tulach 2009 gameWhiteBlack={0} vs. {1} LastMove=Last move {1,choice,\ diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Tue Sep 15 07:32:17 2009 +0200 @@ -1,4 +1,5 @@ TITLE=Komunitn\u00ED server Quoridor +copyright=Komunitn\u00ED server Quoridor, Verze {0}, napsal Jaroslav Tulach roku 2009 gameWhiteBlack={0} proti {1} GAME_MOVE=Na tahu GAME_WAIT=\u010Cek\u00E1 se na tah diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.fmt Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.fmt Tue Sep 15 07:32:17 2009 +0200 @@ -109,5 +109,7 @@ +
+ ${bundle("copyright", version)} \ No newline at end of file diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Tue Sep 15 07:32:17 2009 +0200 @@ -100,5 +100,7 @@ +
+ ${bundle("copyright", version)} \ No newline at end of file diff -r 96f80f14cfcd -r a3be2be0112f freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login.fmt Mon Sep 14 19:00:55 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login.fmt Tue Sep 15 07:32:17 2009 +0200 @@ -21,5 +21,7 @@ +
+ ${bundle("copyright", version)} \ No newline at end of file