1
0
Fork 0
Conflicts:
	CHANGELOG
This commit is contained in:
Jan Steemann 2013-12-20 15:14:04 +01:00
commit 834f3dfe94
292 changed files with 12748 additions and 8810 deletions

View File

@ -1,3 +1,41 @@
v1.4.x (XXXX-XX-XX)
-------------------
* added `--server.ssl-protocol` option for client tools
this allows connecting from arangosh, arangoimp, arangoimp etc. to an ArangoDB
server that uses a non-default value for `--server.ssl-protocol`. The default
value for the SSL protocol is 4 (TLSv1). If the server is configured to use a
different protocol, it was not possible to connect to it with the client tools.
* added more detailed request statistics
This adds the number of async-executed HTTP requests plus the number of HTTP
requests per individual HTTP method type.
* added `--force` option for arangorestore
this option allows continuing a restore operation even if the server reports errors
in the middle of the restore operation
* better error reporting for arangorestore
in case the server returned an HTTP error, arangorestore previously reported this
error as `internal error` without any details only. Now server-side errors are
reported by arangorestore with the server's error message
* include more system collections in dumps produced by arangodump
previously some system collections were intentionally excluded from dumps, even if the
dump was run with `--include-system-collections`. for example, the collections `_aal`,
`_modules`, `_routing`, and `_users` were excluded. This makes sense in a replication
context but not always in a dump context.
When specifying `--include-system-collections`, arangodump will now include the above-
mentioned collections in the dump, too. Some other system collections are still excluded
even when the dump is run with `--include-system-collections`, for example `_replication`
and `_trx`.
* fixed issue #701: ArangoStatement undefined in arangosh
* fixed typos in configuration files
v1.4.3 (2013-11-25)
-------------------

View File

@ -137,18 +137,15 @@ endif ()
file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb-apps")
################################################################################
### @brief TRI_BINDIR
################################################################################
set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
################################################################################
### @brief database directory
################################################################################
FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb")
################################################################################
### @brief apps directory
################################################################################

View File

@ -6,6 +6,9 @@
/* ************************************************************************** */
/* global */
/* ************************************************************************** */
.page-id-1410 #wrapper {
margin-top: 75px;
}
#content div.arangodb {
background: none repeat scroll 0 0 transparent;
@ -15,7 +18,7 @@
font-size: 16px;
font-weight: 300;
line-height: 1.4em;
margin: 0;
margin: 0px 0px 0px 0px;
padding: 0px;
vertical-align: baseline;
}
@ -45,8 +48,8 @@
border-bottom: 1px solid #EFECE9;
font-family: Rockwell,Georgia,"Times New Roman",Times,serif;
font-size: 2em;
margin-bottom: 38px;
padding: 14px 0 3px;
margin-bottom: 40px;
padding: 3px 0 3px;
}
#content div.arangodb h2 {
@ -58,21 +61,15 @@
padding: 14px 0 3px;
}
#content div.arangodb h3 {
margin-top: 20px;
margin-bottom: 14px;
border-bottom: 1px solid #EFECE9;
}
/* ************************************************************************** */
/* navigation bar */
/* ************************************************************************** */
#content div.arangodb div.navigate {
height: 0px;
position: relative;
height: 0px;
position: relative;
text-align: right;
top: -70px;
top: -69px;
}
/* ************************************************************************** */
@ -82,8 +79,9 @@
#content div.arangodb div.toc {
border-width: thin;
border-style: solid;
background-color: #E7F3C5;
background-color: #F8F8F8;
margin-bottom: 14px;
padding: 4px;
}
#content div.arangodb div.toc ul {
@ -92,12 +90,7 @@
}
#content div.arangodb ul ul {
margin-top: 14px;
margin-bottom: 14px;
}
#content div.arangodb ul {
margin-top: 14px;
margin-bottom: 14px;
margin-bottom: 0px;
}
/* ************************************************************************** */
@ -105,12 +98,7 @@
/* ************************************************************************** */
#content div.arangodb div.functionsignature {
font-size: 14px;
font-weight: bold;
font-family: monospace,fixed;
border: 2px dotted;
background-color: #F8F8F8;
padding: 10px;
margin-top: 14px;
margin-bottom: 14px;
}
@ -131,48 +119,18 @@
/* ************************************************************************** */
/* rest call */
/* ************************************************************************** */
.space-before {
margin-top: 14px;
}
#content div.arangodb div.restheader {
font-size: 14px;
font-weight: bold;
font-size: 18px;
font-family: monospace,fixed;
border: 2px dotted;
background-color: #F8F8F8;
padding: 10px;
margin-top: 14px;
border-bottom: 1px dotted;
margin-bottom: 14px;
}
#content div.arangodb div.restheaderremark {
float: right;
}
#content div.arangodb div.restbodyparam {
font-size: 18px;
float: right;
font-family: "Helvetica",sans-serif;
font-size: 16px;
margin-bottom: 14px;
}
#content div.arangodb div.resturlparameters {
font-weight: bold;
margin-top: 14px;
margin-bottom: 14px;
}
#content div.arangodb div.resturlparam {
font-style: italic;
margin-top: 14px;
margin-bottom: 14px;
}
#content div.arangodb div.restheaderparameters {
font-weight: bold;
margin-top: 14px;
margin-bottom: 14px;
}
#content div.arangodb div.restheaderparam {
font-style: italic;
}
#content div.arangodb div.restqueryparameters {
@ -194,14 +152,11 @@
#content div.arangodb div.restreturncodes {
font-weight: bold;
margin-top: 14px;
margin-bottom: 0px;
}
#content div.arangodb div.restreturncodes p {
margin: 0px;
margin-bottom: 14px;
}
#content div.arangodb div.restreturncode {
font-style: italic;
display: inline;
}
/* ************************************************************************** */
@ -220,11 +175,12 @@
#content div.arangodb pre {
background-color: #FBFCFD !important;
border: 0px;
border: 1px solid #C4CFE5 !important;
font-family: monospace,fixed;
font-size: 105%;
font-size: 15px;
line-height: 21px;
margin: 4px 8px 24px 36px;
margin: 4px 8px 24px 2px;
overflow: auto;
padding: 4px 6px;
word-wrap: break-word;
@ -232,15 +188,15 @@
#content div.arangodb div.fragment {
background-color: #FBFCFD !important;
border: 0px;
border: 1px solid #C4CFE5 !important;
font-family: monospace,fixed;
font-size: 105%;
font-size: 15px;
line-height: 11px;
margin: 4px 8px 24px 36px;
line-height: 21px;
margin: 4px 8px 24px 2px;
overflow: auto;
padding: 4px 6px;
word-wrap: break-word;
white-space: pre;
}
#content div.arangodb code {
@ -259,5 +215,12 @@
/* ************************************************************************** */
#content hr {
margin-bottom: 2px;
margin-top: 15px;
margin-bottom: 2px;
}
a.anchor {
padding-top: 80px;
width: 0;
font-size: 0;
}

View File

@ -104,7 +104,7 @@ pack-dmg-cmake:
-D "CMAKE_INSTALL_PREFIX=${prefix}" \
-D "USE_MRUBY=ON" \
-D "USE_RAW_CONFIG=ON" \
-D "ARANGODB_VERSION=@VERSION@" \
-D "ARANGODB_VERSION=${VERSION}" \
-D "CPACK_PACKAGE_VERSION_MAJOR=${VERSION_MAJOR}" \
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \
@ -150,7 +150,7 @@ pack-macosx-cmake:
-D "CMAKE_INSTALL_PREFIX=${prefix}" \
-D "USE_MRUBY=ON" \
-D "USE_RAW_CONFIG=ON" \
-D "ARANGODB_VERSION=@VERSION@" \
-D "ARANGODB_VERSION=${VERSION}" \
-D "CPACK_PACKAGE_VERSION_MAJOR=${VERSION_MAJOR}" \
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \
@ -195,7 +195,7 @@ pack-arm-cmake:
-D "VARDIR=${localstatedir}" \
-D "USE_MRUBY=OFF" \
-D "USE_RAW_CONFIG=OFF" \
-D "ARANGODB_VERSION=@VERSION@" \
-D "ARANGODB_VERSION=${VERSION}" \
-D "CPACK_PACKAGE_VERSION_MAJOR=${VERSION_MAJOR}" \
-D "CPACK_PACKAGE_VERSION_MINOR=${VERSION_MINOR}" \
-D "CPACK_PACKAGE_VERSION_PATCH=${VERSION_PATCH}" \

View File

@ -13,8 +13,7 @@ for script in $SCRIPTS; do
echo "#!/bin/bash"
echo
echo "export ARANGODB_ROOT=\"${ARANGODB_ROOT}Contents/MacOS/\""
echo "export DATABASEDIR=\"\${ARANGODB_ROOT}opt/arangodb/var/lib/arangodb\""
echo "export LOGDIR=\"\${ARANGODB_ROOT}opt/arangodb/var/log/arangodb\""
echo "export LOCALSTATEDIR=\"\${ARANGODB_ROOT}opt/arangodb/var\""
echo "export PKGDATADIR=\"\${ARANGODB_ROOT}opt/arangodb/share/arangodb\""
echo
if [ "$base" == "arango-dfdb" ]; then

View File

@ -92,3 +92,16 @@ You can use the Google group for improvements, feature requests, comments
http://www.arangodb.org/connect
Citing ArangoDB
---------------
Please kindly cite ArangoDB in your publications if it helps your research:
```bibtex
@misc{ArangoDB2013,
Author = {ArangoDB},
Title = { {ArangoDB}: An Open Source multi-purpose database supporting flexible data models for documents, graphs, and key-values.},
Year = {2013},
Howpublished = {\url{http://arangodb.org/}
}
```

View File

@ -150,6 +150,10 @@ static bool CheckArgumentType (TRI_aql_node_t const* parameter,
const param_t* const allowed) {
param_t found = InitParam();
if (parameter->_type == TRI_AQL_NODE_REFERENCE) {
return true;
}
if (parameter->_type == TRI_AQL_NODE_PARAMETER) {
// node is a bind parameter
char* name = TRI_AQL_NODE_STRING(parameter);

View File

@ -208,6 +208,10 @@ install(
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb
DESTINATION ${VARDIR_INSTALL}/lib)
install(
DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb-apps
DESTINATION ${VARDIR_INSTALL}/lib)
## -----------------------------------------------------------------------------
## --SECTION-- END-OF-FILE
## -----------------------------------------------------------------------------

View File

@ -120,7 +120,8 @@ Syncer::Syncer (TRI_vocbase_t* vocbase,
_connection = GeneralClientConnection::factory(_endpoint,
_configuration._requestTimeout,
_configuration._connectTimeout,
(size_t) _configuration._maxConnectRetries);
(size_t) _configuration._maxConnectRetries,
(uint32_t) _configuration._sslProtocol);
if (_connection != 0) {
_client = new SimpleHttpClient(_connection, _configuration._requestTimeout, false);
@ -302,7 +303,7 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
}
if (res == TRI_ERROR_NO_ERROR) {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false);
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
}
}
else {
@ -311,7 +312,7 @@ int Syncer::applyCollectionDumpMarker (TRI_transaction_collection_t* trxCollecti
res = TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID;
}
else {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false);
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
}
}
}

View File

