changeset 76:41b6f3788cc3 draft

TPGraph wrap graph
author one
date Fri, 08 Mar 2013 16:18:53 +0900
parents 9448734399db
children 4c5b3e990712
files app/controllers/Claim.java app/controllers/User.java app/models/ClaimModel.java app/models/TPGraph.java logs/application.log project/target/scala-2.9.1/sbt-0.11.3/cache/compile/compile target/scala-2.9.1/cache/compile/compile target/scala-2.9.1/cache/compile/copy-resources target/scala-2.9.1/cache/update/output target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$1$$anonfun$apply$2.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$1.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$3$$anonfun$apply$4.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$3.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1$$anonfun$apply$5.class target/scala-2.9.1/classes/Routes$$anonfun$routes$1.class target/scala-2.9.1/classes/Routes$.class target/scala-2.9.1/classes/Routes.class target/scala-2.9.1/classes/controllers/Application.class target/scala-2.9.1/classes/controllers/ReverseApplication.class target/scala-2.9.1/classes/controllers/ReverseAssets.class target/scala-2.9.1/classes/controllers/javascript/ReverseApplication.class target/scala-2.9.1/classes/controllers/javascript/ReverseAssets.class target/scala-2.9.1/classes/controllers/ref/ReverseApplication$$anonfun$hello$1.class target/scala-2.9.1/classes/controllers/ref/ReverseApplication.class target/scala-2.9.1/classes/controllers/ref/ReverseAssets$$anonfun$at$1.class target/scala-2.9.1/classes/controllers/ref/ReverseAssets.class target/scala-2.9.1/classes/routes target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$1$$anonfun$apply$2.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$1.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$3$$anonfun$apply$4.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$3.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$5$$anonfun$apply$6.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1$$anonfun$apply$5.class target/scala-2.9.1/classes_managed/Routes$$anonfun$routes$1.class target/scala-2.9.1/classes_managed/Routes$.class target/scala-2.9.1/classes_managed/Routes.class target/scala-2.9.1/classes_managed/controllers/ReverseApplication.class target/scala-2.9.1/classes_managed/controllers/ReverseAssets.class target/scala-2.9.1/classes_managed/controllers/javascript/ReverseApplication.class target/scala-2.9.1/classes_managed/controllers/javascript/ReverseAssets.class target/scala-2.9.1/classes_managed/controllers/ref/ReverseApplication$$anonfun$hello$1.class target/scala-2.9.1/classes_managed/controllers/ref/ReverseApplication.class target/scala-2.9.1/classes_managed/controllers/ref/ReverseAssets$$anonfun$at$1.class target/scala-2.9.1/classes_managed/controllers/ref/ReverseAssets.class target/scala-2.9.1/src_managed/main/controllers/routes.java target/scala-2.9.1/src_managed/main/routes_reverseRouting.scala target/scala-2.9.1/src_managed/main/routes_routing.scala target/scala-2.9.1/src_managed/main/views/html/index.template.scala target/scala-2.9.1/src_managed/main/views/html/main.template.scala
diffstat 50 files changed, 182 insertions(+), 133 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/Claim.java	Thu Mar 07 20:08:15 2013 +0900
+++ b/app/controllers/Claim.java	Fri Mar 08 16:18:53 2013 +0900
@@ -10,7 +10,6 @@
 import models.TPGraph;
 import models.UserModel;
 
-import com.tinkerpop.blueprints.Graph;
 import com.tinkerpop.blueprints.Vertex;
 
 import play.libs.Json;
@@ -28,8 +27,7 @@
 		}
 		String author = json.findPath(NodeModel.L_AUTHOR).getTextValue(); // Author
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		if ( graph.getVertex(author) == null) { 
+		if ( tpGraph.getVertex(author) == null) {
 			return badRequest("Author "+ author + "does not exist.");
 		}
 		JsonNode toulmin = json.findPath(NodeModel.TOULMIN);
@@ -37,11 +35,11 @@
 			return badRequest("Please set title");
 		}
  		JsonNode usersJson = json.get(NodeModel.USERS); // Users (class JsonNode) 
-		if (usersJson == null) {
+ 		if (usersJson == null) {
 			return badRequest("Please set users");
 		}
 		String type = json.findPath(NodeModel.TYPE).getTextValue(); // Type (majority|unanimously)		
-		ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
+		ClaimModel newClaim = new ClaimModel(tpGraph.addVertex(null));
 		tpGraph.setLabelToAuthor(newClaim, author);
 		newClaim.setClaimProperties(toulmin, type);
 		String[] users = toStringArray(usersJson);
@@ -58,15 +56,14 @@
 		}
 		String author = json.findPath(NodeModel.L_AUTHOR).getTextValue(); // Author
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		ClaimModel claim = new ClaimModel(graph.getVertex(id));
+		ClaimModel claim = new ClaimModel(tpGraph.getVertex(id));
 		if ( claim.getVertex() == null ) {
 			return badRequest("Claim id "+ id + " does not exist.");
 		} 
 		if ( !claim.getAuthorId().equals(author)) {
 			return badRequest("Wrong Author.");
 		}
