1
0
Fork 0

Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel

This commit is contained in:
Michael Hackstein 2014-06-23 13:18:06 +02:00
commit 658fa5cc25
9 changed files with 1468 additions and 76 deletions

View File

@ -16,36 +16,36 @@
* [Collections](FirstSteps/CollectionsAndDocuments.md)
<!-- 3 -->
* [ArangoDB Web Interface](WebInterface/README.md)
* [Some Features](WebInterface/Features.md)
* [Some Features](WebInterface/Features.md)
<!-- 4 -->
* [Handling Databases](Databases/README.md)
* [Working with Databases](Databases/WorkingWith.md)
* [Notes about Databases](Databases/Notes.md)
* [Working with Databases](Databases/WorkingWith.md)
* [Notes about Databases](Databases/Notes.md)
<!-- 5 -->
* [Handling Collections](Collections/README.md)
* [Collection Methods](Collections/CollectionMethods.md)
* [Database Methods](Collections/DatabaseMethods.md)
* [Collection Methods](Collections/CollectionMethods.md)
* [Database Methods](Collections/DatabaseMethods.md)
<!-- 6 -->
* [Handling Documents](Documents/README.md)
* [Address and ETag](Documents/DocumentAddress.md)
* [Collection Methods](Documents/DocumentMethods.md)
* [Database Methods](Documents/DatabaseMethods.md)
* [Address and ETag](Documents/DocumentAddress.md)
* [Collection Methods](Documents/DocumentMethods.md)
* [Database Methods](Documents/DatabaseMethods.md)
<!-- 7 -->
* [Handling Edges](Edges/README.md)
<!-- 8 -->
* [Simple Queries](SimpleQueries/README.md)
* [Geo Queries](SimpleQueries/GeoQueries.md)
* [Fulltext Queries](SimpleQueries/FulltextQueries.md)
* [Pagination](SimpleQueries/Pagination.md)
* [Sequential Access](SimpleQueries/Access.md)
* [Modification Queries](SimpleQueries/ModificationQueries.md)
* [Geo Queries](SimpleQueries/GeoQueries.md)
* [Fulltext Queries](SimpleQueries/FulltextQueries.md)
* [Pagination](SimpleQueries/Pagination.md)
* [Sequential Access](SimpleQueries/Access.md)
* [Modification Queries](SimpleQueries/ModificationQueries.md)
<!-- 9 -->
* [Transactions](Transactions/README.md)
* [Transaction invocation](Transactions/TransactionInvocation.md)
* [Passing parameters](Transactions/Passing.md)
* [Locking and isolation](Transactions/LockingAndIsolation.md)
* [Durability](Transactions/Durability.md)
* [Limitations](Transactions/Limitations.md)
* [Transaction invocation](Transactions/TransactionInvocation.md)
* [Passing parameters](Transactions/Passing.md)
* [Locking and isolation](Transactions/LockingAndIsolation.md)
* [Durability](Transactions/Durability.md)
* [Limitations](Transactions/Limitations.md)
<!-- 10 -->
* [AQL](Aql/README.md)
* [How to invoke AQL](Aql/Invoke.md)
@ -57,47 +57,47 @@
* [Advanced Features](Aql/Advanced.md)
<!-- 11 -->
* [Extending AQL](AqlExtending/README.md)
* [Conventions](AqlExtending/Conventions.md)
* [Registering Functions](AqlExtending/Functions.md)
* [Conventions](AqlExtending/Conventions.md)
* [Registering Functions](AqlExtending/Functions.md)
<!-- 12 -->
* [AQL Examples](AqlExamples/README.md)
* [Examples](AqlExamples/Examples.md)
* [Collection based queries](AqlExamples/CollectionQueries.md)
* [Projections and filters](AqlExamples/ProjectionsAndFilters.md)
* [Joins](AqlExamples/Join.md)
* [Grouping](AqlExamples/Grouping.md)
* [Examples](AqlExamples/Examples.md)
* [Collection based queries](AqlExamples/CollectionQueries.md)
* [Projections and filters](AqlExamples/ProjectionsAndFilters.md)
* [Joins](AqlExamples/Join.md)
* [Grouping](AqlExamples/Grouping.md)
<!-- 13 -->
* [Blueprint Graphs](Blueprint-Graphs/README.md)
* [Graph Constructor](Blueprint-Graphs/GraphConstructor.md)
* [Vertex Methods](Blueprint-Graphs/VertexMethods.md)
* [Edge Methods](Blueprint-Graphs/EdgeMethods.md)
* [Graph Constructor](Blueprint-Graphs/GraphConstructor.md)
* [Vertex Methods](Blueprint-Graphs/VertexMethods.md)
* [Edge Methods](Blueprint-Graphs/EdgeMethods.md)
<!-- 14 -->
* [General Graphs](General-Graphs/README.md)
* [Functions](General-Graphs/GeneralGraphFunctions.md)
* [Fluent Query Interface](General-Graphs/FluentAQLInterface.md)
* [Fluent Query Interface](General-Graphs/FluentAQLInterface.md)
<!-- 15 -->
* [Traversals](Traversals/README.md)
* [Starting from Scratch](Traversals/StartingFromScratch.md)
* [Using Traversal Objects](Traversals/UsingTraversalObjects.md)
* [Example Data](Traversals/ExampleData.md)
* [Starting from Scratch](Traversals/StartingFromScratch.md)
* [Using Traversal Objects](Traversals/UsingTraversalObjects.md)
* [Example Data](Traversals/ExampleData.md)
<!-- 17 -->
* [Foxx](Foxx/README.md)
* [Handling Request](Foxx/HandlingRequest.md)
* [Handling Request](Foxx/HandlingRequest.md)
* [Manifest](Foxx/FoxxManifest.md)
* [FoxxController](Foxx/FoxxController.md)
* [FoxxModel](Foxx/FoxxModel.md)
* [FoxxRepository](Foxx/FoxxRepository.md)
* [Developing Applications](Foxx/DevelopingAnApplication.md)
* [Deploying Applications](Foxx/DeployingAnApplication.md)
* [Optional Functionlity](Foxx/FoxxOptional.md)
* [FoxxController](Foxx/FoxxController.md)
* [FoxxModel](Foxx/FoxxModel.md)
* [FoxxRepository](Foxx/FoxxRepository.md)
* [Developing Applications](Foxx/DevelopingAnApplication.md)
* [Deploying Applications](Foxx/DeployingAnApplication.md)
* [Optional Functionality](Foxx/FoxxOptional.md)
<!-- 18 -->
* [Foxx Manager](FoxxManager/README.md)
* [First Steps](FoxxManager/FirstSteps.md)
* [Behind the scenes](FoxxManager/BehindTheScenes.md)
* [Multiple Databases](FoxxManager/MultipleDatabases.md)
* [Foxx Applications](FoxxManager/ApplicationsAndReplications.md)
* [Manager Commands](FoxxManager/ManagerCommands.md)
* [Frequently Used Options](FoxxManager/FrequentlyUsedOptions.md)
* [First Steps](FoxxManager/FirstSteps.md)
* [Behind the scenes](FoxxManager/BehindTheScenes.md)
* [Multiple Databases](FoxxManager/MultipleDatabases.md)
* [Foxx Applications](FoxxManager/ApplicationsAndReplications.md)
* [Manager Commands](FoxxManager/ManagerCommands.md)
* [Frequently Used Options](FoxxManager/FrequentlyUsedOptions.md)
<!-- 19 -->
* [ArangoDB's Actions](ArangoActions/README.md)
<!-- 20 -->
@ -109,15 +109,15 @@
* [Replication Events](Replication/Events.md)
<!-- 21 -->
* [Sharding](Sharding/README.md)
* [How to try it out](Sharding/HowTo.md)
* [Implementation](Sharding/StatusOfImplementation.md)
* [Authentication](Sharding/Authentication.md)
* [Firewall setup](Sharding/FirewallSetup.md)
* [How to try it out](Sharding/HowTo.md)
* [Implementation](Sharding/StatusOfImplementation.md)
* [Authentication](Sharding/Authentication.md)
* [Firewall setup](Sharding/FirewallSetup.md)
<!-- 22 -->
* [Configure ArangoDB](ConfigureArango/README.md)
* [General options](ConfigureArango/GeneralOptions.md)
* [Arangod options](ConfigureArango/Arangod.md)
* [Endpoints options](ConfigureArango/Endpoint.md)
* [Endpoints options](ConfigureArango/Endpoint.md)
* [Development options](ConfigureArango/Development.md)
* [Cluster options](ConfigureArango/Cluster.md)
* [Logging options](ConfigureArango/Logging.md)
@ -130,14 +130,14 @@
<!-- 24 -->
* [Arangodump](Arangodump/README.md)
<!-- 25 -->
* [Arangorestore](Arangorestore/README.md)
* [Arangorestore](Arangorestore/README.md)
<!-- 26 -->
* [HTTP API](HttpApi/README.md)
* [Databases](HttpDatabase/README.md)
* [To-Endpoint](HttpDatabase/DatabaseEndpoint.md)
* [Management](HttpDatabase/DatabaseManagement.md)
* [Managing (http)](HttpDatabase/ManagingDatabasesUsingHttp.md)
* [Note on Databases](HttpDatabase/NotesOnDatabases.md)
* [Note on Databases](HttpDatabase/NotesOnDatabases.md)
* [Documents](HttpDocument/README.md)
* [Address and ETag](HttpDocument/AddressAndEtag.md)
* [Working with](HttpDocument/WorkingWithDocuments.md)
@ -159,10 +159,10 @@
* [Address of an Index](HttpIndexes/Address.md)
* [Working with Indexes](HttpIndexes/WorkingWith.md)
* [Cap Constraints](HttpIndexes/Cap.md)
* [Hash](HttpIndexes/Hash.md)
* [Skiplist](HttpIndexes/Skiplist.md)
* [Geo](HttpIndexes/Geo.md)
* [Fulltext](HttpIndexes/Fulltext.md)
* [Hash](HttpIndexes/Hash.md)
* [Skiplist](HttpIndexes/Skiplist.md)
* [Geo](HttpIndexes/Geo.md)
* [Fulltext](HttpIndexes/Fulltext.md)
* [Transactions](HttpTransaction/README.md)
* [Graphs](HttpGraphs/README.md)
* [Vertex](HttpGraphs/Vertex.md)
@ -213,9 +213,9 @@
* [Datafile Debugger](DatafileDebugger/README.md)
<!-- 31 -->
* [Naming Conventions](NamingConventions/README.md)
* [Database Names](NamingConventions/DatabaseNames.md)
* [Collection Names](NamingConventions/CollectionNames.md)
* [Document Keys](NamingConventions/DocumentKeys.md)
* [Attribute Names](NamingConventions/AttributeNames.md)
* [Database Names](NamingConventions/DatabaseNames.md)
* [Collection Names](NamingConventions/CollectionNames.md)
* [Document Keys](NamingConventions/DocumentKeys.md)
* [Attribute Names](NamingConventions/AttributeNames.md)
<!-- 32 -->
* [Error codes and meanings](ErrorCodes/README.md)

View File

@ -1,6 +1,6 @@
!CHAPTER Details on FoxxController
`New FoxxController(applicationContext, options)`
`new FoxxController(applicationContext, options)`
This creates a new Controller. The first argument is the controller context available in the variable applicationContext. The second one is an options array with the following attributes:

View File

@ -124,7 +124,7 @@ js/apps/system/aardvark/frontend/js/modules/%.js: @srcdir@/js/common/modules/%.j
js/apps/system/aardvark/frontend/js/modules/%.js: @srcdir@/js/client/modules/%.js .setup-js-directories
(echo "module.define(\"$(patsubst js/client/modules/%.js,%,$<)\", function(exports, module) {" && cat $< && echo "});") > $@
js/apps/system/aardvark/frontend/js/modules/underscore.js: @srcdir@/js/node/node_modules/underscore/underscore-min.js
js/apps/system/aardvark/frontend/js/modules/underscore.js: @srcdir@/js/node/node_modules/underscore/underscore.js
(echo "module.define(\"underscore\", function(exports, module) {" && cat $< && echo "});") > $@

View File

@ -1657,7 +1657,6 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
'edgeDefinitions' : edgeDefinitions,
'_key' : graphName
});
return new Graph(graphName, edgeDefinitions, collections[0], collections[1], orphanCollections);
};

