comparison app/controllers/Claim.java @ 30:80b5628f17d8

modified ClaimModel/getInfo action
author one
date Wed, 03 Oct 2012 14:27:44 +0900
parents fbb232e78422
children 995be14b30a2
comparison
equal deleted inserted replaced
29:fbb232e78422 30:80b5628f17d8
38 ClaimModel newClaim = new ClaimModel(graph.addVertex(null)); 38 ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
39 tpGraph.setLabelToAuthor(newClaim, author); 39 tpGraph.setLabelToAuthor(newClaim, author);
40 newClaim.setClaimProperties(toulmin, type); 40 newClaim.setClaimProperties(toulmin, type);
41 41
42 String[] users = toStringArray(usersJson); 42 String[] users = toStringArray(usersJson);
43 tpGraph.setLabelToUsers(newClaim, users, NodeModel.L_REQUEST); 43 tpGraph.setLabelStatusToUsers(newClaim, users, NodeModel.L_REQUEST, NodeModel.FAIL);
44 tpGraph.setLabelToRootClaim(newClaim); 44 tpGraph.setLabelToRootClaim(newClaim);
45 45
46 return created(); 46 return created();
47 } 47 }
48 48
73 ClaimModel newClaim = new ClaimModel(graph.addVertex(null)); 73 ClaimModel newClaim = new ClaimModel(graph.addVertex(null));
74 tpGraph.setLabelToAuthor(newClaim, author); 74 tpGraph.setLabelToAuthor(newClaim, author);
75 newClaim.setClaimProperties(toulmin, type); 75 newClaim.setClaimProperties(toulmin, type);
76 76
77 String[] users = toStringArray(usersJson); 77 String[] users = toStringArray(usersJson);
78 tpGraph.setLabelToUsers(newClaim, users, NodeModel.L_REQUEST); 78 tpGraph.setLabelStatusToUsers(newClaim, users, NodeModel.L_REQUEST, NodeModel.FAIL);
79 tpGraph.setLabelToRootClaim(newClaim); 79 tpGraph.setLabelToRootClaim(newClaim);
80 80
81 ClaimModel mentionV = new ClaimModel(graph.getVertex(id)); 81 ClaimModel mentionV = new ClaimModel(graph.getVertex(id));
82 tpGraph.setLabelMention(mentionV, newClaim, mentionType); 82 tpGraph.setLabelMention(mentionV, newClaim, mentionType);
83 83
102 Graph graph = tpGraph.getGraph(); 102 Graph graph = tpGraph.getGraph();
103 103
104 Vertex v = graph.getVertex(id); 104 Vertex v = graph.getVertex(id);
105 if (v == null) return badRequest("Consensus id "+ id +" is not found."); 105 if (v == null) return badRequest("Consensus id "+ id +" is not found.");
106 ClaimModel consensusRoot = new ClaimModel(v); 106 ClaimModel consensusRoot = new ClaimModel(v);
107 107 ObjectNode consensusObj = consensusRoot.getClaimInfoFromGraph();
108
109 JsonNode jobj = consensusObj.findValue(NodeModel.TOULMIN);
108 110
109 111
110 112
111 113 ObjectNode result = Json.newObject();
112 114 result.put("message",jobj.toString());
113 return ok(); 115 return ok(result);
114 } 116 }
115 117
116 118
117 119
118 120