view app/models/ClaimModel.java @ 28:7112b826a53a

modified RequestTest.java
author one
date Wed, 03 Oct 2012 12:53:37 +0900
parents 97b249d9fad1
children fbb232e78422
line wrap: on
line source

package models;

import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ObjectNode;

import play.libs.Json;

import com.tinkerpop.blueprints.Vertex;

public class ClaimModel extends NodeModel {

	

	
	public ClaimModel(Vertex vertex) {
		super(vertex);
	}
	
	public ObjectNode getClaimPropertyFromGraph() {
		
		ObjectNode t = Json.newObject();
		
		
		
		
		
		return null;
	}
	
	
	public void setClaimProperties(JsonNode toulmin, String type) {
		String title = toulmin.findPath(NodeModel.TITLE).getTextValue();
		String contents = toulmin.findPath(NodeModel.CONTENTS).getTextValue();
		String q = toulmin.findPath(NodeModel.QUALIFIER).getTextValue(); // Qualifier
		String d = toulmin.findPath(NodeModel.DATA).getTextValue(); // Data
		String w = toulmin.findPath(NodeModel.WARRANT).getTextValue(); // Warrant
		String b = toulmin.findPath(NodeModel.BACKING).getTextValue(); // Backing
		String r = toulmin.findPath(NodeModel.REBUTTLE).getTextValue(); // Rebuttle

		ObjectNode t = Json.newObject();
		t.put(TITLE, title);
		t.put(CONTENTS, contents);
		t.put(QUALIFIER, q);
		t.put(DATA, d);
		t.put(WARRANT, w);
		t.put(BACKING, b);
		t.put(REBUTTLE, r);

		setProperty(TYPE, type);
		setProperty(MENTIONS, null);
		setProperty(STATUS, FAIL); // Default Status is fail.
		setProperty(TOULMIN, t);
	}
	
	public void setClaimMention(String label) {
		
		
	}

	
	
}