diff --git a/Doxygen/Examples.Durham/graph1 b/Doxygen/Examples.Durham/graph1 index 4ba6e0ba70..0ed1374c2f 100644 --- a/Doxygen/Examples.Durham/graph1 +++ b/Doxygen/Examples.Durham/graph1 @@ -1,5 +1,6 @@ -avocado> var g = new Graph(db.vertices, edges.edges); -avocado> g; +avocado> var Graph = require("graph").Graph; + +avocado> new Graph(db.vertices, edges.edges); Graph("vertices", "edges") avocado> new Graph("vertices", "edges"); diff --git a/Doxygen/Examples.Durham/graph10 b/Doxygen/Examples.Durham/graph10 index b8bd6f76db..2add71ab3d 100644 --- a/Doxygen/Examples.Durham/graph10 +++ b/Doxygen/Examples.Durham/graph10 @@ -1,14 +1,8 @@ -avocado> g = new Graph("vertices", "edges"); -Graph("vertices", "edges") - -avocado> v1 = g.addVertex({ name : "Hugo" }); -Vertex(, "153246:2310672") - -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e = g.addEdge(v1, v2, "knows", { weight : 10 }); Edge(, "3999653:5570857") +avocado> e.getLabel(); +knows + avocado> e.getProperty(e, "weight"); 10 diff --git a/Doxygen/Examples.Durham/graph11 b/Doxygen/Examples.Durham/graph11 index f4b37c0141..fc3f747aac 100644 --- a/Doxygen/Examples.Durham/graph11 +++ b/Doxygen/Examples.Durham/graph11 @@ -1,10 +1,12 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v1 = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); +avocado> v2 = g.addVertex(); Vertex(, "153246:2310673") avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); diff --git a/Doxygen/Examples.Durham/graph12 b/Doxygen/Examples.Durham/graph12 index 573a377506..ff3fb7b13d 100644 --- a/Doxygen/Examples.Durham/graph12 +++ b/Doxygen/Examples.Durham/graph12 @@ -1,13 +1,12 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e = g.addEdge(v, v, "self", { "weight" : 10 }); Edge(, "3999653:5570857") avocado> e.getProperty("weight"); diff --git a/Doxygen/Examples.Durham/graph13 b/Doxygen/Examples.Durham/graph13 index 3470089bc5..d99e570ebd 100644 --- a/Doxygen/Examples.Durham/graph13 +++ b/Doxygen/Examples.Durham/graph13 @@ -1,13 +1,12 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e = g.addEdge(v, v, "self"); Edge(, "3999653:5570857") avocado> e.getId(); diff --git a/Doxygen/Examples.Durham/graph14 b/Doxygen/Examples.Durham/graph14 index 0691536d03..542c40f604 100644 --- a/Doxygen/Examples.Durham/graph14 +++ b/Doxygen/Examples.Durham/graph14 @@ -1,20 +1,19 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") +avocado> e = g.addEdge(v, v, "self", { weight: 10 }) +Edge(, "2141724:6339989") -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); -Edge(, "3999653:5570857") - -avocado> e.getProperty("weight"); +avocado> e.getPropert("weight") 10 avocado> e.setProperty("weight", 20); 20 -avocado> e.getProperty("weight"); +avocado> e.getPropert("weight") 20 diff --git a/Doxygen/Examples.Durham/graph15 b/Doxygen/Examples.Durham/graph15 index 66dd1f4d46..f97751b62c 100644 --- a/Doxygen/Examples.Durham/graph15 +++ b/Doxygen/Examples.Durham/graph15 @@ -1,12 +1,14 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v1 = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); +avocado> v2 = g.addVertex(); Vertex(, "153246:2310673") -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e = g.addEdge(v1, v2); Edge(, "3999653:7197720") avocado> v1.edges(); diff --git a/Doxygen/Examples.Durham/graph16 b/Doxygen/Examples.Durham/graph16 index 9b5273e744..c789b972d9 100644 --- a/Doxygen/Examples.Durham/graph16 +++ b/Doxygen/Examples.Durham/graph16 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); avocado> v1 = g.addVertex({ name : "Hugo" }); diff --git a/Doxygen/Examples.Durham/graph17 b/Doxygen/Examples.Durham/graph17 index a1173ce798..dc8eff7042 100644 --- a/Doxygen/Examples.Durham/graph17 +++ b/Doxygen/Examples.Durham/graph17 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); avocado> v1 = g.addVertex({ name : "Hugo" }); diff --git a/Doxygen/Examples.Durham/graph18 b/Doxygen/Examples.Durham/graph18 index 27df01d46b..f8fa61ed51 100644 --- a/Doxygen/Examples.Durham/graph18 +++ b/Doxygen/Examples.Durham/graph18 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); avocado> v1 = g.addVertex({ name : "Hugo" }); @@ -6,10 +8,10 @@ Vertex(, "153246:2310672") avocado> v2 = g.addVertex({ name : "Emil" }); Vertex(, "153246:2310673") -avocado> e1 = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e1 = g.addEdge(v1, v2, "knows"); Edge(, "3999653:7360858") -avocado> e2 = g.addEdge(v1, v2, "hates", { "weight" : 10 }); +avocado> e2 = g.addEdge(v1, v2, "hates"); Edge(, "3999653:7426394") avocado> v2.getInEdges(); @@ -20,3 +22,6 @@ avocado> v2.getInEdges("knows"); avocado> v2.getInEdges("hates"); [ Edge(, "3999653:7426394") ] + +avocado> v2.getInEdges("knows", "hates"); +[ Edge(, "3999653:7360858"), Edge(, "3999653:7426394") ] diff --git a/Doxygen/Examples.Durham/graph19 b/Doxygen/Examples.Durham/graph19 index b71eae3ca0..b228ae47f3 100644 --- a/Doxygen/Examples.Durham/graph19 +++ b/Doxygen/Examples.Durham/graph19 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); avocado> v1 = g.addVertex({ name : "Hugo" }); @@ -6,17 +8,20 @@ Vertex(, "153246:2310672") avocado> v2 = g.addVertex({ name : "Emil" }); Vertex(, "153246:2310673") -avocado> e1 = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e1 = g.addEdge(v1, v2, "knows"); Edge(, "3999653:7360858") -avocado> e2 = g.addEdge(v1, v2, "hates", { "weight" : 10 }); +avocado> e2 = g.addEdge(v1, v2, "hates"); Edge(, "3999653:7426394") avocado> v1.getOutEdges(); [ Edge(, "3999653:7360858"), Edge(, "3999653:7426394") ] -avocado> v1.getOutEdges('knows'); +avocado> v1.getOutEdges("knows"); [ Edge(, "3999653:7360858") ] -avocado> v1.getOutEdges('hates'); +avocado> v1.getOutEdges("hates"); [ Edge(, "3999653:7426394") ] + +avocado> v1.getOutEdges("knows", "hates"); +[ Edge(, "3999653:7360858"), Edge(, "3999653:7426394") ] diff --git a/Doxygen/Examples.Durham/graph2 b/Doxygen/Examples.Durham/graph2 index d980ae8656..4b585a1535 100644 --- a/Doxygen/Examples.Durham/graph2 +++ b/Doxygen/Examples.Durham/graph2 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph20 b/Doxygen/Examples.Durham/graph20 index acd93d235a..3dd96f6b7d 100644 --- a/Doxygen/Examples.Durham/graph20 +++ b/Doxygen/Examples.Durham/graph20 @@ -1,13 +1,12 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v1 = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e1 = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e1 = g.addEdge(v, v, "self"); Edge(, "3999653:7360858") avocado> e1.getLabel(); -"knows" +knows diff --git a/Doxygen/Examples.Durham/graph21 b/Doxygen/Examples.Durham/graph21 index 55046f8a7d..80dbedee6d 100644 --- a/Doxygen/Examples.Durham/graph21 +++ b/Doxygen/Examples.Durham/graph21 @@ -1,12 +1,11 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v1 = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e1 = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e1 = g.addEdge(v, v, "self"); Edge(, "3999653:7360858") avocado> e1.getInVertex(); diff --git a/Doxygen/Examples.Durham/graph22 b/Doxygen/Examples.Durham/graph22 index 311e351ba3..508e48e7c2 100644 --- a/Doxygen/Examples.Durham/graph22 +++ b/Doxygen/Examples.Durham/graph22 @@ -1,12 +1,11 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); -avocado> v1 = g.addVertex({ name : "Hugo" }); +avocado> v = g.addVertex(); Vertex(, "153246:2310672") -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - -avocado> e = g.addEdge(v1, v2, "knows", { "weight" : 10 }); +avocado> e = g.addEdge(v, v, "self"); Edge(, "3999653:7360858") avocado> e.getOutVertex(); diff --git a/Doxygen/Examples.Durham/graph23 b/Doxygen/Examples.Durham/graph23 index 9aeb081184..5f05854e86 100644 --- a/Doxygen/Examples.Durham/graph23 +++ b/Doxygen/Examples.Durham/graph23 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") @@ -7,17 +9,8 @@ Vertex(, "153246:8712055") avocado> v2 = g.addVertex(); Vertex(, "153246:8777591") -avocado> v3 = g.addVertex(); -Vertex(, "153246:8843127") - avocado> v1.addInEdge(v2, "knows"); Edge(, "3999653:8908663") avocado> v1.getInEdges(); [ Edge(, "3999653:8908663") ] - -avocado> v1.addOutEdge(v3, "knows"); -Edge(, "3999653:8974199") - -avocado> v1.getOutEdges(); -[ Edge(, "3999653:8974199") ] diff --git a/Doxygen/Examples.Durham/graph24 b/Doxygen/Examples.Durham/graph24 index f613840506..6bef4e8dd7 100644 --- a/Doxygen/Examples.Durham/graph24 +++ b/Doxygen/Examples.Durham/graph24 @@ -1,23 +1,11 @@ -avocado> g = new Graph("vertices", "edges"); -Graph("vertices", "edges") - avocado> v1 = g.addVertex(); Vertex(, "153246:8712055") avocado> v2 = g.addVertex(); Vertex(, "153246:8777591") -avocado> v3 = g.addVertex(); -Vertex(, "153246:8843127") - avocado> v1.addInEdge(v2, "knows", { data : 1 }); Edge(, "3999653:8908663") avocado> v1.getInEdges(); [ Edge(, "3999653:8908663") ] - -avocado> v1.addOutEdge(v3, "knows", { data : 1 }); -Edge(, "3999653:8974199") - -avocado> v1.getOutEdges(); -[ Edge(, "3999653:8974199") ] diff --git a/Doxygen/Examples.Durham/graph25 b/Doxygen/Examples.Durham/graph25 index 786980362e..cd77108a54 100644 --- a/Doxygen/Examples.Durham/graph25 +++ b/Doxygen/Examples.Durham/graph25 @@ -1,2 +1,4 @@ +avocado> var Graph = require("graph").Graph; + avocado> g1 = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph26 b/Doxygen/Examples.Durham/graph26 index ee40a8e8f7..15182fb7dd 100644 --- a/Doxygen/Examples.Durham/graph26 +++ b/Doxygen/Examples.Durham/graph26 @@ -1,2 +1,4 @@ +avocado> var Graph = require("graph").Graph; + avocado> g2 = new Graph("vertices", "alternativeEdges"); Graph("vertices", "alternativeEdges") diff --git a/Doxygen/Examples.Durham/graph27 b/Doxygen/Examples.Durham/graph27 new file mode 100644 index 0000000000..d5b8a1e9b5 --- /dev/null +++ b/Doxygen/Examples.Durham/graph27 @@ -0,0 +1,16 @@ +avocado> var Graph = require("graph").Graph; + +avocado> g = new Graph("vertices", "edges"); +Graph("vertices", "edges") + +avocado> v1 = g.addVertex(); +Vertex(, "153246:8712055") + +avocado> v2 = g.addVertex(); +Vertex(, "153246:8843127") + +avocado> v1.addOutEdge(v2, "knows"); +Edge(, "3999653:8974199") + +avocado> v1.getOutEdges(); +[ Edge(, "3999653:8974199") ] diff --git a/Doxygen/Examples.Durham/graph28 b/Doxygen/Examples.Durham/graph28 new file mode 100644 index 0000000000..508cab51ce --- /dev/null +++ b/Doxygen/Examples.Durham/graph28 @@ -0,0 +1,11 @@ +avocado> v1 = g.addVertex(); +Vertex(, "153246:8712055") + +avocado> v2 = g.addVertex(); +Vertex(, "153246:8777591") + +avocado> v1.addOutEdge(v2, "knows", { data : 1 }); +Edge(, "3999653:8974199") + +avocado> v1.getOutEdges(); +[ Edge(, "3999653:8974199") ] diff --git a/Doxygen/Examples.Durham/graph29 b/Doxygen/Examples.Durham/graph29 new file mode 100644 index 0000000000..ea2f9c4cf3 --- /dev/null +++ b/Doxygen/Examples.Durham/graph29 @@ -0,0 +1,10 @@ +avocado> var Graph = require("graph").Graph; + +avocado> g = new Graph("vertices", "edges"); +Graph("vertices", "edges") + +avocado> v = g.addVertex(); +Vertex(, "153246:1824463") + +avocado> g.getVertex("153246:1824463") +Vertex(, "153246:1824463") diff --git a/Doxygen/Examples.Durham/graph3 b/Doxygen/Examples.Durham/graph3 index e6fdb93e99..e2485eeebc 100644 --- a/Doxygen/Examples.Durham/graph3 +++ b/Doxygen/Examples.Durham/graph3 @@ -1,8 +1,5 @@ -avocado> g = new Graph("vertices", "edges"); -Graph("vertices", "edges") - avocado> v = g.addVertex({ name : "Hugo" }); Vertex(, "153246:2034680") avocado> v.getProperty("name"); -"Hugo" +Hugo diff --git a/Doxygen/Examples.Durham/graph30 b/Doxygen/Examples.Durham/graph30 new file mode 100644 index 0000000000..ea251f4508 --- /dev/null +++ b/Doxygen/Examples.Durham/graph30 @@ -0,0 +1,13 @@ +avocado> var Graph = require("graph").Graph; + +avocado> g = new Graph("vertices", "edges"); +Graph("vertices", "edges") + +avocado> v1 = g.addVertex(); +Vertex(, "153246:2310672") + +avocado> v2 = g.addVertex(); +Vertex(, "153246:2310673") + +avocado> e = g.addEdge(v1, v2); +Edge(, "3999653:5570857") diff --git a/Doxygen/Examples.Durham/graph31 b/Doxygen/Examples.Durham/graph31 new file mode 100644 index 0000000000..a8d4704af2 --- /dev/null +++ b/Doxygen/Examples.Durham/graph31 @@ -0,0 +1,5 @@ +avocado> e = g.addEdge(v1, v2, { name : "Emil"); +Edge(, "3999653:5570857") + +avocado> e.getProperty("name"); +Emil diff --git a/Doxygen/Examples.Durham/graph32 b/Doxygen/Examples.Durham/graph32 new file mode 100644 index 0000000000..b3a392ea71 --- /dev/null +++ b/Doxygen/Examples.Durham/graph32 @@ -0,0 +1,19 @@ +avocado> var Graph = require("graph").Graph; + +avocado> g = new Graph("vertices", "edges"); +Graph("vertices", "edges") + +avocado> v = g.addVertex(); +Vertex(, "153246:2310672") + +avocado> e = g.addEdge(v, v, "self", { weight: 10 }) +Edge(, "2141724:6339989") + +avocado> e.getPropertyKeys() +[ "weight" ] + +avocado> e.setProperty("name", "Hugo"); +Hugo + +avocado> e.getPropertyKeys() +[ "weight", "name" ] diff --git a/Doxygen/Examples.Durham/graph4 b/Doxygen/Examples.Durham/graph4 index a75db98fb0..b9c19e41a8 100644 --- a/Doxygen/Examples.Durham/graph4 +++ b/Doxygen/Examples.Durham/graph4 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph5 b/Doxygen/Examples.Durham/graph5 index 3c8be0744d..8819c769da 100644 --- a/Doxygen/Examples.Durham/graph5 +++ b/Doxygen/Examples.Durham/graph5 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") @@ -5,4 +7,4 @@ avocado> v = g.addVertex({ name : "Hugo" }); Vertex(, "153246:2310672") avocado> v.getProperty("name"); -"Hugo" +Hugo diff --git a/Doxygen/Examples.Durham/graph6 b/Doxygen/Examples.Durham/graph6 index a60b8aed1c..2e765fbba3 100644 --- a/Doxygen/Examples.Durham/graph6 +++ b/Doxygen/Examples.Durham/graph6 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph7 b/Doxygen/Examples.Durham/graph7 index 34e3ea5aad..ac8005bf1e 100644 --- a/Doxygen/Examples.Durham/graph7 +++ b/Doxygen/Examples.Durham/graph7 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph8 b/Doxygen/Examples.Durham/graph8 index c12163ca91..078963e800 100644 --- a/Doxygen/Examples.Durham/graph8 +++ b/Doxygen/Examples.Durham/graph8 @@ -1,3 +1,5 @@ +avocado> var Graph = require("graph").Graph; + avocado> g = new Graph("vertices", "edges"); Graph("vertices", "edges") diff --git a/Doxygen/Examples.Durham/graph9 b/Doxygen/Examples.Durham/graph9 index 7fb1c1a092..15aacd194c 100644 --- a/Doxygen/Examples.Durham/graph9 +++ b/Doxygen/Examples.Durham/graph9 @@ -1,11 +1,5 @@ -avocado> g = new Graph("vertices", "edges"); -Graph("vertices", "edges") - -avocado> v1 = g.addVertex({ name : "Hugo" }); -Vertex(, "153246:2310672") - -avocado> v2 = g.addVertex({ name : "Emil" }); -Vertex(, "153246:2310673") - avocado> e = g.addEdge(v1, v2, "knows"); Edge(, "3999653:5570857") + +avocado> e.getLabel(); +knows diff --git a/Doxygen/avocado.doxy.in b/Doxygen/avocado.doxy.in index 2ade5ab377..4baf4912b2 100644 --- a/Doxygen/avocado.doxy.in +++ b/Doxygen/avocado.doxy.in @@ -624,8 +624,8 @@ INPUT = \ @srcdir@/RestServer \ @srcdir@/ShapedJson \ @srcdir@/V8 \ - @srcdir@/VocBase - + @srcdir@/VocBase \ + @srcdir@/js # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/Makefile.am b/Makefile.am index 9bf5f94463..b7e28259fb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = AM_CPPFLAGS = AM_LDFLAGS = -BUILT_SOURCES = +BUILT_SOURCES = js Doxygen/js Doxygen/js/system Doxygen/js/modules LIBS = noinst_LIBRARIES = libavocadodb.a @@ -22,9 +22,9 @@ include Makefile.files .PHONY: js js: - @test -d js || mkdir js + @test -d $@ || mkdir $@ -js/js-%.h: @srcdir@/js/%.js js +js/js-%.h: @srcdir@/js/%.js @top_srcdir@/config/js2c.sh $< > $@ ################################################################################ @@ -55,18 +55,18 @@ JsonParserX/%.cpp: @srcdir@/JsonParserX/%.yy ## Doxygen ################################################################################ -.PHONY: doxygen +.PHONY: doxygen Doxygen/js Doxygen/js/system Doxygen/js/modules -Doxygen/js: - mkdir Doxygen/js +Doxygen/js Doxygen/js/system Doxygen/js/modules: + test -d $@ || mkdir $@ -Doxygen/js/system: - mkdir Doxygen/js/system - -Doxygen/js/%.c: @srcdir@/js/%.js Doxygen/js +Doxygen/js/%.c: @srcdir@/js/%.js python @top_srcdir@/Doxygen/Scripts/js2doxy.py $< > $@ -Doxygen/js/system/%.c: @srcdir@/js/system/%.js Doxygen/js/system +Doxygen/js/system/%.c: @srcdir@/js/system/%.js + python @top_srcdir@/Doxygen/Scripts/js2doxy.py $< > $@ + +Doxygen/js/modules/%.c: @srcdir@/js/system/%.js python @top_srcdir@/Doxygen/Scripts/js2doxy.py $< > $@ doxygen: Doxygen/avocado.doxy $(DOXYGEN) diff --git a/Makefile.files b/Makefile.files index f476768f09..60ad06b84c 100644 --- a/Makefile.files +++ b/Makefile.files @@ -214,7 +214,6 @@ avocado_SOURCES = \ BUILT_SOURCES += \ js/js-modules.h \ js/js-actions.h \ - js/js-graph.h \ js/js-json.h \ js/js-shell.h @@ -245,13 +244,13 @@ BUILT_SOURCES += \ ################################################################################ DOXYGEN = \ - Doxygen/js/shell.c \ - Doxygen/js/system/indexes.c \ Doxygen/js/actions.c \ - Doxygen/js/graph.c \ - Doxygen/js/system/collections.c \ + Doxygen/js/json.c \ Doxygen/js/modules.c \ - Doxygen/js/json.c + Doxygen/js/modules/graph.c \ + Doxygen/js/shell.c \ + Doxygen/js/system/collections.c \ + Doxygen/js/system/indexes.c ################################################################################ ## wiki @@ -270,13 +269,16 @@ WIKI = \ Doxygen/xml/d7/daa/Actions.md \ Doxygen/xml/d4/d7d/HttpInterface.md \ Doxygen/xml/d9/de4/JSModules.md \ - Doxygen/xml/d0/da4/GraphFuncIndex.md \ + Doxygen/xml/d2/d35/JSModuleGraph.md \ Doxygen/xml/d9/db2/CommandLineScheduler.md \ Doxygen/xml/d8/d3d/RestInterface.md \ Doxygen/xml/db/d14/GeoCoordinates.md \ Doxygen/xml/d3/db6/JavaScriptFuncIndex.md \ Doxygen/xml/df/d91/CommandLineRandom.md \ - Doxygen/xml/d9/ddd/CommandLineAvocado.md + Doxygen/xml/d9/ddd/CommandLineAvocado.md \ + Doxygen/xml/d7/d40/JSModuleConsole.md \ + Doxygen/xml/d3/d4b/JSModuleInternal.md \ + Doxygen/xml/d2/d66/JSModuleFs.md Doxygen/xml/d9/d52/DefineAction.md: Doxygen/xml/d9/d52/DefineAction.xml python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ @@ -314,7 +316,7 @@ Doxygen/xml/d4/d7d/HttpInterface.md: Doxygen/xml/d4/d7d/HttpInterface.xml Doxygen/xml/d9/de4/JSModules.md: Doxygen/xml/d9/de4/JSModules.xml python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ -Doxygen/xml/d0/da4/GraphFuncIndex.md: Doxygen/xml/d0/da4/GraphFuncIndex.xml +Doxygen/xml/d2/d35/JSModuleGraph.md: Doxygen/xml/d2/d35/JSModuleGraph.xml python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ Doxygen/xml/d9/db2/CommandLineScheduler.md: Doxygen/xml/d9/db2/CommandLineScheduler.xml @@ -335,3 +337,11 @@ Doxygen/xml/df/d91/CommandLineRandom.md: Doxygen/xml/df/d91/CommandLineRandom.xm Doxygen/xml/d9/ddd/CommandLineAvocado.md: Doxygen/xml/d9/ddd/CommandLineAvocado.xml python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ +Doxygen/xml/d7/d40/JSModuleConsole.md: Doxygen/xml/d7/d40/JSModuleConsole.xml + python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ + +Doxygen/xml/d3/d4b/JSModuleInternal.md: Doxygen/xml/d3/d4b/JSModuleInternal.xml + python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ + +Doxygen/xml/d2/d66/JSModuleFs.md: Doxygen/xml/d2/d66/JSModuleFs.xml + python @top_srcdir@/Doxygen/Scripts/xml2md.py $< > $@ diff --git a/RestServer/ActionDispatcherThread.cpp b/RestServer/ActionDispatcherThread.cpp index 70f29e620f..073e0d0b07 100644 --- a/RestServer/ActionDispatcherThread.cpp +++ b/RestServer/ActionDispatcherThread.cpp @@ -227,8 +227,7 @@ JSLoader* ActionDisptacherThread::actionLoader () { void ActionDisptacherThread::initialise () { bool ok; - char* filename; - char const* files[] = { "actions.js", "graph.js", "json.js", "modules.js" }; + char const* files[] = { "modules.js", "actions.js", "json.js" }; size_t i; // enter a new isolate @@ -240,7 +239,8 @@ void ActionDisptacherThread::initialise () { if (_context.IsEmpty()) { LOGGER_FATAL << "cannot initialize V8 engine"; - TRIAGENS_REST_SHUTDOWN; + cerr << "cannot initialize V8 engine\n"; + _isolate->Exit(); exit(EXIT_FAILURE); } @@ -256,8 +256,10 @@ void ActionDisptacherThread::initialise () { ok = _startupLoader->loadScript(_context, files[i]); if (! ok) { - LOGGER_FATAL << "cannot load json utilities from file '" << filename << "'"; - TRIAGENS_REST_SHUTDOWN; + LOGGER_FATAL << "cannot load json utilities from file '" << files[i] << "'"; + cerr << "cannot load json utilities from file '" << files[i] << "'\n"; + _context->Exit(); + _isolate->Exit(); exit(EXIT_FAILURE); } } @@ -272,8 +274,10 @@ void ActionDisptacherThread::initialise () { ok = actionLoader()->loadAllScripts(_context); if (! ok) { - LOGGER_FATAL << "cannot load actions from directory '" << filename << "'"; - TRIAGENS_REST_SHUTDOWN; + LOGGER_FATAL << "cannot load actions from directory '" << loader->getDirectory() << "'"; + cerr << "cannot load actions from directory '" << loader->getDirectory() << "'\n"; + _context->Exit(); + _isolate->Exit(); exit(EXIT_FAILURE); } } diff --git a/RestServer/AvocadoServer.cpp b/RestServer/AvocadoServer.cpp index d963ceacfa..289f561e9a 100644 --- a/RestServer/AvocadoServer.cpp +++ b/RestServer/AvocadoServer.cpp @@ -157,7 +157,7 @@ AvocadoServer::AvocadoServer (int argc, char** argv) _adminPort("localhost:8530"), _dispatcherThreads(1), _startupPath(), - _startupModules(), + _startupModules("js/modules"), _actionPath(), _systemActionPath(), _actionThreads(1), @@ -279,7 +279,6 @@ void AvocadoServer::buildApplicationServer () { // ............................................................................. if (! _applicationServer->parse(_argc, _argv, additional)) { - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } @@ -300,7 +299,6 @@ void AvocadoServer::buildApplicationServer () { if (_startupPath.empty()) { StartupLoader.defineScript("modules.js", JS_modules); StartupLoader.defineScript("actions.js", JS_actions); - StartupLoader.defineScript("graph.js", JS_graph); StartupLoader.defineScript("json.js", JS_json); StartupLoader.defineScript("shell.js", JS_shell); } @@ -316,8 +314,8 @@ void AvocadoServer::buildApplicationServer () { if (ok) { LOGGER_FATAL << "action directory '" << path << "' must be a directory"; + cerr << "action directory '" << path << "' must be a directory\n"; LOGGER_INFO << "please use the '--database.directory' option"; - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } @@ -325,8 +323,8 @@ void AvocadoServer::buildApplicationServer () { if (! ok) { LOGGER_FATAL << "cannot create action directory '" << path << "': " << TRI_last_error(); + cerr << "cannot create action directory '" << path << "': " << TRI_last_error() << "\n"; LOGGER_INFO << "please use the '--database.directory' option"; - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } } @@ -365,16 +363,16 @@ void AvocadoServer::buildApplicationServer () { if (_daemonMode) { if (_pidFile.empty()) { LOGGER_FATAL << "no pid-file defined, but daemon mode requested"; + cerr << "no pid-file defined, but daemon mode requested\n"; LOGGER_INFO << "please use the '--pid-file' option"; - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } } if (_databasePath.empty()) { LOGGER_FATAL << "no database path has been supplied, giving up"; + cerr << "no database path has been supplied, giving up\n"; LOGGER_INFO << "please use the '--database.directory' option"; - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } } @@ -515,7 +513,7 @@ void AvocadoServer::executeShell () { v8::Isolate* isolate; v8::Persistent context; bool ok; - char const* files[] = { "modules.js", "graph.js", "json.js", "shell.js" }; + char const* files[] = { "modules.js", "json.js", "shell.js" }; size_t i; // only simple logging @@ -538,7 +536,7 @@ void AvocadoServer::executeShell () { if (context.IsEmpty()) { LOGGER_FATAL << "cannot initialize V8 engine"; - TRIAGENS_REST_SHUTDOWN; + cerr << "cannot initialize V8 engine\n"; exit(EXIT_FAILURE); } @@ -557,7 +555,7 @@ void AvocadoServer::executeShell () { } else { LOGGER_FATAL << "cannot load json file '" << files[i] << "'"; - TRIAGENS_REST_SHUTDOWN; + cerr << "cannot load json file '" << files[i] << "'\n"; exit(EXIT_FAILURE); } } @@ -614,8 +612,8 @@ void AvocadoServer::openDatabase () { if (_vocbase == 0) { LOGGER_FATAL << "cannot open database '" << _databasePath << "'"; + cerr << "cannot open database '" << _databasePath << "'\n"; LOGGER_INFO << "please use the '--database.directory' option"; - TRIAGENS_REST_SHUTDOWN; exit(EXIT_FAILURE); } } diff --git a/RestServer/JSLoader.cpp b/RestServer/JSLoader.cpp index 295470c561..67906e07b1 100644 --- a/RestServer/JSLoader.cpp +++ b/RestServer/JSLoader.cpp @@ -69,6 +69,14 @@ JSLoader::JSLoader () /// @{ //////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +/// @brief gets the directory for scripts +//////////////////////////////////////////////////////////////////////////////// + +string const& JSLoader::getDirectory () const { + return _directory; +} + //////////////////////////////////////////////////////////////////////////////// /// @brief sets the directory for scripts //////////////////////////////////////////////////////////////////////////////// diff --git a/RestServer/JSLoader.h b/RestServer/JSLoader.h index 4542421dfb..b0580bf94c 100644 --- a/RestServer/JSLoader.h +++ b/RestServer/JSLoader.h @@ -88,6 +88,12 @@ namespace triagens { public: +//////////////////////////////////////////////////////////////////////////////// +/// @brief gets the directory for scripts +//////////////////////////////////////////////////////////////////////////////// + + string const& getDirectory () const; + //////////////////////////////////////////////////////////////////////////////// /// @brief sets the directory for scripts //////////////////////////////////////////////////////////////////////////////// diff --git a/V8/v8-utils.cpp b/V8/v8-utils.cpp index b7601f30a8..cbccf02be4 100644 --- a/V8/v8-utils.cpp +++ b/V8/v8-utils.cpp @@ -1790,6 +1790,8 @@ bool TRI_ObjectToBoolean (v8::Handle value) { /// assigned inside the @FA{script}, will be visible in the @FA{sandbox} object /// after execution. The @FA{filename} is used for displaying error /// messages. +/// +/// If @FA{sandbox} is undefined, then @FN{execute} uses the current context. //////////////////////////////////////////////////////////////////////////////// static v8::Handle JS_Execute (v8::Arguments const& argv) { @@ -1810,36 +1812,38 @@ static v8::Handle JS_Execute (v8::Arguments const& argv) { return scope.Close(v8::ThrowException(v8::String::New("