view app/controllers/Application.java @ 4:e12d0b6dbe02 draft default tip

add some files
author e085711
date Wed, 26 Sep 2012 14:43:57 +0900
parents 5a097a2336fa
children
line wrap: on
line source

package controllers;

import play.*;
import play.mvc.*;

import java.util.*;

import models.TPGraph;

import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.blueprints.impls.tg.TinkerGraph;


public class Application extends Controller {

    public static void index() {
        render();
    }
    
    public static void testwrite() {
    	TPGraph tpgraph = TPGraph.getInstance();
		Graph graph = tpgraph.getGraph();	
    	Vertex a = graph.addVertex(null);
    	a.setProperty("name","mario");
    	Object id = a.getId(); 
       	tpgraph.shutdownGraph();
       	graph.shutdown();
    	renderText(id);
    }
    
    public static void testread() {
    	TPGraph tpgraph = TPGraph.getInstance();
    	Graph graph = tpgraph.getGraph();
    	Vertex a = graph.getVertex(0);
   		String str = (String) a.getProperty("name");
   		renderText(str);

    }
     
    
}