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(); return TRI_errno();
} }
if (trxCollection->_accessType == TRI_TRANSACTION_WRITE && if (trxCollection->_accessType == TRI_TRANSACTION_WRITE
TRI_GetOperationModeServer() == TRI_VOCBASE_MODE_READONLY && && TRI_GetOperationModeServer() == TRI_VOCBASE_MODE_NO_CREATE
! TRI_IsSystemNameCollection(trxCollection->_collection->_collection->_info._name)) { && ! TRI_IsSystemNameCollection(trxCollection->_collection->_collection->_info._name)) {
return TRI_ERROR_ARANGO_READ_ONLY; return TRI_ERROR_ARANGO_READ_ONLY;
} }

View File

@ -136,7 +136,7 @@ TRI_voc_document_operation_e;
typedef enum { typedef enum {
TRI_VOCBASE_MODE_NORMAL = 1, // CRUD is allowed 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; 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/common/modules/org -name "*.js"` \
`find @srcdir@/js/client/modules -name "*.js"` \ `find @srcdir@/js/client/modules -name "*.js"` \
`find @srcdir@/js/server/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/models -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/views -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/views -name "*.js"` \
`find @srcdir@/js/apps/system/aardvark/frontend/js/collections -name "*.js"` \ `find @srcdir@/js/apps/system/aardvark/frontend/js/collections -name "*.js"` \

View File

@ -43,6 +43,7 @@
this.collection.fetch({ this.collection.fetch({
async: false async: false
}); });
console.log(this.collection);
$(this.el).html(this.template.render({ $(this.el).html(this.template.render({
graphs: this.collection, graphs: this.collection,
searchString : '' searchString : ''
@ -158,24 +159,25 @@
vertexCollections = _.pluck($('#newVertexCollections').select2("data"), "text"), vertexCollections = _.pluck($('#newVertexCollections').select2("data"), "text"),
edgeDefinitions = [], edgeDefinitions = [],
self = this, self = this,
hasNext = false, hasNext = true,
newEdgeDefinitions1, collection,
from, from,
to; to;
newEdgeDefinitions1 = $("#newEdgeDefinitions1").val(); collection = $('#newEdgeDefinitions1').val();
if (newEdgeDefinitions1 !== "") { if (collection !== "") {
from = _.pluck($('#s2id_fromCollections1').select2("data"), "text"); from = _.pluck($('#s2id_fromCollections1').select2("data"), "text");
to = _.pluck($('#s2id_toCollections1').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) { if (!name) {
arangoHelper.arangoNotification( arangoHelper.arangoNotification(
"A name for the graph has to be provided." "A name for the graph has to be provided."

View File

@ -1,4 +1,6 @@
(function() { /*jslint indent: 2, nomen: true, maxlen: 120, regexp: true, vars: true */
/*global module, require, exports, applicationContext */
(function () {
"use strict"; "use strict";
var Foxx = require("org/arangodb/foxx"), var Foxx = require("org/arangodb/foxx"),
@ -6,7 +8,7 @@
controller = new Foxx.Controller(applicationContext), controller = new Foxx.Controller(applicationContext),
url = require("url"); url = require("url");
controller.get("/initpwd/:token", function(req, res) { controller.get("/initpwd/:token", function (req, res) {
var token = req.params("token"), var token = req.params("token"),
username; username;
@ -26,14 +28,14 @@
}); });
controller.post("/checkpwd", function(req, res) { controller.post("/checkpwd", function (req, res) {
var params = req.rawBody().split("&"); var params = req.rawBody().split("&");
var password = params[0].split("=")[1]; var password = params[0].split("=")[1];
var confirmPassword = params[1].split("=")[1]; var confirmPassword = params[1].split("=")[1];
var token = params[2].split("=")[1]; var token = params[2].split("=")[1];
//check, if passwords are equal //check, if passwords are equal
if(password !== confirmPassword) { if (password !== confirmPassword) {
var path = url.parse(req.url).pathname.split("/"); var path = url.parse(req.url).pathname.split("/");
path = path.slice(0, path.length - 2).join("/") + "/changePassword.html"; path = path.slice(0, path.length - 2).join("/") + "/changePassword.html";

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*/ /*global require, applicationContext*/
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -76,7 +76,7 @@ function changeOperationModePositiveCaseTestSuite () {
collections: { }, collections: { },
action: function () { action: function () {
var db = require('internal').db; var db = require('internal').db;
var result = db._changeMode('ReadOnly'); var result = db._changeMode('NoCreate');
return result; return result;
} }
}); });

View File

@ -1619,7 +1619,7 @@ var _extendEdgeDefinitions = function (edgeDefinition) {
var _create = function (graphName, edgeDefinitions, orphanCollections) { var _create = function (graphName, edgeDefinitions, orphanCollections) {
if (!orphanCollections) { if (! Array.isArray(orphanCollections) ) {
orphanCollections = []; orphanCollections = [];
} }
var gdb = getGraphCollection(), var gdb = getGraphCollection(),
@ -1697,9 +1697,16 @@ var _create = function (graphName, edgeDefinitions, orphanCollections) {
findOrCreateCollectionByName(oC, ArangoCollection.TYPE_DOCUMENT); findOrCreateCollectionByName(oC, ArangoCollection.TYPE_DOCUMENT);
} }
); );
edgeDefinitions.forEach(
function(eD, index) {
var tmp = sortEdgeDefinition(eD);
edgeDefinitions[index] = tmp;
}
);
orphanCollections = orphanCollections.sort();
gdb.save({ gdb.save({
'orphanCollections' : orphanCollections.sort, 'orphanCollections' : orphanCollections,
'edgeDefinitions' : edgeDefinitions, 'edgeDefinitions' : edgeDefinitions,
'_key' : graphName '_key' : graphName
}); });
@ -2246,6 +2253,7 @@ var checkIfMayBeDropped = function(colName, graphName, graphs) {
} }
); );
} }
var orphanCollections = graph.orphanCollections; var orphanCollections = graph.orphanCollections;
if (orphanCollections) { if (orphanCollections) {
if (orphanCollections.indexOf(colName) !== -1) { if (orphanCollections.indexOf(colName) !== -1) {

View File

@ -56,7 +56,7 @@ function databaseTestSuite () {
} }
db._createDatabase("testDB"); db._createDatabase("testDB");
db._changeMode("ReadOnly"); db._changeMode("NoCreate");
}, },
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -121,7 +121,7 @@ function operationsTestSuite () {
db._drop("testCol"); db._drop("testCol");
collection = db._create("testCol"); collection = db._create("testCol");
collection.save({_key: "testDocKey", a: 2 }); collection.save({_key: "testDocKey", a: 2 });
db._changeMode("ReadOnly"); db._changeMode("NoCreate");
}, },
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////