14
|
1 package models;
|
|
2
|
16
|
3 import org.codehaus.jackson.JsonNode;
|
14
|
4 import org.codehaus.jackson.node.ObjectNode;
|
|
5
|
|
6 import play.libs.Json;
|
|
7
|
|
8 import com.tinkerpop.blueprints.Vertex;
|
|
9
|
|
10 public class ClaimModel extends NodeModel {
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15 public ClaimModel(Vertex vertex) {
|
|
16 super(vertex);
|
|
17 }
|
|
18
|
|
19
|
18
|
20 public void setClaimProperties(JsonNode toulmin, String type) {
|
16
|
21 String title = toulmin.findPath(NodeModel.TITLE).getTextValue();
|
|
22 String contents = toulmin.findPath(NodeModel.CONTENTS).getTextValue();
|
|
23 String q = toulmin.findPath(NodeModel.QUALIFIER).getTextValue(); // Qualifier
|
|
24 String d = toulmin.findPath(NodeModel.DATA).getTextValue(); // Data
|
|
25 String w = toulmin.findPath(NodeModel.WARRANT).getTextValue(); // Warrant
|
|
26 String b = toulmin.findPath(NodeModel.BACKING).getTextValue(); // Backing
|
|
27 String r = toulmin.findPath(NodeModel.REBUTTLE).getTextValue(); // Rebuttle
|
14
|
28
|
16
|
29 ObjectNode t = Json.newObject();
|
|
30 t.put(TITLE, title);
|
|
31 t.put(CONTENTS, contents);
|
|
32 t.put(QUALIFIER, q);
|
|
33 t.put(DATA, d);
|
|
34 t.put(WARRANT, w);
|
|
35 t.put(BACKING, b);
|
|
36 t.put(REBUTTLE, r);
|
14
|
37
|
|
38 setProperty(TYPE, type);
|
|
39 setProperty(MENTIONS, null);
|
18
|
40 setProperty(STATUS, FAIL); // Default Status is fail.
|
16
|
41 setProperty(TOULMIN, t);
|
18
|
42
|
14
|
43 }
|
18
|
44
|
14
|
45
|
|
46
|
|
47 }
|