ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-843 WIP on preview java code.
Date Thu, 27 Aug 2015 10:14:32 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843 f83d034be -> c5aa8f337


IGNITE-843 WIP on preview java code.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/c5aa8f33
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c5aa8f33
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c5aa8f33

Branch: refs/heads/ignite-843
Commit: c5aa8f337ce50b3a887d7cdb00684a4ffd235c45
Parents: f83d034
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Thu Aug 27 17:14:55 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Aug 27 17:14:55 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    |  25 +--
 .../main/js/controllers/clusters-controller.js  |  32 ++--
 .../src/main/js/controllers/common-module.js    |  46 ++---
 .../main/js/controllers/metadata-controller.js  |  27 ++-
 .../src/main/js/public/stylesheets/style.scss   |  14 +-
 .../js/routes/generator/generator-common.js     | 179 ++++++++++---------
 .../main/js/routes/generator/generator-java.js  |  49 ++---
 .../main/js/routes/generator/generator-xml.js   |   4 +-
 .../src/main/js/views/configuration/caches.jade |  16 +-
 .../main/js/views/configuration/clusters.jade   |  19 +-
 .../main/js/views/configuration/metadata.jade   |  16 +-
 11 files changed, 189 insertions(+), 238 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index c248c06..4ea6aef 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -31,10 +31,7 @@ controlCenterModule.controller('cachesController', [
             $scope.tableRemove = function (item, field, index) {
                 $table.tableRemove(item, field, index);
 
-                markChanged();
-
-                // Dirty state do not change automatically.
-                $scope.ui.inputForm.$dirty = true;
+                $common.markChanged($scope.ui.inputForm, 'cacheBackupItemChanged');
             };
 
             $scope.tableSimpleSave = $table.tableSimpleSave;
@@ -48,6 +45,8 @@ controlCenterModule.controller('cachesController', [
 
             $scope.previewInit = $preview.previewInit;
 
+            $scope.formChanged = $common.formChanged;
+
             $scope.hidePopover = $common.hidePopover;
 
             var showPopoverMessage = $common.showPopoverMessage;
@@ -107,10 +106,6 @@ controlCenterModule.controller('cachesController', [
                 sessionStorage.removeItem('cacheBackupItemChanged');
             }
 
-            function cacheChanged() {
-                return $common.isDefined($scope.ui.inputForm) && $scope.ui.inputForm.$dirty;
-            }
-
             $scope.panels = {activePanels: [0]};
 
             $scope.$watchCollection('panels.activePanels', function () {
@@ -314,7 +309,7 @@ controlCenterModule.controller('cachesController', [
                             $scope.preview.serverNearCacheJava = $generatorJava.cacheServerNearCache(val,
varName).join('');
                             $scope.preview.statisticsJava = $generatorJava.cacheStatistics(val,
varName).join('');
 
-                            markChanged();
+                            $common.markChanged($scope.ui.inputForm, 'cacheBackupItemChanged');
                         }
                     }, true);
 
@@ -346,19 +341,17 @@ controlCenterModule.controller('cachesController', [
 
                     $timeout(function () {
                         $common.previewHeightUpdate();
-
-                        $common.configureStickyElement();
                     });
 
                     $timeout(function () {
                         if (changed)
-                            markChanged();
+                            $common.markChanged($scope.ui.inputForm, 'cacheBackupItemChanged');
                         else
-                            markPristine();
+                            $common.markPristine($scope.ui.inputForm, 'cacheBackupItemChanged');
                     }, 50);
                 }
 
-                if (cacheChanged())
+                if ($common.formChanged($scope.ui.inputForm))
                     $confirm.show('<span>Current cache is modified.<br/><br/>Discard
unsaved changes?</span>').then(
                         function () {
                             selectItem();
@@ -446,7 +439,7 @@ controlCenterModule.controller('cachesController', [
             function save(item) {
                 $http.post('caches/save', item)
                     .success(function (_id) {
-                        markPristine();
+                        $common.markPristine($scope.ui.inputForm, 'cacheBackupItemChanged');
 
                         var idx = _.findIndex($scope.caches, function (cache) {
                             return cache._id == _id;
@@ -502,7 +495,7 @@ controlCenterModule.controller('cachesController', [
 
                 $confirm.show('Are you sure you want to remove cache: "' + selectedItem.name
+ '"?').then(
                     function () {
-                        markPristine();
+                        $common.markPristine($scope.ui.inputForm, 'cacheBackupItemChanged');
 
                         var _id = selectedItem._id;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index d01d21d..f8f1a19 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -28,10 +28,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
         $scope.tableRemove = function (item, field, index) {
             $table.tableRemove(item, field, index);
 
-            markChanged();
-
-            // Dirty state do not change automatically.
-            $scope.ui.inputForm.$dirty = true;
+            $common.markChanged($scope.ui.inputForm, 'clusterBackupItemChanged');
         };
 
         $scope.tableSimpleSave = $table.tableSimpleSave;
@@ -42,15 +39,12 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
 
         $scope.previewInit = $preview.previewInit;
 
+        $scope.formChanged = $common.formChanged;
+
         $scope.hidePopover = $common.hidePopover;
         var showPopoverMessage = $common.showPopoverMessage;
 
-        $scope.templates = [
-            {value: {discovery: {kind: 'Multicast', Vm: {addresses: ['127.0.0.1:47500..47510']},
Multicast: {}}},label: 'multicast'},
-            {value: {discovery: {kind: 'Vm', Vm: {addresses: ['127.0.0.1:47500..47510']}}},
label: 'local'}
-        ];
-
-        $scope.template = $scope.templates[0].value;
+        $scope.template = {discovery: {kind: 'Multicast', Vm: {addresses: ['127.0.0.1:47500..47510']},
Multicast: {}}};
 
         $scope.discoveries = [
             {value: 'Vm', label: 'static IPs'},
@@ -110,10 +104,6 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
             sessionStorage.removeItem('clusterBackupItemChanged');
         }
 
-        function clusterChanged() {
-            return $common.isDefined($scope.ui.inputForm) && $scope.ui.inputForm.$dirty;
-        }
-
         $scope.panels = {activePanels: [0]};
 
         $scope.$watchCollection('panels.activePanels', function () {
@@ -251,7 +241,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
                         $scope.preview.poolsJava = $generatorJava.clusterPools(val).join('');
                         $scope.preview.transactionsJava = $generatorJava.clusterTransactions(val).join('');
 
-                        markChanged();
+                        $common.markChanged($scope.ui.inputForm, 'clusterBackupItemChanged');
                     }
                 }, true);
 
@@ -283,19 +273,17 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
 
                 $timeout(function () {
                     $common.previewHeightUpdate();
-
-                    $common.configureStickyElement();
                 });
 
                 $timeout(function () {
                     if (changed)
-                        markChanged();
+                        $common.markChanged($scope.ui.inputForm, 'clusterBackupItemChanged');
                     else
-                        markPristine();
+                        $common.markPristine($scope.ui.inputForm, 'clusterBackupItemChanged');
                 }, 50);
             }
 
-            if (clusterChanged())
+            if ($common.formChanged($scope.ui.inputForm))
                 $confirm.show('<span>Current cluster is modified.<br/><br/>Discard
unsaved changes?</span>').then(
                     function () {
                         selectItem();
@@ -387,7 +375,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
         function save(item) {
             $http.post('clusters/save', item)
                 .success(function (_id) {
-                    markPristine();
+                    $common.markPristine($scope.ui.inputForm, 'clusterBackupItemChanged');
 
                     var idx = _.findIndex($scope.clusters, function (cluster) {
                         return cluster._id == _id;
@@ -443,7 +431,7 @@ controlCenterModule.controller('clustersController', ['$scope', '$http',
'$timeo
 
             $confirm.show('Are you sure you want to remove cluster: "' + selectedItem.name
+ '"?').then(
                 function () {
-                    markPristine();
+                    $common.markPristine($scope.ui.inputForm, 'clusterBackupItemChanged');
 
                     var _id = selectedItem._id;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 5334239..3b18e30 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -501,37 +501,6 @@ controlCenterModule.service('$common', [
             }
         }
 
-        var win = $(window);
-
-        var stickyOffsetTop = undefined;
-
-        function configureStickyElement() {
-            var elem = $('#scrolled');
-
-            if (elem.length > 0) {
-                if (!stickyOffsetTop)
-                    stickyOffsetTop = elem.offset().top;
-
-                var cont = $('.docs-content');
-
-                var scrollSpyWidth = Math.round(cont[0].getBoundingClientRect().width);
-
-                elem.toggleClass('panel-sticky', win.scrollTop() > stickyOffsetTop);
-
-                elem.width(scrollSpyWidth);
-
-                elem.find('label').width(scrollSpyWidth - elem.find('#buttonsPnl').outerWidth()
- 1);
-            }
-        }
-
-        win.scroll(function() {
-            configureStickyElement();
-        });
-
-        win.resize(function () {
-            configureStickyElement();
-        });
-
         return {
             getModel: function (obj, field) {
                 var path = field.path;
@@ -700,8 +669,19 @@ controlCenterModule.service('$common', [
                     });
                 });
             },
-            configureStickyElement: function () {
-                configureStickyElement();
+            markChanged: function (form, item) {
+                sessionStorage.setItem(item, 'true');
+
+                form.$setDirty();
+            },
+            markPristine: function (form, item) {
+                if (isDefined(form))
+                    form.$setPristine();
+
+                sessionStorage.removeItem(item);
+            },
+            formChanged: function (form) {
+                return isDefined(form) && form.$dirty;
             }
         }
     }]);

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index 810ce93..2fe7058 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -38,10 +38,7 @@ controlCenterModule.controller('metadataController', [
             $scope.tableRemove = function (item, field, index) {
                 $table.tableRemove(item, field, index);
 
-                markChanged();
-
-                // Dirty state do not change automatically.
-                $scope.ui.inputForm.$dirty = true;
+                $common.markChanged($scope.ui.inputForm, 'metadataBackupItemChanged');
             };
 
             $scope.tableSimpleSave = $table.tableSimpleSave;
@@ -56,6 +53,8 @@ controlCenterModule.controller('metadataController', [
 
             $scope.previewInit = $preview.previewInit;
 
+            $scope.formChanged = $common.formChanged;
+
             $scope.hidePopover = $common.hidePopover;
 
             var showPopoverMessage = $common.showPopoverMessage;
@@ -179,10 +178,6 @@ controlCenterModule.controller('metadataController', [
                 sessionStorage.removeItem('metadataBackupItemChanged');
             }
 
-            function metadataChanged() {
-                return $common.isDefined($scope.ui.inputForm) && $scope.ui.inputForm.$dirty;
-            }
-
             $scope.isJavaBuildInClass = function () {
                 var item = $scope.backupItem;
 
@@ -218,19 +213,17 @@ controlCenterModule.controller('metadataController', [
 
                     $timeout(function () {
                         $common.previewHeightUpdate();
-
-                        $common.configureStickyElement();
                     });
 
                     $timeout(function () {
                         if (changed)
-                            markChanged();
+                            $common.markChanged($scope.ui.inputForm, 'metadataBackupItemChanged');
                         else
-                            markPristine();
+                            $common.markPristine($scope.ui.inputForm, 'metadataBackupItemChanged');
                     }, 50);
                 }
 
-                if (metadataChanged())
+                if ($common.formChanged($scope.ui.inputForm))
                     $confirm.show('<span>Current metadata is modified.<br/><br/>Discard
unsaved changes?</span>').then(
                         function () {
                             setSelectedAndBackupItem();
@@ -566,7 +559,7 @@ controlCenterModule.controller('metadataController', [
                             $scope.preview.queryJava = $generatorJava.metadataQuery(val).join('');
                             $scope.preview.storeJava = $generatorJava.metadataStore(val).join('');
 
-                            markChanged();
+                            $common.markChanged($scope.ui.inputForm, 'metadataBackupItemChanged');
                         }
                     }, true);
 
@@ -696,7 +689,7 @@ controlCenterModule.controller('metadataController', [
 
                 $http.post('metadata/save', item)
                     .success(function (_id) {
-                        markPristine();
+                        $common.markPristine($scope.ui.inputForm, 'metadataBackupItemChanged');
 
                         $common.showInfo('Metadata "' + item.name + '" saved.');
 
@@ -757,7 +750,7 @@ controlCenterModule.controller('metadataController', [
 
                         $http.post('metadata/remove', {_id: _id})
                             .success(function () {
-                                markPristine();
+                                $common.markPristine($scope.ui.inputForm, 'metadataBackupItemChanged');
 
                                 $common.showInfo('Cache type metadata has been removed: '
+ selectedItem.name);
 
@@ -1066,7 +1059,7 @@ controlCenterModule.controller('metadataController', [
 
                 group.fields.splice(index, 1);
 
-                markChanged();
+                $common.markChanged($scope.ui.inputForm, 'metadataBackupItemChanged');
 
                 // Dirty state do not change automatically.
                 $scope.ui.inputForm.$dirty = true;

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index c8abd89..9bc6eed 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -954,19 +954,9 @@ button .caret, .btn .caret {
     margin: 0;
 }
 
-div.panel-sticky {
+div.affix.padding-top-dflt {
     z-index: 10000;
-    position: fixed;
-    top: 0;
-    background-color: #ffffff;
-
-    border-left: 1px solid #e2e2e2;
-    border-bottom: 1px solid #e2e2e2;
-    border-right: 1px solid #e2e2e2;
-
-    margin-left: -30px;
-    margin-top: 0;
-    padding: 10px 30px 10px 29px;
+    background-color: white;
 }
 
 .panel-title a {

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/routes/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-common.js b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
index e645b76..dd96ac0 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-common.js
@@ -19,7 +19,9 @@ if (typeof window === 'undefined') {
     $dataStructures = require('../../helpers/data-structures');
 }
 
-function _addLeadingZero(numberStr, minSize) {
+$generatorCommon = {};
+
+$generatorCommon.addLeadingZero = function (numberStr, minSize) {
     if (typeof (numberStr) != 'string')
         numberStr = '' + numberStr;
 
@@ -28,21 +30,19 @@ function _addLeadingZero(numberStr, minSize) {
     }
 
     return numberStr;
-}
+};
 
-function _formatDate(date) {
-    var dd = _addLeadingZero(date.getDate(), 2);
-    var mm = _addLeadingZero(date.getMonth() + 1, 2);
+$generatorCommon.formatDate = function (date) {
+    var dd = $generatorCommon.addLeadingZero(date.getDate(), 2);
+    var mm = $generatorCommon.addLeadingZero(date.getMonth() + 1, 2);
 
     var yyyy = date.getFullYear();
 
-    return mm + '/' + dd + '/' + yyyy + ' ' + _addLeadingZero(date.getHours(), 2) + ':' +
_addLeadingZero(date.getMinutes(), 2);
-}
-
-$generatorCommon = {};
+    return mm + '/' + dd + '/' + yyyy + ' ' + $generatorCommon.addLeadingZero(date.getHours(),
2) + ':' + $generatorCommon.addLeadingZero(date.getMinutes(), 2);
+};
 
 $generatorCommon.mainComment = function mainComment() {
-    return 'This configuration was generated by Ignite Control Center (' + _formatDate(new
Date()) + ')';
+    return 'This configuration was generated by Ignite Control Center (' + $generatorCommon.formatDate(new
Date()) + ')';
 };
 
 $generatorCommon.builder = function () {
@@ -150,34 +150,49 @@ $generatorCommon.builder = function () {
     return res;
 };
 
-function _classDescriptor(className, fields) {
-    return {className: className, fields: fields}
-}
-
 $generatorCommon.EVICTION_POLICIES = {
-    LRU: _classDescriptor('org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
-        {batchSize: null, maxMemorySize: null, maxSize: null}),
-    RND: _classDescriptor('org.apache.ignite.cache.eviction.random.RandomEvictionPolicy',
-        {maxSize: null}),
-    FIFO: _classDescriptor('org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
-        {batchSize: null, maxMemorySize: null, maxSize: null}),
-    SORTED: _classDescriptor('org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy',
-        {batchSize: null, maxMemorySize: null, maxSize: null})
+    LRU: {
+        className: 'org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    },
+    RND: {
+        className: 'org.apache.ignite.cache.eviction.random.RandomEvictionPolicy',
+        fields: {maxSize: null}
+    },
+    FIFO: {
+        className: 'org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    },
+    SORTED: {
+        className: 'org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy',
+        fields: {batchSize: null, maxMemorySize: null, maxSize: null}
+    }
 };
 
 $generatorCommon.MARSHALLERS = {
-    OptimizedMarshaller: _classDescriptor('org.apache.ignite.marshaller.optimized.OptimizedMarshaller',
-        {poolSize: null, requireSerializable: null }),
-    JdkMarshaller: _classDescriptor('org.apache.ignite.marshaller.jdk.JdkMarshaller', {})
+    OptimizedMarshaller: {
+        className: 'org.apache.ignite.marshaller.optimized.OptimizedMarshaller',
+        fields: {poolSize: null, requireSerializable: null }
+    },
+    JdkMarshaller: {
+        className: 'org.apache.ignite.marshaller.jdk.JdkMarshaller',
+        fields: {}
+    }
+};
+
+$generatorCommon.JDBC_DIALECTS = {
+    Oracle: 'org.apache.ignite.cache.store.jdbc.dialect.OracleDialect',
+    DB2: 'org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect',
+    SQLServer: 'org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect',
+    MySQL: 'org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect',
+    PostgreSQL: 'org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
+    H2: 'org.apache.ignite.cache.store.jdbc.dialect.H2Dialect'
 };
 
-$generatorCommon.KNOWN_CLASSES = {
-    Oracle: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.OracleDialect',
{}),
-    DB2: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect', {}),
-    SQLServer: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect',
{}),
-    MySQL: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect', {}),
-    PostgreSQL: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect',
{}),
-    H2: _classDescriptor('org.apache.ignite.cache.store.jdbc.dialect.H2Dialect', {})
+$generatorCommon.jdbcDialectClassName = function(dialect) {
+    var dialectClsName = $generatorCommon.JDBC_DIALECTS[dialect];
+
+    return dialectClsName ? dialectClsName : 'Unknown JDBC dialect: ' + dialect;
 };
 
 $generatorCommon.DATA_SOURCES = {
@@ -190,66 +205,62 @@ $generatorCommon.DATA_SOURCES = {
 };
 
 $generatorCommon.STORE_FACTORIES = {
-    CacheJdbcPojoStoreFactory: _classDescriptor('org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory',
-        {dataSourceBean: null, dialect: {type: 'className'}}),
-    CacheJdbcBlobStoreFactory: _classDescriptor('org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory',
-        {user: null, dataSourceBean: null, initSchema: null, createTableQuery: null, loadQuery:
null, insertQuery: null, updateQuery: null, deleteQuery: null}),
-    CacheHibernateBlobStoreFactory: _classDescriptor('org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory',
-        {hibernateProperties: {type: 'propertiesAsList', propVarName: 'props'}})
+    CacheJdbcPojoStoreFactory: {
+        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory',
+        fields: {dataSourceBean: null, dialect: {type: 'jdbcDialect'}}
+    },
+    CacheJdbcBlobStoreFactory: {
+        className: 'org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory',
+        fields: {
+            user: null,
+            dataSourceBean: null,
+            initSchema: null,
+            createTableQuery: null,
+            loadQuery: null,
+            insertQuery: null,
+            updateQuery: null,
+            deleteQuery: null
+        }
+    },
+    CacheHibernateBlobStoreFactory: {
+        className: 'org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory',
+        fields: {hibernateProperties: {type: 'propertiesAsList', propVarName: 'props'}}
+    }
 };
 
-$generatorCommon.ATOMIC_CONFIGURATION = _classDescriptor('org.apache.ignite.configuration.AtomicConfiguration',
-    {backups: null, cacheMode: {type: 'enum', enumClass: 'CacheMode'}, atomicSequenceReserveSize:
null});
+$generatorCommon.ATOMIC_CONFIGURATION = {
+    className: 'org.apache.ignite.configuration.AtomicConfiguration',
+    fields: {
+        backups: null,
+        cacheMode: {type: 'enum', enumClass: 'org.apache.ignite.cache.CacheMode'},
+        atomicSequenceReserveSize: null
+    }
+};
 
-$generatorCommon.SWAP_SPACE_SPI = _classDescriptor('org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi',
-    {baseDirectory: null, readStripesNumber: null, maximumSparsity: {type: 'float'}, maxWriteQueueSize:
null, writeBufferSize: null});
+$generatorCommon.SWAP_SPACE_SPI = {
+    className: 'org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi',
+    fields: {
+        baseDirectory: null,
+        readStripesNumber: null,
+        maximumSparsity: {type: 'float'},
+        maxWriteQueueSize: null,
+        writeBufferSize: null
+    }
+};
 
-$generatorCommon.TRANSACTION_CONFIGURATION = _classDescriptor('org.apache.ignite.configuration.TransactionConfiguration',
-    {
-        defaultTxConcurrency: {type: 'enum', enumClass: 'TransactionConcurrency'},
-        transactionIsolation: {type: 'TransactionIsolation', setterName: 'defaultTxIsolation'},
+$generatorCommon.TRANSACTION_CONFIGURATION = {
+    className: 'org.apache.ignite.configuration.TransactionConfiguration',
+    fields: {
+        defaultTxConcurrency: {type: 'enum', enumClass: 'org.apache.ignite.transactions.TransactionConcurrency'},
+        transactionIsolation: {
+            type: 'org.apache.ignite.transactions.TransactionIsolation',
+            setterName: 'defaultTxIsolation'
+        },
         defaultTxTimeout: null,
         pessimisticTxLogLinger: null,
         pessimisticTxLogSize: null,
-        txSerializableEnabled: null}
-);
-
-/**
- * Generate properties file with properties stubs for stores data sources.
- *
- * @param cluster Configuration to process.
- * @returns {string} Generated content.
- */
-$generatorCommon.generateProperties = function (cluster) {
-    var res = exports.builder();
-
-    var datasources = [];
-
-    if (cluster.caches && cluster.caches.length > 0) {
-        _.forEach(cluster.caches, function (cache) {
-            if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
-                var storeFactory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
-
-                if (storeFactory.dialect) {
-                    var beanId = storeFactory.dataSourceBean;
-
-                    if (!_.contains(datasources, beanId)) {
-                        datasources.push(beanId);
-
-                        res.line(beanId + '.jdbc.url=YOUR_JDBC_URL');
-                        res.line(beanId + '.jdbc.username=YOUR_USER_NAME');
-                        res.line(beanId + '.jdbc.password=YOUR_PASSWORD');
-                        res.line();
-                    }
-                }
-            }
-        });
+        txSerializableEnabled: null
     }
-
-    if (datasources.length > 0)
-        return '# ' + mainComment() + '\n\n' + res.join('');
-
-    return undefined;
 };
 
 if (typeof window === 'undefined') {

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/routes/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-java.js b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
index d3e7752..115bdba 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-java.js
@@ -328,9 +328,11 @@ $generatorJava._addBeanWithProperties = function (res, varName, bean,
beanPropNa
                             }
                             break;
 
-                        case 'className':
+                        case 'jdbcDialect':
                             if (bean[propName]) {
-                                res.line(beanVarName + '.' + $generatorJava._setterName(propName)
+ '(new ' + $generatorCommon.KNOWN_CLASSES[bean[propName]].className + '());');
+                                var jdbcDialectClsName = res.importClass($generatorCommon.jdbcDialectClassName(bean[propName]));
+
+                                res.line(beanVarName + '.' + $generatorJava._setterName(propName)
+ '(new ' + jdbcDialectClsName + '());');
                             }
 
                             break;
@@ -819,38 +821,41 @@ $generatorJava.cacheStore = function (cache, varName, res) {
 
     if (cache.cacheStoreFactory && cache.cacheStoreFactory.kind) {
         var storeFactory = cache.cacheStoreFactory[cache.cacheStoreFactory.kind];
-        var data = $generatorCommon.STORE_FACTORIES[cache.cacheStoreFactory.kind];
 
-        var sfVarName = $generatorJava._toJavaName('storeFactory', cache.name);
-        var dsVarName = 'none';
+        if (storeFactory) {
+            var storeFactoryDesc = $generatorCommon.STORE_FACTORIES[cache.cacheStoreFactory.kind];
 
-        if (storeFactory.dialect) {
-            var dataSourceBean = storeFactory.dataSourceBean;
+            var sfVarName = $generatorJava._toJavaName('storeFactory', cache.name);
+            var dsVarName = 'none';
 
-            dsVarName = $generatorJava._toJavaName('dataSource', dataSourceBean);
+            if (storeFactory.dialect) {
+                var dataSourceBean = storeFactory.dataSourceBean;
 
-            if (!_.contains(res.datasources, dataSourceBean)) {
-                res.datasources.push(dataSourceBean);
+                dsVarName = $generatorJava._toJavaName('dataSource', dataSourceBean);
 
-                var dataSource = $generatorCommon.DATA_SOURCES[storeFactory.dialect];
+                if (!_.contains(res.datasources, dataSourceBean)) {
+                    res.datasources.push(dataSourceBean);
 
-                res.line();
+                    var dataSource = $generatorCommon.DATA_SOURCES[storeFactory.dialect];
 
-                $generatorJava._declareVariable(res, true, dsVarName, dataSource);
+                    res.line();
 
-                res.line(dsVarName + '.setURL(_URL_);');
-                res.line(dsVarName + '.setUsername(_User_Name_);');
-                res.line(dsVarName + '.setPassword(_Password_);');
+                    $generatorJava._declareVariable(res, true, dsVarName, dataSource);
+
+                    res.line(dsVarName + '.setURL(_URL_);');
+                    res.line(dsVarName + '.setUsername(_User_Name_);');
+                    res.line(dsVarName + '.setPassword(_Password_);');
+                }
             }
-        }
 
-        $generatorJava._addBeanWithProperties(res, varName, storeFactory, 'cacheStoreFactory',
sfVarName, data.className,
-            data.fields, true);
+            $generatorJava._addBeanWithProperties(res, varName, storeFactory, 'cacheStoreFactory',
sfVarName,
+                storeFactoryDesc.className, storeFactoryDesc.fields, true);
 
-        if (dsVarName != 'none')
-            res.line(sfVarName + '.setDataSource(' + dsVarName + ');');
+            if (dsVarName != 'none')
+                res.line(sfVarName + '.setDataSource(' + dsVarName + ');');
 
-        res.needEmptyLine = true;
+            res.needEmptyLine = true;
+        }
     }
 
     $generatorJava._addProperty(res, varName, cache, 'loadPreviousValue');

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
index cdef916..005fbcf 100644
--- a/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/generator-xml.js
@@ -111,10 +111,10 @@ $generatorXml._addBeanWithProperties = function (res, bean, beanPropName,
beanCl
                     if (descr.type == 'list') {
                         $generatorXml._addListProperty(res, bean, propName, descr.setterName);
                     }
-                    else if (descr.type == 'className') {
+                    else if (descr.type == 'jdbcDialect') {
                         if (bean[propName]) {
                             res.startBlock('<property name="' + propName + '">');
-                            res.line('<bean class="' + $generatorCommon.KNOWN_CLASSES[bean[propName]].className
+ '"/>');
+                            res.line('<bean class="' + $generatorCommon.jdbcDialectClassName(bean[propName])
+ '"/>');
                             res.endBlock('</property>');
                         }
                     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/views/configuration/caches.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/caches.jade b/modules/control-center-web/src/main/js/views/configuration/caches.jade
index 3abb011..1ae37dc 100644
--- a/modules/control-center-web/src/main/js/views/configuration/caches.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/caches.jade
@@ -28,16 +28,14 @@ block content
     .docs-body(ng-controller='cachesController')
         +block-callout('{{screenTip.workflowTitle}}', 'joinTip(screenTip.workflowContent)',
'{{screenTip.whatsNextTitle}}', 'joinTip(screenTip.whatsNextContent)')
         +main-table('Caches:', 'caches', 'cacheName', 'selectItem(row)', '{{$index + 1}})
{{row.name}}, {{row.mode | displayValue:modes:"Cache mode not set"}}, {{row.atomicityMode
| displayValue:atomicities:"Cache atomicity not set"}}')
-        .padding-top-dflt
-            button.btn.btn-primary(ng-click='createItem()') Add cache
-        hr
+        .padding-top-dflt(bs-affix)
+            button.btn.btn-primary(ng-click='createItem()') New
+            button.btn.btn-primary(ng-disabled='!formChanged(ui.inputForm)' ng-click='saveItem()')
Save
+            button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()') Copy
+            button.btn.btn-primary(ng-show='backupItem._id' ng-click='removeItem()') Remove
+            //label {{ui.formTitle}}
+            hr
         form.form-horizontal(name='ui.inputForm' ng-if='backupItem' novalidate)
-            .section-top(id='scrolled')
-                label {{ui.formTitle}}
-                span(id='buttonsPnl')
-                    button.btn.btn-primary(ng-click='saveItem()') Save
-                    button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()')
Copy
-                    button.btn.btn-primary(ng-show='backupItem._id' ng-click='removeItem()')
Remove
             .panel-group(bs-collapse ng-model='panels.activePanels' data-allow-multiple='true')
                 +groups('general', 'backupItem')
                 div(ng-show='ui.expanded')

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/views/configuration/clusters.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/clusters.jade b/modules/control-center-web/src/main/js/views/configuration/clusters.jade
index c4c2428..aa1c22c 100644
--- a/modules/control-center-web/src/main/js/views/configuration/clusters.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/clusters.jade
@@ -28,19 +28,14 @@ block content
     .docs-body(ng-controller='clustersController')
         +block-callout('{{screenTip.workflowTitle}}', 'joinTip(screenTip.workflowContent)',
'{{screenTip.whatsNextTitle}}', 'joinTip(screenTip.whatsNextContent)')
         +main-table('Clusters:', 'clusters', 'clusterName', 'selectItem(row)', '{{$index
+ 1}}) {{row.name}}, {{row.discovery.kind | displayValue:discoveries:"Discovery not set"}}')
-        .padding-top-dflt
-            button.btn.btn-primary(ng-click='createItem()') Add cluster
-            label(style='margin-left: 10px; margin-right: 10px') Use template:
-            button.form-control.line-control(ng-model='template' bs-options='item.value as
item.label for item in templates' bs-select)
-            i.tipLabel.fa.fa-question-circle(bs-tooltip data-title='{{joinTip(templateTip)}}'
type='button')
-        hr
+        .padding-top-dflt(bs-affix)
+            button.btn.btn-primary(ng-click='createItem()') New
+            button.btn.btn-primary(ng-disabled='!formChanged(ui.inputForm)' ng-click='saveItem()')
Save
+            button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()') Copy
+            button.btn.btn-primary(ng-show='backupItem._id' ng-click='removeItem()') Remove
+            //label {{ui.formTitle}}
+            hr
         form.form-horizontal(name='ui.inputForm' ng-if='backupItem' novalidate)
-            .section-top(id='scrolled')
-                label {{ui.formTitle}}
-                span(id='buttonsPnl')
-                    button.btn.btn-primary(ng-click='saveItem()') Save
-                    button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()')
Copy
-                    button.btn.btn-primary(ng-show='backupItem._id' ng-click='removeItem()')
Remove
             .panel-group(bs-collapse ng-model='panels.activePanels' data-allow-multiple='true'
ng-click='triggerDigest = true')
                 +groups('general', 'backupItem')
                 div(ng-show='ui.expanded')

http://git-wip-us.apache.org/repos/asf/ignite/blob/c5aa8f33/modules/control-center-web/src/main/js/views/configuration/metadata.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/metadata.jade b/modules/control-center-web/src/main/js/views/configuration/metadata.jade
index 12e79f1..c2e70f8 100644
--- a/modules/control-center-web/src/main/js/views/configuration/metadata.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/metadata.jade
@@ -28,16 +28,14 @@ block content
     .docs-body(ng-controller='metadataController')
         +block-callout('{{screenTip.workflowTitle}}', 'joinTip(screenTip.workflowContent)',
'{{screenTip.whatsNextTitle}}', 'joinTip(screenTip.whatsNextContent)')
         +main-table('Types metadata:', 'metadatas', 'metadataName', 'selectItem(row)', '{{$index
+ 1}}) {{row.name}}')
-        .padding-top-dflt
-            button.btn.btn-primary(ng-click='createItem()') Add metadata
+        .padding-top-dflt(bs-affix)
+            button.btn.btn-primary(ng-click='createItem()') New
             button.btn.btn-primary(ng-click='showLoadMetadataModal()') Load from database
-        hr
+            button.btn.btn-primary(ng-disabled='!formChanged(ui.inputForm)' ng-click='saveItem()')
Save
+            button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()') Copy
+            button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()')
Remove
+            //label {{ui.formTitle}}
+            hr
         form.form-horizontal(name='ui.inputForm' ng-if='backupItem' novalidate)
-            .section-top(id='scrolled')
-                label {{ui.formTitle}}
-                span(id='buttonsPnl')
-                    button.btn.btn-primary(ng-click='saveItem()') Save
-                    button.btn.btn-primary(ng-show='backupItem._id' ng-click='saveItemAs()')
Copy
-                    button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()')
Remove
             .panel-group(bs-collapse ng-model='panels.activePanels' data-allow-multiple='true')
                 +groups('metadata', 'backupItem')


Mime
View raw message