changeset 3:5a097a2336fa draft

commit
author e085711
date Wed, 26 Sep 2012 14:43:07 +0900
parents 23c7aea84c46
children e12d0b6dbe02
files .classpath app/controllers/Application.java conf/routes test/ApplicationTest.java test/BasicTest.java
diffstat 5 files changed, 43 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/.classpath	Tue Sep 18 04:51:04 2012 +0900
+++ b/.classpath	Wed Sep 26 14:43:07 2012 +0900
@@ -74,5 +74,8 @@
 	<classpathentry kind="lib" path="lib/jersey-json-1.12.jar"/>
 	<classpathentry kind="lib" path="lib/jersey-server-1.12.jar"/>
 	<classpathentry kind="lib" path="lib/JSON-java-1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/blueprints-core-2.2.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/gremlin-java-2.2.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/pipes-2.2.0-SNAPSHOT.jar"/>
 	<classpathentry kind="output" path="eclipse/classes"/>
 </classpath>
--- a/app/controllers/Application.java	Tue Sep 18 04:51:04 2012 +0900
+++ b/app/controllers/Application.java	Wed Sep 26 14:43:07 2012 +0900
@@ -5,12 +5,38 @@
 
 import java.util.*;
 
-import models.*;
+import models.TPGraph;
+
+import com.tinkerpop.blueprints.Graph;
+import com.tinkerpop.blueprints.Vertex;
+import com.tinkerpop.blueprints.impls.tg.TinkerGraph;
+
 
 public class Application extends Controller {
 
     public static void index() {
         render();
     }
+    
+    public static void testwrite() {
+    	TPGraph tpgraph = TPGraph.getInstance();
+		Graph graph = tpgraph.getGraph();	
+    	Vertex a = graph.addVertex(null);
+    	a.setProperty("name","mario");
+    	Object id = a.getId(); 
+       	tpgraph.shutdownGraph();
+       	graph.shutdown();
+    	renderText(id);
+    }
+    
+    public static void testread() {
+    	TPGraph tpgraph = TPGraph.getInstance();
+    	Graph graph = tpgraph.getGraph();
+    	Vertex a = graph.getVertex(0);
+   		String str = (String) a.getProperty("name");
+   		renderText(str);
 
-}
\ No newline at end of file
+    }
+     
+    
+}
--- a/conf/routes	Tue Sep 18 04:51:04 2012 +0900
+++ b/conf/routes	Wed Sep 26 14:43:07 2012 +0900
@@ -11,5 +11,17 @@
 # Map static resources from the /app/public folder to the /public path
 GET     /public/                                staticDir:public
 
+
+GET		/db/data/testwrite								Application.testwrite
+GET		/db/data/testread								Application.testread
+#GET		/db/data/{action}						db.Data.{action}
+POST		/db/data/node						db.Data.node
+GET		/db/data/node/{id}						db.Data.node
+
+
+GET /{id}/test									db.Data.test
+
+
 # Catch all
 *       /{controller}/{action}                  {controller}.{action}
+
--- a/test/ApplicationTest.java	Tue Sep 18 04:51:04 2012 +0900
+++ b/test/ApplicationTest.java	Wed Sep 26 14:43:07 2012 +0900
@@ -2,7 +2,6 @@
 import play.test.*;
 import play.mvc.*;
 import play.mvc.Http.*;
-import models.*;
 
 public class ApplicationTest extends FunctionalTest {
 
--- a/test/BasicTest.java	Tue Sep 18 04:51:04 2012 +0900
+++ b/test/BasicTest.java	Wed Sep 26 14:43:07 2012 +0900
@@ -1,7 +1,6 @@
 import org.junit.*;
 import java.util.*;
 import play.test.*;
-import models.*;
 
 public class BasicTest extends UnitTest {