@ -36,6 +36,9 @@
#include "HttpServer/HttpServer.h"
#include "Replication/InitialSyncer.h"
#include "Rest/HttpRequest.h"
#include "Utils/EmbeddableTransaction.h"
#include "Utils/RestTransactionContext.h"
#include "Utils/SingleCollectionWriteTransaction.h"
#include "VocBase/compactor.h"
#include "VocBase/replication-applier.h"
#include "VocBase/replication-dump.h"
@ -292,18 +295,29 @@ bool RestReplicationHandler::filterCollection (TRI_vocbase_col_t* collection,
// invalid type
return false;
}
if (TRI_ExcludeCollectionReplication(collection->_name)) {
// collection is excluded
return false;
}
bool includeSystem = *((bool*) data);
if (! includeSystem && collection->_name[0] == '_') {
// exclude all system collections
return false;
}
if (TRI_ExcludeCollectionReplication(collection->_name)) {
// collection is excluded from replication
if (includeSystem) {
// now check if we still should include it in the dump
if (! TRI_EqualString(collection->_name, TRI_COL_NAME_USERS) &&
! TRI_EqualString(collection->_name, "_aal") &&
! TRI_EqualString(collection->_name, "_modules") &&
! TRI_EqualString(collection->_name, "_routing")) {
return false;
}
}
// _aal, _modules, _routing should be included
}
// all other cases should be included
return true;
}
@ -1601,10 +1615,16 @@ void RestReplicationHandler::handleCommandRestoreCollection () {
if (found) {
recycleIds = StringUtils::boolean(value);
}
bool force = false;
value = _request->value("force", found);
if (found) {
force = StringUtils::boolean(value);
}
TRI_server_id_t remoteServerId = 0; // TODO
string errorMsg;
int res = processRestoreCollection(json, overwrite, recycleIds, remoteServerId, errorMsg);
int res = processRestoreCollection(json, overwrite, recycleIds, force, remoteServerId, errorMsg);
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, json);
@ -1634,10 +1654,17 @@ void RestReplicationHandler::handleCommandRestoreIndexes () {
"invalid JSON");
return;
}
bool found;
bool force = false;
char const* value = _request->value("force", found);
if (found) {
force = StringUtils::boolean(value);
}
TRI_server_id_t remoteServerId = 0; // TODO
string errorMsg;
int res = processRestoreIndexes(json, remoteServerId, errorMsg);
int res = processRestoreIndexes(json, force, remoteServerId, errorMsg);
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, json);
@ -1661,6 +1688,7 @@ void RestReplicationHandler::handleCommandRestoreIndexes () {
int RestReplicationHandler::processRestoreCollection (TRI_json_t* const collection,
bool dropExisting,
bool reuseId,
bool force,
TRI_server_id_t remoteServerId,
string& errorMsg) {
if (! JsonHelper::isArray(collection)) {
@ -1725,9 +1753,34 @@ int RestReplicationHandler::processRestoreCollection (TRI_json_t* const collecti
if (col != 0) {
if (dropExisting) {
int res = TRI_DropCollectionVocBase(_vocbase, col, remoteServerId);
if (res == TRI_ERROR_FORBIDDEN) {
// some collections must not be dropped
// instead, truncate them
CollectionNameResolver resolver(_vocbase);
SingleCollectionWriteTransaction<EmbeddableTransaction<RestTransactionContext>, UINT64_MAX> trx(_vocbase, resolver, col->_cid);
res = trx.begin();
if (res != TRI_ERROR_NO_ERROR) {
return res;
}
TRI_barrier_t* barrier = TRI_CreateBarrierElement(&(trx.primaryCollection()->_barrierList));
if (barrier == 0) {
return TRI_ERROR_INTERNAL;
}
res = trx.truncate(false);
res = trx.finish(res);
TRI_FreeBarrier(barrier);
return res;
}
if (res != TRI_ERROR_NO_ERROR) {
errorMsg = "unable to drop collection: " + string(TRI_errno_string(res));
errorMsg = "unable to drop collection '" + name + "': " + string(TRI_errno_string(res));
return res;
}
@ -1735,7 +1788,7 @@ int RestReplicationHandler::processRestoreCollection (TRI_json_t* const collecti
else {
int res = TRI_ERROR_ARANGO_DUPLICATE_NAME;
errorMsg = "unable to drop collection: " + string(TRI_errno_string(res));
errorMsg = "unable to create collection '" + name + "': " + string(TRI_errno_string(res));
return res;
}
@ -1758,6 +1811,7 @@ int RestReplicationHandler::processRestoreCollection (TRI_json_t* const collecti
////////////////////////////////////////////////////////////////////////////////
int RestReplicationHandler::processRestoreIndexes (TRI_json_t* const collection,
bool force,
TRI_server_id_t remoteServerId,
string& errorMsg) {
if (! JsonHelper::isArray(collection)) {
@ -1907,7 +1961,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
}
if (res == TRI_ERROR_NO_ERROR) {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false);
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_EDGE, shaped, &edge, false, false, true);
}
}
else {
@ -1916,7 +1970,7 @@ int RestReplicationHandler::applyCollectionDumpMarker (CollectionNameResolver co
res = TRI_ERROR_ARANGO_COLLECTION_TYPE_INVALID;
}
else {
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false);
res = primary->insert(trxCollection, key, rid, &mptr, TRI_DOC_MARKER_KEY_DOCUMENT, shaped, 0, false, false, true);
}
}
}
@ -1977,6 +2031,7 @@ int RestReplicationHandler::processRestoreDataBatch (CollectionNameResolver cons
TRI_transaction_collection_t* trxCollection,
TRI_server_id_t generatingServer,
bool useRevision,
bool force,
std::string& errorMsg) {
const string invalidMsg = "received invalid JSON data for collection " +
StringUtils::itoa(trxCollection->_cid);
@ -2065,7 +2120,7 @@ int RestReplicationHandler::processRestoreDataBatch (CollectionNameResolver cons
TRI_FreeJson(TRI_CORE_MEM_ZONE, json);
if (res != TRI_ERROR_NO_ERROR) {
if (res != TRI_ERROR_NO_ERROR && ! force) {
return res;
}
}
@ -2084,6 +2139,7 @@ int RestReplicationHandler::processRestoreData (CollectionNameResolver const& re
TRI_voc_cid_t cid,
TRI_server_id_t generatingServer,
bool useRevision,
bool force,
string& errorMsg) {
TRI_transaction_t* trx = TRI_CreateTransaction(_vocbase,
@ -2127,7 +2183,7 @@ int RestReplicationHandler::processRestoreData (CollectionNameResolver const& re
// TODO: waitForSync disabled here. use for initial replication, too
// sync at end of trx
trxCollection->_waitForSync = false;
res = processRestoreDataBatch(resolver, trxCollection, generatingServer, useRevision, errorMsg);
res = processRestoreDataBatch(resolver, trxCollection, generatingServer, useRevision, force, errorMsg);
}
if (res == TRI_ERROR_NO_ERROR) {
@ -2169,11 +2225,17 @@ void RestReplicationHandler::handleCommandRestoreData () {
if (value != 0) {
recycleIds = StringUtils::boolean(value);
}
bool force = false;
value = _request->value("force");
if (value != 0) {
force = StringUtils::boolean(value);
}
TRI_server_id_t remoteServerId = 0; // TODO
string errorMsg;
int res = processRestoreData(resolver, cid, remoteServerId, recycleIds, errorMsg);
int res = processRestoreData(resolver, cid, remoteServerId, recycleIds, force, errorMsg);
if (res != TRI_ERROR_NO_ERROR) {
generateError(HttpResponse::SERVER_ERROR, res);
@ -2894,6 +2956,7 @@ void RestReplicationHandler::handleCommandApplierSetConfig () {
config._connectTimeout = JsonHelper::getNumericValue<double>(json, "connectTimeout", config._connectTimeout);
config._ignoreErrors = JsonHelper::getNumericValue<uint64_t>(json, "ignoreErrors", config._ignoreErrors);
config._maxConnectRetries = JsonHelper::getNumericValue<uint64_t>(json, "maxConnectRetries", config._maxConnectRetries);
config._sslProtocol = JsonHelper::getNumericValue<uint32_t>(json, "sslProtocol", config._sslProtocol);
config._chunkSize = JsonHelper::getNumericValue<uint64_t>(json, "chunkSize", config._chunkSize);
config._autoStart = JsonHelper::getBooleanValue(json, "autoStart", config._autoStart);
config._adaptivePolling = JsonHelper::getBooleanValue(json, "adaptivePolling", config._adaptivePolling);

View File

@ -247,6 +247,7 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
int processRestoreCollection (struct TRI_json_s* const,
bool,
bool,
bool,
TRI_server_id_t,
@ -257,6 +258,7 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
int processRestoreIndexes (struct TRI_json_s* const,
bool,
TRI_server_id_t,
std::string&);
@ -280,6 +282,7 @@ namespace triagens {
struct TRI_transaction_collection_s*,
TRI_server_id_t,
bool,
bool,
std::string&);
////////////////////////////////////////////////////////////////////////////////
@ -290,6 +293,7 @@ namespace triagens {
TRI_voc_cid_t,
TRI_server_id_t,
bool,
bool,
std::string&);
////////////////////////////////////////////////////////////////////////////////

View File

@ -847,7 +847,8 @@ namespace triagens {
shaped,
data,
! isLocked(trxCollection, TRI_TRANSACTION_WRITE),
forceSync);
forceSync,
false);
return res;
}

View File

@ -3595,6 +3595,12 @@ static v8::Handle<v8::Value> JS_ConfigureApplierReplication (v8::Arguments const
}
}
if (object->Has(TRI_V8_SYMBOL("sslProtocol"))) {
if (object->Get(TRI_V8_SYMBOL("sslProtocol"))->IsNumber()) {
config._sslProtocol = (uint32_t) TRI_ObjectToUInt64(object->Get(TRI_V8_SYMBOL("sslProtocol")), false);
}
}
if (object->Has(TRI_V8_SYMBOL("chunkSize"))) {
if (object->Get(TRI_V8_SYMBOL("chunkSize"))->IsNumber()) {
config._chunkSize = TRI_ObjectToUInt64(object->Get(TRI_V8_SYMBOL("chunkSize")), true);

View File

@ -429,7 +429,8 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
const TRI_df_marker_type_e markerType,
TRI_voc_key_t key,
TRI_shaped_json_t const* shaped,
void const* data) {
void const* data,
bool isRestore) {
char* mem;
TRI_doc_document_key_marker_t* marker;
TRI_key_generator_t* keyGenerator;
@ -458,7 +459,8 @@ static int CreateDocumentMarker (TRI_primary_collection_t* primary,
tick,
key,
(char*) &keyBuffer,
&keySize);
&keySize,
isRestore);
if (res != TRI_ERROR_NO_ERROR) {
// key generation failed
@ -1565,7 +1567,8 @@ static int InsertShapedJson (TRI_transaction_collection_t* trxCollection,
TRI_shaped_json_t const* shaped,
void const* data,
const bool lock,
const bool forceSync) {
const bool forceSync,
const bool isRestore) {
TRI_primary_collection_t* primary;
TRI_doc_document_key_marker_t* marker;
@ -1593,7 +1596,8 @@ static int InsertShapedJson (TRI_transaction_collection_t* trxCollection,
markerType,
key,
shaped,
data);
data,
isRestore);
if (res != TRI_ERROR_NO_ERROR) {
return res;

View File

@ -232,7 +232,8 @@ static int TraditionalGenerate (TRI_key_generator_t* const generator,
const TRI_voc_tick_t tick,
const char* const userKey,
char* const outBuffer,
size_t* const outLength) {
size_t* const outLength,
bool isRestore) {
traditional_keygen_t* data;
char* current;
@ -245,7 +246,7 @@ static int TraditionalGenerate (TRI_key_generator_t* const generator,
size_t userKeyLength;
// user has specified a key
if (! data->_allowUserKeys) {
if (! data->_allowUserKeys && ! isRestore) {
// we do not allow user-generated keys
return TRI_ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED;
}
@ -475,7 +476,8 @@ static int AutoIncrementGenerate (TRI_key_generator_t* const generator,
const TRI_voc_tick_t tick,
const char* const userKey,
char* const outBuffer,
size_t* const outLength) {
size_t* const outLength,
bool isRestore) {
autoincrement_keygen_t* data;
char* current;
@ -489,7 +491,7 @@ static int AutoIncrementGenerate (TRI_key_generator_t* const generator,
size_t userKeyLength;
// user has specified a key
if (! data->_allowUserKeys) {
if (! data->_allowUserKeys && ! isRestore) {
// we do not allow user-generated keys
return TRI_ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED;
}

View File

@ -78,7 +78,7 @@ typedef struct TRI_key_generator_s {
void* _data;
int (*init)(struct TRI_key_generator_s* const, const struct TRI_json_s* const);
int (*generate)(struct TRI_key_generator_s* const, const size_t, const TRI_voc_tick_t, const char* const, char* const, size_t* const);
int (*generate)(struct TRI_key_generator_s* const, const size_t, const TRI_voc_tick_t, const char* const, char* const, size_t* const, bool);
void (*track)(struct TRI_key_generator_s* const, const TRI_voc_key_t);
void (*free)(struct TRI_key_generator_s* const);
struct TRI_json_s* (*toJson)(const struct TRI_key_generator_s* const);

View File

@ -321,7 +321,7 @@ typedef struct TRI_primary_collection_s {
#endif
int (*notifyTransaction) (struct TRI_primary_collection_s*, TRI_transaction_status_e);
int (*insert) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_df_marker_type_e, TRI_shaped_json_t const*, void const*, const bool, const bool);
int (*insert) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_voc_rid_t, TRI_doc_mptr_t*, TRI_df_marker_type_e, TRI_shaped_json_t const*, void const*, const bool, const bool, const bool);
int (*read) (struct TRI_transaction_collection_s*, const TRI_voc_key_t, TRI_doc_mptr_t*, const bool);

View File

@ -173,6 +173,11 @@ static TRI_json_t* JsonConfiguration (TRI_replication_applier_configuration_t co
json,
"maxConnectRetries",
TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, (double) config->_maxConnectRetries));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE,
json,
"sslProtocol",
TRI_CreateNumberJson(TRI_CORE_MEM_ZONE, (double) config->_sslProtocol));
TRI_Insert3ArrayJson(TRI_CORE_MEM_ZONE,
json,
@ -304,6 +309,12 @@ static int LoadConfiguration (TRI_vocbase_t* vocbase,
config->_maxConnectRetries = (uint64_t) value->_value._number;
}
value = TRI_LookupArrayJson(json, "sslProtocol");
if (TRI_IsNumberJson(value)) {
config->_sslProtocol = (uint32_t) value->_value._number;
}
value = TRI_LookupArrayJson(json, "chunkSize");
if (TRI_IsNumberJson(value)) {
@ -1178,6 +1189,7 @@ void TRI_InitConfigurationReplicationApplier (TRI_replication_applier_configurat
config->_requestTimeout = 300.0;
config->_connectTimeout = 10.0;
config->_maxConnectRetries = 100;
config->_sslProtocol = 0;
config->_autoStart = false;
config->_chunkSize = 0;
config->_adaptivePolling = true;
@ -1247,6 +1259,7 @@ void TRI_CopyConfigurationReplicationApplier (TRI_replication_applier_configurat
dst->_connectTimeout = src->_connectTimeout;
dst->_ignoreErrors = src->_ignoreErrors;
dst->_maxConnectRetries = src->_maxConnectRetries;
dst->_sslProtocol = src->_sslProtocol;
dst->_chunkSize = src->_chunkSize;
dst->_autoStart = src->_autoStart;
dst->_adaptivePolling = src->_adaptivePolling;

View File

@ -74,6 +74,7 @@ typedef struct TRI_replication_applier_configuration_s {
uint64_t _ignoreErrors;
uint64_t _maxConnectRetries;
uint64_t _chunkSize;
uint32_t _sslProtocol;
bool _autoStart;
bool _adaptivePolling;
}

View File

@ -523,7 +523,8 @@ static int LogEvent (TRI_replication_logger_t* logger,
shaped,
NULL,
isStandaloneOperation,
forceSync);
forceSync,
false);
TRI_FreeShapedJson(primary->_shaper->_memoryZone, shaped);

View File

@ -438,6 +438,7 @@ static int InsertTrxCallback (TRI_transaction_collection_t* trxCollection,
shaped,
NULL,
false,
false,
false);
TRI_FreeShapedJson(primary->_shaper->_memoryZone, shaped);

View File

@ -78,7 +78,7 @@ MRubyClientConnection::MRubyClientConnection (mrb_state* mrb,
_client(0),
_httpResult(0) {
_connection = GeneralClientConnection::factory(endpoint, connectionTimeout, requestTimeout, numRetries);
_connection = GeneralClientConnection::factory(endpoint, connectionTimeout, requestTimeout, numRetries, 0);
if (_connection == 0) {
throw "out of memory";
}

View File

@ -111,7 +111,8 @@ ArangoClient::ArangoClient ()
_password(""),
_hasPassword(false),
_connectTimeout(DEFAULT_CONNECTION_TIMEOUT),
_requestTimeout(DEFAULT_REQUEST_TIMEOUT) {
_requestTimeout(DEFAULT_REQUEST_TIMEOUT),
_sslProtocol(4) {
char* p = TRI_GetTempPath();
@ -242,6 +243,7 @@ void ArangoClient::setupServer (ProgramOptionsDescription& description) {
("server.password", &_password, "password to use when connecting (leave empty for prompt)")
("server.connect-timeout", &_connectTimeout, "connect timeout in seconds")
("server.request-timeout", &_requestTimeout, "request timeout in seconds")
("server.ssl-protocol", &_sslProtocol, "1 = SSLv2, 2 = SSLv23, 3 = SSLv3, 4 = TLSv1")
;
description(clientOptions, false);
@ -828,6 +830,14 @@ double ArangoClient::requestTimeout () const {
return _requestTimeout;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief ssl protocol
////////////////////////////////////////////////////////////////////////////////
uint32_t ArangoClient::sslProtocol () const {
return _sslProtocol;
}
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE
// -----------------------------------------------------------------------------

View File

@ -415,6 +415,12 @@ namespace triagens {
double requestTimeout () const;
////////////////////////////////////////////////////////////////////////////////
/// @brief ssl protocol
////////////////////////////////////////////////////////////////////////////////
uint32_t sslProtocol () const;
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
@ -589,6 +595,12 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
double _requestTimeout;
////////////////////////////////////////////////////////////////////////////////
/// @brief ssl protocol
////////////////////////////////////////////////////////////////////////////////
uint32_t _sslProtocol;
};
}
}

View File

@ -82,6 +82,7 @@ namespace triagens {
const string& password,
double requestTimeout,
double connectTimeout,
uint32_t sslProtocol,
bool keepAlive,
bool async)
: Thread("arangob"),
@ -99,6 +100,7 @@ namespace triagens {
_password(password),
_requestTimeout(requestTimeout),
_connectTimeout(connectTimeout),
_sslProtocol(sslProtocol),
_keepAlive(keepAlive),
_async(async),
_client(0),
@ -146,7 +148,8 @@ namespace triagens {
virtual void run () {
allowAsynchronousCancelation();
_connection = GeneralClientConnection::factory(_endpoint, _requestTimeout, _connectTimeout, 3);
_connection = GeneralClientConnection::factory(_endpoint, _requestTimeout, _connectTimeout, 3, _sslProtocol);
if (_connection == 0) {
LOGGER_FATAL_AND_EXIT("out of memory");
}
@ -519,6 +522,12 @@ namespace triagens {
double _connectTimeout;
////////////////////////////////////////////////////////////////////////////////
/// @brief ssl protocol
////////////////////////////////////////////////////////////////////////////////
uint32_t _sslProtocol;
////////////////////////////////////////////////////////////////////////////////
/// @brief use HTTP keep-alive
////////////////////////////////////////////////////////////////////////////////

View File

@ -309,6 +309,7 @@ int main (int argc, char* argv[]) {
BaseClient.password(),
BaseClient.requestTimeout(),
BaseClient.connectTimeout(),
BaseClient.sslProtocol(),
KeepAlive,
Async);

View File

@ -67,6 +67,7 @@ V8ClientConnection::V8ClientConnection (Endpoint* endpoint,
double requestTimeout,
double connectTimeout,
size_t numRetries,
uint32_t sslProtocol,
bool warn)
: _connection(0),
_databaseName(databaseName),
@ -76,7 +77,7 @@ V8ClientConnection::V8ClientConnection (Endpoint* endpoint,
_httpResult(0) {
_connection = GeneralClientConnection::factory(endpoint, requestTimeout, connectTimeout, numRetries);
_connection = GeneralClientConnection::factory(endpoint, requestTimeout, connectTimeout, numRetries, sslProtocol);
if (_connection == 0) {
throw "out of memory";

View File

@ -97,6 +97,7 @@ namespace triagens {
double,
double,
size_t,
uint32_t,
bool);
////////////////////////////////////////////////////////////////////////////////

View File

@ -891,7 +891,8 @@ int main (int argc, char* argv[]) {
Connection = GeneralClientConnection::factory(BaseClient.endpointServer(),
BaseClient.requestTimeout(),
BaseClient.connectTimeout(),
ArangoClient::DEFAULT_RETRIES);
ArangoClient::DEFAULT_RETRIES,
BaseClient.sslProtocol());
if (Connection == 0) {
cerr << "out of memory" << endl;

View File

@ -301,6 +301,7 @@ int main (int argc, char* argv[]) {
BaseClient.requestTimeout(),
BaseClient.connectTimeout(),
ArangoClient::DEFAULT_RETRIES,
BaseClient.sslProtocol(),
false);
if (! ClientConnection->isConnected() || ClientConnection->getLastHttpReturnCode() != HttpResponse::OK) {

View File

@ -137,6 +137,12 @@ static bool Overwrite = true;
static bool RecycleIds = false;
////////////////////////////////////////////////////////////////////////////////
/// @brief continue restore even in the face of errors
////////////////////////////////////////////////////////////////////////////////
static bool Force = false;
////////////////////////////////////////////////////////////////////////////////
/// @brief statistics
////////////////////////////////////////////////////////////////////////////////
@ -173,6 +179,7 @@ static void ParseProgramOptions (int argc, char* argv[]) {
("batch-size", &ChunkSize, "maximum size for individual data batches (in bytes)")
("import-data", &ImportData, "import data into collection")
("recycle-ids", &RecycleIds, "recycle collection and revision ids from dump")
("force", &Force, "continue restore even in the face of some server-side errors")
("create-collection", &ImportStructure, "create collection structure")
("include-system-collections", &IncludeSystemCollections, "include system collections")
("input-directory", &InputDirectory, "input directory")
@ -367,7 +374,8 @@ static int SendRestoreCollection (TRI_json_t const* json,
const string url = "/_api/replication/restore-collection"
"?overwrite=" + string(Overwrite ? "true" : "false") +
"&recycleIds=" + string(RecycleIds ? "true" : "false");
"&recycleIds=" + string(RecycleIds ? "true" : "false") +
"&force=" + string(Force ? "true" : "false");
const string body = JsonHelper::toString(json);
@ -407,7 +415,7 @@ static int SendRestoreIndexes (TRI_json_t const* json,
string& errorMsg) {
map<string, string> headers;
const string url = "/_api/replication/restore-indexes";
const string url = "/_api/replication/restore-indexes?force=" + string(Force ? "true" : "false");
const string body = JsonHelper::toString(json);
SimpleHttpResult* response = Client->request(HttpRequest::HTTP_REQUEST_PUT,
@ -451,7 +459,8 @@ static int SendRestoreData (string const& cid,
const string url = "/_api/replication/restore-data?collection=" +
StringUtils::urlEncode(cname) +
"&recycleIds=" + (RecycleIds ? "true" : "false");
"&recycleIds=" + (RecycleIds ? "true" : "false") +
"&force=" + (Force ? "true" : "false");
SimpleHttpResult* response = Client->request(HttpRequest::HTTP_REQUEST_PUT,
url,
@ -630,12 +639,22 @@ static int ProcessInputDirectory (string& errorMsg) {
if (ImportStructure) {
// re-create collection
if (Progress) {
cout << "Creating collection '" << cname << "'..." << endl;
if (Overwrite) {
cout << "Re-creating collection '" << cname << "'..." << endl;
}
else {
cout << "Creating collection '" << cname << "'..." << endl;
}
}
int res = SendRestoreCollection(json, errorMsg);
if (res != TRI_ERROR_NO_ERROR) {
if (Force) {
cerr << errorMsg << endl;
continue;
}
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, collections);
return TRI_ERROR_INTERNAL;
@ -728,9 +747,19 @@ static int ProcessInputDirectory (string& errorMsg) {
if (res != TRI_ERROR_NO_ERROR) {
TRI_CLOSE(fd);
errorMsg = string(TRI_errno_string(res));
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, collections);
if (errorMsg.empty()) {
errorMsg = string(TRI_errno_string(res));
}
else {
errorMsg = string(TRI_errno_string(res)) + ": " + errorMsg;
}
if (Force) {
cerr << errorMsg << endl;
continue;
}
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, collections);
return res;
}
@ -760,6 +789,11 @@ static int ProcessInputDirectory (string& errorMsg) {
int res = SendRestoreIndexes(json, errorMsg);
if (res != TRI_ERROR_NO_ERROR) {
if (Force) {
cerr << errorMsg << endl;
continue;
}
TRI_FreeJson(TRI_UNKNOWN_MEM_ZONE, collections);
return TRI_ERROR_INTERNAL;
@ -851,7 +885,8 @@ int main (int argc, char* argv[]) {
Connection = GeneralClientConnection::factory(BaseClient.endpointServer(),
BaseClient.requestTimeout(),
BaseClient.connectTimeout(),
ArangoClient::DEFAULT_RETRIES);
ArangoClient::DEFAULT_RETRIES,
BaseClient.sslProtocol());
if (Connection == 0) {
cerr << "out of memory" << endl;

View File

@ -406,6 +406,7 @@ static V8ClientConnection* CreateConnection () {
BaseClient.requestTimeout(),
BaseClient.connectTimeout(),
ArangoClient::DEFAULT_RETRIES,
BaseClient.sslProtocol(),
false);
}

View File

@ -3,4 +3,4 @@ progress = true
[server]
endpoint = tcp://localhost:8529
disable-authentcation = true
disable-authentication = true

View File

@ -2,4 +2,4 @@ progress = true
[server]
endpoint = tcp://localhost:8529
disable-authentcation = true
disable-authentication = true

View File

@ -2,4 +2,4 @@ progress = true
[server]
endpoint = tcp://localhost:8529
disable-authentcation = true
disable-authentication = true

View File

@ -79,90 +79,90 @@ function graph_by_request (req) {
if (g._properties === null) {
throw "no graph found for: " + key;
}
return g;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief get vertex by request (throws exception)
////////////////////////////////////////////////////////////////////////////////
return g;
}
function vertex_by_request (req, g) {
if (req.suffix.length < 3) {
throw "no vertex found";
}
////////////////////////////////////////////////////////////////////////////////
/// @brief get vertex by request (throws exception)
////////////////////////////////////////////////////////////////////////////////
var key = req.suffix[2];
if (req.suffix.length > 3) {
key += "/" + req.suffix[3];
}
var vertex = g.getVertex(key);
if (vertex === null || vertex._properties === undefined) {
throw "no vertex found for: " + key;
}
return vertex;
function vertex_by_request (req, g) {
if (req.suffix.length < 3) {
throw "no vertex found";
}
////////////////////////////////////////////////////////////////////////////////
/// @brief get edge by request (throws exception)
////////////////////////////////////////////////////////////////////////////////
function edge_by_request (req, g) {
if (req.suffix.length < 3) {
throw "no edge found";
}
var key = req.suffix[2];
if (req.suffix.length > 3) {
key += "/" + req.suffix[3];
}
var edge = g.getEdge(key);
if (edge === null || edge._properties === undefined) {
throw "no edge found for: " + key;
}
return edge;
var key = req.suffix[2];
if (req.suffix.length > 3) {
key += "/" + req.suffix[3];
}
////////////////////////////////////////////////////////////////////////////////
/// @brief returns true if a "if-match" or "if-none-match" error happens
////////////////////////////////////////////////////////////////////////////////
var vertex = g.getVertex(key);
function matchError (req, res, doc, errorCode) {
if (vertex === null || vertex._properties === undefined) {
throw "no vertex found for: " + key;
}
if (req.headers["if-none-match"] !== undefined) {
if (doc._rev === req.headers["if-none-match"]) {
// error
res.responseCode = actions.HTTP_NOT_MODIFIED;
res.contentType = "application/json; charset=utf-8";
res.body = '';
res.headers = {};
return true;
}
}
if (req.headers["if-match"] !== undefined) {
if (doc._rev !== req.headers["if-match"]) {
// error
actions.resultError(req,
res,
actions.HTTP_PRECONDITION_FAILED,
errorCode,
"wrong revision",
{});
return true;
}
}
var rev = req.parameters.rev;
if (rev !== undefined) {
if (doc._rev !== rev) {
// error
return vertex;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief get edge by request (throws exception)
////////////////////////////////////////////////////////////////////////////////
function edge_by_request (req, g) {
if (req.suffix.length < 3) {
throw "no edge found";
}
var key = req.suffix[2];
if (req.suffix.length > 3) {
key += "/" + req.suffix[3];
}
var edge = g.getEdge(key);
if (edge === null || edge._properties === undefined) {
throw "no edge found for: " + key;
}
return edge;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief returns true if a "if-match" or "if-none-match" error happens
////////////////////////////////////////////////////////////////////////////////
function matchError (req, res, doc, errorCode) {
if (req.headers["if-none-match"] !== undefined) {
if (doc._rev === req.headers["if-none-match"]) {
// error
res.responseCode = actions.HTTP_NOT_MODIFIED;
res.contentType = "application/json; charset=utf-8";
res.body = '';
res.headers = {};
return true;
}
}
if (req.headers["if-match"] !== undefined) {
if (doc._rev !== req.headers["if-match"]) {
// error
actions.resultError(req,
res,
actions.HTTP_PRECONDITION_FAILED,
errorCode,
"wrong revision",
{});
return true;
}
}
var rev = req.parameters.rev;
if (rev !== undefined) {
if (doc._rev !== rev) {
// error
actions.resultError(req,
res,
actions.HTTP_PRECONDITION_FAILED,
@ -455,9 +455,20 @@ function delete_graph_graph (req, res) {
var g;
try {
g = graph_by_request(req);
if (g === null || g === undefined) {
throw "graph not found";
var name = req.suffix[0];
var exists = arangodb.db._collection('_graphs').exists(name);
try {
g = graph_by_request(req);
if (g === null || g === undefined) {
throw "graph not found";
}
}
catch (graphNotFound) {
if (exists) {
graph.Graph.drop(name);
actions.resultOk(req, res, actions.HTTP_OK, { "deleted" : true });
}
}
}
catch (err) {

View File

@ -357,7 +357,8 @@ actions.defineHttp({
try {
result = {};
result.system = internal.processStatistics();
result.client = internal.requestStatistics();
result.client = internal.clientStatistics();
result.http = internal.httpStatistics();
result.server = internal.serverStatistics();
actions.resultOk(req, res, actions.HTTP_OK, result);
@ -391,7 +392,7 @@ actions.defineHttp({
/// - `group`: The identifier of the group to which this figure belongs.
/// - `identifier`: The identifier of the figure. It is unique within the group.
/// - `name`: The name of the figure.
/// - `description`: A description of the group.
/// - `description`: A description of the figure.
/// - `type`: Either `current`, `accumulated`, or `distribution`.
/// - `cuts`: The distribution vector.
/// - `units`: Units in which the figure is measured.
@ -432,10 +433,16 @@ actions.defineHttp({
{
group: "client",
name: "Client Statistics",
description: "Statistics about the clients connecting to the server."
name: "Client Connection Statistics",
description: "Statistics about the connections."
},
{
group: "http",
name: "HTTP Request Statistics",
description: "Statistics about the HTTP requests."
},
{
group: "server",
name: "Server Statistics",
@ -523,12 +530,12 @@ actions.defineHttp({
// .............................................................................
// client statistics
// .............................................................................
{
group: "client",
identifier: "httpConnections",
name: "HTTP Client Connections",
description: "The number of http connections that are currently open.",
name: "Client Connections",
description: "The number of connections that are currently open.",
type: "current",
units: "number"
},
@ -562,7 +569,7 @@ actions.defineHttp({
cuts: internal.requestTimeDistribution,
units: "seconds"
},
{
group: "client",
identifier: "bytesSent",
@ -592,6 +599,87 @@ actions.defineHttp({
cuts: internal.connectionTimeDistribution,
units: "seconds"
},
{
group: "http",
identifier: "requestsTotal",
name: "Total requests",
description: "Total number of HTTP requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsAsync",
name: "Async requests",
description: "Number of asynchronously executed HTTP requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsGet",
name: "HTTP GET requests",
description: "Number of HTTP GET requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsHead",
name: "HTTP HEAD requests",
description: "Number of HTTP HEAD requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsPost",
name: "HTTP POST requests",
description: "Number of HTTP POST requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsPut",
name: "HTTP PUT requests",
description: "Number of HTTP PUT requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsPatch",
name: "HTTP PATCH requests",
description: "Number of HTTP PATCH requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsDelete",
name: "HTTP DELETE requests",
description: "Number of HTTP DELETE requests.",
type: "accumulated",
units: "number"
},
{
group: "http",
identifier: "requestsOptions",
name: "HTTP OPTIONS requests",
description: "Number of HTTP OPTIONS requests.",
type: "accumulated",
units: "number"
},
// .............................................................................
// server statistics

View File

@ -91,34 +91,45 @@ function notFound (req, res, code, message) {
/// - `Array` -> containing any combination of the above.
/// If there is at least one `"exclude"` or `"prune"` respectivly
/// is contained, it's effect will occur.
///
/// - `minDepth` (optional, ANDed with any existing filters):
/// visits only nodes in at least the given depth
///
/// - `maxDepth` (optional, ANDed with any existing filters):
/// visits only nodes in at most the given depth
///
/// - `visitor` (optional): body (JavaScript) code of custom visitor function
/// function signature: (config, result, vertex, path) -> void
/// visitor function can do anything, but its return value is ignored. To
/// populate a result, use the `result` variable by reference
///
/// - `direction` (optional): direction for traversal
/// - *if set*, must be either `"outbound"`, `"inbound"`, or `"any"`
/// - *if not set*, the `expander` attribute must be specified
///
/// - `init` (optional): body (JavaScript) code of custom result initialisation function
/// function signature: (config, result) -> void
/// initialise any values in result with what is required
///
/// - `expander` (optional): body (JavaScript) code of custom expander function
/// *must* be set if `direction` attribute is *not* set
/// function signature: (config, vertex, path) -> array
/// expander must return an array of the connections for `vertex`
/// each connection is an object with the attributes `edge` and `vertex`
///
/// - `strategy` (optional): traversal strategy
/// can be `"depthfirst"` or `"breadthfirst"`
///
/// - `order` (optional): traversal order
/// can be `"preorder"` or `"postorder"`
///
/// - `itemOrder` (optional): item iteration order
/// can be `"forward"` or `"backward"`
///
/// - `uniqueness` (optional): specifies uniqueness for vertices and edges visited
/// if set, must be an object like this:
/// `"uniqueness": {"vertices": "none"|"global"|path", "edges": "none"|"global"|"path"}`
///
/// - `maxIterations` (optional): Maximum number of iterations in each traversal. This number can be
/// set to prevent endless loops in traversal of cyclic graphs. When a traversal performs
/// as many iterations as the `maxIterations` value, the traversal will abort with an

View File

@ -150,7 +150,29 @@ controller.get('/docu/:key/*', function(req, res) {
allowMultiple: false
}).summary("List the API for one foxx")
.notes("This function lists the API of the foxx"
+ " runnning under the given mount point");
+ " running under the given mount point");
// .............................................................................
// Move one foxx from mount-point to another
// .............................................................................
controller.put('/foxx/move/:key', function(req, res) {
var body = req.body();
var mountPoint = body.mount;
var app = body.app;
var key = req.params("key");
var prefix = body.prefix;
var result = foxxes.move(key, app, mountPoint, prefix);
if (result.error) {
res.status(result.status);
res.body = result.message;
return;
}
res.json(result);
})
.summary("Move one foxx to another moint point")
.notes ("This function moves one installed foxx"
+ " to a given mount point.");
// -----------------------------------------------------------------------------
// --SECTION-- END-OF-FILE

View File

@ -34,7 +34,7 @@
to { opacity: 0.0; }
}
.jqconsole-ansi-blink {
.jqconsole-ansi-blink, .jqconsole-ansi-blink-rapid {
-webkit-animation-name: blinker;
-moz-animation-name: blinker;
-ms-animation-name: blinker;
@ -47,6 +47,9 @@
-ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-o-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
}
.jqconsole-ansi-blink {
-webkit-animation-duration: 1s;
-moz-animation-duration: 1s;
-o-animation-duration: 1s;
@ -54,18 +57,6 @@
}
.jqconsole-ansi-blink-rapid {
-webkit-animation-name: blinker;
-moz-animation-name: blinker;
-ms-animation-name: blinker;
-o-animation-name: blinker;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-ms-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
-webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-ms-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-o-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-moz-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-webkit-animation-duration: 0.5s;
-moz-animation-duration: 0.5s;
-o-animation-duration: 0.5s;

View File

@ -5,7 +5,6 @@
.api-actions {
margin: 0 !important;
padding: 0;
background-color: rgba(0,0,0,0.15) !important;
}
.api-actions .container {

View File

@ -10,16 +10,18 @@
font-style: normal;
}
.arango-icon-disk, .arango-icon-uncomment, .arango-icon-export, .arango-icon-import, .arango-icon-remove, .arango-icon-remove-2, .arango-icon-trashcan, .arango-icon-undo, .arango-icon-loop, .arango-icon-comment, .arango-icon-redo ,[data-icon]:before {
font-family: 'arangodbfont';
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: 'arangodbfont';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
@ -29,14 +31,7 @@ you can use the generic selector below, but it's slower:
[class*="arango-icon-"] {
*/
.arango-icon-disk, .arango-icon-uncomment, .arango-icon-export, .arango-icon-import, .arango-icon-remove, .arango-icon-remove-2, .arango-icon-trashcan, .arango-icon-undo, .arango-icon-loop, .arango-icon-comment, .arango-icon-redo {
font-family: 'arangodbfont';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.arango-icon-disk:before {
content: "\e000";

View File

@ -0,0 +1,15 @@
.addButton {
position: relative;
margin-right: 7px;
font-size: 20px;
color: #8AA050;
margin-top: 2px;
}
.deleteButton {
color: #B30000;
font-size: 20px;
padding-right: 3px;
top: 3px;
position: relative;
}

View File

@ -46,7 +46,7 @@
margin-right: 5px;
opacity: 0.5;
cursor: pointer;
font-size: 20px;
font-size: 25px;
}
.span3 .glyphicon-edit {
margin-top: 4px !important;

View File

@ -10,9 +10,10 @@
}
#newCollection {
position: relative;
margin-left: 22px;
font-size: 25px;
margin-top: -3px;
font-size: 28px;
margin-top: -5px;
margin-right: 10px;
}
@ -24,7 +25,6 @@
.thumbnails2 {
padding-top: 1px !important;
background-color: rgba(0, 0, 0, 0.15);
margin-left:0;
margin-bottom:0;
}
@ -35,12 +35,10 @@
padding-right: 0px;
padding-bottom: 5px;
padding-top: 13px;
background-color: rgba(0, 0, 0, 0.15);
}
.thumbnails li {
background-color: #f4f3f3;
/*border: 2px solid rgba(0, 0, 0, 0.1);*/
}
.thumbnails a.add {
@ -103,14 +101,7 @@
#transparentHeader {
width: auto;
height: 36px;
margin-top: 5px !important;
margin-bottom: 0px !important;
background-color:#686766;
color:#FFF;
margin-left: 5px;
margin-right: 5px;
padding-left: 5px;
padding-right: 10px;
position:relative;
font-size: 16px;
@ -162,9 +153,9 @@
/* option 1 - dropdown filter */
#transparentHeader .dropdown-menu {
border-radius: 0 0 0px 0px !important;
margin-top: 6px !important;
margin-right: -20px !important;
border-radius: 0px 0px 0px 0px;
margin-top: 6px;
margin-right: -20px;
background-color: rgba(0, 0, 0, 0.7);
/*background-color: #BFBDBC;*/
border: solid 1px #686766;
@ -216,6 +207,56 @@ border-top: 0;
border-radius: 0 !important;
}
div.headerDropdown {
background-color: white;
position:relative;
display:none;
margin-left: 5px;
margin-right: 5px;
padding-bottom: 15px;
width: auto;
}
div.headerDropdown > div.dropdownInner {
position: relative;
min-height: 125px;
width: auto;
box-shadow: 0 !important;
}
div.dropdownInner > .nav-header {
font-size: 13px;
font-weight: 400;
color: black;
}
div.dropdownInner > label {
color: black;
font-weight: 300;
}
div.dropdownInner > ul {
border-left: 1px solid black;
}
div.dropdownInner > ul:first-of-type {
border: none;
}
div.dropdownInner ul {
min-height: 105px;
float: left;
margin-top: 10px;
width: 238px;
display: inline;
}
div.dropdownInner ul li label {
padding-left: 35px;
color: black;
}
/*
#collectionsDropdown2, #dashboardDropdownOut, #foxxDropdownOut, .dropdownOut {
background-color: white;
position:relative;
@ -224,14 +265,14 @@ border-top: 0;
margin-right: 5px;
width: auto;
}
*/
/*
#collectionsDropdown, #dashboardDropdown, #foxxDropdown, .dropdownIn{
position: relative;
min-height: 125px;
width: auto;
box-shadow: 0 !important;
}
#collectionsDropdown .nav-header, #dashboardDropdown .nav-header, #foxxDropdown .nav-header, .dropdownOut .nav-header{
font-size: 13px;
font-weight: 400;
@ -246,7 +287,6 @@ border-top: 0;
#collectionsDropdown ul, #dashboardDropdown ul, #foxxDropdown ul, .dropdownIn ul{
border-left: 1px solid black;
}
.dropdownOut ul:last-of-type,
#collectionsDropdown ul:last-of-type,
#dashboardDropdown ul:last-of-type,
@ -282,6 +322,7 @@ border-top: 0;
color: black;
}
*/
.containerdivNewLine {
clear: both;
float: left;

View File

@ -25,6 +25,8 @@
margin-top: 6px;
margin-bottom: 0;
padding-bottom: 0;
border-radius: 0 !important;
max-height: 30px !important;
}
#dashboardHeader ul a {
@ -202,7 +204,7 @@ li:hover h6, li.hover h6 {
font-family: 'Open Sans', sans-serif !important;
}
#dashboardHeader {
#dashboardHeader, #transparentHeader {
margin-left: 5px;
margin-right: 5px;
padding-right: 5px;
@ -213,10 +215,6 @@ li:hover h6, li.hover h6 {
margin-top: 5px !important;
}
#dashboardHeader .btn-group {
border-radius: 0 !important;
max-height: 30px !important;
}
/*NVD3*/
.nv-series {
@ -356,6 +354,8 @@ li:hover h6, li.hover h6 {
#detailReplicationDiv table {
margin-top: 10px;
border-spacing: 0 0px;
width: 100%;
text-align:left !important;
}
#detailReplicationDiv table thead {
@ -367,35 +367,27 @@ li:hover h6, li.hover h6 {
font-weight: 400 !important;
}
#detailReplicationDiv table {
width: 100%;
}
#detailReplicationDiv table {
text-align:left !important;
}
#detailReplicationDiv table tr {
}
#detailReplicationDiv table tbody tr th {
padding-bottom: 4px;
padding-top: 4px;
}
#rightReplicationDiv {
min-height: 150px;
#leftReplicationDiv, #rightReplicationDiv {
padding: 10px !important;
padding-top: 5px;
min-height: 150px;
margin-right: 10px;
margin-bottom: 8px;
background-color: #FFFFFF;
}
#leftReplicationDiv, #rightReplicationDiv {
padding: 10px !important;
#rightReplicationDiv {
margin-bottom: 8px;
}
#leftReplicationDiv h4, #rightReplicationDiv h4 {
#leftReplicationDiv {
width: auto;
margin-top: -1px;
border-top: 1px solid #888;
}
#leftReplicationDiv table, #rightReplicationDiv table {
@ -428,15 +420,6 @@ li:hover h6, li.hover h6 {
#leftReplicationDiv tbody tr, #rightReplicationDiv tbody tr {
}
#leftReplicationDiv {
padding-top: 5px;
width: auto;
min-height: 150px;
margin-right: 10px;
margin-top: -1px;
border-top: 1px solid #888;
background-color: #FFFFFF;
}
.alignLeft {
width: 240px !important;
@ -572,32 +555,26 @@ li:hover h6, li.hover h6 {
visibility: hidden !important;
}
.greenLight {
background: green;
background-image: radial-gradient(lime, transparent);
.greenLight, .redLight {
background-size: 3px 3px;
width: 20px;
height: 20px;
border-radius: 50%;
box-shadow:
margin-top: 1px;
0 0 10px #111 inset,
0 0 5px lime;
}
.greenLight {
background: green;
background-image: radial-gradient(lime, transparent);
box-shadow: 0 0 10px #111 inset, 0 0 5px lime;
animation: 13s green infinite;
}
.redLight {
background: red;
background-image: radial-gradient(brown, transparent);
background-size: 3px 3px;
margin-top: 1px;
width: 20px;
height: 20px;
border-radius: 50%;
animation: 13s red infinite;
box-shadow:
0 0 10px #111 inset,
0 0 5px red;
box-shadow: 0 0 10px #111 inset, 0 0 5px red;
}
#dashboardDropdown > ul > li > a > .radio {

View File

@ -1,5 +1,4 @@
#databaseDiv {
background-color: rgba(0,0,0,0.15);
padding: 5px;
}

View File

@ -0,0 +1,56 @@
#documentsTable thead {
border: 0 !important;
}
#tableDiv table.dataTable td {
padding:12px 18px !important;
}
#logContent .odd {
background-color: #F1F0EE;
}
#logContent .even {
background-color: #FFFFFF;
}
table.dataTable thead th {
border-bottom:none;
cursor: default !important;
}
table.arangoDataTable.dataTable td {
padding:10px 18px;
}
.arangoDataTable thead {
font-weight: 400 !important;
background-color: #FFFFFF !important;
text-align: left;
}
.arangoDataTable {
padding-left: 5px !important;
padding-right: 5px !important;
width: 100% !important;
position: relative;
table-layout:fixed !important;
border-spacing:0 0px;
}
.arangoDataTable.dataTable thead tr {
border-bottom: 1px solid #C2C2C2;
}
.arangoDataTable .odd:hover,
.arangoDataTable .even:hover,
#logContent .odd:hover,
#logContent .even:hover {
cursor: pointer;
}
.arangoDataTable .key {
margin-top: 4px;
}

View File

@ -1,12 +1,8 @@
span.selectDB {
top: 6px;
left: 210px;
position: absolute;
}
span.selectDB > select {
line-height: 20px;
height: 20px;
width: 150px;
padding: 0px;
margin: -3px 0px 2px 0px;
border-radius: 0px !important;
border: 1px solid;
}

View File

@ -28,9 +28,6 @@
#sourceDiv {
margin-top: 0px;
padding-left: 5px;
padding-top: 13px;
padding-right: 5px;
padding-bottom: 5px;
min-height: 400px;
margin-bottom: 20px;

View File

@ -18,15 +18,6 @@
cursor: default !important;
}
.docLink {
}
.docPreview {
text-align: right;
float: right;
margin-right: -17px !important;
}
#collectionPrev, #collectionNext{
cursor: pointer;
}
@ -36,8 +27,14 @@
cursor: default !important;
}
#tableDiv, #logContent{
padding: 13px 5px 10px 5px;
#tableDiv, #logContent, #documentsDiv, #sourceDiv, #graphManagementDiv {
padding-top: 13px;
padding-right: 5px;
padding-left: 5px;
}
#tableDiv, #logContent {
padding-bottom: 10px;
}
#logContent .tab-content {
@ -83,19 +80,36 @@
color: #B30000;
}
.editSecondAttribute, .editFirstAttribute, .docPreview {
text-align: right;
float: right;
}
.editSecondAttribute, .editFirstAttribute {
color: #444444;
font-size: 16px;
float:right;
padding-top: 4px;
}
.editFirstAttribute, .docPreview{
margin-right: -17px !important;
}
.editSecondAttribute {
margin-right: -30px !important;
padding-bottom: 1px;
}
.addAttribute, .deleteAttribute {
font-size: 20px;
font-size: 27px;
float:right;
padding-top: 2px;
}
#documentTableID .icon_arangodb_edit {
font-size: 27px;
margin-top: -2px;
}
#documentTableID {
font-weight: 300;
font-size: 15px !important;
@ -123,18 +137,7 @@ table.dataTable thead th {
cursor: default !important;
}
.editFirstAttribute {
float:right;
text-align:right;
margin-right: -17px !important;
}
.editSecondAttribute {
float:right;
text-align:right;
margin-right: -30px !important;
padding-bottom: 1px;
}
#documentTableID .icon-edit {
margin-top: 0;
@ -156,10 +159,12 @@ table.dataTable thead th {
box-shadow: none;
}
#documentTableID .odd, #documentsTableID .odd {
#documentTableID .odd,
table.dataTable.arangoDataTable tr.odd {
background:#F1F0EE;
}
#documentTableID .even, #documentsTableID .even {
#documentTableID .even,
table.dataTable.arangoDataTable tr.even {
background:#FFFFFF;
}

View File

@ -1,27 +1,3 @@
#documentsTableID .key {
margin-top: 4px;
}
#addDocumentButton {
position: relative;
margin-right: 6px;
font-size: 20px;
color: #8AA050;
margin-top: 2px;
}
table.dataTable thead th {
cursor: default !important;
}
#tableDiv table.dataTable td {
padding:12px 18px !important;
}
#documentsDiv table.dataTable td {
padding:10px 18px !important;
}
#documentAddBtn {
margin-left: 6px;
}
@ -30,19 +6,7 @@ table.dataTable thead th {
width: 30px !important;
}
#deleteDoc {
color: #B30000;
font-size: 20px;
padding-right: 3px;
top: 3px;
position: relative;
}
#deleteDoc span {
}
#documentsFooterBox {
background-color: rgba(0,0,0,0.15);
height: 56px;
}
@ -78,24 +42,26 @@ table.dataTable thead th {
}
.arangoDropdown {
background-color: rgba(0,0,0,0.15);
margin-bottom: -10px;
}
#filterHeader, #importHeader, .arangoDropdownIn {
#filterHeader, #importHeader, .arangoDropdownIn, #indexHeaderContent {
margin-left: 5px;
margin-right: 5px;
background-color: white;
}
#filterHeader, #importHeader, .arangoDropdownIn {
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
padding-bottom: 5px;
margin-left: 5px;
margin-right: 5px;
position:relative;
}
#importHeader input {
line-height: 0px !important;
(;margin-top: 5px;margin-bottom: -5px;)
margin-top: 5px;margin-bottom: -5px;
}
#confirmDocImport {
@ -137,16 +103,6 @@ table.dataTable thead th {
#documentsDiv {
margin-top: 10px !important;
padding-left: 5px;
padding-right: 5px;
padding-top: 13px;
background-color: rgba(0, 0, 0, 0.15);
}
#documentsTableID thead {
font-weight: 400 !important;
background-color: #FFFFFF !important;
text-align: left;
}
#documentsTableID_length, #documentsTableID_filter {
@ -162,68 +118,10 @@ table.dataTable thead th {
visibility: hidden;
}
#documentsTableID {
padding-left: 5px !important;
padding-right: 5px !important;
width: 100% !important;
position: relative;
table-layout:fixed !important;
border-spacing:0 0px;
}
#documentsTable thead {
border: 0 !important;
}
.docsFirstCol, .docsSecCol, .docsThirdCol {
border: 0 !important;
}
table.dataTable thead th {
border-bottom:none;
}
#documentsTableID.dataTable thead tr {
border-bottom: 1px solid #C2C2C2;
}
#documentsTableID tbody {
}
#documentsTableID.dataTable tr,
#logContent .dataTable tr {
}
#logContent .odd {
background-color: #F1F0EE;
}
#logContent .even {
background-color: #FFFFFF;
}
#documentsTableID .odd:hover,
#documentsTableID .even:hover,
#logContent .odd:hover,
#logContent .even:hover {
cursor: pointer;
/*background-color: #D4DFC3 !important;*/
}
#documentsTableID.dataTable tr.even td.sorting_1,
#documentsTableID.dataTable tr.odd td.sorting_1,
#logContent tr.even td.sorting_1,
#logContent tr.odd td.sorting_1 {
}
#documentsTableID tr.even:hover td.sorting_1,
#documentsTableID tr.odd:hover td.sorting_1,
#logContent tr.even:hover td.sorting_1,
#logContent tr.odd:hover td.sorting_1 {
}
#documentsTableID_paginate, #documentsTableID_filter, #documentsTableID_length {
visibility: hidden;
}
@ -353,22 +251,24 @@ table.dataTable thead th {
padding-right: 9px;
}
.badge-success .cornered {
.badge-success .cornered,
.badge-important .cornered,
.badge-inverse .cornered {
height: 0px;
border-bottom: 16px solid #8AA051;
border-left: 16px solid transparent;
border-bottom-width: 16px;
border-bottom-style: solid;
}
.badge-success .cornered {
border-bottom-color: #8AA051;
}
.badge-important .cornered {
height: 0px;
border-bottom: 16px solid #B94A48;
border-left: 16px solid transparent;
border-bottom-color: #B94A48;
}
.badge-inverse .cornered {
height: 0px;
border-bottom: 16px solid #333333;
border-left: 16px solid transparent;
border-bottom-color: #333333;
}
.badge .arrow:after {
@ -376,9 +276,6 @@ table.dataTable thead th {
border-right-color: #8AA051;
bottom: -10px;
left: 1px;
}
.badge .arrow:after {
border-width: 10px;
content: "";
}
@ -473,7 +370,6 @@ table.dataTable thead th {
}
.docsThirdCol {
padding-right: 15px !important;
float:right;
}
@ -527,24 +423,38 @@ table.dataTable thead th {
}
#documentsToolbar span {
font-size: 16px;
position: absolute;
top: 0;
right: 2px;
font-size: 25px;
margin-right: 3px;
margin-left: 0px;
}
#resetView, #filterSend, #confirmDocImport {
/* better look of some icons */
#documentsToolbar .icon_arangodb_filter {
top: 1px !important;
}
#indexHeaderContent {
margin-left: 5px;
margin-right: 5px;
background-color: white;
#documentsToolbar .icon_arangodb_import {
top: -1px !important;
}
#documentsToolbar .icon_arangodb_arrowleft,
#documentsToolbar .icon_arangodb_arrowright {
font-weight:bold;
}
#indexHeaderContent > div {
padding: 10px;
}
#indexHeaderContent .arangoicon {
font-size: 25px;
position: relative;
top: -3px !important;
}
#figuresHeader th {
width: 100% !important;
}

View File

@ -1,5 +1,5 @@
.container {
padding-bottom: 40px;
margin-bottom: 40px;
}
.footer {

View File

@ -0,0 +1,75 @@
/* Sets the default values shared for content views*/
#content
{
background-color: rgba(0, 0, 0, 0.15);
margin-top: 74px;
margin-bottom: 33px;
min-height: 80px;
height: 100%;
width: 100%;
margin-left: 20px;
margin-left: 0;
}
/* layout.css
#aboutDiv {
padding-bottom: 5px;
}
queryView.css
#queryDiv {
margin-top: 0px !important;
padding-top: 6px !important;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px !important;
}
#queryDropdown {
margin-left: 0;
margin-right: 0;
padding-left: 5px;
padding-right: 5px;
}
documentsView.css
#documentsFooterBox {
height: 56px;
}
.arangoDropdown {
margin-bottom: -10px;
}
#documentsDiv {
margin-top: 10px !important;
}
#databaseDiv {
padding: 5px;
}
collectionsView.css
.thumbnails {
margin-left:0px;
padding-left: 0px;
padding-right: 0px;
padding-bottom: 5px;
padding-top: 13px;
}
.thumbnails2 {
padding-top: 1px !important;
margin-left:0;
margin-bottom:0;
}
api.css
.api-actions {
margin: 0 !important;
padding: 0;
}
*/

View File

@ -0,0 +1,11 @@
svg.graphViewer {
background-color: white;
border-width: 1px;
border-style: solid;
border-color: rgba(0,0,0,0.125);
margin-left: 74px;
}
.gv_manageButtonContainer {
margin-top: 10px;
}

View File

@ -22,18 +22,32 @@ img.searchSubmit {
}
.toolbox {
margin-right: -40px;
margin-left: 5px;
margin-right: 5px;
margin-bottom: -340px;
border-radius: 0px !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-style: solid;
border-width: 3px;
border-color: rgb(51, 51, 51);
}
.toolbox > .btn {
width: 40px;
height: 40px;
padding: 0px;
width: 50px;
height: 50px;
margin-top: 2px;
margin-bottom: 2px;
background-color: rgb(51, 51, 51);
background-size: 40px 40px;
background-size: 50px 50px;
}
.toolbox > .btn:first-child {
margin-top: 0px;
}
.toolbox > .btn:last-child {
margin-bottom: 0px;
}
.btn-icon {
@ -44,6 +58,7 @@ img.searchSubmit {
.searchByAttribute, .searchEqualsLabel {
margin-top: 3px;
margin-right: 6px;
margin-left: 6px;
}
svg.graphViewer text {
@ -55,10 +70,6 @@ svg.graphViewer text {
text-transform:capitalize;
}
svg.graphViewer {
border-style: groove;
background-color: #FFFFEE
}
div.mousepointer {
position: absolute;
@ -134,62 +145,43 @@ button.gv-icon-btn {
-moz-border-radius: 0px !important;
}
button.gv-icon-btn.active {
background-color: #8AA051
}
button.gv-icon-btn.edit{
background-image:url("../img/gv_edit.png");
}
button.gv-icon-btn.edit.active{
background-image:url("../img/gv_edit_reverse.png");
}
button.gv-icon-btn.view{
background-image:url("../img/gv_view.png");
}
button.gv-icon-btn.view.active{
background-image:url("../img/gv_view_reverse.png");
}
button.gv-icon-btn.add{
background-image:url("../img/gv_add.png");
}
button.gv-icon-btn.add.active{
background-image:url("../img/gv_add_reverse.png");
}
button.gv-icon-btn.expand{
background-image:url("../img/gv_expand.png");
}
button.gv-icon-btn.expand.active{
background-image:url("../img/gv_expand_reverse.png");
}
button.gv-icon-btn.drag{
background-image:url("../img/gv_drag.png");
}
button.gv-icon-btn.drag.active{
background-image:url("../img/gv_drag_reverse.png");
}
button.gv-icon-btn.connect{
background-image:url("../img/gv_connect.png");
}
button.gv-icon-btn.connect.active{
background-image:url("../img/gv_connect_reverse.png");
}
button.gv-icon-btn.trash{
background-image:url("../img/gv_trash.png");
}
button.gv-icon-btn.trash.active{
background-image:url("../img/gv_trash_reverse.png");
}
div.gv_zoom_widget {
position: relative;
left: 60px;
top: 20px;
left: 95px;
width: 40px;
height: 300px;
margin-bottom: -300px;
margin-bottom: -322px;
}
div.gv_zoom_slider {
margin: 0px 17px;
@ -211,7 +203,7 @@ div.gv_zoom_buttons_bg {
button.btn-zoom:hover {
background:inherit;
background: inherit;
}
button.btn-zoom {
@ -280,7 +272,8 @@ input.gv_radio_button {
}
label.gv_dropdown_label {
color: white;
color: white !important;
padding-left: 0px !important;
}
/*Overriding the slider UI*/
@ -335,13 +328,51 @@ ul.gv_configure_menu {
top: 18px;
}
a.gv_dropdown_entry {
width: 160px !important;
background-color: rgba(0, 0, 0, 0.7) !important;
color: #FFFFFF !important;
height: 20px !important;
button.gv_dropdown_entry {
width: 160px;
height: 30px;
margin: 4px 4px 4px 30px;
}
button.gv_context_button {
width: 65px;
}
span.gv_caret {
margin-top: 2px !important;
}
div.gv_colour_list {
position: relative;
right: 26px;
top: 20px;
text-align: right;
height: 680px;
overflow: auto;
margin-bottom: -100%;
float: right;
}
div.gv_colour_list li {
background-color: transparent;
padding: 2px 6px;
}
div.queryline div.searchByAttribute > ul.dropdown-menu {
position: absolute;
border-radius: 0px;
top: 21px;
left: 5px;
width: 247px;
background-color: #333231;
color: white;
margin-bottom: 100%;
display: none;
/* background-color: #8F8D8C; */
}
/* Temporary */
#transparentPlaceholder {
margin-right: -100%;
}

View File

@ -6,9 +6,7 @@
margin-left: 22px;
}
.arangoBtn {
background: none repeat scroll 0 0 #FFFFFF;
color: #333232;
.arangoBtn, .arangoBtnSuccess {
float: left;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
@ -16,14 +14,14 @@
text-decoration: none;
}
.arangoBtn {
background: none repeat scroll 0 0 #FFFFFF;
color: #333232;
}
.arangoBtnSuccess {
background: none repeat scroll 0 0 #5E7B36;
color: #FFFFFF;
float: left;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
padding: 4px 10px;
text-decoration: none;
}
/* Radius */
@ -138,16 +136,6 @@ textarea, .alert {
color:#b9d375;
}
#content {
margin-top: 74px;
margin-bottom: 33px;
min-height: 80px;
height: 100%;
width: 100%;
margin-left: 20px;
margin-left: 0;
}
body {
background-color: white !important;
/*background: url("../img/bg_paper.gif") repeat scroll 0 0 #E5E1DD !important;*/
@ -158,7 +146,8 @@ body {
}
.form-actions {
background-color: #FFFFFF;
margin-top: -10px !important;
background-color: rgba(0,0,0,0.05);
border:none;
}
@ -172,15 +161,22 @@ body {
margin-right: 12px;
}
.clearicon {
.clearicon, .reloadicon {
opacity: 0.2;
cursor: pointer;
margin-top: 3px;
top: 20px;
right: 25px;
position: absolute;
}
.clearicon {
right: 25px;
}
.reloadicon {
right: 45px;
}
#plusIcon {
margin-right: 10px;
margin-top: 11px;
@ -188,26 +184,7 @@ body {
opacity: 0.3;
}
#plusIcon:hover {
opacity: 0.8;
cursor: pointer;
}
.reloadicon {
opacity: 0.2;
cursor: pointer;
margin-top: 3px;
top: 20px;
right: 45px;
position: absolute;
}
.clearicon:hover {
opacity: 0.8;
cursor: pointer;
}
.reloadicon:hover {
#plusIcon:hover, .clearicon:hover, .reloadicon:hover {
opacity: 0.8;
cursor: pointer;
}
@ -218,7 +195,6 @@ table .sorting {
/* ABOUT VIEW */
#aboutDiv {
background-color: rgba(0,0,0,0.15);
padding-bottom: 5px;
}
@ -260,15 +236,12 @@ table .sorting {
}
.row {
margin: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
margin-bottom: 20px;
}
.marginRight10 {
}
.form-actions {
margin-top: -10px !important;
}
input,select,option {
border-radius: 0 !important;
@ -300,3 +273,15 @@ button {
width: 397px !important;
font-weight: 400;
}
li a [class^="icon_arangodb"], li a [class*=" icon_arangodb"] {
font-size: 26px;
position: absolute;
right: 4px;
top: 0px;
}
.modal-body .icon_arangodb_info {
font-size: 23px;
color: #736B68;
}

View File

@ -1,11 +1,3 @@
/*#logContent {
margin-top: 0;
border: 20px solid rgba(0, 0, 0, 0.00);
background-color: rgba(0, 0, 0, 0.05);
min-height: 330px !important;
padding-bottom: 25px;
}
*/
#logPages {
float:left;
margin-top: -6px !important;
@ -112,9 +104,9 @@ background-color: none !important;
}
#logContent .dataTable {
table-layout:fixed !important;
border-collapse:separate;
border-spacing:0 5px;
table-layout:fixed !important;
border-collapse:separate;
border-spacing:0 5px;
}
#logPaginationDiv a {

View File

@ -56,13 +56,3 @@ body, input, textarea, .page-title span, .pingback a.url {
margin-right: 15px;
}
@media (max-width: 1284px) {
#arangoCollectionUl { display: none; }
#collectionsDropdown ul { width: auto !important; }
#arangoCollectionSelect { display: inline-block; }
.footer-left { display: none; }
.footer-mid { margin-left: 35%; height: 30px; margin-top: 10px;}
.footer-mid p { display: inline; }
.footer-right { display: none; }
}

View File

@ -0,0 +1,36 @@
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(../fonts/opensans/OpenSansLight.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(../fonts/opensans/OpenSans.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(../fonts/opensans/OpenSansBold.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 300;
src: local('Open Sans Light Italic'), local('OpenSansLight-Italic'), url(../fonts/opensans/OpenSansLightItalic.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 400;
src: local('Open Sans Italic'), local('OpenSans-Italic'), url(../fonts/opensans/OpenSansItalic.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: italic;
font-weight: 700;
src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(../fonts/opensans/OpenSansBoldItalic.woff) format('woff');
}

View File

@ -24,24 +24,44 @@
border-top: 0;
}
#editorToolbar {
margin-top: 5px;
.queryToolbar, #aqlEditor {
margin-left: 0px;
margin-right: 0px;
border-top: 1px solid #A0A0A0;
border-right: 1px solid #A0A0A0;
border-left: 1px solid #A0A0A0;
border-width: 1px;
border-style: solid;
border-bottom: 0px;
height: 20px;
background-color: #F0F0F0;
}
#editorToolbar {
margin-top: 5px;
border-color: #A0A0A0;
}
#outputToolbar {
position: relative;
width: auto;
border-color: #C0C0C0;
}
#aqlEditor {
border-bottom: 1px;
width: auto;
border-color: #A0A0A0;
min-width: 99.8%;
height: 200px;
min-height: 100px;
margin-bottom: 5px;
}
#queryDiv {
background-color: rgba(0,0,0,0.15);
margin-top: 0px !important;
padding-top: 6px !important;
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px !important;
padding-bottom: 20px !important;
background-color: transparent;
}
#outputToolbar span, #editorToolbar span {
@ -52,19 +72,6 @@
float:right;
}
#outputToolbar {
position: relative;
margin-left: 0;
margin-right: 0;
width: auto;
border-top: 1px solid #C0C0C0;
border-right: 1px solid #C0C0C0;
border-left: 1px solid #C0C0C0;
height: 20px;
background-color: #F0F0F0;
}
#editorToolbar i:hover, #outputToolbar i:hover {
cursor: pointer;
}
@ -99,17 +106,6 @@
border-top: 0 !important;
}
#aqlEditor {
width: auto;
min-width: 99.8%;
margin-right: 0px;
margin-left: 0px;
height: 200px;
min-height: 100px;
border: 1px solid #A0A0A0;
margin-bottom: 5px;
}
#wideButtonDiv {
width: 100%;
height: 20px;
@ -255,7 +251,7 @@
margin-right: 0;
padding-left: 5px;
padding-right: 5px;
background-color: rgba(0,0,0,0.15);
background-color: #D9D9D9;
}
#queryDropdownIn {

View File

@ -0,0 +1,25 @@
@media (max-width: 798px) {
#arangoCollectionUl {
display: none;
}
#collectionsDropdown ul {
width: auto !important;
}
#arangoCollectionSelect {
display: inline-block;
}
}
@media (min-width: 799px) and (max-width: 1041px) {
#arangoCollectionUl a {
font-size: 12px;
padding: 7px 5px 10px;
}
}
@media (min-width: 1042px) and (max-width: 1284px) {
#arangoCollectionUl a {
font-size: 13px;
}
}

View File

@ -3,7 +3,6 @@
.shellul {
border-bottom: 20px solid rgba(0, 0, 0, 0.00);
padding-bottom: 20px;
background-color: black;
}
#shell_workspace {

View File

@ -2,7 +2,6 @@ pre{
margin: 0 0 0 0;
}
.form-actions {
background-color: rgba(0,0,0,0.05);
}
.swagger-ui-wrap .container {
width: auto;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,253 +1,255 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global window, $ */
window.arangoHelper = {
lastNotificationMessage: null,
(function() {
"use strict";
window.arangoHelper = {
lastNotificationMessage: null,
CollectionTypes: {},
systemAttributes: function () {
return {
'_id' : true,
'_rev' : true,
'_key' : true,
'_bidirectional' : true,
'_vertices' : true,
'_from' : true,
'_to' : true,
'$id' : true
};
},
CollectionTypes: {},
systemAttributes: function () {
return {
'_id' : true,
'_rev' : true,
'_key' : true,
'_bidirectional' : true,
'_vertices' : true,
'_from' : true,
'_to' : true,
'$id' : true
};
},
fixTooltips: function (selector, placement) {
$(selector).tooltip({
placement: placement,
hide: false,
show: false
});
},
currentDatabase: function () {
var returnVal = false;
$.ajax({
type: "GET",
cache: false,
url: "/_api/database/current",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
returnVal = data.result.name;
},
error: function(data) {
returnVal = false;
}
});
return returnVal;
},
databaseAllowed: function () {
var currentDB = this.currentDatabase();
returnVal = false;
$.ajax({
type: "GET",
cache: false,
url: "/_db/"+encodeURIComponent(currentDB)+"/_api/database/",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
returnVal = true;
},
error: function(data) {
returnVal = false;
}
});
return returnVal;
},
removeNotifications: function () {
$.gritter.removeAll();
this.lastNotificationMessage = null;
},
arangoNotification: function (message) {
var returnVal = false;
$.gritter.add({
title: "Notice:",
text: message,
time: 3000,
before_open: function(){
returnVal = true;
}
});
this.lastNotificationMessage = null;
return returnVal;
},
arangoError: function (message) {
var returnVal = false;
$.gritter.add({
title: "Error:",
text: message,
sticky: true,
before_open: function(){
if (this.lastNotificationMessage === message) {
// prevent display the same message over & over
return false;
}
if($('.gritter-item-wrapper').length == 3) {
// not more than 3 messages at once
return false;
}
this.lastNotificationMessage = message;
returnVal = true;
},
before_close: function(){
// reset last text when closing a specific message
this.lastNotificationMessage = null;
}
});
return returnVal;
},
getRandomToken: function () {
return Math.round(new Date().getTime());
},
isSystemAttribute: function (val) {
var a = this.systemAttributes();
return a[val];
},
isSystemCollection: function (val) {
//return val && val.name && val.name.substr(0, 1) === '_';
return val.substr(0, 1) === '_';
},
collectionApiType: function (identifier, refresh) {
// set "refresh" to disable caching collection type
if (refresh || this.CollectionTypes[identifier] === undefined) {
this.CollectionTypes[identifier] = window.arangoDocumentStore
.getCollectionInfo(identifier).type;
}
if (this.CollectionTypes[identifier] === 3) {
return "edge";
}
return "document";
},
collectionType: function (val) {
if (! val || val.name === '') {
return "-";
}
var type;
if (val.type === 2) {
type = "document";
}
else if (val.type === 3) {
type = "edge";
}
else {
type = "unknown";
}
if (val.name.substr(0, 1) === '_') {
type += " (system)";
}
return type;
},
FormatJSON: function (oData, sIndent) {
var self = this;
var sHTML, iCount;
if (sIndent === undefined) {
sIndent = "";
}
var sIndentStyle = " ";
var sDataType = self.RealTypeOf(oData);
if (sDataType === "array") {
if (oData.length === 0) {
return "[]";
}
sHTML = "[";
} else {
iCount = 0;
$.each(oData, function() {
iCount++;
return;
fixTooltips: function (selector, placement) {
$(selector).tooltip({
placement: placement,
hide: false,
show: false
});
if (iCount === 0) { // object is empty
return "{}";
}
sHTML = "{";
}
},
iCount = 0;
$.each(oData, function(sKey, vValue) {
if (iCount > 0) {
sHTML += ",";
currentDatabase: function () {
var returnVal = false;
$.ajax({
type: "GET",
cache: false,
url: "/_api/database/current",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
returnVal = data.result.name;
},
error: function(data) {
returnVal = false;
}
});
return returnVal;
},
databaseAllowed: function () {
var currentDB = this.currentDatabase(),
returnVal = false;
$.ajax({
type: "GET",
cache: false,
url: "/_db/"+encodeURIComponent(currentDB)+"/_api/database/",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
returnVal = true;
},
error: function(data) {
returnVal = false;
}
});
return returnVal;
},
removeNotifications: function () {
$.gritter.removeAll();
this.lastNotificationMessage = null;
},
arangoNotification: function (message) {
var returnVal = false;
$.gritter.add({
title: "Notice:",
text: message,
time: 3000,
before_open: function(){
returnVal = true;
}
});
this.lastNotificationMessage = null;
return returnVal;
},
arangoError: function (message) {
var returnVal = false;
$.gritter.add({
title: "Error:",
text: message,
sticky: true,
before_open: function(){
if (this.lastNotificationMessage === message) {
// prevent display the same message over & over
return false;
}
if($('.gritter-item-wrapper').length === 3) {
// not more than 3 messages at once
return false;
}
this.lastNotificationMessage = message;
returnVal = true;
},
before_close: function(){
// reset last text when closing a specific message
this.lastNotificationMessage = null;
}
});
return returnVal;
},
getRandomToken: function () {
return Math.round(new Date().getTime());
},
isSystemAttribute: function (val) {
var a = this.systemAttributes();
return a[val];
},
isSystemCollection: function (val) {
//return val && val.name && val.name.substr(0, 1) === '_';
return val.substr(0, 1) === '_';
},
collectionApiType: function (identifier, refresh) {
// set "refresh" to disable caching collection type
if (refresh || this.CollectionTypes[identifier] === undefined) {
this.CollectionTypes[identifier] = window.arangoDocumentStore
.getCollectionInfo(identifier).type;
}
if (this.CollectionTypes[identifier] === 3) {
return "edge";
}
return "document";
},
collectionType: function (val) {
if (! val || val.name === '') {
return "-";
}
var type;
if (val.type === 2) {
type = "document";
}
else if (val.type === 3) {
type = "edge";
}
else {
type = "unknown";
}
if (val.name.substr(0, 1) === '_') {
type += " (system)";
}
return type;
},
FormatJSON: function (oData, sIndent) {
var self = this;
var sHTML, iCount;
if (sIndent === undefined) {
sIndent = "";
}
var sIndentStyle = " ";
var sDataType = self.RealTypeOf(oData);
if (sDataType === "array") {
sHTML += ("\n" + sIndent + sIndentStyle);
if (oData.length === 0) {
return "[]";
}
sHTML = "[";
} else {
sHTML += ("\n" + sIndent + sIndentStyle + JSON.stringify(sKey) + ": ");
iCount = 0;
$.each(oData, function() {
iCount++;
return;
});
if (iCount === 0) { // object is empty
return "{}";
}
sHTML = "{";
}
// display relevant data type
switch (self.RealTypeOf(vValue)) {
case "array":
case "object":
sHTML += self.FormatJSON(vValue, (sIndent + sIndentStyle));
break;
case "boolean":
case "number":
sHTML += vValue.toString();
break;
case "null":
sHTML += "null";
break;
case "string":
sHTML += "\"" + vValue.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"";
break;
default:
sHTML += ("TYPEOF: " + typeof vValue);
}
// loop
iCount++;
});
iCount = 0;
$.each(oData, function(sKey, vValue) {
if (iCount > 0) {
sHTML += ",";
}
if (sDataType === "array") {
sHTML += ("\n" + sIndent + sIndentStyle);
} else {
sHTML += ("\n" + sIndent + sIndentStyle + JSON.stringify(sKey) + ": ");
}
// close object
if (sDataType === "array") {
sHTML += ("\n" + sIndent + "]");
} else {
sHTML += ("\n" + sIndent + "}");
// display relevant data type
switch (self.RealTypeOf(vValue)) {
case "array":
case "object":
sHTML += self.FormatJSON(vValue, (sIndent + sIndentStyle));
break;
case "boolean":
case "number":
sHTML += vValue.toString();
break;
case "null":
sHTML += "null";
break;
case "string":
sHTML += "\"" + vValue.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\"";
break;
default:
sHTML += ("TYPEOF: " + typeof vValue);
}
// loop
iCount++;
});
// close object
if (sDataType === "array") {
sHTML += ("\n" + sIndent + "]");
} else {
sHTML += ("\n" + sIndent + "}");
}
// return
return sHTML;
},
RealTypeOf: function (v) {
if (typeof v === "object") {
if (v === null) {
return "null";
}
var array = [];
if (v.constructor === array.constructor) {
return "array";
}
var date = new Date();
if (v.constructor === date.constructor) {
return "date";
}
var regexp = new RegExp();
if (v.constructor === regexp.constructor) {
return "regex";
}
return "object";
}
return typeof v;
}
// return
return sHTML;
},
RealTypeOf: function (v) {
if (typeof v === "object") {
if (v === null) {
return "null";
}
var array = [];
if (v.constructor === array.constructor) {
return "array";
}
var date = new Date();
if (v.constructor === date.constructor) {
return "date";
}
var regexp = new RegExp();
if (v.constructor === regexp.constructor) {
return "regex";
}
return "object";
}
return typeof v;
}
};
};
}());

View File

@ -1,3 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global EJS, window*/
(function() {
"use strict";
var TemplateEngine = function(prefix) {

View File

@ -94,6 +94,7 @@
"ERROR_ARANGO_ENDPOINT_NOT_FOUND" : { "code" : 1231, "message" : "endpoint not found" },
"ERROR_ARANGO_INVALID_KEY_GENERATOR" : { "code" : 1232, "message" : "invalid key generator" },
"ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE" : { "code" : 1233, "message" : "edge attribute missing" },
"ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 1234, "message" : "index insertion warning - attribute missing in document" },
"ERROR_ARANGO_DATAFILE_FULL" : { "code" : 1300, "message" : "datafile full" },
"ERROR_REPLICATION_NO_RESPONSE" : { "code" : 1400, "message" : "no response" },
"ERROR_REPLICATION_INVALID_RESPONSE" : { "code" : 1401, "message" : "invalid response" },
@ -173,24 +174,8 @@
"SIMPLE_CLIENT_COULD_NOT_CONNECT" : { "code" : 2001, "message" : "could not connect to server" },
"SIMPLE_CLIENT_COULD_NOT_WRITE" : { "code" : 2002, "message" : "could not write to server" },
"SIMPLE_CLIENT_COULD_NOT_READ" : { "code" : 2003, "message" : "could not read from server" },
"ERROR_ARANGO_INDEX_PQ_INSERT_FAILED" : { "code" : 3100, "message" : "priority queue insert failure" },
"ERROR_ARANGO_INDEX_PQ_REMOVE_FAILED" : { "code" : 3110, "message" : "priority queue remove failure" },
"ERROR_ARANGO_INDEX_PQ_REMOVE_ITEM_MISSING" : { "code" : 3111, "message" : "priority queue remove failure - item missing in index" },
"ERROR_ARANGO_INDEX_HASH_INSERT_ITEM_DUPLICATED" : { "code" : 3112, "message" : "(non-unique) hash index insert failure - document duplicated in index" },
"ERROR_ARANGO_INDEX_SKIPLIST_INSERT_ITEM_DUPLICATED" : { "code" : 3113, "message" : "(non-unique) skiplist index insert failure - document duplicated in index" },
"WARNING_ARANGO_INDEX_HASH_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 3200, "message" : "hash index insertion warning - attribute missing in document" },
"WARNING_ARANGO_INDEX_HASH_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3202, "message" : "hash index update warning - attribute missing in revised document" },
"WARNING_ARANGO_INDEX_HASH_REMOVE_ITEM_MISSING" : { "code" : 3211, "message" : "hash index remove failure - item missing in index" },
"WARNING_ARANGO_INDEX_SKIPLIST_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 3300, "message" : "skiplist index insertion warning - attribute missing in document" },
"WARNING_ARANGO_INDEX_SKIPLIST_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3302, "message" : "skiplist index update warning - attribute missing in revised document" },
"WARNING_ARANGO_INDEX_SKIPLIST_INSERT_CAS_FAILURE" : { "code" : 3304, "message" : "skiplist index insertion warning - CAS failure while attempting to insert document" },
"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_MISSING" : { "code" : 3311, "message" : "skiplist index remove failure - item missing in index" },
"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_CAS_FAILURE" : { "code" : 3313, "message" : "skiplist index remove warning - CAS failure while attempting to remove document" },
"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_POST_INSERTED" : { "code" : 3315, "message" : "skiplist index remove failure - item inserted post this transaction in the index" },
"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_PRIOR_REMOVED" : { "code" : 3317, "message" : "skiplist index remove failure - item removed prior this transaction in the index" },
"WARNING_ARANGO_INDEX_BITARRAY_DOCUMENT_ATTRIBUTE_MISSING" : { "code" : 3400, "message" : "bitarray index insertion warning - attribute missing in document" },
"WARNING_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3402, "message" : "bitarray index update warning - attribute missing in revised document" },
"WARNING_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING" : { "code" : 3411, "message" : "bitarray index remove failure - item missing in index" },
"ERROR_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING" : { "code" : 3402, "message" : "bitarray index update warning - attribute missing in revised document" },
"ERROR_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING" : { "code" : 3411, "message" : "bitarray index remove failure - item missing in index" },
"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE" : { "code" : 3413, "message" : "bitarray index insert failure - document attribute value unsupported in index" },
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES" : { "code" : 3415, "message" : "bitarray index creation failure - one or more index attributes are duplicated." },
"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES" : { "code" : 3417, "message" : "bitarray index creation failure - one or more index attribute values are duplicated." },

View File

@ -11,7 +11,7 @@
SYS_RAND, SYS_SERVER_STATISTICS, SYS_SPRINTF, SYS_TIME, SYS_START_PAGER, SYS_STOP_PAGER,
SYS_SHA256, SYS_WAIT, SYS_PARSE, SYS_IMPORT_CSV_FILE, SYS_IMPORT_JSON_FILE, SYS_LOG,
SYS_GEN_RANDOM_NUMBERS, SYS_GEN_RANDOM_ALPHA_NUMBERS, SYS_GEN_RANDOM_SALT, SYS_CREATE_NONCE,
SYS_CHECK_AND_MARK_NONCE, SYS_REQUEST_STATISTICS, SYS_UNIT_TESTS, SYS_UNIT_TESTS_RESULT:true,
SYS_CHECK_AND_MARK_NONCE, SYS_CLIENT_STATISTICS, SYS_HTTP_STATISTICS, SYS_UNIT_TESTS, SYS_UNIT_TESTS_RESULT:true,
SYS_PROCESS_CSV_FILE, SYS_PROCESS_JSON_FILE, ARANGO_QUIET, COLORS, COLOR_OUTPUT,
COLOR_OUTPUT_RESET, COLOR_BRIGHT, COLOR_BLACK, COLOR_BOLD_BLACK, COLOR_BLINK, COLOR_BLUE,
COLOR_BOLD_BLUE, COLOR_BOLD_GREEN, COLOR_RED, COLOR_BOLD_RED, COLOR_GREEN, COLOR_WHITE,
@ -627,12 +627,21 @@
}
////////////////////////////////////////////////////////////////////////////////
/// @brief requestStatistics
/// @brief clientStatistics
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_REQUEST_STATISTICS !== "undefined") {
exports.requestStatistics = SYS_REQUEST_STATISTICS;
delete SYS_REQUEST_STATISTICS;
if (typeof SYS_CLIENT_STATISTICS !== "undefined") {
exports.clientStatistics = SYS_CLIENT_STATISTICS;
delete SYS_CLIENT_STATISTICS;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief httpStatistics
////////////////////////////////////////////////////////////////////////////////
if (typeof SYS_HTTP_STATISTICS !== "undefined") {
exports.httpStatistics = SYS_HTTP_STATISTICS;
delete SYS_HTTP_STATISTICS;
}
// -----------------------------------------------------------------------------

View File

@ -108,6 +108,12 @@ var arango = require("org/arangodb").arango;
var fm = require("org/arangodb/foxx/manager");
////////////////////////////////////////////////////////////////////////////////
/// @brief global 'ArangoStatement'
////////////////////////////////////////////////////////////////////////////////
var ArangoStatement = require("org/arangodb/arango-statement").ArangoStatement;
////////////////////////////////////////////////////////////////////////////////
/// @brief global 'Buffer'
////////////////////////////////////////////////////////////////////////////////

View File

@ -161,10 +161,10 @@ window.arangoDocument = Backbone.Collection.extend({
contentType: "application/json",
processData: false,
success: function(data) {
result = true;
result = true;
},
error: function(data) {
result = false;
result = false;
}
});
return result;

View File

@ -1,206 +1,211 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global require, exports, window, Backbone, arangoDocumentModel, _, $*/
(function() {
"use strict";
window.arangoDocuments = Backbone.Collection.extend({
currentPage: 1,
collectionID: 1,
totalPages: 1,
documentsPerPage: 10,
documentsCount: 1,
offset: 0,
window.arangoDocuments = Backbone.Collection.extend({
currentPage: 1,
collectionID: 1,
totalPages: 1,
documentsPerPage: 10,
documentsCount: 1,
offset: 0,
url: '/_api/documents',
model: arangoDocumentModel,
getFirstDocuments: function () {
if (this.currentPage !== 1) {
var link = window.location.hash.split("/");
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/1";
}
},
getLastDocuments: function () {
if (this.currentPage !== this.totalPages) {
var link = window.location.hash.split("/");
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + this.totalPages;
}
},
getPrevDocuments: function () {
if (this.currentPage !== 1) {
var link = window.location.hash.split("/");
var page = parseInt(this.currentPage, null) - 1;
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + page;
}
},
getNextDocuments: function () {
if (this.currentPage !== this.totalPages) {
var link = window.location.hash.split("/");
var page = parseInt(this.currentPage, null) + 1;
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + page;
}
},
getDocuments: function (colid, currpage) {
var self = this;
this.collectionID = colid;
this.currentPage = currpage;
$.ajax({
cache: false,
type: "GET",
url: "/_api/collection/" + this.collectionID + "/count",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
self.totalPages = Math.ceil(data.count / self.documentsPerPage);
self.documentsCount = data.count;
},
error: function(data) {
url: '/_api/documents',
model: arangoDocumentModel,
getFirstDocuments: function () {
if (this.currentPage !== 1) {
var link = window.location.hash.split("/");
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/1";
}
});
if (isNaN(this.currentPage) || this.currentPage === undefined || this.currentPage < 1) {
this.currentPage = 1;
}
if (this.totalPages === 0) {
this.totalPages = 1;
}
this.offset = (this.currentPage - 1) * this.documentsPerPage;
var myQueryVal;
var sortParameter = '_key';
var sortCount = 10000;
if (this.documentsCount <= sortCount) {
//sorted
myQueryVal = "FOR x in @@collection SORT TO_NUMBER(x._key) == 0 " +
"? x._key : TO_NUMBER(x._key) LIMIT @offset, @count RETURN x";
}
else {
//not sorted
myQueryVal = "FOR x in @@collection LIMIT @offset, @count RETURN x";
}
var myQuery = {
query: myQueryVal,
bindVars: {
"@collection": this.collectionID,
"offset": this.offset,
"count": this.documentsPerPage
},
getLastDocuments: function () {
if (this.currentPage !== this.totalPages) {
var link = window.location.hash.split("/");
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + this.totalPages;
}
};
},
getPrevDocuments: function () {
if (this.currentPage !== 1) {
var link = window.location.hash.split("/");
var page = parseInt(this.currentPage, null) - 1;
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + page;
}
},
getNextDocuments: function () {
if (this.currentPage !== this.totalPages) {
var link = window.location.hash.split("/");
var page = parseInt(this.currentPage, null) + 1;
window.location.hash = link[0] + "/" + link[1] + "/" + link[2] + "/" + page;
}
},
getDocuments: function (colid, currpage) {
var self = this;
this.collectionID = colid;
this.currentPage = currpage;
$.ajax({
cache: false,
type: 'POST',
async: false,
url: '/_api/cursor',
data: JSON.stringify(myQuery),
contentType: "application/json",
success: function(data) {
self.clearDocuments();
if (self.documentsCount !== 0) {
$.each(data.result, function(k, v) {
//ERROR HERE
window.arangoDocumentsStore.add({
"id": v._id,
"rev": v._rev,
"key": v._key,
"content": v
$.ajax({
cache: false,
type: "GET",
url: "/_api/collection/" + this.collectionID + "/count",
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
self.totalPages = Math.ceil(data.count / self.documentsPerPage);
self.documentsCount = data.count;
},
error: function(data) {
}
});
if (isNaN(this.currentPage) || this.currentPage === undefined || this.currentPage < 1) {
this.currentPage = 1;
}
if (this.totalPages === 0) {
this.totalPages = 1;
}
this.offset = (this.currentPage - 1) * this.documentsPerPage;
var myQueryVal;
var sortCount = 10000;
if (this.documentsCount <= sortCount) {
//sorted
myQueryVal = "FOR x in @@collection SORT TO_NUMBER(x._key) == 0 " +
"? x._key : TO_NUMBER(x._key) LIMIT @offset, @count RETURN x";
}
else {
//not sorted
myQueryVal = "FOR x in @@collection LIMIT @offset, @count RETURN x";
}
var myQuery = {
query: myQueryVal,
bindVars: {
"@collection": this.collectionID,
"offset": this.offset,
"count": this.documentsPerPage
}
};
$.ajax({
cache: false,
type: 'POST',
async: false,
url: '/_api/cursor',
data: JSON.stringify(myQuery),
contentType: "application/json",
success: function(data) {
self.clearDocuments();
if (self.documentsCount !== 0) {
$.each(data.result, function(k, v) {
//ERROR HERE
window.arangoDocumentsStore.add({
"id": v._id,
"rev": v._rev,
"key": v._key,
"content": v
});
});
});
window.documentsView.drawTable();
window.documentsView.renderPagination(self.totalPages);
window.documentsView.drawTable();
window.documentsView.renderPagination(self.totalPages);
}
else {
window.documentsView.initTable();
window.documentsView.drawTable();
}
},
error: function(data) {
}
else {
window.documentsView.initTable();
window.documentsView.drawTable();
}
},
error: function(data) {
});
},
getFilteredDocuments: function (colid, currpage, filter, bindValues) {
var self = this;
this.collectionID = colid;
this.currentPage = currpage;
this.currentFilterPage = currpage;
var filterString;
if(filter.length === 0){
filterString ="";
} else {
filterString = ' FILTER' + filter.join(' && ');
}
});
},
getFilteredDocuments: function (colid, currpage, filter, bindValues) {
var self = this;
this.collectionID = colid;
this.currentPage = currpage;
this.currentFilterPage = currpage;
var filterString;
if(filter.length === 0){
filterString ="";
} else {
filterString = ' FILTER' + filter.join(' && ');
}
var sortCount = 10000;
var sortCount = 10000;
var sortString = '';
if (this.documentsCount <= sortCount) {
//sorted
sortString = " SORT TO_NUMBER(u._key) == 0 ? u._key : TO_NUMBER(u._key)";
}
var myQueryVal = "FOR u in @@collection" + filterString + sortString +
" LIMIT 0, @count RETURN u";
var myQuery = {
query: myQueryVal,
bindVars: {
"@collection": this.collectionID,
"count": this.documentsPerPage
},
options: {
fullCount: true
var sortString = '';
if (this.documentsCount <= sortCount) {
//sorted
sortString = " SORT TO_NUMBER(u._key) == 0 ? u._key : TO_NUMBER(u._key)";
}
};
var myQueryVal = "FOR u in @@collection" + filterString + sortString +
" LIMIT 0, @count RETURN u";
$.each(bindValues, function(k,v) {
myQuery.bindVars[k] = v;
});
$.ajax({
cache: false,
type: 'POST',
async: false,
url: '/_api/cursor',
data: JSON.stringify(myQuery),
contentType: "application/json",
success: function(data) {
self.clearDocuments();
self.documentsCount = data.extra.fullCount;
self.totalPages = Math.ceil(self.documentsCount / self.documentsPerPage);
if (isNaN(this.currentPage) || this.currentPage === undefined || this.currentPage < 1) {
this.currentPage = 1;
}
if (this.totalPages === 0) {
this.totalPages = 1;
var myQuery = {
query: myQueryVal,
bindVars: {
"@collection": this.collectionID,
"count": this.documentsPerPage
},
options: {
fullCount: true
}
};
this.offset = (this.currentPage - 1) * this.documentsPerPage;
if (self.documentsCount !== 0) {
$.each(data.result, function(k, v) {
window.arangoDocumentsStore.add({
"id": v._id,
"rev": v._rev,
"key": v._key,
"content": v
$.each(bindValues, function(k,v) {
myQuery.bindVars[k] = v;
});
$.ajax({
cache: false,
type: 'POST',
async: false,
url: '/_api/cursor',
data: JSON.stringify(myQuery),
contentType: "application/json",
success: function(data) {
self.clearDocuments();
self.documentsCount = data.extra.fullCount;
self.totalPages = Math.ceil(self.documentsCount / self.documentsPerPage);
if (
isNaN(this.currentPage)
|| this.currentPage === undefined
|| this.currentPage < 1
) {
this.currentPage = 1;
}
if (this.totalPages === 0) {
this.totalPages = 1;
}
this.offset = (this.currentPage - 1) * this.documentsPerPage;
if (self.documentsCount !== 0) {
$.each(data.result, function(k, v) {
window.arangoDocumentsStore.add({
"id": v._id,
"rev": v._rev,
"key": v._key,
"content": v
});
});
});
window.documentsView.drawTable();
window.documentsView.renderPagination(self.totalPages, true);
window.documentsView.drawTable();
window.documentsView.renderPagination(self.totalPages, true);
}
else {
window.documentsView.initTable();
window.documentsView.drawTable();
}
},
error: function(data) {
}
else {
window.documentsView.initTable();
window.documentsView.drawTable();
}
},
error: function(data) {
"use strict";
}
});
},
clearDocuments: function () {
window.arangoDocumentsStore.reset();
}
});
});
},
clearDocuments: function () {
window.arangoDocumentsStore.reset();
}
});
}());

View File

@ -1,57 +1,16 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global require, exports, Backbone, window, $, arangoLog */
(function () {
window.arangoLogs = Backbone.Collection.extend({
url: '/_admin/log?upto=4&size=10&offset=0',
parse: function(response) {
var myResponse = [];
var i = 0;
$.each(response.lid, function(key, val) {
myResponse.push({
"level": response.level[i],
"lid": response.lid[i],
"text": response.text[i],
"timestamp": response.timestamp[i],
"totalAmount": response.totalAmount
});
i++;
});
return myResponse;
},
tables: ["logTableID", "warnTableID", "infoTableID", "debugTableID", "critTableID"],
model: arangoLog,
clearLocalStorage: function () {
window.arangoLogsStore.reset();
},
returnElements: function () {
},
fillLocalStorage: function (table, offset, size) {
var self = this;
this.clearLocalStorage();
if (! table) {
table = 'logTableID';
}
if (! size) {
size = 10;
}
if (! offset) {
offset = 0;
}
var loglevel = this.showLogLevel(table);
var url = "";
if (loglevel === 5) {
url = "/_admin/log?upto=4";
}
else {
url = "/_admin/log?level=" + loglevel;
}
url = url + "&size=" + size + "&offset=" + offset;
$.getJSON(url, function(response) {
var totalAmount = response.totalAmount;
"use strict";
window.ArangoLogs = Backbone.Collection.extend({
url: '/_admin/log?upto=4&size=10&offset=0',
parse: function(response) {
var myResponse = [];
var i = 0;
$.each(response.lid, function () {
window.arangoLogsStore.add({
$.each(response.lid, function(key, val) {
myResponse.push({
"level": response.level[i],
"lid": response.lid[i],
"text": response.text[i],
@ -60,27 +19,70 @@ window.arangoLogs = Backbone.Collection.extend({
});
i++;
});
window.logsView.drawTable();
});
},
showLogLevel: function (tableid) {
tableid = '#'+tableid;
var returnVal = 0;
if (tableid === "#critTableID") {
returnVal = 1;
return myResponse;
},
tables: ["logTableID", "warnTableID", "infoTableID", "debugTableID", "critTableID"],
model: arangoLog,
clearLocalStorage: function () {
window.arangoLogsStore.reset();
},
returnElements: function () {
},
fillLocalStorage: function (table, offset, size) {
this.clearLocalStorage();
if (! table) {
table = 'logTableID';
}
if (! size) {
size = 10;
}
if (! offset) {
offset = 0;
}
var loglevel = this.showLogLevel(table);
var url = "";
if (loglevel === 5) {
url = "/_admin/log?upto=4";
}
else {
url = "/_admin/log?level=" + loglevel;
}
url = url + "&size=" + size + "&offset=" + offset;
$.getJSON(url, function(response) {
var i = 0;
$.each(response.lid, function () {
window.arangoLogsStore.add({
"level": response.level[i],
"lid": response.lid[i],
"text": response.text[i],
"timestamp": response.timestamp[i],
"totalAmount": response.totalAmount
});
i++;
});
window.logsView.drawTable();
});
},
showLogLevel: function (tableid) {
tableid = '#'+tableid;
var returnVal = 0;
if (tableid === "#critTableID") {
returnVal = 1;
}
else if (tableid === "#warnTableID") {
returnVal = 2;
}
else if (tableid === "#infoTableID") {
returnVal = 3;
}
else if (tableid === "#debugTableID") {
returnVal = 4;
}
else if (tableid === "#logTableID") {
returnVal = 5;
}
return returnVal;
}
else if (tableid === "#warnTableID") {
returnVal = 2;
}
else if (tableid === "#infoTableID") {
returnVal = 3;
}
else if (tableid === "#debugTableID") {
returnVal = 4;
}
else if (tableid === "#logTableID") {
returnVal = 5;
}
return returnVal;
}
});
});
}());

View File

@ -1,7 +1,10 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*jslint indent: 2, nomen: true, maxlen: 100, white: true, plusplus: true */
/*global window, Backbone */
window.FoxxCollection = Backbone.Collection.extend({
model: window.Foxx,
url: "/_admin/aardvark/foxxes"
});
(function() {
"use strict";
window.FoxxCollection = Backbone.Collection.extend({
model: window.Foxx,
url: "/_admin/aardvark/foxxes"
});
}());

View File

@ -0,0 +1,19 @@
/*jslint indent: 2, nomen: true, maxlen: 100, sloppy: true, vars: true, white: true, plusplus: true */
/*global window, Backbone */
(function () {
"use strict";
window.GraphCollection = Backbone.Collection.extend({
model: window.Graph,
url: "/_api/graph",
comparator: "_key",
parse: function(res) {
if (!res.error) {
return res.graphs;
}
}
});
}());

View File

@ -1,237 +0,0 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style/bootstrap.min.css" type="text/css"/>
<link rel="stylesheet" href="style/graphlayout.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="style/bootstrap.min.css">
<script src="../lib/d3.v3.min.js"></script>
<script src="../lib/underscore.js"></script>
<script src="../lib/jquery-1.8.3.js"></script>
<script type="text/javascript" src="../lib/bootstrap.js"></script>
<script src="../lib/jquery.livequery.js"></script>
<script src="graph/colourMapper.js"></script>
<script src="graph/forceLayouter.js"></script>
<script src="graph/eventLibrary.js"></script>
<script src="graph/eventDispatcher.js"></script>
<script src="graph/nodeShaper.js"></script>
<script src="graph/edgeShaper.js"></script>
<script src="graph/arangoAdapter.js"></script>
<script type="text/javascript" src="ui/modalDialogHelper.js"></script>
<script type="text/javascript" src="ui/nodeShaperControls.js"></script>
<script type="text/javascript" src="ui/edgeShaperControls.js"></script>
<script type="text/javascript" src="ui/uiComponentsHelper.js"></script>
<script type="text/javascript" src="ui/eventDispatcherControls.js"></script>
<script type="text/javascript" src="ui/graphViewerUI.js"></script>
<script src="graphViewer.js"></script>
<script>
var arangodb = "http://localhost:8529";
//var arangodb = "nirvana.org";
var createCollection = function(name, type, callback) {
if (type !== "Document" && type !== "Edge") {
throw "Unsupported type";
}
var data = {
"name": name,
"type": type,
"journalSize": 1048576
};
$.ajax({
cache: false,
type: "POST",
url: arangodb + "/_api/collection",
data: JSON.stringify(data),
contentType: "application/json",
processData: false,
async: false,
success: function(data) {
callback(data.id);
},
error: function(data) {
throw data.statusText;
}
});
};
var insertEdge = function (collectionID, from, to) {
$.ajax({
cache: false,
type: "POST",
async: false,
url: arangodb + "/_api/edge?collection=" + collectionID + "&from=" + from + "&to=" + to,
data: JSON.stringify({}),
contentType: "application/json",
processData: false,
success: function(data) {
return data._id;
},
error: function(data) {
throw data.statusText;
}
});
};
var insertNode = function (collectionID, node) {
var id;
$.ajax({
cache: false,
type: "POST",
async: false,
url: arangodb + "/_api/document?collection=" + collectionID,
data: JSON.stringify(node),
contentType: "application/json",
processData: false,
success: function(data) {
id = data._id;
},
error: function(data) {
throw data.statusText;
}
});
return id;
};
var setupArangoContent = function() {
var nodesCollection = "Classes";
var edgesCollection = "Connections";
//deleteArangoContent();
createCollection(nodesCollection, "Document", function(id) {nodesCollId = id;});
createCollection(edgesCollection, "Edge", function(id) {edgesCollId = id;});
var c1 = insertNode(nodesCollection, {id: 1, name: "graphViewer", type: "Controller"}),
c2 = insertNode(nodesCollection, {id: 2, name: "Shaper", type: "AbstractView"}),
c3 = insertNode(nodesCollection, {id: 3, name: "NodeShaper", type: "View"}),
c4 = insertNode(nodesCollection, {id: 4, name: "EdgeShaper", type: "View"}),
c5 = insertNode(nodesCollection, {id: 5, name: "Adapter", type: "AbstractModel"}),
c6 = insertNode(nodesCollection, {id: 6, name: "ArangoAdapter", type: "Model"}),
c7 = insertNode(nodesCollection, {id: 7, name: "JSONAdapter", type: "Model"}),
c8 = insertNode(nodesCollection, {id: 8, name: "Layouter", type: "AbstractView"}),
c9 = insertNode(nodesCollection, {id: 9, name: "forceLayouter", type: "View"}),
c10 = insertNode(nodesCollection, {id: 10, name: "eventLibrary", type: "Events"}),
c11 = insertNode(nodesCollection, {id: 11, name: "Configuration", type: "JSON"}),
c12 = insertNode(nodesCollection, {id: 12, name: "Configuration", type: "JSON"}),
c13 = insertNode(nodesCollection, {id: 13, name: "Configuration", type: "JSON"}),
c14 = insertNode(nodesCollection, {id: 14, name: "Configuration", type: "JSON"}),
c15 = insertNode(nodesCollection, {id: 15, name: "Configuration", type: "JSON"}),
nsc1 = insertNode(nodesCollection, {id: 16, name: "shape", type: "NodeShaper.shapes"}),
nsc2 = insertNode(nodesCollection, {id: 17, name: "label", type: "string||function(node)"}),
nsc3 = insertNode(nodesCollection, {id: 18, name: "size", type: "double||function(node)"}),
nsc4 = insertNode(nodesCollection, {id: 19, name: "ondrag", type: "function(node)"}),
nsc5 = insertNode(nodesCollection, {id: 20, name: "onclick", type: "function(node)"}),
nsc6 = insertNode(nodesCollection, {id: 21, name: "onupdate", type: "function(node)"});
insertEdge(edgesCollection, c1, c2);
insertEdge(edgesCollection, c1, c5);
insertEdge(edgesCollection, c1, c8);
insertEdge(edgesCollection, c1, c10);
insertEdge(edgesCollection, c2, c3);
insertEdge(edgesCollection, c2, c4);
insertEdge(edgesCollection, c5, c6);
insertEdge(edgesCollection, c5, c7);
insertEdge(edgesCollection, c8, c9);
insertEdge(edgesCollection, c10, c8);
insertEdge(edgesCollection, c10, c5);
insertEdge(edgesCollection, c10, c2);
insertEdge(edgesCollection, c3, c11);
insertEdge(edgesCollection, c4, c12);
insertEdge(edgesCollection, c6, c13);
insertEdge(edgesCollection, c7, c14);
insertEdge(edgesCollection, c9, c15);
insertEdge(edgesCollection, c11, nsc1);
insertEdge(edgesCollection, c11, nsc2);
insertEdge(edgesCollection, c11, nsc3);
insertEdge(edgesCollection, c11, nsc4);
insertEdge(edgesCollection, c11, nsc5);
insertEdge(edgesCollection, c11, nsc6);
};
function createViewer() {
var host,
ecol,
ncol,
aaconfig;
host = $("#host")[0].value;
ecol = $("#edgeCollection")[0].value;
ncol = $("#nodeCollection")[0].value;
aaconfig = {
type: "arango",
nodeCollection: ncol,
edgeCollection: ecol,
host: host
};
/*
layouterConfig = {
"type": "force",
"gravity": 0.01,
"distance": 100,
"charge": -300
};
*/
$("#creationDialog")[0].style.display = "none";
ui = new GraphViewerUI(document.getElementById("content"), aaconfig);
}
var ui;
</script>
<title>DEMO</title>
</head>
<!--<body onload="setupArangoContent()"> -->
<body>
<form action="javascript:void(0);" autocomplete="on" class="form-horizontal" id="creationDialog">
<fieldset>
<legend>Create the Viewer</legend>
<fieldset>
<legend>Setup Arango Connection</legend>
<div class="control-group">
<label for="host" class="control-label">Host</label>
<div class="controls">
<input id="host" type="text" name="host" placeholder="Host" maxlength="75" class="input-xlarge" value="http://localhost:8529">
</div>
</div>
<div class="control-group">
<label for="nodeCollection" class="control-label">Node Collection</label>
<div class="controls">
<input id="nodeCollection" type="text" name="nodeCollection" placeholder="Node Collection" maxlength="75" class="input-xlarge" value="Classes">
</div>
</div>
<div class="control-group">
<label for="edgeCollection" class="control-label">Edge Collection</label>
<div class="controls">
<input id="edgeCollection" type="text" name="edgeCollection" placeholder="Edge Collection" maxlength="75" class="input-xlarge" value="Connections">
</div>
</div>
</fieldset>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary" onclick="createViewer()">Create</button>
</div>
</div>
</fieldset>
</form>
<div id="content" style="width:980px; height:640px" />
</body>
</html>

View File

@ -28,13 +28,13 @@
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
function JSONAdapter(jsonPath, nodes, edges, width, height) {
function JSONAdapter(jsonPath, nodes, edges, viewer, width, height) {
"use strict";
var self = this,
initialX = {},
initialY = {},
absAdapter = new AbstractAdapter(nodes, edges, this),
absAdapter = new AbstractAdapter(nodes, edges, this, viewer),
findNode = function(n) {
var res = $.grep(nodes, function(e){
return e._id === n._id;
@ -208,4 +208,4 @@ function JSONAdapter(jsonPath, nodes, edges, width, height) {
self.explore = absAdapter.explore;
}
}

View File

@ -30,7 +30,7 @@
////////////////////////////////////////////////////////////////////////////////
function AbstractAdapter(nodes, edges, descendant, config) {
function AbstractAdapter(nodes, edges, descendant, viewer, config) {
"use strict";
if (nodes === undefined) {
@ -42,6 +42,9 @@ function AbstractAdapter(nodes, edges, descendant, config) {
if (descendant === undefined) {
throw "An inheriting class has to be given.";
}
if (viewer === undefined) {
throw "A reference to the graph viewer has to be given.";
}
config = config || {};
var self = this,
@ -104,7 +107,7 @@ function AbstractAdapter(nodes, edges, descendant, config) {
throw "Too many edges with the same ID, should never happen";
},
insertNode = function(data) {
insertNode = function(data, x, y) {
var node = {
_data: data,
_id: data._id
@ -113,8 +116,8 @@ function AbstractAdapter(nodes, edges, descendant, config) {
if (n) {
return n;
}
node.x = initialX.getStart();
node.y = initialY.getStart();
node.x = x || initialX.getStart();
node.y = y || initialY.getStart();
nodes.push(node);
node._outboundCounter = 0;
node._inboundCounter = 0;
@ -134,6 +137,7 @@ function AbstractAdapter(nodes, edges, descendant, config) {
edges.length = 0;
joinedInCommunities = {};
cachedCommunities = {};
viewer.cleanUp();
},
insertEdge = function(data) {

View File

@ -28,7 +28,7 @@
/// @author Copyright 2011-2013, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
function ArangoAdapter(nodes, edges, config) {
function ArangoAdapter(nodes, edges, viewer, config) {
"use strict";
if (nodes === undefined) {
@ -37,6 +37,9 @@ function ArangoAdapter(nodes, edges, config) {
if (edges === undefined) {
throw "The edges have to be given.";
}
if (viewer === undefined) {
throw "A reference to the graph viewer has to be given.";
}
if (config === undefined) {
throw "A configuration with node- and edgeCollection has to be given.";
}
@ -124,9 +127,9 @@ function ArangoAdapter(nodes, edges, config) {
if (query !== queries.getAllGraphs) {
if (query !== queries.connectedEdges) {
bindVars["@nodes"] = nodeCollection;
}
if (query !== queries.childrenCentrality) {
bindVars.dir = direction;
if (query !== queries.childrenCentrality) {
bindVars.dir = direction;
}
}
bindVars["@edges"] = edgeCollection;
}
@ -265,7 +268,7 @@ function ArangoAdapter(nodes, edges, config) {
return;
}
callback(absAdapter.insertInitialNode(n));
}
};
},
@ -281,7 +284,7 @@ function ArangoAdapter(nodes, edges, config) {
if (config.prioList) {
absConfig.prioList = config.prioList;
}
absAdapter = new AbstractAdapter(nodes, edges, this, absConfig);
absAdapter = new AbstractAdapter(nodes, edges, this, viewer, absConfig);
parseConfig(config);

View File

@ -30,13 +30,12 @@
function ColourMapper() {
"use strict";
var mapCreated = false,
mapping = {},
reverseMapping = {},
colours = [],
listener,
self = this,
nextColour = 0;
var mapping = {},
reverseMapping = {},
colours = [],
listener,
self = this,
nextColour = 0;
colours.push({back: "navy", front: "white"});
colours.push({back: "green", front: "white"});
@ -129,4 +128,4 @@ function ColourMapper() {
};
this.reset();
}
}

Some files were not shown because too many files have changed in this diff Show More