changeset 72:1c13476a0c1f draft

modified ClaiModel clone method
author one
date Wed, 06 Mar 2013 16:00:15 +0900
parents c76b3b60eb18
children b17c8a25195e
files .settings/org.scala-ide.sdt.core.prefs app/controllers/Claim.java app/models/ClaimModel.java app/models/UserModel.java logs/application.log target/scala-2.9.1/cache/compile/compile
diffstat 6 files changed, 26 insertions(+), 51 deletions(-) [+]
line wrap: on
line diff
--- a/.settings/org.scala-ide.sdt.core.prefs	Thu Feb 21 03:15:39 2013 +0900
+++ b/.settings/org.scala-ide.sdt.core.prefs	Wed Mar 06 16:00:15 2013 +0900
@@ -1,5 +1,5 @@
 #Generated by sbteclipse
-#Wed Nov 07 22:43:18 JST 2012
+#Thu Feb 21 03:16:11 JST 2013
 Xcheckinit=true
 deprecation=true
 encoding=utf8
--- a/app/controllers/Claim.java	Thu Feb 21 03:15:39 2013 +0900
+++ b/app/controllers/Claim.java	Wed Mar 06 16:00:15 2013 +0900
@@ -36,7 +36,7 @@
 		if (toulmin.findPath(NodeModel.TITLE) == null) { 
 			return badRequest("Please set title");
 		}
-		JsonNode usersJson = json.get(NodeModel.USERS); // Users (class JsonNode) 
+ 		JsonNode usersJson = json.get(NodeModel.USERS); // Users (class JsonNode) 
 		if (usersJson == null) {
 			return badRequest("Please set users");
 		}
@@ -158,7 +158,6 @@
 		tpGraph.setLabelMention(targetClaim, newClaim, mentionType);
 		newClaim.computeAndUpdateStatus();
 		targetClaim.computeAndUpdateStatus();
-
 		return created();
 	}
 
--- a/app/models/ClaimModel.java	Thu Feb 21 03:15:39 2013 +0900
+++ b/app/models/ClaimModel.java	Wed Mar 06 16:00:15 2013 +0900
@@ -425,4 +425,24 @@
 		}
 		return null;
 	}
+	
+	public ClaimModel clone() {
+		TPGraph tpGraph = TPGraph.getInstance();
+		Graph graph = tpGraph.getGraph();
+		ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
+		String author = (this.getProperty(L_AUTHOR)).toString();
+		String type = (this.getProperty(TYPE)).toString();
+		JsonNode toulmin = (JsonNode)this.getProperty(TOULMIN);
+		Object[] usersObj = getUsersId();
+		ArrayList<String> usersList = new ArrayList<String>(); 
+		for (Object o : usersObj) {
+			usersList.add(o.toString());
+		}
+		tpGraph.setLabelToAuthor(newClaim, author.toString());
+		newClaim.setClaimProperties(toulmin, type);
+		
+		return newClaim;
+		
+	}
+
 }
--- a/app/models/UserModel.java	Thu Feb 21 03:15:39 2013 +0900
+++ b/app/models/UserModel.java	Wed Mar 06 16:00:15 2013 +0900
@@ -60,4 +60,5 @@
 		hash.put(NodeModel.CONSENSUS, tpGraph.checkConsensus(set));
 		return hash;
 	}
+	
 }
--- a/logs/application.log	Thu Feb 21 03:15:39 2013 +0900
+++ b/logs/application.log	Wed Mar 06 16:00:15 2013 +0900
@@ -1,54 +1,9 @@
-2013-02-20 02:50:38,688 - [INFO] - from play in main 
+2013-02-22 19:37:21,212 - [INFO] - from play in main 
 Listening for HTTP on port 9000...
 
-2013-02-20 02:51:35,779 - [INFO] - from play in play-akka.actor.default-dispatcher-2 
-Application started (Dev)
-
-2013-02-20 02:52:42,637 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 02:52:42,658 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
+2013-02-22 19:37:32,151 - [INFO] - from play in play-akka.actor.default-dispatcher-2 
 Application started (Dev)
 
-2013-02-20 02:54:52,949 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 02:54:52,971 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
-Application started (Dev)
-
-2013-02-20 02:55:15,321 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 02:55:15,344 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
-Application started (Dev)
-
-2013-02-20 02:55:32,383 - [INFO] - from application in play-akka.actor.default-dispatcher-2 
+2013-03-05 12:04:39,229 - [INFO] - from application in main 
 Application shutdown...
 
-2013-02-20 02:55:32,403 - [INFO] - from play in play-akka.actor.default-dispatcher-2 
-Application started (Dev)
-
-2013-02-20 03:02:34,944 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 03:02:34,975 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
-Application started (Dev)
-
-2013-02-20 03:02:45,717 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 03:02:45,738 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
-Application started (Dev)
-
-2013-02-20 03:03:07,563 - [INFO] - from application in play-akka.actor.default-dispatcher-4 
-Application shutdown...
-
-2013-02-20 03:03:07,586 - [INFO] - from play in play-akka.actor.default-dispatcher-4 
-Application started (Dev)
-
-2013-02-21 02:40:12,217 - [INFO] - from application in play-akka.actor.default-dispatcher-5 
-Application shutdown...
-
-2013-02-21 02:40:12,271 - [INFO] - from play in play-akka.actor.default-dispatcher-5 
-Application started (Dev)
-
Binary file target/scala-2.9.1/cache/compile/compile has changed