mirror of https://gitee.com/bigwinds/arangodb
Some changes in the code documentation
This commit is contained in:
parent
f7be757b0b
commit
f005d676cb
|
@ -426,9 +426,9 @@ static int UseCollections (TRI_transaction_t* trx,
|
|||
return TRI_errno();
|
||||
}
|
||||
|
||||
if (trxCollection->_accessType == TRI_TRANSACTION_WRITE &&
|
||||
TRI_GetOperationModeServer() == TRI_VOCBASE_MODE_READONLY &&
|
||||
! TRI_IsSystemNameCollection(trxCollection->_collection->_collection->_info._name)) {
|
||||
if (trxCollection->_accessType == TRI_TRANSACTION_WRITE
|
||||
&& TRI_GetOperationModeServer() == TRI_VOCBASE_MODE_NO_CREATE
|
||||
&& ! TRI_IsSystemNameCollection(trxCollection->_collection->_collection->_info._name)) {
|
||||
return TRI_ERROR_ARANGO_READ_ONLY;
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ TRI_voc_document_operation_e;
|
|||
|
||||
typedef enum {
|
||||
TRI_VOCBASE_MODE_NORMAL = 1, // CRUD is allowed
|
||||
TRI_VOCBASE_MODE_READONLY = 2, // C & U not allowed RD allowed
|
||||
TRI_VOCBASE_MODE_NO_CREATE = 2, // C & U not allowed RD allowed
|
||||
}
|
||||
TRI_vocbase_operationmode_e;
|
||||
|
||||
|
|
|
@ -56,6 +56,10 @@ 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/apps/system/cerberus -name "*.js"` \
|
||||
`find @srcdir@/js/apps/system/gharial -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"` \
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
this.collection.fetch({
|
||||
async: false
|
||||
});
|
||||
console.log(this.collection);
|
||||
$(this.el).html(this.template.render({
|
||||
graphs: this.collection,
|
||||
searchString : ''
|
||||
|
@ -158,24 +159,25 @@
|
|||
vertexCollections = _.pluck($('#newVertexCollections').select2("data"), "text"),
|
||||
edgeDefinitions = [],
|
||||
self = this,
|
||||
hasNext = false,
|
||||
newEdgeDefinitions1,
|
||||
hasNext = true,
|
||||
collection,
|
||||
from,
|
||||
to;
|
||||
|
||||
newEdgeDefinitions1 = $("#newEdgeDefinitions1").val();
|
||||
if (newEdgeDefinitions1 !== "") {
|
||||
collection = $('#newEdgeDefinitions1').val();
|
||||
if (collection !== "") {
|
||||
from = _.pluck($('#s2id_fromCollections1').select2("data"), "text");
|
||||
to = _.pluck($('#s2id_toCollections1').select2("data"), "text");
|
||||
edgeDefinitions.push(
|
||||
{
|
||||
collection: collection,
|
||||
from: from,
|
||||
to: to
|
||||
}
|
||||
/*
|
||||
console.log("newEdgeDefinitions1");
|
||||
console.log(newEdgeDefinitions1);
|
||||
console.log("from");
|
||||
console.log(from);
|
||||
console.log("to");
|
||||
console.log(to);
|
||||
*/
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (!name) {
|
||||
arangoHelper.arangoNotification(
|
||||
"A name for the graph has to be provided."
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 120, regexp: true, vars: true */
|
||||
/*global module, require, exports, applicationContext */
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true, unparam: true */
|
||||
/*jslint indent: 2, nomen: true, maxlen: 120, white: true, plusplus: true, unparam: true, regexp: true, vars: true */
|
||||
/*global require, applicationContext*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -76,7 +76,7 @@ function changeOperationModePositiveCaseTestSuite () {
|
|||
collections: { },
|
||||
action: function () {
|
||||
var db = require('internal').db;
|
||||
var result = db._changeMode('ReadOnly');
|
||||
var result = db._changeMode('NoCreate');
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1619,7 +1619,7 @@ var _extendEdgeDefinitions = function (edgeDefinition) {
|
|||
|
||||
var _create = function (graphName, edgeDefinitions, orphanCollections) {
|
||||
|
||||
if (!orphanCollections) {
|
||||
if (! Array.isArray(orphanCollections) ) {
|
||||
orphanCollections = [];
|
||||
}
|
||||
var gdb = getGraphCollection(),
|
||||
|
@ -1697,9 +1697,16 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
|
|||
findOrCreateCollectionByName(oC, ArangoCollection.TYPE_DOCUMENT);
|
||||
}
|
||||
);
|
||||
edgeDefinitions.forEach(
|
||||
function(eD, index) {
|
||||
var tmp = sortEdgeDefinition(eD);
|
||||
edgeDefinitions[index] = tmp;
|
||||
}
|
||||
);
|
||||
orphanCollections = orphanCollections.sort();
|
||||
|
||||
gdb.save({
|
||||
'orphanCollections' : orphanCollections.sort,
|
||||
'orphanCollections' : orphanCollections,
|
||||
'edgeDefinitions' : edgeDefinitions,
|
||||
'_key' : graphName
|
||||
});
|
||||
|
@ -2246,6 +2253,7 @@ var checkIfMayBeDropped = function(colName, graphName, graphs) {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
var orphanCollections = graph.orphanCollections;
|
||||
if (orphanCollections) {
|
||||
if (orphanCollections.indexOf(colName) !== -1) {
|
||||
|
|
|
@ -56,7 +56,7 @@ function databaseTestSuite () {
|
|||
}
|
||||
|
||||
db._createDatabase("testDB");
|
||||
db._changeMode("ReadOnly");
|
||||
db._changeMode("NoCreate");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -121,7 +121,7 @@ function operationsTestSuite () {
|
|||
db._drop("testCol");
|
||||
collection = db._create("testCol");
|
||||
collection.save({_key: "testDocKey", a: 2 });
|
||||
db._changeMode("ReadOnly");
|
||||
db._changeMode("NoCreate");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue