IGNITE-843 Added check for write-behind & store. Hide write-behind settings. Fix escape all label text. Fixed indexed types xml generation.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/fca9ac99 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/fca9ac99 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/fca9ac99 Branch: refs/heads/ignite-1121 Commit: fca9ac999777b5c02494d06f2fd96daec76c076f Parents: 55f7e07 Author: AKuznetsov <akuznet...@gridgain.com> Authored: Wed Jul 15 16:23:57 2015 +0700 Committer: AKuznetsov <akuznet...@gridgain.com> Committed: Wed Jul 15 16:23:57 2015 +0700 ---------------------------------------------------------------------- .../nodejs/controllers/caches-controller.js | 14 +++++++++++--- .../nodejs/controllers/models/caches.json | 6 +++++- .../web-control-center/nodejs/routes/generator/xml.js | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fca9ac99/modules/web-control-center/nodejs/controllers/caches-controller.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/caches-controller.js b/modules/web-control-center/nodejs/controllers/caches-controller.js index fa308da..5c9a793 100644 --- a/modules/web-control-center/nodejs/controllers/caches-controller.js +++ b/modules/web-control-center/nodejs/controllers/caches-controller.js @@ -159,14 +159,22 @@ controlCenterModule.controller('cachesController', ['$scope', '$http', 'commonFu $scope.saveItem = function () { var item = $scope.backupItem; - if (item.cacheStoreFactory && item.cacheStoreFactory.kind && !(item.readThrough || item.writeThrough)) { + var cacheStoreFactorySelected = item.cacheStoreFactory && item.cacheStoreFactory.kind; + + if (cacheStoreFactorySelected && !(item.readThrough || item.writeThrough)) { commonFunctions.showError('Store is configured but read/write through are not enabled!'); return; } - if ((item.readThrough || item.writeThrough) && (!item.cacheStoreFactory || !item.cacheStoreFactory.kind)) { - commonFunctions.showError('Read / write through are enabled but strore is not configured!'); + if ((item.readThrough || item.writeThrough) && !cacheStoreFactorySelected) { + commonFunctions.showError('Read / write through are enabled but store is not configured!'); + + return; + } + + if (item.writeBehindEnabled && !cacheStoreFactorySelected) { + commonFunctions.showError('Write behind enabled but store is not configured!'); return; } http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fca9ac99/modules/web-control-center/nodejs/controllers/models/caches.json ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/controllers/models/caches.json b/modules/web-control-center/nodejs/controllers/models/caches.json index d54c5eb..7becbdd 100644 --- a/modules/web-control-center/nodejs/controllers/models/caches.json +++ b/modules/web-control-center/nodejs/controllers/models/caches.json @@ -328,7 +328,7 @@ ], "fields": [ { - "label": "Escape all", + "label": "Escape table and filed names", "type": "check", "model": "sqlEscapeAll", "tip": [ @@ -859,6 +859,7 @@ "label": "Batch size", "type": "number", "model": "writeBehindBatchSize", + "hide": "!backupItem.writeBehindEnabled", "placeholder": 512, "tip": [ "Maximum batch size for write-behind cache store operations.", @@ -869,6 +870,7 @@ "label": "Flush size", "type": "number", "model": "writeBehindFlushSize", + "hide": "!backupItem.writeBehindEnabled", "placeholder": 10240, "tip": [ "Maximum size of the write-behind cache.<br>", @@ -879,6 +881,7 @@ "label": "Flush frequency", "type": "number", "model": "writeBehindFlushFrequency", + "hide": "!backupItem.writeBehindEnabled", "placeholder": 5000, "tip": [ "Frequency with which write-behind cache is flushed to the cache store in milliseconds." @@ -888,6 +891,7 @@ "label": "Flush threads count", "type": "number", "model": "writeBehindFlushThreadCount", + "hide": "!backupItem.writeBehindEnabled", "placeholder": 1, "tip": [ "Number of threads that will perform cache flushing." http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/fca9ac99/modules/web-control-center/nodejs/routes/generator/xml.js ---------------------------------------------------------------------- diff --git a/modules/web-control-center/nodejs/routes/generator/xml.js b/modules/web-control-center/nodejs/routes/generator/xml.js index f01d136..9e45111 100644 --- a/modules/web-control-center/nodejs/routes/generator/xml.js +++ b/modules/web-control-center/nodejs/routes/generator/xml.js @@ -380,7 +380,7 @@ function generateCacheConfiguration(cacheCfg, res) { if (cacheCfg.indexedTypes && cacheCfg.indexedTypes.length > 0) { res.startBlock('<property name="indexedTypes">'); - res.startBlock('<array>'); + res.startBlock('<list>'); for (var i = 0; i < cacheCfg.indexedTypes.length; i++) { var pair = cacheCfg.indexedTypes[i]; @@ -389,7 +389,7 @@ function generateCacheConfiguration(cacheCfg, res) { res.line('<value>' + escape(pair.valueClass) + '</value>'); } - res.endBlock('</array>'); + res.endBlock('</list>'); res.endBlock('</property>'); }