-		if ( graph.getVertex(author) == null) { 
+		if ( tpGraph.getVertex(author) == null) { 
 			return badRequest("Author "+ author + " does not exist.");
 		}
 		JsonNode toulmin = json.findPath(NodeModel.TOULMIN);
@@ -87,12 +84,11 @@
 	
 	public static Result getUserConsensusStatus(String id, String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		ClaimModel claim = new ClaimModel(graph.getVertex(id));
+		ClaimModel claim = new ClaimModel(tpGraph.getVertex(id));
 		if (claim.getVertex() == null) {
 			return badRequest("Claim id "+id+" does not exist");
 		}
-		UserModel user = new UserModel(graph.getVertex(name));
+		UserModel user = new UserModel(tpGraph.getVertex(name));
 		if (user.getVertex() == null) {
 			return badRequest("User "+name+" does not exist");
 		}
@@ -108,12 +104,11 @@
 				return badRequest("Wrong status type.");
 		}
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		ClaimModel claim = new ClaimModel(graph.getVertex(id));
+		ClaimModel claim = new ClaimModel(tpGraph.getVertex(id));
 		if (claim.getVertex() == null) {
 			return badRequest("Claim id "+id+" does not exist");
 		}
-		UserModel user = new UserModel(graph.getVertex(name));
+		UserModel user = new UserModel(tpGraph.getVertex(name));
 		if (user.getVertex() == null) {
 			return badRequest("User "+name+" does not exist");
 		}
@@ -135,8 +130,7 @@
 		}
 		String author = json.findPath(NodeModel.L_AUTHOR).getTextValue(); // Author
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		if ( graph.getVertex(author) == null) { 
+		if ( tpGraph.getVertex(author) == null) { 
 			return badRequest("Author "+ author + " does not exist.");
 		}
 		JsonNode toulmin = json.findPath(NodeModel.TOULMIN);
@@ -148,13 +142,13 @@
 			return badRequest("Please set users");
 		}
 		String type = json.findPath(NodeModel.TYPE).getTextValue(); // Type (majority|unanimously)		
-		ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
+		ClaimModel newClaim = new ClaimModel(tpGraph.addVertex(null));
 		tpGraph.setLabelToAuthor(newClaim, author);
 		newClaim.setClaimProperties(toulmin, type);
 		String[] users = toStringArray(usersJson);
 		tpGraph.setLabelStatusToUsers(newClaim, users, NodeModel.L_REQUEST, NodeModel.UNKNOWN);
 		tpGraph.setLabelFromRootClaim(newClaim);
-		ClaimModel targetClaim = new ClaimModel(graph.getVertex(id));
+		ClaimModel targetClaim = new ClaimModel(tpGraph.getVertex(id));
 		tpGraph.setLabelMention(targetClaim, newClaim, mentionType);
 		newClaim.computeAndUpdateStatus();
 		targetClaim.computeAndUpdateStatus();
@@ -163,8 +157,7 @@
 
 	public static Result copyClaims(String id) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		ClaimModel claim = new ClaimModel(graph.getVertex(id));
+		ClaimModel claim = new ClaimModel(tpGraph.getVertex(id));
 		if ( claim.getVertex() == null) {
 			return badRequest("Claim id " + id + " does not exist.");
 		}
@@ -174,8 +167,7 @@
 
 	public static Result getClaimInfo(String id) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex claimV = graph.getVertex(id); 
+		Vertex claimV = tpGraph.getVertex(id); 
 		if (claimV == null) {
 			badRequest("Claim id "+id+" does not exist.");
 		}
@@ -188,8 +180,7 @@
 	
 	public static Result getClaimTree(String id) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex v = graph.getVertex(id);
+		Vertex v = tpGraph.getVertex(id);
 		if (v == null) { 
 			return badRequest("Consensus id "+ id +" does not exist.");
 		}
--- a/app/controllers/User.java	Thu Mar 07 20:08:15 2013 +0900
+++ b/app/controllers/User.java	Fri Mar 08 16:18:53 2013 +0900
@@ -3,7 +3,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 
-import com.tinkerpop.blueprints.Graph;
 import com.tinkerpop.blueprints.Vertex;
 
 import models.TPGraph;
