1
0
Fork 0

Some changes in the code documentation

This commit is contained in:
Thomas Schmidts 2014-06-25 15:10:13 +02:00
parent f7be757b0b
commit f005d676cb
10 changed files with 75 additions and 59 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -1 +1 @@
#define TRI_VERSION "2.2.0"
#define TRI_VERSION "2.2.0-devel"

View File

@ -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"` \

View File

@ -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."

View File

@ -1,3 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 120, regexp: true, vars: true */
/*global module, require, exports, applicationContext */
(function () {
"use strict";

View File

@ -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*/
////////////////////////////////////////////////////////////////////////////////

View File

@ -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;
}
});

View File

@ -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) {

View File

@ -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");
},
////////////////////////////////////////////////////////////////////////////////