annotate app/Global.java @ 8:7b314898fddd

create action User.getUser()
author one
date Mon, 01 Oct 2012 19:53:43 +0900
parents 2122c50278bd
children f3db6edc61ad
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
1 import models.TPGraph;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
2
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
3 import com.tinkerpop.blueprints.Graph;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
4 import com.tinkerpop.blueprints.Vertex;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
5
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
6 import play.Application;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
7 import play.GlobalSettings;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
8 import play.Logger;
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
9
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
10
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
11 public class Global extends GlobalSettings {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
12
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
13 @Override
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
14 public void onStart(Application app) {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
15 TPGraph tpgraph = TPGraph.getInstance();
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
16 tpgraph.setPath(null);
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
17 Graph graph = tpgraph.newGraph();
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
18 Vertex claimV = graph.addVertex(null);
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
19 tpgraph.setClaimRootId(claimV.getId());
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
20 Vertex userV = graph.addVertex(null);
8
7b314898fddd create action User.getUser()
one
parents: 7
diff changeset
21 tpgraph.setUserRootId(userV.getId());
7
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
22 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
23
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
24 @Override
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
25 public void onStop(Application app) {
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
26 Logger.info("Application shutdown...");
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
27
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
28 }
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
29
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
30
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
31
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
32
2122c50278bd add Global.java, ande models/*
one
parents:
diff changeset
33 }