@@ -16,11 +15,10 @@
 
 	public static Result createUser(String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
 		Vertex v = null;
 		UserModel newUser = null; 
 		try {
-			v = graph.addVertex(name);
+			v = tpGraph.addVertex(name);
 		} catch (IllegalArgumentException e) {
 			return status(CONFLICT, name+" already exists");
 		}
@@ -32,8 +30,7 @@
 
 	public static Result getUser(String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex v = graph.getVertex(name);
+		Vertex v = tpGraph.getVertex(name);
 		if (v == null) {
 			return notFound();
 		} else {
@@ -54,8 +51,7 @@
 	
 	public static Result getUserRequests(String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex v = graph.getVertex(name);
+		Vertex v = tpGraph.getVertex(name);
 		if (v == null) {
 			return notFound("User: "+name+" does not found");
 		} else {
@@ -70,8 +66,7 @@
 	
 	public static Result getUserConsensus(String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex v = graph.getVertex(name);
+		Vertex v = tpGraph.getVertex(name);
 		if (v == null) {
 			return notFound("user: "+name+" not found");
 		} else {
@@ -87,8 +82,7 @@
 
 	public static Result getUserClaims(String name) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		Vertex v = graph.getVertex(name);
+		Vertex v = tpGraph.getVertex(name);
 		if (v == null) {
 			return notFound("User "+name+" does not found");
 		} else {
--- a/app/models/ClaimModel.java	Thu Mar 07 20:08:15 2013 +0900
+++ b/app/models/ClaimModel.java	Fri Mar 08 16:18:53 2013 +0900
@@ -260,10 +260,9 @@
 
 	private long getEdgeStatusNumber(Object[] requestEdges, String checkStatus) {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
 		long count = 0;
 		for (Object eId : requestEdges) {
-			Edge e = graph.getEdge(eId);
+			Edge e = tpGraph.getEdge(eId);
 			String status = e.getProperty(STATUS).toString();
 			if (status.equals(checkStatus)) {
 				count++;
@@ -439,8 +438,7 @@
 	
 	public ClaimModel clone() {
 		TPGraph tpGraph = TPGraph.getInstance();
-		Graph graph = tpGraph.getGraph();
-		ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
+		ClaimModel newClaim = new ClaimModel(tpGraph.addVertex(null));
 		String author = (getAuthorId()).toString();
 		String type = (this.getProperty(TYPE)).toString();
 		JsonNode toulmin = (JsonNode)this.getProperty(TOULMIN);
--- a/app/models/TPGraph.java	Thu Mar 07 20:08:15 2013 +0900
+++ b/app/models/TPGraph.java	Fri Mar 08 16:18:53 2013 +0900
@@ -54,6 +54,18 @@
 		return graph;
 	}
 	
+	public Vertex addVertex(Object vId) {
+		return graph.addVertex(vId);
+	}
+
+	public Vertex getVertex(Object vId) {
+		return graph.getVertex(vId);
+	}
+	
+	public Edge getEdge(Object eId) {
+		return graph.getEdge(eId);
+	}
+	
 	public void setClaimRootId(Object id) {
 		this.claimRootId = id;
 	}
@@ -69,13 +81,13 @@
 	public Object getUserRootId() {
 		return userRootId;
 	}
-
+	
 	public Vertex getClaimRootVertex() {
-		return graph.getVertex(claimRootId);
+		return getVertex(claimRootId);
 	}
 	
 	public Vertex getUserRootVertex() {
-		return graph.getVertex(userRootId);
+		return getVertex(userRootId);
 	}
 
 	private Edge setLabel(Vertex fromV, Vertex toV, String label) {
@@ -95,7 +107,7 @@
 	}
 	
 	public Edge setLabelToAuthor(ClaimModel claim, String author) {
-		Vertex authorVertex = graph.getVertex(author);
+		Vertex authorVertex = getVertex(author);
 		//  claim ---author---> authorVertex(userVertex)
 		return setLabel(claim.getVertex(), authorVertex, NodeModel.L_AUTHOR);
 	}
@@ -107,7 +119,7 @@
 	
 	public Boolean setLabelToUsers(ClaimModel claim, String[] users, String label) {
 		for (String userName: users) {
-			Vertex userVertex = graph.getVertex(userName);
+			Vertex userVertex = getVertex(userName);
 			if (userVertex == null) {
 				return false;
 			}
@@ -117,7 +129,7 @@
 	}
 	
 	public Boolean setLabelStatusToUser(ClaimModel claim, String userName, String label, String status) {
-		Vertex userVertex = graph.getVertex(userName);
+		Vertex userVertex = getVertex(userName);
 		if (userVertex == null) { 
 			return false;
 		}
@@ -141,7 +153,7 @@
 	}
 	
 	public Object[] searchAllUser() {
-		Vertex userRootVertex = graph.getVertex(getUserRootId());
+		Vertex userRootVertex = getVertex(getUserRootId());
 		GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();		
 		pipe.start(userRootVertex).out(CHILD);
 		ArrayList<Object> userArray = new ArrayList<Object>();
@@ -203,7 +215,7 @@
 	 * Return CLAIM numbers of above [id] CLAIM.
 	 */
 	public ArrayList<Object> getAllUpperVertexId(Object id) {
-		Vertex startV = graph.getVertex(id);
+		Vertex startV = getVertex(id);
 		ArrayList<Object> vertexArray = new ArrayList<Object>();
 		while (true) {
 			GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();			
@@ -220,7 +232,7 @@
 	}
 	
 	public Object getOneUpperClaimVertexId(Object id) {
-		Vertex startV = graph.getVertex(id);
+		Vertex startV = getVertex(id);
 		GremlinPipeline<Vertex,Vertex> pipe = new GremlinPipeline<Vertex,Vertex>();
 		pipe.start(startV).in(NodeModel.L_QUESTION, NodeModel.L_REFUTATION, NodeModel.L_SUGGESTION);
 		if (pipe.hasNext()) { 
@@ -261,6 +273,9 @@
 		return latestTopClaim;
 	}
 	
+	/*
+	 * TODO: update TimeStamp
+	 */
 	public ClaimModel copyConsensusTree(ClaimModel claim) {
 		ClaimModel oldTopClaim = new ClaimModel(graph.getVertex(getTopClaimVertexId(claim.getId()))); 
 		ClaimModel latestTopClaim = copyDownClaims(oldTopClaim);
--- a/logs/application.log	Thu Mar 07 20:08:15 2013 +0900
+++ b/logs/application.log	Fri Mar 08 16:18:53 2013 +0900
@@ -1,9 +1,18 @@
-2013-03-06 17:10:08,718 - [INFO] - from play in main 
+2013-03-07 20:17:42,790 - [INFO] - from play in main 
 Listening for HTTP on port 9000...
 
-2013-03-06 17:24:42,902 - [INFO] - from play in play-akka.actor.default-dispatcher-3 
+2013-03-07 20:17:47,414 - [INFO] - from play in play-akka.actor.default-dispatcher-1 
 Application started (Dev)
 
-2013-03-06 17:25:02,562 - [INFO] - from application in main 
+2013-03-08 16:03:42,378 - [INFO] - from application in play-akka.actor.default-dispatcher-2 
 Application shutdown...
 
+2013-03-08 16:03:42,409 - [INFO] - from play in play-akka.actor.default-dispatcher-2 
+Application started (Dev)
+
+2013-03-08 16:07:25,214 - [INFO] - from application in play-akka.actor.default-dispatcher-2 
+Application shutdown...
+
+2013-03-08 16:07:25,234 - [INFO] - from play in play-akka.actor.default-dispatcher-2 
+Application started (Dev)
+
Binary file project/target/scala-2.9.1/sbt-0.11.3/cache/compile/compile has changed
Binary file target/scala-2.9.1/cache/compile/compile has changed
Binary file target/scala-2.9.1/cache/compile/copy-resources has changed
Binary file target/scala-2.9.1/cache/update/output has changed
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$1.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$3.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/Routes$$anonfun$routes$1$$anonfun$apply$5.class has changed
Binary file target/scala-2.9.1/classes/Routes$$anonfun$routes$1.class has changed
Binary file target/scala-2.9.1/classes/Routes$.class has changed
Binary file target/scala-2.9.1/classes/Routes.class has changed
Binary file target/scala-2.9.1/classes/controllers/Application.class has changed
Binary file target/scala-2.9.1/classes/controllers/ReverseApplication.class has changed
Binary file target/scala-2.9.1/classes/controllers/ReverseAssets.class has changed
Binary file target/scala-2.9.1/classes/controllers/javascript/ReverseApplication.class has changed
Binary file target/scala-2.9.1/classes/controllers/javascript/ReverseAssets.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.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/controllers/ref/ReverseAssets.class has changed
--- a/target/scala-2.9.1/classes/routes	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/classes/routes	Fri Mar 08 16:18:53 2013 +0900
@@ -14,6 +14,7 @@
 GET		/claims/consensus/:id		controllers.Claim.getClaimTree(id: String)
 GET		/consensus/browse/:id		controllers.Claim.getClaimTree(id: String)
 GET		/claims/answer/:id/:name	controllers.Claim.getUserConsensusStatus(id: String, name: String)
+GET		/copytree/:id				controllers.Claim.copyClaims(id: String)
 POST	/claims/answer/:id/:name/:status	controllers.Claim.updateUserConsensusStatus(id: String, name: String, status: String)
 POST	/claims/create				controllers.Claim.createClaim()
 POST	/claims/:mentionType/:id/create			controllers.Claim.createMention(mentionType: String ,id: String)
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/Routes$$anonfun$routes$1.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes$.class has changed
Binary file target/scala-2.9.1/classes_managed/Routes.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ReverseApplication.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ReverseAssets.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.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ref/ReverseAssets$$anonfun$at$1.class has changed
Binary file target/scala-2.9.1/classes_managed/controllers/ref/ReverseAssets.class has changed
--- a/target/scala-2.9.1/src_managed/main/controllers/routes.java	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/src_managed/main/controllers/routes.java	Fri Mar 08 16:18:53 2013 +0900
@@ -1,6 +1,6 @@
 // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes
-// @HASH:f8a97bc8ba05630c36d0e563f7a835a6fa57153c
-// @DATE:Tue Nov 13 04:47:46 JST 2012
+// @HASH:3317ca87d73529fc1de270007d36f9a429867f66
+// @DATE:Thu Mar 07 18:55:07 JST 2013
 
 package controllers;
 
--- a/target/scala-2.9.1/src_managed/main/routes_reverseRouting.scala	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/src_managed/main/routes_reverseRouting.scala	Fri Mar 08 16:18:53 2013 +0900
@@ -1,6 +1,6 @@
 // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes
-// @HASH:f8a97bc8ba05630c36d0e563f7a835a6fa57153c
-// @DATE:Tue Nov 13 04:47:46 JST 2012
+// @HASH:3317ca87d73529fc1de270007d36f9a429867f66
+// @DATE:Thu Mar 07 18:55:07 JST 2013
 
 import play.core._
 import play.core.Router._
@@ -12,11 +12,12 @@
 import Router.queryString
 
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
+// @LINE:27
 // @LINE:26
-// @LINE:25
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -33,7 +34,8 @@
 // @LINE:7
 package controllers {
 
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -47,25 +49,31 @@
 
 
  
-// @LINE:18
+// @LINE:19
 def createClaim() = {
    Call("POST", "/claims/create")
 }
                                                         
  
-// @LINE:17
+// @LINE:18
 def updateUserConsensusStatus(id:String, name:String, status:String) = {
    Call("POST", "/claims/answer/" + implicitly[PathBindable[String]].unbind("id", id) + "/" + implicitly[PathBindable[String]].unbind("name", name) + "/" + implicitly[PathBindable[String]].unbind("status", status))
 }
                                                         
  
-// @LINE:20
+// @LINE:21
 def editClaim(id:String) = {
    Call("POST", "/claims/edit/" + implicitly[PathBindable[String]].unbind("id", id))
 }
                                                         
  
-// @LINE:19
+// @LINE:17
+def copyClaims(id:String) = {
+   Call("GET", "/copytree/" + implicitly[PathBindable[String]].unbind("id", id))
+}
+                                                        
+ 
+// @LINE:20
 def createMention(mentionType:String, id:String) = {
    Call("POST", "/claims/" + implicitly[PathBindable[String]].unbind("mentionType", mentionType) + "/" + implicitly[PathBindable[String]].unbind("id", id) + "/create")
 }
@@ -77,7 +85,7 @@
 }
                                                         
  
-// @LINE:22
+// @LINE:23
 def reset() = {
    Call("GET", "/reset")
 }
@@ -108,20 +116,20 @@
 }
                             
 
+// @LINE:27
 // @LINE:26
-// @LINE:25
 class ReverseApplication {
     
 
 
  
-// @LINE:26
+// @LINE:27
 def test() = {
    Call("GET", "/test")
 }
                                                         
  
-// @LINE:25
+// @LINE:26
 def hello() = {
    Call("POST", "/hello")
 }
@@ -132,21 +140,21 @@
 }
                             
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
 class ReverseAssets {
     
 
 
  
+// @LINE:33
 // @LINE:32
-// @LINE:31
 def at(file:String) = {
    (file) match {
-// @LINE:31
+// @LINE:32
 case (file) if file == "index.html" => Call("GET", "/")
                                                                 
-// @LINE:32
+// @LINE:33
 case (file) if true => Call("GET", "/" + implicitly[PathBindable[String]].unbind("file", file))
                                                                     
    }
@@ -213,11 +221,12 @@
                     
 
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
+// @LINE:27
 // @LINE:26
-// @LINE:25
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -234,7 +243,8 @@
 // @LINE:7
 package controllers.javascript {
 
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -248,7 +258,7 @@
 
 
  
-// @LINE:18
+// @LINE:19
 def createClaim = JavascriptReverseRoute(
    "controllers.Claim.createClaim",
    """
@@ -259,7 +269,7 @@
 )
                                                         
  
-// @LINE:17
+// @LINE:18
 def updateUserConsensusStatus = JavascriptReverseRoute(
    "controllers.Claim.updateUserConsensusStatus",
    """
@@ -270,7 +280,7 @@
 )
                                                         
  
-// @LINE:20
+// @LINE:21
 def editClaim = JavascriptReverseRoute(
    "controllers.Claim.editClaim",
    """
@@ -281,7 +291,18 @@
 )
                                                         
  
-// @LINE:19
+// @LINE:17
+def copyClaims = JavascriptReverseRoute(
+   "controllers.Claim.copyClaims",
+   """
+      function(id) {
+      return _wA({method:"GET", url:"/copytree/" + (""" + implicitly[PathBindable[String]].javascriptUnbind + """)("id", id)})
+      }
+   """
+)
+                                                        
+ 
+// @LINE:20
 def createMention = JavascriptReverseRoute(
    "controllers.Claim.createMention",
    """
@@ -303,7 +324,7 @@
 )
                                                         
  
-// @LINE:22
+// @LINE:23
 def reset = JavascriptReverseRoute(
    "controllers.Claim.reset",
    """
@@ -347,14 +368,14 @@
 }
                             
 
+// @LINE:27
 // @LINE:26
-// @LINE:25
 class ReverseApplication {
     
 
 
  
-// @LINE:26
+// @LINE:27
 def test = JavascriptReverseRoute(
    "controllers.Application.test",
    """
@@ -365,7 +386,7 @@
 )
                                                         
  
-// @LINE:25
+// @LINE:26
 def hello = JavascriptReverseRoute(
    "controllers.Application.hello",
    """
@@ -381,15 +402,15 @@
 }
                             
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
 class ReverseAssets {
     
 
 
  
+// @LINE:33
 // @LINE:32
-// @LINE:31
 def at = JavascriptReverseRoute(
    "controllers.Assets.at",
    """
@@ -495,11 +516,12 @@
                     
 
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
+// @LINE:27
 // @LINE:26
-// @LINE:25
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -516,7 +538,8 @@
 // @LINE:7
 package controllers.ref {
 
-// @LINE:22
+// @LINE:23
+// @LINE:21
 // @LINE:20
 // @LINE:19
 // @LINE:18
@@ -530,25 +553,31 @@
 
 
  
-// @LINE:18
+// @LINE:19
 def createClaim() = new play.api.mvc.HandlerRef(
    controllers.Claim.createClaim(), HandlerDef(this, "controllers.Claim", "createClaim", Seq())
 )
                               
  
-// @LINE:17
+// @LINE:18
 def updateUserConsensusStatus(id:String, name:String, status:String) = new play.api.mvc.HandlerRef(
    controllers.Claim.updateUserConsensusStatus(id, name, status), HandlerDef(this, "controllers.Claim", "updateUserConsensusStatus", Seq(classOf[String], classOf[String], classOf[String]))
 )
                               
  
-// @LINE:20
+// @LINE:21
 def editClaim(id:String) = new play.api.mvc.HandlerRef(
    controllers.Claim.editClaim(id), HandlerDef(this, "controllers.Claim", "editClaim", Seq(classOf[String]))
 )
                               
  
-// @LINE:19
+// @LINE:17
+def copyClaims(id:String) = new play.api.mvc.HandlerRef(
+   controllers.Claim.copyClaims(id), HandlerDef(this, "controllers.Claim", "copyClaims", Seq(classOf[String]))
+)
+                              
+ 
+// @LINE:20
 def createMention(mentionType:String, id:String) = new play.api.mvc.HandlerRef(
    controllers.Claim.createMention(mentionType, id), HandlerDef(this, "controllers.Claim", "createMention", Seq(classOf[String], classOf[String]))
 )
@@ -560,7 +589,7 @@
 )
                               
  
-// @LINE:22
+// @LINE:23
 def reset() = new play.api.mvc.HandlerRef(
    controllers.Claim.reset(), HandlerDef(this, "controllers.Claim", "reset", Seq())
 )
@@ -583,20 +612,20 @@
 }
                             
 
+// @LINE:27
 // @LINE:26
-// @LINE:25
 class ReverseApplication {
     
 
 
  
-// @LINE:26
+// @LINE:27
 def test() = new play.api.mvc.HandlerRef(
    controllers.Application.test(), HandlerDef(this, "controllers.Application", "test", Seq())
 )
                               
  
-// @LINE:25
+// @LINE:26
 def hello() = new play.api.mvc.HandlerRef(
    controllers.Application.hello(), HandlerDef(this, "controllers.Application", "hello", Seq())
 )
@@ -607,14 +636,14 @@
 }
                             
 
+// @LINE:33
 // @LINE:32
-// @LINE:31
 class ReverseAssets {
     
 
 
  
-// @LINE:31
+// @LINE:32
 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]))
 )
--- a/target/scala-2.9.1/src_managed/main/routes_routing.scala	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/src_managed/main/routes_routing.scala	Fri Mar 08 16:18:53 2013 +0900
@@ -1,6 +1,6 @@
 // @SOURCE:/Users/aotokage/workspace/Consensus/conf/routes
-// @HASH:f8a97bc8ba05630c36d0e563f7a835a6fa57153c
-// @DATE:Tue Nov 13 04:47:46 JST 2012
+// @HASH:3317ca87d73529fc1de270007d36f9a429867f66
+// @DATE:Thu Mar 07 18:55:07 JST 2013
 
 import play.core._
 import play.core.Router._
@@ -55,41 +55,45 @@
                     
 
 // @LINE:17
-val controllers_Claim_updateUserConsensusStatus10 = Route("POST", PathPattern(List(StaticPart("/claims/answer/"),DynamicPart("id", """[^/]+"""),StaticPart("/"),DynamicPart("name", """[^/]+"""),StaticPart("/"),DynamicPart("status", """[^/]+"""))))
+val controllers_Claim_copyClaims10 = Route("GET", PathPattern(List(StaticPart("/copytree/"),DynamicPart("id", """[^/]+"""))))
                     
 
 // @LINE:18
-val controllers_Claim_createClaim11 = Route("POST", PathPattern(List(StaticPart("/claims/create"))))
+val controllers_Claim_updateUserConsensusStatus11 = Route("POST", PathPattern(List(StaticPart("/claims/answer/"),DynamicPart("id", """[^/]+"""),StaticPart("/"),DynamicPart("name", """[^/]+"""),StaticPart("/"),DynamicPart("status", """[^/]+"""))))
                     
 
 // @LINE:19
-val controllers_Claim_createMention12 = Route("POST", PathPattern(List(StaticPart("/claims/"),DynamicPart("mentionType", """[^/]+"""),StaticPart("/"),DynamicPart("id", """[^/]+"""),StaticPart("/create"))))
+val controllers_Claim_createClaim12 = Route("POST", PathPattern(List(StaticPart("/claims/create"))))
                     
 
 // @LINE:20
-val controllers_Claim_editClaim13 = Route("POST", PathPattern(List(StaticPart("/claims/edit/"),DynamicPart("id", """[^/]+"""))))
+val controllers_Claim_createMention13 = Route("POST", PathPattern(List(StaticPart("/claims/"),DynamicPart("mentionType", """[^/]+"""),StaticPart("/"),DynamicPart("id", """[^/]+"""),StaticPart("/create"))))
                     
 
-// @LINE:22
-val controllers_Claim_reset14 = Route("GET", PathPattern(List(StaticPart("/reset"))))
+// @LINE:21
+val controllers_Claim_editClaim14 = Route("POST", PathPattern(List(StaticPart("/claims/edit/"),DynamicPart("id", """[^/]+"""))))
                     
 
-// @LINE:25
-val controllers_Application_hello15 = Route("POST", PathPattern(List(StaticPart("/hello"))))
+// @LINE:23
+val controllers_Claim_reset15 = Route("GET", PathPattern(List(StaticPart("/reset"))))
                     
 
 // @LINE:26
-val controllers_Application_test16 = Route("GET", PathPattern(List(StaticPart("/test"))))
+val controllers_Application_hello16 = Route("POST", PathPattern(List(StaticPart("/hello"))))
                     
 
-// @LINE:31
-val controllers_Assets_at17 = Route("GET", PathPattern(List(StaticPart("/"))))
+// @LINE:27
+val controllers_Application_test17 = Route("GET", PathPattern(List(StaticPart("/test"))))
                     
 
 // @LINE:32
-val controllers_Assets_at18 = Route("GET", PathPattern(List(StaticPart("/"),DynamicPart("file", """.+"""))))
+val controllers_Assets_at18 = Route("GET", PathPattern(List(StaticPart("/"))))
                     
-def documentation = List(("""GET""","""/users/all""","""controllers.User.getAllUsers()"""),("""PUT""","""/users/create/$name<[^/]+>""","""controllers.User.createUser(name:String)"""),("""GET""","""/users/browse/$name<[^/]+>""","""controllers.User.getUser(name:String)"""),("""GET""","""/users/requests/$name<[^/]+>""","""controllers.User.getUserRequests(name:String)"""),("""GET""","""/users/consensus/$name<[^/]+>""","""controllers.User.getUserConsensus(name:String)"""),("""GET""","""/users/claims/$name<[^/]+>""","""controllers.User.getUserClaims(name:String)"""),("""GET""","""/claims/browse/$id<[^/]+>""","""controllers.Claim.getClaimInfo(id:String)"""),("""GET""","""/claims/consensus/$id<[^/]+>""","""controllers.Claim.getClaimTree(id:String)"""),("""GET""","""/consensus/browse/$id<[^/]+>""","""controllers.Claim.getClaimTree(id:String)"""),("""GET""","""/claims/answer/$id<[^/]+>/$name<[^/]+>""","""controllers.Claim.getUserConsensusStatus(id:String, name:String)"""),("""POST""","""/claims/answer/$id<[^/]+>/$name<[^/]+>/$status<[^/]+>""","""controllers.Claim.updateUserConsensusStatus(id:String, name:String, status:String)"""),("""POST""","""/claims/create""","""controllers.Claim.createClaim()"""),("""POST""","""/claims/$mentionType<[^/]+>/$id<[^/]+>/create""","""controllers.Claim.createMention(mentionType:String, id:String)"""),("""POST""","""/claims/edit/$id<[^/]+>""","""controllers.Claim.editClaim(id:String)"""),("""GET""","""/reset""","""controllers.Claim.reset()"""),("""POST""","""/hello""","""controllers.Application.hello()"""),("""GET""","""/test""","""controllers.Application.test()"""),("""GET""","""/""","""controllers.Assets.at(path:String = "/public/viewer", file:String = "index.html")"""),("""GET""","""/$file<.+>""","""controllers.Assets.at(path:String = "/public/viewer", file:String)"""))
+
+// @LINE:33
+val controllers_Assets_at19 = Route("GET", PathPattern(List(StaticPart("/"),DynamicPart("file", """.+"""))))
+                    
+def documentation = List(("""GET""","""/users/all""","""controllers.User.getAllUsers()"""),("""PUT""","""/users/create/$name<[^/]+>""","""controllers.User.createUser(name:String)"""),("""GET""","""/users/browse/$name<[^/]+>""","""controllers.User.getUser(name:String)"""),("""GET""","""/users/requests/$name<[^/]+>""","""controllers.User.getUserRequests(name:String)"""),("""GET""","""/users/consensus/$name<[^/]+>""","""controllers.User.getUserConsensus(name:String)"""),("""GET""","""/users/claims/$name<[^/]+>""","""controllers.User.getUserClaims(name:String)"""),("""GET""","""/claims/browse/$id<[^/]+>""","""controllers.Claim.getClaimInfo(id:String)"""),("""GET""","""/claims/consensus/$id<[^/]+>""","""controllers.Claim.getClaimTree(id:String)"""),("""GET""","""/consensus/browse/$id<[^/]+>""","""controllers.Claim.getClaimTree(id:String)"""),("""GET""","""/claims/answer/$id<[^/]+>/$name<[^/]+>""","""controllers.Claim.getUserConsensusStatus(id:String, name:String)"""),("""GET""","""/copytree/$id<[^/]+>""","""controllers.Claim.copyClaims(id:String)"""),("""POST""","""/claims/answer/$id<[^/]+>/$name<[^/]+>/$status<[^/]+>""","""controllers.Claim.updateUserConsensusStatus(id:String, name:String, status:String)"""),("""POST""","""/claims/create""","""controllers.Claim.createClaim()"""),("""POST""","""/claims/$mentionType<[^/]+>/$id<[^/]+>/create""","""controllers.Claim.createMention(mentionType:String, id:String)"""),("""POST""","""/claims/edit/$id<[^/]+>""","""controllers.Claim.editClaim(id:String)"""),("""GET""","""/reset""","""controllers.Claim.reset()"""),("""POST""","""/hello""","""controllers.Application.hello()"""),("""GET""","""/test""","""controllers.Application.test()"""),("""GET""","""/""","""controllers.Assets.at(path:String = "/public/viewer", file:String = "index.html")"""),("""GET""","""/$file<.+>""","""controllers.Assets.at(path:String = "/public/viewer", file:String)"""))
              
     
 def routes:PartialFunction[RequestHeader,Handler] = {        
@@ -175,71 +179,79 @@
                     
 
 // @LINE:17
-case controllers_Claim_updateUserConsensusStatus10(params) => {
+case controllers_Claim_copyClaims10(params) => {
+   call(params.fromPath[String]("id", None)) { (id) =>
+        invokeHandler(_root_.controllers.Claim.copyClaims(id), HandlerDef(this, "controllers.Claim", "copyClaims", Seq(classOf[String])))
+   }
+}
+                    
+
+// @LINE:18
+case controllers_Claim_updateUserConsensusStatus11(params) => {
    call(params.fromPath[String]("id", None), params.fromPath[String]("name", None), params.fromPath[String]("status", None)) { (id, name, status) =>
         invokeHandler(_root_.controllers.Claim.updateUserConsensusStatus(id, name, status), HandlerDef(this, "controllers.Claim", "updateUserConsensusStatus", Seq(classOf[String], classOf[String], classOf[String])))
    }
 }
                     
 
-// @LINE:18
-case controllers_Claim_createClaim11(params) => {
+// @LINE:19
+case controllers_Claim_createClaim12(params) => {
    call { 
         invokeHandler(_root_.controllers.Claim.createClaim(), HandlerDef(this, "controllers.Claim", "createClaim", Nil))
    }
 }
                     
 
-// @LINE:19
-case controllers_Claim_createMention12(params) => {
+// @LINE:20
+case controllers_Claim_createMention13(params) => {
    call(params.fromPath[String]("mentionType", None), params.fromPath[String]("id", None)) { (mentionType, id) =>
         invokeHandler(_root_.controllers.Claim.createMention(mentionType, id), HandlerDef(this, "controllers.Claim", "createMention", Seq(classOf[String], classOf[String])))
    }
 }
                     
 
-// @LINE:20
-case controllers_Claim_editClaim13(params) => {
+// @LINE:21
+case controllers_Claim_editClaim14(params) => {
    call(params.fromPath[String]("id", None)) { (id) =>
         invokeHandler(_root_.controllers.Claim.editClaim(id), HandlerDef(this, "controllers.Claim", "editClaim", Seq(classOf[String])))
    }
 }
                     
 
-// @LINE:22
-case controllers_Claim_reset14(params) => {
+// @LINE:23
+case controllers_Claim_reset15(params) => {
    call { 
         invokeHandler(_root_.controllers.Claim.reset(), HandlerDef(this, "controllers.Claim", "reset", Nil))
    }
 }
                     
 
-// @LINE:25
-case controllers_Application_hello15(params) => {
+// @LINE:26
+case controllers_Application_hello16(params) => {
    call { 
         invokeHandler(_root_.controllers.Application.hello(), HandlerDef(this, "controllers.Application", "hello", Nil))
    }
 }
                     
 
-// @LINE:26
-case controllers_Application_test16(params) => {
+// @LINE:27
+case controllers_Application_test17(params) => {
    call { 
         invokeHandler(_root_.controllers.Application.test(), HandlerDef(this, "controllers.Application", "test", Nil))
    }
 }
                     
 
-// @LINE:31
-case controllers_Assets_at17(params) => {
+// @LINE:32
+case controllers_Assets_at18(params) => {
    call(Param[String]("path", Right("/public/viewer")), Param[String]("file", Right("index.html"))) { (path, file) =>
         invokeHandler(_root_.controllers.Assets.at(path, file), HandlerDef(this, "controllers.Assets", "at", Seq(classOf[String], classOf[String])))
    }
 }
                     
 
-// @LINE:32
-case controllers_Assets_at18(params) => {
+// @LINE:33
+case controllers_Assets_at19(params) => {
    call(Param[String]("path", Right("/public/viewer")), 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/scala-2.9.1/src_managed/main/views/html/index.template.scala	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/src_managed/main/views/html/index.template.scala	Fri Mar 08 16:18:53 2013 +0900
@@ -45,7 +45,7 @@
 }
                 /*
                     -- GENERATED --
-                    DATE: Tue Nov 13 03:26:06 JST 2012
+                    DATE: Thu Mar 07 18:49:49 JST 2013
                     SOURCE: /Users/aotokage/workspace/Consensus/app/views/index.scala.html
                     HASH: 40523c3560c255ffb9a20c98b65c17e640c1d57a
                     MATRIX: 755->1|849->18|886->21|921->48|960->50|1005->61|1019->67|1073->100
--- a/target/scala-2.9.1/src_managed/main/views/html/main.template.scala	Thu Mar 07 20:08:15 2013 +0900
+++ b/target/scala-2.9.1/src_managed/main/views/html/main.template.scala	Fri Mar 08 16:18:53 2013 +0900
@@ -54,7 +54,7 @@
 }
                 /*
                     -- GENERATED --
-                    DATE: Tue Nov 13 03:26:06 JST 2012
+                    DATE: Thu Mar 07 18:49:49 JST 2013
                     SOURCE: /Users/aotokage/workspace/Consensus/app/views/main.scala.html
                     HASH: 6a9d3e71a4db67b23442aa0e15837c7026dc07bb
                     MATRIX: 759->1|866->31|954->84|980->89|1077->151|1091->157|1146->191|1242->252|1256->258|1309->290|1370->315|1385->321|1452->366|1555->433|1584->440