Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
|
@ -1918,9 +1918,9 @@ def RunSystemTests(flavor):
|
|||
arflags_target = 'crs'
|
||||
# ar -T enables thin archives on Linux. OS X's ar supports a -T flag, but it
|
||||
# does something useless (it limits filenames in the archive to 15 chars).
|
||||
if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_target,
|
||||
cc_command=cc_target):
|
||||
arflags_target = 'crsT'
|
||||
#if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_target,
|
||||
# cc_command=cc_target):
|
||||
# arflags_target = 'crsT'
|
||||
|
||||
ar_host = os.environ.get('AR_host', 'ar')
|
||||
cc_host = os.environ.get('CC_host', 'gcc')
|
||||
|
@ -1929,9 +1929,9 @@ def RunSystemTests(flavor):
|
|||
# cross-compiles, but due to quirks of history CC_host defaults to 'gcc'
|
||||
# while CC_target defaults to 'cc', so the commands really are different
|
||||
# even though they're nearly guaranteed to run the same code underneath.
|
||||
if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_host,
|
||||
cc_command=cc_host):
|
||||
arflags_host = 'crsT'
|
||||
#if flavor != 'mac' and gyp.system_test.TestArSupportsT(ar_command=ar_host,
|
||||
# cc_command=cc_host):
|
||||
# arflags_host = 'crsT'
|
||||
|
||||
return { 'ARFLAGS.target': arflags_target,
|
||||
'ARFLAGS.host': arflags_host }
|
||||
|
|
48
CHANGELOG
|
@ -38,27 +38,6 @@ v1.5.0 (XXXX-XX-XX)
|
|||
is not considered an error, but specifying an invalid value for any
|
||||
of these attributes will make an AQL query fail.
|
||||
|
||||
* added SHORTEST_PATH AQL function
|
||||
|
||||
this calculates the shortest paths between two vertices, using the Dijkstra
|
||||
algorithm, employing a min-heap
|
||||
|
||||
By default, ArangoDB does not know the distance between any two vertices and
|
||||
will use a default distance of 1. A custom distance function can be registered
|
||||
as an AQL user function to make the distance calculation use any document
|
||||
attributes or custom logic:
|
||||
|
||||
RETURN SHORTEST_PATH(cities, motorways, "cities/CGN", "cities/MUC", "outbound", {
|
||||
paths: true,
|
||||
distance: "myfunctions::citydistance"
|
||||
})
|
||||
|
||||
// using the following custom distance function
|
||||
var aqlfunctions = require("org/arangodb/aql/functions");
|
||||
aqlfunctions.register("myfunctions::distance", function (config, vertex1, vertex2, edge) {
|
||||
return Math.sqrt(Math.pow(vertex1.x - vertex2.x) + Math.pow(vertex1.y - vertex2.y));
|
||||
}, false);
|
||||
|
||||
* issue #751: Create database through API should return HTTP status code 201
|
||||
|
||||
By default, the server now returns HTTP 201 (created) when creating a new
|
||||
|
@ -183,14 +162,39 @@ v1.5.0 (XXXX-XX-XX)
|
|||
v1.4.11 (XXXX-XX-XX)
|
||||
--------------------
|
||||
|
||||
* added SHORTEST_PATH AQL function
|
||||
|
||||
this calculates the shortest paths between two vertices, using the Dijkstra
|
||||
algorithm, employing a min-heap
|
||||
|
||||
By default, ArangoDB does not know the distance between any two vertices and
|
||||
will use a default distance of 1. A custom distance function can be registered
|
||||
as an AQL user function to make the distance calculation use any document
|
||||
attributes or custom logic:
|
||||
|
||||
RETURN SHORTEST_PATH(cities, motorways, "cities/CGN", "cities/MUC", "outbound", {
|
||||
paths: true,
|
||||
distance: "myfunctions::citydistance"
|
||||
})
|
||||
|
||||
// using the following custom distance function
|
||||
var aqlfunctions = require("org/arangodb/aql/functions");
|
||||
aqlfunctions.register("myfunctions::distance", function (config, vertex1, vertex2, edge) {
|
||||
return Math.sqrt(Math.pow(vertex1.x - vertex2.x) + Math.pow(vertex1.y - vertex2.y));
|
||||
}, false);
|
||||
|
||||
* fixed bug in Graph.pathTo function
|
||||
|
||||
* fixed small memleak in AQL optimiser
|
||||
|
||||
* fixed access to potentially uninitialised variable when collection had a cap constraint
|
||||
|
||||
|
||||
v1.4.10 (XXXX-XX-XX)
|
||||
v1.4.10 (2014-02-21)
|
||||
--------------------
|
||||
|
||||
* fixed graph constructor to allow graph with some parameter to be used
|
||||
|
||||
* added node.js "events" and "stream"
|
||||
|
||||
* updated npm packages
|
||||
|
|
|
@ -93,7 +93,7 @@ See @ref RestDocument for details.
|
|||
See @ref RestDocument for details.
|
||||
|
||||
@anchor RestEdgeHead
|
||||
@RESTHEADER{GET /_api/edge,reads an edge header}
|
||||
@RESTHEADER{HEAD /_api/edge,reads an edge header}
|
||||
|
||||
@REST{HEAD /_api/edge/@FA{document-handle}}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ describe ArangoDB do
|
|||
doc1.code.should eq(201)
|
||||
|
||||
doc2 = create_graph( prefix, "recreate", vertex_collection, edge_collection )
|
||||
doc2.code.should eq(400)
|
||||
doc2.code.should eq(201)
|
||||
end
|
||||
|
||||
it "checks (re)create graph different name" do
|
||||
|
|
|
@ -1529,7 +1529,7 @@ static void GenerateBitarrayAccess (TRI_aql_codegen_js_t* const generator,
|
|||
ScopeOutput(generator, ")");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (fieldAccess->_type == TRI_AQL_ACCESS_REFERENCE &&
|
||||
fieldAccess->_value._reference._operator == TRI_AQL_NODE_OPERATOR_BINARY_IN) {
|
||||
ScopeOutput(generator, "aql.GET_DOCUMENTS_BITARRAY_LIST('");
|
||||
|
|
|
@ -1537,7 +1537,9 @@ static bool RunUnitTests (v8::Handle<v8::Context> context) {
|
|||
}
|
||||
|
||||
TRI_AddGlobalVariableVocbase(context, "SYS_UNIT_TESTS", sysTestFiles);
|
||||
TRI_AddGlobalVariableVocbase(context, "SYS_UNIT_TESTS_RESULT", v8::True());
|
||||
|
||||
// do not use TRI_AddGlobalVariableVocBase because it creates read-only variables!!
|
||||
context->Global()->Set(v8::String::New("SYS_UNIT_TESTS_RESULT"), v8::True());
|
||||
|
||||
// run tests
|
||||
char const* input = "require(\"jsunity\").runCommandLineTests();";
|
||||
|
|
|
@ -50,7 +50,6 @@ JAVASCRIPT_JSLINT = \
|
|||
`find @srcdir@/js/common/modules/org -name "*.js"` \
|
||||
`find @srcdir@/js/client/modules -name "*.js"` \
|
||||
`find @srcdir@/js/server/modules -name "*.js"` \
|
||||
`find @srcdir@/js/client/tests -name "*.js"` \
|
||||
`find @srcdir@/js/apps/system/aardvark/frontend/js/models -name "*.js"` \
|
||||
`find @srcdir@/js/apps/system/aardvark/frontend/js/views -name "*.js"` \
|
||||
`find @srcdir@/js/apps/system/aardvark/frontend/js/collections -name "*.js"` \
|
||||
|
|
|
@ -1355,7 +1355,7 @@ function put_api_collection (req, res) {
|
|||
put_api_collection_rotate(req, res, collection);
|
||||
}
|
||||
else {
|
||||
actions.resultNotFound(req, res, actions.errors.ERROR_HTTP_NOT_FOUND,
|
||||
actions.resultNotFound(req, res, arangodb.ERROR_HTTP_NOT_FOUND,
|
||||
"expecting one of the actions 'load', 'unload',"
|
||||
+ " 'truncate', 'properties', 'rename'");
|
||||
}
|
||||
|
|
|
@ -213,6 +213,13 @@
|
|||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "vertex-name",
|
||||
"description": "The name of the vertex "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
|
@ -535,7 +542,7 @@
|
|||
"description": "The call expects a JSON hash array as body with the edge properties: "
|
||||
}
|
||||
],
|
||||
"notes": "Creates an edge in a graph. <br><br>The call expects a JSON hash array as body with the edge properties: <br><br>- <em>_key</em>: The name of the edge.- <em>_from</em>: The name of the from vertex.- <em>_to</em>: The name of the to vertex.- <em>$label</em>: A label for the edge (optional).- further optional attributes.<br><br>Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
|
||||
"notes": "Creates an edge in a graph. <br><br>The call expects a JSON hash array as body with the edge properties: <br><br>- <em>_key</em>: The name of the edge (optional, if edge collection allows user defined keys).- <em>_from</em>: The name of the from vertex.- <em>_to</em>: The name of the to vertex.- <em>$label</em>: A label for the edge (optional).- further optional attributes.<br><br>Returns an object with an attribute <em>edge</em> containing the list of all edge properties. <br><br>",
|
||||
"summary": "create edge",
|
||||
"httpMethod": "POST",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X POST --data @- --dump - http://localhost:8529/_api/graph/graph/edge\n{\"_key\":\"edge1\",\"_from\":\"vert2\",\"_to\":\"vert1\",\"optional1\":\"val1\"}\n\nHTTP/1.1 202 Accepted\ncontent-type: application/json; charset=utf-8\netag: 162021799\n\n{ \n \"edge\" : { \n \"_id\" : \"edges/edge1\", \n \"_rev\" : \"162021799\", \n \"_key\" : \"edge1\", \n \"_from\" : \"vertices/vert2\", \n \"_to\" : \"vertices/vert1\", \n \"$label\" : null, \n \"optional1\" : \"val1\" \n }, \n \"error\" : false, \n \"code\" : 202 \n}\n\n</code></pre><br>",
|
||||
|
@ -573,6 +580,13 @@
|
|||
"name": "graph-name",
|
||||
"description": "The name of the graph "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "path",
|
||||
"required": "true",
|
||||
"name": "edge-name",
|
||||
"description": "The name of the edge "
|
||||
},
|
||||
{
|
||||
"dataType": "String",
|
||||
"paramType": "query",
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
"description": "The index-handle. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>The result is an objects describing the index. It has at least the following attributes: <br><br>- <em>id</em>: The identifier of the index.<br><br>- <em>type</em>: The type of the collection.<br><br>All other attributes are type-dependent. <br><br>",
|
||||
"notes": "<br><br>The result is an objects describing the index. It has at least the following attributes: <br><br>- <em>id</em>: The identifier of the index.<br><br>All other attributes are type-dependent. <br><br>",
|
||||
"summary": "reads an index",
|
||||
"httpMethod": "GET",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl --dump - http://localhost:8529/_api/index/products/0\n\nHTTP/1.1 200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"id\" : \"products/0\", \n \"type\" : \"primary\", \n \"unique\" : true, \n \"fields\" : [ \n \"_id\" \n ], \n \"error\" : false, \n \"code\" : 200 \n}\n\n</code></pre><br>",
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
"description": "Contains the query. "
|
||||
}
|
||||
],
|
||||
"notes": "<br><br>This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br>In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br>The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: If given, the identifier of the fulltext-index to use. (optional)<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"notes": "<br><br>This will find all documents from the collection that match the fulltext query specified in <em>query</em>. <br><br>In order to use the <em>fulltext</em> operator, a fulltext index must be defined for the collection and the specified attribute. <br><br>The call expects a JSON object as body with the following attributes: <br><br>- <em>collection</em>: The name of the collection to query.<br><br>- <em>attribute</em>: The attribute that contains the texts.<br><br>- <em>query</em>: The fulltext query.<br><br>- <em>skip</em>: The documents to skip in the query. (optional)<br><br>- <em>limit</em>: The maximal amount of documents to return. (optional)<br><br>- <em>index</em>: The identifier of the fulltext-index to use.<br><br>Returns a cursor containing the result, see the manual for details. <br><br>",
|
||||
"summary": "executes simple query FULLTEXT",
|
||||
"httpMethod": "PUT",
|
||||
"examples": "<br><br><pre><code class=\"json\" >unix> curl -X PUT --data @- --dump - http://localhost:8529/_api/simple/fulltext\n{ \"collection\": \"products\", \"attribute\" : \"text\", \"query\" : \"word\" }\n\nHTTP/1.1 201 Created\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : [ \n { \n \"_id\" : \"products/224805287\", \n \"_rev\" : \"224805287\", \n \"_key\" : \"224805287\", \n \"text\" : \"this text contains word\" \n }, \n { \n \"_id\" : \"products/225067431\", \n \"_rev\" : \"225067431\", \n \"_key\" : \"225067431\", \n \"text\" : \"this text also has a word\" \n } \n ], \n \"hasMore\" : false, \n \"count\" : 2, \n \"error\" : false, \n \"code\" : 201 \n}\n\n</code></pre><br>",
|
||||
|
|
Before Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 298 B |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
|
@ -29,7 +29,13 @@
|
|||
"graphManagement/add" : "graphAddNew",
|
||||
"graphManagement/delete/:name" : "graphDelete",
|
||||
"userManagement" : "userManagement",
|
||||
"userProfile" : "userProfile"
|
||||
"userProfile" : "userProfile",
|
||||
"testing" : "testview"
|
||||
},
|
||||
|
||||
testview: function() {
|
||||
this.testView = new window.testView();
|
||||
this.testView.render();
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
<script id="collectionInfoView.ejs" type="text/template">
|
||||
<%
|
||||
var roundNumber = function(number, n) {
|
||||
var factor;
|
||||
factor = Math.pow(10,n);
|
||||
var returnVal = (Math.round(number * factor) / factor);
|
||||
return returnVal;
|
||||
};
|
||||
|
||||
%>
|
||||
|
||||
<div id="show-collection" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
|
@ -22,9 +32,11 @@
|
|||
<th class="collectionInfoTh2">Journal size (MB):</th>
|
||||
<th class="collectionInfoTh"><div id="show-collection-size" class="modal-text"/></th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="The maximal size of a journal or datafile (in MB). Must be at least 1.">
|
||||
<span class="arangoicon icon_arangodb_info"></span>
|
||||
</a>
|
||||
<div>
|
||||
<a class="modalInfoTooltips" data-toggle="tooltip" data-placement="left" title="The maximal size of a journal or datafile (in MB). Must be at least 1.">
|
||||
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr id="collectionSyncBox" style="display:none">
|
||||
|
@ -32,7 +44,13 @@
|
|||
<th class="collectionInfoTh">
|
||||
<div id="show-collection-sync" class="modal-text"/>
|
||||
</th>
|
||||
<th class="tooltipInfoTh"><a class="modalInfoTooltips" title="Synchronise to disk before returning from a create or update of a document."><span class="arangoicon icon_arangodb_info"</span></a></th>
|
||||
<th class="tooltipInfoTh">
|
||||
<div>
|
||||
<a class="modalInfoTooltips" data-toggle="tooltip" data-placement="left" title="Synchronise to disk before returning from a create or update of a document.">
|
||||
<span rel="tooltip" class="arangoicon icon_arangodb_info"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
@ -66,7 +84,126 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="figures"/>
|
||||
<div class="tab-pane" id="figures">
|
||||
<table id="figures1">
|
||||
<tr class="figuresHeader">
|
||||
<th class="">Type</th>
|
||||
<th>Count</th>
|
||||
<th>Size (MB)</th>
|
||||
<th>Info</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Datafiles</th>
|
||||
<th class="modal-text"><%=figuresData.figures.datafiles.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.datafiles.fileSize / 1024 / 1024, 2)%>
|
||||
</th>
|
||||
<th class="tooltipInfoTh">
|
||||
<div>
|
||||
<a class="modalInfoTooltips" data-toggle="tooltip" data-placement="left" title="Number of active datafiles.">
|
||||
<span class="arangoicon icon_arangodb_info"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Journals</th>
|
||||
<th class="modal-text"><%=figuresData.figures.journals.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.journals.fileSize / 1024 / 1024, 2)%>
|
||||
</th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Number of journal files.">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Compactors</th>
|
||||
<th class="modal-text"><%=figuresData.figures.compactors.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.compactors.fileSize / 1024 / 1024, 2)%>
|
||||
</th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Number of compactor files.">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Shape files</th>
|
||||
<th class="modal-text"><%=figuresData.figures.shapefiles.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.shapefiles.fileSize / 1024 / 1024, 2)%>
|
||||
</th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Number of shape files.">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="figures2">
|
||||
<tr class="figuresHeader">
|
||||
<th>Type</th>
|
||||
<th>Count</th>
|
||||
<th>Info</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Shapes</th>
|
||||
<th class="modal-text"><%=figuresData.figures.shapes.count%></th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Total number of shapes used in the collection">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Attributes</th>
|
||||
<th class="modal-text"><%=figuresData.figures.attributes.count%></th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Total number of attributes used in the collection">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="figures3">
|
||||
<tr class="figuresHeader">
|
||||
<th>Type</th>
|
||||
<th>Count</th>
|
||||
<th>Size (MB)</th>
|
||||
<th>Deletion</th>
|
||||
<th>Info</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Alive</th>
|
||||
<th class="modal-text"><%=figuresData.figures.alive.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.alive.size/1024/1024, 2)%>
|
||||
</th>
|
||||
<th class="modal-text"> -</th>
|
||||
<th class="tooltipInfoTh">
|
||||
<a class="modalInfoTooltips" title="Total number and size used by all living documents.">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="modal-text">Dead</th>
|
||||
<th class="modal-text"><%=figuresData.figures.dead.count%></th>
|
||||
<th class="modal-text">
|
||||
<%=roundNumber(figuresData.figures.dead.size/1024/1024, 2)%>
|
||||
</th>
|
||||
<th class="modal-text"><%=figuresData.figures.dead.deletion%></th>
|
||||
|
||||
<th class="tooltipInfoTh">
|
||||
<div>
|
||||
<a class="modalInfoTooltips" title="Total number and size used by all dead documents.">
|
||||
<span class="arangoicon icon_arangodb_info"></span></a>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
<tr><th><div> </div></th></tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="index">
|
||||
<table id="collectionIndexTable">
|
||||
|
|
|
@ -21,7 +21,13 @@
|
|||
<tr id="collectionSizeBox" style="display:none">
|
||||
<th class="collectionTh">Journal size:</th>
|
||||
<th class="collectionTh"><input type="text" id="change-collection-size" name="size" value=""/></th>
|
||||
<th><a class="modalTooltips" title="The maximal size of a journal or datafile (in MB). Must be at least 1."><span class="arangoicon icon_arangodb_info" style="color:black"></span></a></th>
|
||||
<th>
|
||||
<div>
|
||||
<a class="modalTooltips" data-toggle="tooltip" data-placement="left" title="The maximal size of a journal or datafile (in MB). Must be at least 1.">
|
||||
<span rel="tooltip" class="arangoicon icon_arangodb_info" style="color:black"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr id="collectionSyncBox" style="display:none">
|
||||
<th class="collectionTh">Wait for sync:</th>
|
||||
|
@ -31,7 +37,13 @@
|
|||
<option value="true">Yes</option>
|
||||
</select>
|
||||
</th>
|
||||
<th><a class="modalTooltips" title="Synchronise to disk before returning from a create or update of a document."><span class="arangoicon icon_arangodb_info" style="color:black"></span></a></th>
|
||||
<th>
|
||||
<div>
|
||||
<a class="modalTooltips" data-toggle="tooltip" data-placement="left" title="Synchronise to disk before returning from a create or update of a document.">
|
||||
<span class="arangoicon icon_arangodb_info" style="color:black"></span>
|
||||
</a>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
<script id="statisticBarView.ejs" type="text/template">
|
||||
<div class="navlogo">
|
||||
<a id="stat_cpu" href="#dashboard" style="padding-left: 5px">
|
||||
<img src="img/tmp_dashbord_activity_yellow.jpg">
|
||||
<img src="img/tmp_dashbord_activity_green.jpg">
|
||||
<img height="23"src="img/tmp_dashbord_activity_red.jpg">
|
||||
</a>
|
||||
</div>
|
||||
<div class="navlogo">
|
||||
<a href="#dashboard" style="padding-left: 15px;">
|
||||
<img id="stat_cpu"
|
||||
src="img/statusBar-cpu-16.png"
|
||||
style="background-color: #ef8787;margin-top: 9px;"
|
||||
/>
|
||||
<img id="stat_ram"
|
||||
src="img/statusBar-ram-16.png"
|
||||
style="background-color: #FAFF92; margin-top: 9px; margin-left: 4px; margin-right: 2px;"
|
||||
/>
|
||||
<img id="stat_req"
|
||||
src="img/statusBar-req-16.png"
|
||||
style="background-color: #8aa051; margin-top: 9px;"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
<script id="testView.ejs" type="text/template">
|
||||
<h1>Text File Reader</h1>
|
||||
<div>
|
||||
Select a text file:
|
||||
<input type="file" id="fileInput">
|
||||
</div>
|
||||
<pre id="fileDisplayArea"><pre>
|
||||
|
||||
|
||||
</script>
|
|
@ -136,7 +136,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<th>Active:</th>
|
||||
<th><input type="checkbox" id="newStatus" name="status" value="active"/></th>
|
||||
<th><input type="checkbox" id="newStatus" name="status" value="active" checked="checked" /></th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -13,10 +13,14 @@
|
|||
template: templateEngine.createTemplate("collectionInfoView.ejs"),
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template.render({}));
|
||||
$(this.el).html(this.template.render({
|
||||
figuresData :this.data = window.arangoCollectionsStore.getFigures(this.options.colId, true)
|
||||
}));
|
||||
$('#show-collection').modal('show');
|
||||
this.fillModal();
|
||||
|
||||
$("[data-toggle=tooltip]").tooltip();
|
||||
|
||||
$('.modalInfoTooltips').tooltip({
|
||||
placement: "left"
|
||||
});
|
||||
|
@ -61,7 +65,7 @@
|
|||
this.properties = window.arangoCollectionsStore.getProperties(this.options.colId, true);
|
||||
//remove
|
||||
this.index = window.arangoCollectionsStore.getIndex(this.options.colId, true);
|
||||
this.fillLoadedModal(this.data);
|
||||
this.fillLoadedModal();
|
||||
}
|
||||
},
|
||||
roundNumber: function(number, n) {
|
||||
|
@ -70,129 +74,6 @@
|
|||
var returnVal = (Math.round(number * factor) / factor);
|
||||
return returnVal;
|
||||
},
|
||||
appendFigures: function () {
|
||||
var cssClass = 'modal-text';
|
||||
|
||||
if (this.data) {
|
||||
$('#figures').append(
|
||||
'<table id="figures1">'+
|
||||
'<tr class="figuresHeader">'+
|
||||
'<th class="">Type</th>'+
|
||||
'<th>Count</th>'+
|
||||
'<th>Size (MB)</th>'+
|
||||
'<th>Info</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Datafiles</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.datafiles.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.datafiles.fileSize / 1024 / 1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="Number of active datafiles.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Journals</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.journals.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.journals.fileSize / 1024 / 1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="Number of journal files.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Compactors</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.compactors.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.compactors.fileSize / 1024 / 1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="Number of compactor files.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Shape files</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.shapefiles.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.shapefiles.fileSize / 1024 / 1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="Number of shape files.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
|
||||
'</table>'+
|
||||
|
||||
'<table id="figures2">'+
|
||||
'<tr class="figuresHeader">'+
|
||||
'<th>Type</th>'+
|
||||
'<th>Count</th>'+
|
||||
'<th>Info</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Shapes</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.shapes.count+'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="Total number of shapes used in the collection">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Attributes</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.attributes.count+'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="' +
|
||||
'Total number of attributes used in the collection">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
|
||||
'<table id="figures3">'+
|
||||
'<tr class="figuresHeader">'+
|
||||
'<th>Type</th>'+
|
||||
'<th>Count</th>'+
|
||||
'<th>Size (MB)</th>'+
|
||||
'<th>Deletion</th>'+
|
||||
'<th>Info</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Alive</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.alive.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.alive.size/1024/1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="'+cssClass+'"> - </th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="' +
|
||||
'Total number and size used by all living documents.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'<tr>'+
|
||||
'<th class="'+cssClass+'">Dead</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.dead.count+'</th>'+
|
||||
'<th class="'+cssClass+'">'+
|
||||
this.roundNumber(this.data.figures.dead.size/1024/1024, 2)+
|
||||
'</th>'+
|
||||
'<th class="'+cssClass+'">'+this.data.figures.dead.deletion+'</th>'+
|
||||
'<th class="tooltipInfoTh '+cssClass+'">'+
|
||||
'<a class="modalInfoTooltips" title="' +
|
||||
'Total number and size used by all dead documents.">'+
|
||||
'<span class="arangoicon icon_arangodb_info"></span></a>'+
|
||||
'</th>'+
|
||||
'</tr>'+
|
||||
'</table>'
|
||||
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
appendIndex: function () {
|
||||
var cssClass = 'collectionInfoTh modal-text';
|
||||
|
@ -219,22 +100,22 @@
|
|||
}
|
||||
},
|
||||
|
||||
fillLoadedModal: function (data) {
|
||||
fillLoadedModal: function () {
|
||||
$('#collectionSizeBox').show();
|
||||
$('#collectionSyncBox').show();
|
||||
$('#collectionRevBox').show();
|
||||
if (data.waitForSync === false) {
|
||||
if (this.data.waitForSync === false) {
|
||||
$('#show-collection-sync').text('false');
|
||||
}
|
||||
else {
|
||||
$('#show-collection-sync').text('true');
|
||||
}
|
||||
var calculatedSize = data.journalSize / 1024 / 1024;
|
||||
var calculatedSize = this.data.journalSize / 1024 / 1024;
|
||||
$('#show-collection-size').text(this.roundNumber(calculatedSize, 2));
|
||||
$('#show-collection-rev').text(this.revision.revision);
|
||||
|
||||
this.appendIndex();
|
||||
this.appendFigures();
|
||||
// this.appendFigures();
|
||||
|
||||
$('#show-collection').modal('show');
|
||||
},
|
||||
|
|
|
@ -19,9 +19,7 @@
|
|||
});
|
||||
this.fillModal();
|
||||
|
||||
$('.modalTooltips, .arangoicon').tooltip({
|
||||
placement: "left"
|
||||
});
|
||||
$("[data-toggle=tooltip]").tooltip();
|
||||
|
||||
return this;
|
||||
},
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
|
||||
/*global Backbone, $, _, window, document, templateEngine, FileReader */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
window.testView = Backbone.View.extend({
|
||||
el: '#content',
|
||||
|
||||
events: {
|
||||
"change #fileInput" : "readJSON"
|
||||
},
|
||||
|
||||
template: templateEngine.createTemplate("testView.ejs"),
|
||||
|
||||
readJSON: function() {
|
||||
var fileInput = document.getElementById('fileInput');
|
||||
var fileDisplayArea = document.getElementById('fileDisplayArea');
|
||||
var file = fileInput.files[0];
|
||||
var textType = 'application/json';
|
||||
|
||||
if (file.type.match(textType)) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function(e) {
|
||||
$('#fileDisplayArea pre').text(reader.result);
|
||||
};
|
||||
|
||||
reader.readAsText(file);
|
||||
}
|
||||
else {
|
||||
$('#fileDisplayArea pre').text("File not supported!");
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
$(this.el).html(this.template.render());
|
||||
return this;
|
||||
}
|
||||
});
|
||||
}());
|
|
@ -30,8 +30,6 @@
|
|||
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
|
||||
var jsunity = require("jsunity");
|
||||
var db = require("org/arangodb").db;
|
||||
|
||||
|
@ -215,8 +213,6 @@ jsunity.run(clientTestSuite);
|
|||
|
||||
return jsunity.done();
|
||||
|
||||
}());
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
var jsunity = require("jsunity");
|
||||
var arango = require("org/arangodb").arango;
|
||||
var db = require("internal").db;
|
||||
|
@ -245,7 +244,6 @@ function AuthSuite () {
|
|||
jsunity.run(AuthSuite);
|
||||
|
||||
return jsunity.done();
|
||||
}());
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
|
|
|
@ -28,8 +28,6 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
|
||||
var jsunity = require("jsunity");
|
||||
var arangodb = require("org/arangodb");
|
||||
var arango = arangodb.arango;
|
||||
|
@ -95,7 +93,7 @@ function EndpointsSuite () {
|
|||
}
|
||||
}
|
||||
|
||||
arango.reconnect(originalEndpoint, "", "root", "");
|
||||
arango.reconnect(originalEndpoint, "_system", "root", "");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -387,7 +385,6 @@ function EndpointsSuite () {
|
|||
jsunity.run(EndpointsSuite);
|
||||
|
||||
return jsunity.done();
|
||||
}());
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
/// @author Copyright 2013, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
var jsunity = require("jsunity");
|
||||
var fm = require("org/arangodb/foxx/manager");
|
||||
var arango = require("org/arangodb").arango;
|
||||
|
@ -412,8 +411,6 @@ jsunity.run(FoxxManagerSuite);
|
|||
|
||||
return jsunity.done();
|
||||
|
||||
}());
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "^\\(/// @brief\\|/// @addtogroup\\|// --SECTION--\\|/// @page\\|/// @}\\)"
|
||||
|
|
|
@ -330,14 +330,18 @@ Vertex.prototype.getNeighbors = function (options) {
|
|||
if ((direction === 'both') || (direction === 'outbound')) {
|
||||
this.getOutEdges().forEach(function (current_edge) {
|
||||
current_vertex = current_edge.getInVertex();
|
||||
addNeighborToList(current_edge, current_vertex);
|
||||
if (current_vertex !== null) {
|
||||
addNeighborToList(current_edge, current_vertex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if ((direction === 'both') || (direction === 'inbound')) {
|
||||
this.getInEdges().forEach(function (current_edge) {
|
||||
current_vertex = current_edge.getOutVertex();
|
||||
addNeighborToList(current_edge, current_vertex);
|
||||
if (current_vertex !== null) {
|
||||
addNeighborToList(current_edge, current_vertex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -3969,7 +3969,7 @@ function TRAVERSAL_FUNC (func,
|
|||
}
|
||||
catch (err1) {
|
||||
}
|
||||
|
||||
|
||||
// end vertex
|
||||
var e;
|
||||
if (endVertex !== undefined) {
|
||||
|
|
|
@ -47,11 +47,6 @@ var arangodb = require("org/arangodb"),
|
|||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief find or create a collection by name
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -92,19 +87,14 @@ var findOrCreateEdgeCollectionByName = function (name) {
|
|||
return col;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Edge
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief changes a property of an edge
|
||||
///
|
||||
|
@ -134,40 +124,14 @@ Edge.prototype.setProperty = function (name, value) {
|
|||
return value;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Vertex
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructs a new vertex object
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief inbound and outbound edges
|
||||
///
|
||||
|
@ -325,19 +289,14 @@ Vertex.prototype.setProperty = function (name, value) {
|
|||
return value;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Graph
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructs a new graph object
|
||||
///
|
||||
|
@ -374,13 +333,13 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
if (typeof vertices === 'object' && typeof vertices.name === 'function') {
|
||||
vertices = vertices.name();
|
||||
}
|
||||
|
||||
if (typeof edges === 'object' && typeof edges.name === 'function') {
|
||||
edges = edges.name();
|
||||
}
|
||||
|
||||
// find an existing graph by name
|
||||
if (vertices === undefined && edges === undefined) {
|
||||
|
||||
// Find an existing graph
|
||||
try {
|
||||
graphProperties = gdb.document(name);
|
||||
}
|
||||
|
@ -404,17 +363,19 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
throw "edge collection '" + graphProperties.edges + "' has vanished";
|
||||
}
|
||||
}
|
||||
|
||||
// sanity check for vertices
|
||||
else if (typeof vertices !== "string" || vertices === "") {
|
||||
throw "<vertices> must be a string or null";
|
||||
}
|
||||
|
||||
// sanity check for edges
|
||||
else if (typeof edges !== "string" || edges === "") {
|
||||
throw "<edges> must be a string or null";
|
||||
}
|
||||
|
||||
// create a new graph or get an existing graph
|
||||
else {
|
||||
// Create a new graph or get an existing graph
|
||||
vertices = findOrCreateCollectionByName(vertices);
|
||||
edges = findOrCreateEdgeCollectionByName(edges);
|
||||
|
||||
try {
|
||||
graphProperties = gdb.document(name);
|
||||
}
|
||||
|
@ -422,24 +383,27 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
graphProperties = null;
|
||||
}
|
||||
|
||||
// Graph doesn't exist yet
|
||||
// graph doesn't exist yet, create it
|
||||
if (graphProperties === null) {
|
||||
|
||||
// check if know that graph
|
||||
graphProperties = gdb.firstExample(
|
||||
'vertices', vertices.name(),
|
||||
'edges', edges.name()
|
||||
'vertices', vertices,
|
||||
'edges', edges
|
||||
);
|
||||
|
||||
if (graphProperties === null) {
|
||||
|
||||
// check if edge is used in a graph
|
||||
graphProperties = gdb.firstExample('edges', edges.name());
|
||||
graphProperties = gdb.firstExample('edges', edges);
|
||||
|
||||
if (graphProperties === null) {
|
||||
findOrCreateCollectionByName(vertices);
|
||||
findOrCreateEdgeCollectionByName(edges);
|
||||
|
||||
graphPropertiesId = gdb.save({
|
||||
'vertices' : vertices.name(),
|
||||
'edges' : edges.name(),
|
||||
'vertices' : vertices,
|
||||
'edges' : edges,
|
||||
'_key' : name
|
||||
}, waitForSync);
|
||||
|
||||
|
@ -454,15 +418,13 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
}
|
||||
}
|
||||
else {
|
||||
throw "graph with that name already exists";
|
||||
//if (graphProperties.vertices !== vertices.name()) {
|
||||
// throw "found graph but has different <vertices>";
|
||||
//}
|
||||
|
||||
//if (graphProperties.edges !== edges.name()) {
|
||||
// throw "found graph but has different <edges>";
|
||||
//}
|
||||
if (graphProperties.vertices !== vertices || graphProperties.edges !== edges) {
|
||||
throw "graph with that name already exists";
|
||||
}
|
||||
}
|
||||
|
||||
vertices = db._collection(graphProperties.vertices);
|
||||
edges = db._collection(graphProperties.edges);
|
||||
}
|
||||
|
||||
this._properties = graphProperties;
|
||||
|
@ -481,19 +443,10 @@ Graph.prototype.initialize = function (name, vertices, edges, waitForSync) {
|
|||
this.distances = {};
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @fn JSF_graph_getAll
|
||||
/// @brief returns all available graphs
|
||||
|
@ -628,25 +581,12 @@ Graph.prototype._replaceEdge = function (edge_id, data) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Graph.prototype.getVertex = function (id) {
|
||||
var ref, vertex;
|
||||
|
||||
try {
|
||||
ref = this._vertices.document(id);
|
||||
} catch (e) {
|
||||
ref = null;
|
||||
return this.constructVertex(id);
|
||||
}
|
||||
|
||||
if (ref !== null) {
|
||||
vertex = this.constructVertex(ref);
|
||||
} else {
|
||||
try {
|
||||
vertex = this.constructVertex(id);
|
||||
} catch (e1) {
|
||||
vertex = null;
|
||||
}
|
||||
catch (e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return vertex;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -789,19 +729,10 @@ Graph.prototype.removeEdge = function (edge, waitForSync) {
|
|||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- MODULE EXPORTS
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoGraph
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
exports.Edge = Edge;
|
||||
exports.Graph = Graph;
|
||||
exports.Vertex = Vertex;
|
||||
|
@ -809,10 +740,6 @@ exports.GraphArray = GraphArray;
|
|||
|
||||
require("org/arangodb/graph/algorithms-common");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|