Mercurial > hg > Members > nobuyasu > Consensus
changeset 9:d050b7fb4cda
create getUserRequests action
line wrap: on
line diff
--- a/app/controllers/Application.java Mon Oct 01 19:53:43 2012 +0900 +++ b/app/controllers/Application.java Mon Oct 01 20:23:19 2012 +0900 @@ -22,7 +22,6 @@ for (Long anId: id) { System.out.println(id); } - return ok("test " + id); }
--- a/app/controllers/User.java Mon Oct 01 19:53:43 2012 +0900 +++ b/app/controllers/User.java Mon Oct 01 20:23:19 2012 +0900 @@ -47,6 +47,19 @@ } } + public static Result getUserRequests(String name) { + TPGraph tpGraph = TPGraph.getInstance(); + Graph graph = tpGraph.getGraph(); + Vertex v = graph.getVertex(name); + if (v == null) { + return notFound(); + } else { + UserModel user = new UserModel(v); + HashMap<Object,Object> hash = user.getUserRequests(); + return created(Json.toJson(hash)); + } + } +
--- a/app/models/TPGraph.java Mon Oct 01 19:53:43 2012 +0900 +++ b/app/models/TPGraph.java Mon Oct 01 20:23:19 2012 +0900 @@ -72,7 +72,7 @@ graph.addEdge(null, rootUser, user.getVertex(), CHILD); } - + public void shutdownGraph() { graph.shutdown();
--- a/app/models/UserModel.java Mon Oct 01 19:53:43 2012 +0900 +++ b/app/models/UserModel.java Mon Oct 01 20:23:19 2012 +0900 @@ -30,6 +30,14 @@ } return properties; } + + public HashMap<Object, Object> getUserRequests() { + HashMap<Object, Object> hash = new HashMap<Object,Object>(1); + hash.put(REQUESTS, vertex.getProperty(REQUESTS)); + return hash; + } + +
--- a/conf/routes Mon Oct 01 19:53:43 2012 +0900 +++ b/conf/routes Mon Oct 01 20:23:19 2012 +0900 @@ -6,6 +6,8 @@ GET / controllers.Application.index() PUT /users/create/:name controllers.User.create(name: String) GET /users/browse/:name controllers.User.getUser(name: String) +GET /users/requests/:name controllers.User.getUserRequests(name: String) + # test action POST /hello controllers.Application.hello()
--- a/logs/application.log Mon Oct 01 19:53:43 2012 +0900 +++ b/logs/application.log Mon Oct 01 20:23:19 2012 +0900 @@ -1,135 +1,12 @@ -2012-10-01 18:38:34,223 - [INFO] - from play in main +2012-10-01 20:21:19,930 - [INFO] - from play in main Listening for HTTP on port 9000... -2012-10-01 18:38:56,931 - [INFO] - from play in play-akka.actor.default-dispatcher-1 -Application started (Dev) - -2012-10-01 18:38:57,185 - [ERROR] - from application in play-akka.actor.actions-dispatcher-7 - - -! @6bp43cigh - Internal server error, for request [PUT /users/create/taro] -> - -play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[IllegalArgumentException: Vertex id can not be null]] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.3] - at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2] - at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.3] - at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.run(Mailbox.scala:179) [akka-actor.jar:2.0.2] - at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor.jar:2.0.2] -Caused by: java.lang.IllegalArgumentException: Vertex id can not be null - at com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull(ExceptionFactory.java:14) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at com.tinkerpop.blueprints.impls.tg.TinkerGraph.getVertex(TinkerGraph.java:225) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at controllers.User.create(User.java:18) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.invocation(Router.scala:1086) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:33) ~[play_2.9.1.jar:2.0.3] - at play.GlobalSettings$1.call(GlobalSettings.java:57) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$class.apply(JavaAction.scala:74) ~[play_2.9.1.jar:2.0.3] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.apply(Router.scala:1085) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.utils.Threads$.withContextClassLoader(Threads.scala:17) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:125) [play_2.9.1.jar:2.0.3] - ... 11 common frames omitted - -2012-10-01 18:39:58,288 - [INFO] - from application in play-akka.actor.default-dispatcher-1 -Application shutdown... - -2012-10-01 18:39:58,304 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +2012-10-01 20:21:25,058 - [INFO] - from play in play-akka.actor.default-dispatcher-3 Application started (Dev) -2012-10-01 18:39:58,318 - [ERROR] - from application in play-akka.actor.actions-dispatcher-8 - - -! @6bp43cigi - Internal server error, for request [PUT /users/create/taro] -> - -play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[IllegalArgumentException: Vertex id can not be null]] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.3] - at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2] - at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.3] - at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.run(Mailbox.scala:179) [akka-actor.jar:2.0.2] - at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor.jar:2.0.2] -Caused by: java.lang.IllegalArgumentException: Vertex id can not be null - at com.tinkerpop.blueprints.util.ExceptionFactory.vertexIdCanNotBeNull(ExceptionFactory.java:14) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at com.tinkerpop.blueprints.impls.tg.TinkerGraph.getVertex(TinkerGraph.java:225) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at controllers.User.create(User.java:18) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.invocation(Router.scala:1086) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:33) ~[play_2.9.1.jar:2.0.3] - at play.GlobalSettings$1.call(GlobalSettings.java:57) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$class.apply(JavaAction.scala:74) ~[play_2.9.1.jar:2.0.3] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.apply(Router.scala:1085) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.utils.Threads$.withContextClassLoader(Threads.scala:17) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:125) [play_2.9.1.jar:2.0.3] - ... 11 common frames omitted - -2012-10-01 18:40:59,516 - [INFO] - from application in play-akka.actor.default-dispatcher-1 -Application shutdown... - -2012-10-01 18:40:59,531 - [INFO] - from play in play-akka.actor.default-dispatcher-1 -Application started (Dev) - -2012-10-01 18:42:53,782 - [INFO] - from application in play-akka.actor.default-dispatcher-1 +2012-10-01 20:22:56,156 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-01 18:42:53,796 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +2012-10-01 20:22:56,170 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-01 18:43:06,560 - [ERROR] - from application in play-akka.actor.actions-dispatcher-8 - - -! @6bp43cigj - Internal server error, for request [PUT /users/create/taro] -> - -play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[IllegalArgumentException: Vertex with id already exists: taro]] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:134) [play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:115) [play_2.9.1.jar:2.0.3] - at akka.actor.Actor$class.apply(Actor.scala:318) [akka-actor.jar:2.0.2] - at play.core.ActionInvoker.apply(Invoker.scala:113) [play_2.9.1.jar:2.0.3] - at akka.actor.ActorCell.invoke(ActorCell.scala:626) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:197) [akka-actor.jar:2.0.2] - at akka.dispatch.Mailbox.run(Mailbox.scala:179) [akka-actor.jar:2.0.2] - at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:516) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:259) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1479) [akka-actor.jar:2.0.2] - at akka.jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [akka-actor.jar:2.0.2] -Caused by: java.lang.IllegalArgumentException: Vertex with id already exists: taro - at com.tinkerpop.blueprints.util.ExceptionFactory.vertexWithIdAlreadyExists(ExceptionFactory.java:22) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at com.tinkerpop.blueprints.impls.tg.TinkerGraph.addVertex(TinkerGraph.java:205) ~[blueprints-core-2.2.0-SNAPSHOT.jar:na] - at controllers.User.create(User.java:18) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.apply(routes_routing.scala:56) ~[classes/:na] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.invocation(Router.scala:1086) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:33) ~[play_2.9.1.jar:2.0.3] - at play.GlobalSettings$1.call(GlobalSettings.java:57) ~[play_2.9.1.jar:2.0.3] - at play.core.j.JavaAction$class.apply(JavaAction.scala:74) ~[play_2.9.1.jar:2.0.3] - at play.core.Router$HandlerInvoker$$anon$4$$anon$1.apply(Router.scala:1085) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1$$anonfun$6.apply(Invoker.scala:126) ~[play_2.9.1.jar:2.0.3] - at play.utils.Threads$.withContextClassLoader(Threads.scala:17) ~[play_2.9.1.jar:2.0.3] - at play.core.ActionInvoker$$anonfun$receive$1.apply(Invoker.scala:125) [play_2.9.1.jar:2.0.3] - ... 11 common frames omitted - -2012-10-01 18:50:33,208 - [INFO] - from application in play-akka.actor.default-dispatcher-1 -Application shutdown... - -2012-10-01 18:50:33,222 - [INFO] - from play in play-akka.actor.default-dispatcher-1 -Application started (Dev) -
Binary file target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$1$$anonfun$apply$2.class has changed
Binary file target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$3$$anonfun$apply$4.class has changed
Binary file target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.class has changed
Binary file target/scala-2.9.1/classes/controllers/ref/ReverseApplication$$anonfun$hello$1.class has changed
Binary file target/scala-2.9.1/classes/controllers/ref/ReverseApplication$$anonfun$index$1.class has changed
Binary file target/scala-2.9.1/classes/controllers/ref/ReverseAssets$$anonfun$at$1.class has changed
--- a/target/scala-2.9.1/classes/routes Mon Oct 01 19:53:43 2012 +0900 +++ b/target/scala-2.9.1/classes/routes Mon Oct 01 20:23:19 2012 +0900 @@ -4,8 +4,13 @@ # Home page GET / controllers.Application.index() -POST /db/data/node controllers.Application.hello() PUT /users/create/:name controllers.User.create(name: String) +GET /users/browse/:name controllers.User.getUser(name: String) +GET /users/requests/:name controllers.User.getUserRequests(name: String) + +# test action +POST /hello controllers.Application.hello() +GET /test controllers.Application.test() # Map static resources from the /public folder to the /assets URL path
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$1$$anonfun$apply$2.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$1.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$3$$anonfun$apply$4.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$3.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$5.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/javascript/ReverseApplication.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/javascript/ReverseAssets.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ref/ReverseApplication$$anonfun$hello$1.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ref/ReverseApplication$$anonfun$index$1.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ref/ReverseAssets$$anonfun$at$1.class has changed
--- a/target/scala-2.9.1/src_managed/main/controllers/routes.java Mon Oct 01 19:53:43 2012 +0900 +++ b/target/scala-2.9.1/src_managed/main/controllers/routes.java Mon Oct 01 20:23:19 2012 +0900 @@ -1,6 +1,6 @@ // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes -// @HASH:9ae2edd0f778289ab8b7e3e21d5b4aa0915c955d -// @DATE:Mon Oct 01 17:13:28 JST 2012 +// @HASH:8bd085826bd380a3cbbff589f55d12bed544e145 +// @DATE:Mon Oct 01 20:23:04 JST 2012 package controllers;
--- a/target/scala-2.9.1/src_managed/main/routes_reverseRouting.scala Mon Oct 01 19:53:43 2012 +0900 +++ b/target/scala-2.9.1/src_managed/main/routes_reverseRouting.scala Mon Oct 01 20:23:19 2012 +0900 @@ -1,6 +1,6 @@ // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes -// @HASH:9ae2edd0f778289ab8b7e3e21d5b4aa0915c955d -// @DATE:Mon Oct 01 17:13:28 JST 2012 +// @HASH:8bd085826bd380a3cbbff589f55d12bed544e145 +// @DATE:Mon Oct 01 20:23:04 JST 2012 import play.core._ import play.core.Router._ @@ -12,28 +12,38 @@ import Router.queryString -// @LINE:12 +// @LINE:18 +// @LINE:14 +// @LINE:13 +// @LINE:9 // @LINE:8 // @LINE:7 // @LINE:6 package controllers { -// @LINE:7 +// @LINE:14 +// @LINE:13 // @LINE:6 class ReverseApplication { +// @LINE:14 +def test() = { + Call("GET", "/test") +} + + // @LINE:6 def index() = { Call("GET", "/") } -// @LINE:7 +// @LINE:13 def hello() = { - Call("POST", "/db/data/node") + Call("POST", "/hello") } @@ -42,13 +52,13 @@ } -// @LINE:12 +// @LINE:18 class ReverseAssets { -// @LINE:12 +// @LINE:18 def at(file:String) = { Call("GET", "/assets/" + implicitly[PathBindable[String]].unbind("file", file)) } @@ -59,13 +69,27 @@ } +// @LINE:9 // @LINE:8 +// @LINE:7 class ReverseUser { +// @LINE:9 +def getUserRequests(name:String) = { + Call("GET", "/users/requests/" + implicitly[PathBindable[String]].unbind("name", name)) +} + + // @LINE:8 +def getUser(name:String) = { + Call("GET", "/users/browse/" + implicitly[PathBindable[String]].unbind("name", name)) +} + + +// @LINE:7 def create(name:String) = { Call("PUT", "/users/create/" + implicitly[PathBindable[String]].unbind("name", name)) } @@ -79,19 +103,34 @@ -// @LINE:12 +// @LINE:18 +// @LINE:14 +// @LINE:13 +// @LINE:9 // @LINE:8 // @LINE:7 // @LINE:6 package controllers.javascript { -// @LINE:7 +// @LINE:14 +// @LINE:13 // @LINE:6 class ReverseApplication { +// @LINE:14 +def test = JavascriptReverseRoute( + "controllers.Application.test", + """ + function() { + return _wA({method:"GET", url:"/test"}) + } + """ +) + + // @LINE:6 def index = JavascriptReverseRoute( "controllers.Application.index", @@ -103,12 +142,12 @@ ) -// @LINE:7 +// @LINE:13 def hello = JavascriptReverseRoute( "controllers.Application.hello", """ function() { - return _wA({method:"POST", url:"/db/data/node"}) + return _wA({method:"POST", url:"/hello"}) } """ ) @@ -119,13 +158,13 @@ } -// @LINE:12 +// @LINE:18 class ReverseAssets { -// @LINE:12 +// @LINE:18 def at = JavascriptReverseRoute( "controllers.Assets.at", """ @@ -141,13 +180,37 @@ } +// @LINE:9 // @LINE:8 +// @LINE:7 class ReverseUser { +// @LINE:9 +def getUserRequests = JavascriptReverseRoute( + "controllers.User.getUserRequests", + """ + function(name) { + return _wA({method:"GET", url:"/users/requests/" + (""" + implicitly[PathBindable[String]].javascriptUnbind + """)("name", name)}) + } + """ +) + + // @LINE:8 +def getUser = JavascriptReverseRoute( + "controllers.User.getUser", + """ + function(name) { + return _wA({method:"GET", url:"/users/browse/" + (""" + implicitly[PathBindable[String]].javascriptUnbind + """)("name", name)}) + } + """ +) + + +// @LINE:7 def create = JavascriptReverseRoute( "controllers.User.create", """ @@ -166,26 +229,36 @@ -// @LINE:12 +// @LINE:18 +// @LINE:14 +// @LINE:13 +// @LINE:9 // @LINE:8 // @LINE:7 // @LINE:6 package controllers.ref { -// @LINE:7 +// @LINE:14 +// @LINE:13 // @LINE:6 class ReverseApplication { +// @LINE:14 +def test() = new play.api.mvc.HandlerRef( + controllers.Application.test(), HandlerDef(this, "controllers.Application", "test", Seq()) +) + + // @LINE:6 def index() = new play.api.mvc.HandlerRef( controllers.Application.index(), HandlerDef(this, "controllers.Application", "index", Seq()) ) -// @LINE:7 +// @LINE:13 def hello() = new play.api.mvc.HandlerRef( controllers.Application.hello(), HandlerDef(this, "controllers.Application", "hello", Seq()) ) @@ -196,13 +269,13 @@ } -// @LINE:12 +// @LINE:18 class ReverseAssets { -// @LINE:12 +// @LINE:18 def at(path:String, file:String) = new play.api.mvc.HandlerRef( controllers.Assets.at(path, file), HandlerDef(this, "controllers.Assets", "at", Seq(classOf[String], classOf[String])) ) @@ -213,13 +286,27 @@ } +// @LINE:9 // @LINE:8 +// @LINE:7 class ReverseUser { +// @LINE:9 +def getUserRequests(name:String) = new play.api.mvc.HandlerRef( + controllers.User.getUserRequests(name), HandlerDef(this, "controllers.User", "getUserRequests", Seq(classOf[String])) +) + + // @LINE:8 +def getUser(name:String) = new play.api.mvc.HandlerRef( + controllers.User.getUser(name), HandlerDef(this, "controllers.User", "getUser", Seq(classOf[String])) +) + + +// @LINE:7 def create(name:String) = new play.api.mvc.HandlerRef( controllers.User.create(name), HandlerDef(this, "controllers.User", "create", Seq(classOf[String])) )
--- a/target/scala-2.9.1/src_managed/main/routes_routing.scala Mon Oct 01 19:53:43 2012 +0900 +++ b/target/scala-2.9.1/src_managed/main/routes_routing.scala Mon Oct 01 20:23:19 2012 +0900 @@ -1,6 +1,6 @@ // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes -// @HASH:9ae2edd0f778289ab8b7e3e21d5b4aa0915c955d -// @DATE:Mon Oct 01 17:13:28 JST 2012 +// @HASH:8bd085826bd380a3cbbff589f55d12bed544e145 +// @DATE:Mon Oct 01 20:23:04 JST 2012 import play.core._ import play.core.Router._ @@ -19,17 +19,29 @@ // @LINE:7 -val controllers_Application_hello1 = Route("POST", PathPattern(List(StaticPart("/db/data/node")))) +val controllers_User_create1 = Route("PUT", PathPattern(List(StaticPart("/users/create/"),DynamicPart("name", """[^/]+""")))) // @LINE:8 -val controllers_User_create2 = Route("PUT", PathPattern(List(StaticPart("/users/create/"),DynamicPart("name", """[^/]+""")))) +val controllers_User_getUser2 = Route("GET", PathPattern(List(StaticPart("/users/browse/"),DynamicPart("name", """[^/]+""")))) + + +// @LINE:9 +val controllers_User_getUserRequests3 = Route("GET", PathPattern(List(StaticPart("/users/requests/"),DynamicPart("name", """[^/]+""")))) -// @LINE:12 -val controllers_Assets_at3 = Route("GET", PathPattern(List(StaticPart("/assets/"),DynamicPart("file", """.+""")))) +// @LINE:13 +val controllers_Application_hello4 = Route("POST", PathPattern(List(StaticPart("/hello")))) -def documentation = List(("""GET""","""/""","""controllers.Application.index()"""),("""POST""","""/db/data/node""","""controllers.Application.hello()"""),("""PUT""","""/users/create/$name<[^/]+>""","""controllers.User.create(name:String)"""),("""GET""","""/assets/$file<.+>""","""controllers.Assets.at(path:String = "/public", file:String)""")) + +// @LINE:14 +val controllers_Application_test5 = Route("GET", PathPattern(List(StaticPart("/test")))) + + +// @LINE:18 +val controllers_Assets_at6 = Route("GET", PathPattern(List(StaticPart("/assets/"),DynamicPart("file", """.+""")))) + +def documentation = List(("""GET""","""/""","""controllers.Application.index()"""),("""PUT""","""/users/create/$name<[^/]+>""","""controllers.User.create(name:String)"""),("""GET""","""/users/browse/$name<[^/]+>""","""controllers.User.getUser(name:String)"""),("""GET""","""/users/requests/$name<[^/]+>""","""controllers.User.getUserRequests(name:String)"""),("""POST""","""/hello""","""controllers.Application.hello()"""),("""GET""","""/test""","""controllers.Application.test()"""),("""GET""","""/assets/$file<.+>""","""controllers.Assets.at(path:String = "/public", file:String)""")) def routes:PartialFunction[RequestHeader,Handler] = { @@ -43,23 +55,47 @@ // @LINE:7 -case controllers_Application_hello1(params) => { +case controllers_User_create1(params) => { + call(params.fromPath[String]("name", None)) { (name) => + invokeHandler(_root_.controllers.User.create(name), HandlerDef(this, "controllers.User", "create", Seq(classOf[String]))) + } +} + + +// @LINE:8 +case controllers_User_getUser2(params) => { + call(params.fromPath[String]("name", None)) { (name) => + invokeHandler(_root_.controllers.User.getUser(name), HandlerDef(this, "controllers.User", "getUser", Seq(classOf[String]))) + } +} + + +// @LINE:9 +case controllers_User_getUserRequests3(params) => { + call(params.fromPath[String]("name", None)) { (name) => + invokeHandler(_root_.controllers.User.getUserRequests(name), HandlerDef(this, "controllers.User", "getUserRequests", Seq(classOf[String]))) + } +} + + +// @LINE:13 +case controllers_Application_hello4(params) => { call { invokeHandler(_root_.controllers.Application.hello(), HandlerDef(this, "controllers.Application", "hello", Nil)) } } -// @LINE:8 -case controllers_User_create2(params) => { - call(params.fromPath[String]("name", None)) { (name) => - invokeHandler(_root_.controllers.User.create(name), HandlerDef(this, "controllers.User", "create", Seq(classOf[String]))) +// @LINE:14 +case controllers_Application_test5(params) => { + call { + invokeHandler(_root_.controllers.Application.test(), HandlerDef(this, "controllers.Application", "test", Nil)) } } -// @LINE:12 -case controllers_Assets_at3(params) => { +// @LINE:18 +case controllers_Assets_at6(params) => { call(Param[String]("path", Right("/public")), params.fromPath[String]("file", None)) { (path, file) => invokeHandler(_root_.controllers.Assets.at(path, file), HandlerDef(this, "controllers.Assets", "at", Seq(classOf[String], classOf[String]))) }
--- a/target/streams/compile/compile/$global/out Mon Oct 01 19:53:43 2012 +0900 +++ b/target/streams/compile/compile/$global/out Mon Oct 01 20:23:19 2012 +0900 @@ -0,0 +1,1 @@ +[0m[[0minfo[0m] [0mCompiling 2 Scala sources and 1 Java source to /Users/aotokage/workspace/Consensus/target/scala-2.9.1/classes...[0m