Mercurial > hg > Members > nobuyasu > Consensus
changeset 33:1ca28e3eb4e9
modified createMentionTree
line wrap: on
line diff
--- a/app/controllers/Claim.java Wed Oct 03 16:47:44 2012 +0900 +++ b/app/controllers/Claim.java Wed Oct 03 16:55:16 2012 +0900 @@ -48,39 +48,30 @@ @BodyParser.Of(BodyParser.Json.class) public static Result createMention(String mentionType, String id) { - if ( !(mentionType.equals(NodeModel.L_QUESTION) ||mentionType.equals(NodeModel.L_REFUTATION) ||mentionType.equals(NodeModel.L_QUESTION))) { return badRequest("Wrong mention type."); } - JsonNode json = request().body().asJson(); String author = json.findPath(NodeModel.L_AUTHOR).getTextValue(); // Author - TPGraph tpGraph = TPGraph.getInstance(); Graph graph = tpGraph.getGraph(); if ( graph.getVertex(author) == null) return badRequest("Author "+ author + "is not exist."); - JsonNode toulmin = json.findPath(NodeModel.TOULMIN); if (toulmin.findPath(NodeModel.TITLE) == null) return badRequest("Please set title"); - JsonNode usersJson = json.get(NodeModel.USERS); // Users (class JsonNode) String type = json.findPath(NodeModel.TYPE).getTextValue(); // Type (majority|unanimously) - ClaimModel newClaim = new ClaimModel(graph.addVertex(null)); tpGraph.setLabelToAuthor(newClaim, author); newClaim.setClaimProperties(toulmin, type); - String[] users = toStringArray(usersJson); tpGraph.setLabelStatusToUsers(newClaim, users, NodeModel.L_REQUEST, NodeModel.FAIL); tpGraph.setLabelToRootClaim(newClaim); - ClaimModel mentionV = new ClaimModel(graph.getVertex(id)); tpGraph.setLabelMention(mentionV, newClaim, mentionType); - return created(); }
--- a/app/models/ClaimModel.java Wed Oct 03 16:47:44 2012 +0900 +++ b/app/models/ClaimModel.java Wed Oct 03 16:55:16 2012 +0900 @@ -48,7 +48,6 @@ String label = e.getLabel(); ObjectNode info = Json.newObject(); info.put(TYPE, Json.toJson(label)); - info.put(STATUS, Json.toJson(e.getProperty(STATUS))); GremlinPipeline<Edge,Vertex> pipeChildVertex = new GremlinPipeline<Edge,Vertex>(); pipeChildVertex.start(e).inV(); ClaimModel childClaim = new ClaimModel(pipeChildVertex.next());
--- a/logs/application.log Wed Oct 03 16:47:44 2012 +0900 +++ b/logs/application.log Wed Oct 03 16:55:16 2012 +0900 @@ -1,15 +1,33 @@ -2012-10-03 15:05:55,385 - [INFO] - from play in main +2012-10-03 16:31:09,013 - [INFO] - from play in main Listening for HTTP on port 9000... -2012-10-03 15:06:03,213 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +2012-10-03 16:31:15,139 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +Application started (Dev) + +2012-10-03 16:31:45,206 - [INFO] - from application in play-akka.actor.default-dispatcher-1 +Application shutdown... + +2012-10-03 16:31:45,229 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 15:06:05,058 - [ERROR] - from application in play-akka.actor.actions-dispatcher-4 +2012-10-03 16:35:57,771 - [INFO] - from application in play-akka.actor.default-dispatcher-1 +Application shutdown... + +2012-10-03 16:35:57,790 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +Application started (Dev) + +2012-10-03 16:40:03,578 - [INFO] - from application in play-akka.actor.default-dispatcher-1 +Application shutdown... + +2012-10-03 16:40:03,595 - [INFO] - from play in play-akka.actor.default-dispatcher-1 +Application started (Dev) + +2012-10-03 16:40:04,414 - [ERROR] - from application in play-akka.actor.actions-dispatcher-8 -! @6bphfi9bo - Internal server error, for request [GET /claims/browse/10] -> +! @6bpi0n84b - Internal server error, for request [GET /claims/browse/10] -> -play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[ClassCastException: com.tinkerpop.blueprints.impls.tg.TinkerVertex cannot be cast to com.tinkerpop.blueprints.Edge]] +play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[FastNoSuchElementException: 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] @@ -22,41 +40,26 @@ 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.ClassCastException: com.tinkerpop.blueprints.impls.tg.TinkerVertex cannot be cast to com.tinkerpop.blueprints.Edge - at models.ClaimModel.getUsersIdAndStatus(ClaimModel.java:81) ~[classes/:na] - at models.ClaimModel.getClaimInfoTraverse(ClaimModel.java:39) ~[classes/:na] - at controllers.Claim.getClaimInfo(Claim.java:94) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:124) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:124) ~[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 +com.tinkerpop.pipes.util.FastNoSuchElementException: null -2012-10-03 15:10:08,007 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-03 16:41:51,310 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-03 15:10:08,024 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-03 16:41:51,328 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 15:11:18,369 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-03 16:42:05,908 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-03 15:11:18,384 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-03 16:42:05,926 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 15:11:19,607 - [ERROR] - from application in play-akka.actor.actions-dispatcher-8 +2012-10-03 16:42:06,744 - [ERROR] - from application in play-akka.actor.actions-dispatcher-8 -! @6bphfi9bp - Internal server error, for request [GET /claims/browse/10] -> +! @6bpi0n84c - Internal server error, for request [GET /claims/browse/10] -> -play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[ClassCastException: com.tinkerpop.blueprints.impls.tg.TinkerVertex cannot be cast to com.tinkerpop.blueprints.Edge]] +play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[FastNoSuchElementException: 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] @@ -69,38 +72,23 @@ 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.ClassCastException: com.tinkerpop.blueprints.impls.tg.TinkerVertex cannot be cast to com.tinkerpop.blueprints.Edge - at models.ClaimModel.getUsersIdAndStatus(ClaimModel.java:81) ~[classes/:na] - at models.ClaimModel.getClaimInfoTraverse(ClaimModel.java:39) ~[classes/:na] - at controllers.Claim.getClaimInfo(Claim.java:94) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:124) ~[classes/:na] - at Routes$$anonfun$routes$1$$anonfun$apply$13$$anonfun$apply$14.apply(routes_routing.scala:124) ~[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 +com.tinkerpop.pipes.util.FastNoSuchElementException: null -2012-10-03 15:14:14,692 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-03 16:43:42,491 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-03 15:14:14,708 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-03 16:43:42,508 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 15:14:48,014 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-03 16:52:28,593 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-03 15:14:48,029 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-03 16:52:28,609 - [INFO] - from play in play-akka.actor.default-dispatcher-1 Application started (Dev) -2012-10-03 15:16:13,238 - [INFO] - from application in play-akka.actor.default-dispatcher-2 +2012-10-03 16:54:26,214 - [INFO] - from application in play-akka.actor.default-dispatcher-1 Application shutdown... -2012-10-03 15:16:13,253 - [INFO] - from play in play-akka.actor.default-dispatcher-2 +2012-10-03 16:54:26,229 - [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
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