File diff suppressed because one or more lines are too long

View File

@ -94,6 +94,7 @@
"frontend/js/arango/templateEngine.js",
"frontend/js/shell/browser.js",
"frontend/js/config/dygraphConfig.js",
"frontend/js/modules/underscore.js",
"frontend/js/modules/org/arangodb/**",
"frontend/js/modules/org/arangodb-common.js",
"frontend/js/modules/org/arangodb.js",

View File

@ -1664,7 +1664,7 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
'edgeDefinitions' : edgeDefinitions,
'_key' : graphName
});
require("internal").print("precreate");
return new Graph(graphName, edgeDefinitions, collections[0], collections[1], orphanCollections);
};
@ -1790,6 +1790,7 @@ var bindEdgeCollections = function(self, edgeCollections) {
var bindVertexCollections = function(self, vertexCollections) {
_.each(vertexCollections, function(key) {
require("internal").print("each resolved");
var obj = db._collection(key);
var result;
var wrap = wrapCollection(obj);
@ -1883,9 +1884,19 @@ var updateBindCollections = function(graph) {
bindVertexCollections(graph, edgeDef.to);
}
);
require("internal").print("preVertex");
bindVertexCollections(graph, graph.__orphanCollections);
};
////////////////////////////////////////////////////////////////////////////////
/// internal helper to sort a graph's edge definitions
////////////////////////////////////////////////////////////////////////////////
var sortEdgeDefinition = function(edgeDefinition) {
edgeDefinition.from = edgeDefinition.from.sort();
edgeDefinition.to = edgeDefinition.to.sort();
return edgeDefinition;
};
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_general_graph_vertex_collection_save
/// `graph.vertexCollectionName.save(data)`
@ -2085,6 +2096,13 @@ var updateBindCollections = function(graph) {
///
////////////////////////////////////////////////////////////////////////////////
var Graph = function(graphName, edgeDefinitions, vertexCollections, edgeCollections, orphanCollections) {
edgeDefinitions.forEach(
function(eD, index) {
var tmp = sortEdgeDefinition(eD);
edgeDefinitions[index] = tmp;
}
);
if (!orphanCollections) {
orphanCollections = [];
}
@ -2097,6 +2115,7 @@ var Graph = function(graphName, edgeDefinitions, vertexCollections, edgeCollecti
createHiddenProperty(this, "__idsToRemove", []);
createHiddenProperty(this, "__collectionsToLock", []);
createHiddenProperty(this, "__orphanCollections", orphanCollections);
require("internal").print("preBind");
updateBindCollections(self);
};
@ -3466,8 +3485,6 @@ Graph.prototype._diameter = function(options) {
};
////////////////////////////////////////////////////////////////////////////////
/// @startDocuBlock JSF_general_graph__extendEdgeDefinitions
/// `graph._extendEdgeDefinitions(edgeDefinition)`
@ -3499,6 +3516,7 @@ Graph.prototype._diameter = function(options) {
////////////////////////////////////////////////////////////////////////////////
Graph.prototype._extendEdgeDefinitions = function(edgeDefinition) {
edgeDefinition = sortEdgeDefinition(edgeDefinition);
var self = this;
var err;
//check if edgeCollection not already used
@ -3565,7 +3583,6 @@ Graph.prototype._extendEdgeDefinitions = function(edgeDefinition) {
}
);
updateBindCollections(this);
};
////////////////////////////////////////////////////////////////////////////////
@ -3660,7 +3677,7 @@ var changeEdgeDefinitionsForGraph = function(graph, edgeDefinition, newCollectio
///
////////////////////////////////////////////////////////////////////////////////
Graph.prototype._editEdgeDefinitions = function(edgeDefinition) {
edgeDefinition = sortEdgeDefinition(edgeDefinition);
var self = this;
//check, if in graphs edge definition

View File

@ -164,6 +164,20 @@ function GeneralGraphCreationSuite() {
}
},
test_collectionSorting: function() {
var g = graph._create(
gn,
graph._edgeDefinitions(
graph._directedRelation(rn1, [vn2, vn1], [vn4, vn3])
)
);
assertEqual([vn1, vn2], g.__edgeDefinitions[0].from);
assertEqual([vn3, vn4], g.__edgeDefinitions[0].to);
},
test_directedRelation : function () {
var r = graph._directedRelation(rn,
[vn1, vn2], [vn3, vn4]);
@ -563,11 +577,34 @@ function GeneralGraphCreationSuite() {
assertEqual([dr1], g1.__edgeDefinitions);
g1._addVertexCollection(vc3);
assertEqual([vc3], g1._orphanCollections());
g1._extendEdgeDefinitions(dr3);
assertEqual([dr1, dr3], g1.__edgeDefinitions);
assertEqual([], g1._orphanCollections());
g1._extendEdgeDefinitions(dr2);
assertEqual([dr1, dr3, dr2], g1.__edgeDefinitions);
},
test_extendEdgeDefinitionFromExistingGraph4: function() {
try {
graph._drop(gN1, true);
} catch(ignore) {
}
try {
graph._drop(gN2, true);
} catch(ignore) {
}
var dr1 = graph._directedRelation(ec1, [vc1], [vc1, vc2]),
dr2 = graph._directedRelation(ec2, [vc4, vc3, vc1, vc2], [vc4, vc3, vc1, vc2]),
g1 = graph._create(gN1, [dr1]);
g1._extendEdgeDefinitions(dr2);
assertEqual([dr1, dr2], g1.__edgeDefinitions);
assertEqual([], g1._orphanCollections());
g1._extendEdgeDefinitions(dr3);
assertEqual([dr1, dr2, dr3], g1.__edgeDefinitions);
var edgeDefinition = _.findWhere(g1.__edgeDefinitions, {collection: ec2});
assertEqual(edgeDefinition.from, [vc1, vc2, vc3, vc4]);
assertEqual(edgeDefinition.to, [vc1, vc2, vc3, vc4]);
},
@ -1188,7 +1225,7 @@ function ChainedFluentAQLResultsSuite() {
assertEqual(stmt, plainVertexQueryStmt(0));
assertEqual(query.bindVars.vertexExample_0, [
{name: uaName},
{name: p1Name},
{name: p1Name}
]);
assertEqual(query.bindVars.options_0, {});
},
@ -1219,7 +1256,7 @@ function ChainedFluentAQLResultsSuite() {
assertEqual(query.bindVars.vertexExample_0, [
{name: uaName},
{_id: b_id},
{name: ucName},
{name: ucName}
]);
assertEqual(query.bindVars.options_0, {});
},

View File

@ -6204,7 +6204,7 @@ function GENERAL_GRAPH_COMMON_PROPERTIES (
tmp[f._id + "|keys"].push(t._id);
var obj = {_id : t._id};
Object.keys(f).forEach(function (fromDoc) {
if (t[fromDoc] && t[fromDoc] === f[fromDoc]) {
if (t[fromDoc] !== undefined && t[fromDoc] === f[fromDoc]) {
obj[fromDoc] = t[fromDoc];
}
});