Add version information V01.00
authorymh <ymh.work@gmail.com>
Tue, 04 May 2010 18:01:50 +0200
changeset 16 36a9450b88ba
parent 15 4f60d2511e12
child 17 e9ee4eb533fa
Add version information
WebContent/META-INF/MANIFEST.MF
WebContent/WEB-INF/templates/index.ftl
WebContent/WEB-INF/templates/status.ftl
src/fr/iri/thd/sonyengine/Constants.java
src/fr/iri/thd/sonyengine/core/EngineAccessor.java
src/fr/iri/thd/sonyengine/web/RootResource.java
src/fr/iri/thd/sonyengine/web/StatusResource.java
--- a/WebContent/META-INF/MANIFEST.MF	Wed Apr 28 22:32:31 2010 +0200
+++ b/WebContent/META-INF/MANIFEST.MF	Tue May 04 18:01:50 2010 +0200
@@ -1,3 +1,5 @@
 Manifest-Version: 1.0
 Class-Path: 
-
+Package-Title: SonyEngine Webapp
+Package-Version: 01.00
+Package-Vendor: IRI
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WebContent/WEB-INF/templates/index.ftl	Tue May 04 18:01:50 2010 +0200
@@ -0,0 +1,10 @@
+<html>
+<head>
+  <title>IRI/Sony Engine web app</title>
+</head>
+<body>
+<h1>Welcome to the IRI/Sony Engine webapp</h1>
+<br/>
+<a href="status">Status</a>
+</body>
+</html>
\ No newline at end of file
--- a/WebContent/WEB-INF/templates/status.ftl	Wed Apr 28 22:32:31 2010 +0200
+++ b/WebContent/WEB-INF/templates/status.ftl	Tue May 04 18:01:50 2010 +0200
@@ -12,6 +12,10 @@
     </tr>
     </thead>
     <tr>
+      <td>VERSION</td>
+      <td>${version}</td>
+    </tr>
+    <tr>
       <td>DATABASE PATH</td>
       <td>${dbpath}</td>
     </tr>
@@ -20,7 +24,7 @@
       <td>${untrained_limit}</td>
     </tr>
     <tr>
-      <td>UNTRAINED COUNT</td>
+      <td>Untrained count</td>
       <td>${untrained_count}</td>
     </tr>
     <tr>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/fr/iri/thd/sonyengine/Constants.java	Tue May 04 18:01:50 2010 +0200
@@ -0,0 +1,5 @@
+package fr.iri.thd.sonyengine;
+
+public class Constants {
+	public final static String VERSION = "01.00";
+}
--- a/src/fr/iri/thd/sonyengine/core/EngineAccessor.java	Wed Apr 28 22:32:31 2010 +0200
+++ b/src/fr/iri/thd/sonyengine/core/EngineAccessor.java	Tue May 04 18:01:50 2010 +0200
@@ -7,7 +7,6 @@
 import thd.ThdEngine;
 import thd.ThdMovieFragment;
 
-import com.sleepycat.je.Transaction;
 import com.sleepycat.persist.EntityCursor;
 import com.sleepycat.persist.EntityIndex;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/fr/iri/thd/sonyengine/web/RootResource.java	Tue May 04 18:01:50 2010 +0200
@@ -0,0 +1,28 @@
+package fr.iri.thd.sonyengine.web;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+import com.sun.jersey.api.view.Viewable;
+
+@Path ("")
+public class RootResource {
+	@GET
+	@Produces(MediaType.TEXT_HTML)
+	public Viewable index(@Context ServletContext context) {
+		
+		
+		final Map<String,Object> vars = new HashMap<String, Object>();		
+		
+		Viewable view = new Viewable("/index", vars);
+				
+		return view;
+	}
+}
--- a/src/fr/iri/thd/sonyengine/web/StatusResource.java	Wed Apr 28 22:32:31 2010 +0200
+++ b/src/fr/iri/thd/sonyengine/web/StatusResource.java	Tue May 04 18:01:50 2010 +0200
@@ -12,6 +12,7 @@
 
 import com.sun.jersey.api.view.Viewable;
 
+import fr.iri.thd.sonyengine.Constants;
 import fr.iri.thd.sonyengine.core.DataAccessor;
 import fr.iri.thd.sonyengine.core.DbEnv;
 import fr.iri.thd.sonyengine.core.EngineAccessor;
@@ -43,6 +44,7 @@
 		vars.put("segments_nb", segments_nb);
 		vars.put("segments_db_nb", segments_db_nb);
 		vars.put("tags_nb", tags_nb);
+		vars.put("version", Constants.VERSION);
 		
 		
 		Viewable view = new Viewable("/status", vars);