ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [22/50] [abbrv] ignite git commit: IGNITE-2840 Refactoring to mixins.
Date Mon, 28 Mar 2016 08:48:02 GMT
http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/transactions.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/transactions.jade
b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/transactions.jade
index b241e45..872b46c 100644
--- a/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/transactions.jade
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/clusters/transactions.jade
@@ -14,6 +14,8 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 
+include ../../../../../app/helpers/jade/mixins.jade
+
 - var model = 'backupItem.transactionConfiguration'
 
 form.panel.panel-default(name='transactionConfiguration' novalidate)
@@ -27,95 +29,30 @@ form.panel.panel-default(name='transactionConfiguration' novalidate)
         .panel-body(ng-if='__show__')
             .col-sm-6
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Concurrency
-                        ignite-form-field-tooltip
-                            | Cache transaction concurrency to use when one is not explicitly
specified
-                        ignite-form-field-dropdown(
-                            data-id='defaultTxConcurrency'
-                            data-name='defaultTxConcurrency'
-                            data-options='[\
-                                {value: "OPTIMISTIC", label: "OPTIMISTIC"},\
-                                {value: "PESSIMISTIC", label: "PESSIMISTIC"}\
-                            ]'
-                            data-ng-model='#{model}.defaultTxConcurrency'
-                            data-placeholder='PESSIMISTIC'
-                        )
+                    +dropdown('Concurrency:', model + '.defaultTxConcurrency', 'defaultTxConcurrency',
'true', 'PESSIMISTIC',
+                        '[\
+                            {value: "OPTIMISTIC", label: "OPTIMISTIC"},\
+                            {value: "PESSIMISTIC", label: "PESSIMISTIC"}\
+                        ]',
+                        'Cache transaction concurrency to use when one is not explicitly
specified')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Isolation
-                        ignite-form-field-tooltip
-                            | Default transaction isolation
-                        ignite-form-field-dropdown(
-                            data-id='defaultTxIsolation'
-                            data-name='defaultTxIsolation'
-                            data-options='[\
-                                {value: "READ_COMMITTED", label: "READ_COMMITTED"},\
-                                {value: "REPEATABLE_READ", label: "REPEATABLE_READ"},\
-                                {value: "SERIALIZABLE", label: "SERIALIZABLE"}\
-                            ]'
-                            data-ng-model='#{model}.defaultTxIsolation'
-                            data-placeholder='REPEATABLE_READ'
-                        )
+                    +dropdown('Isolation:', model + '.defaultTxIsolation', 'defaultTxIsolation',
'true', 'REPEATABLE_READ',
+                        '[\
+                            {value: "READ_COMMITTED", label: "READ_COMMITTED"},\
+                            {value: "REPEATABLE_READ", label: "REPEATABLE_READ"},\
+                            {value: "SERIALIZABLE", label: "SERIALIZABLE"}\
+                        ]',
+                        'Default transaction isolation')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Default timeout
-                        ignite-form-field-tooltip
-                            | Default transaction timeout
-                        ignite-form-field-input-number(
-                            data-id='defaultTxTimeout'
-                            data-name='defaultTxTimeout'
-                            data-ng-model='#{model}.defaultTxTimeout'
-                            data-placeholder='0'
-                        )
+                    +number('Default timeout:', model + '.defaultTxTimeout', 'defaultTxTimeout',
'true', '0', '0', 'Default transaction timeout')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Pessimistic log cleanup delay
-                        ignite-form-field-tooltip
-                            | Delay, in milliseconds, after which pessimistic recovery entries
will be cleaned up for failed node
-                        ignite-form-field-input-number(
-                            data-id='pessimisticTxLogLinger'
-                            data-name='pessimisticTxLogLinger'
-                            data-ng-model='#{model}.pessimisticTxLogLinger'
-                            data-placeholder='10000'
-                        )
+                    +number('Pessimistic log cleanup delay:', model + '.pessimisticTxLogLinger',
'pessimisticTxLogLinger', 'true', '10000', '0',
+                        'Delay, in milliseconds, after which pessimistic recovery entries
will be cleaned up for failed node')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Pessimistic log size
-                        ignite-form-field-tooltip
-                            | Size of pessimistic transactions log stored on node in order
to recover transaction commit if originating node has left grid before it has sent all messages
to transaction nodes
-                        ignite-form-field-input-number(
-                            data-id='pessimisticTxLogSize'
-                            data-name='pessimisticTxLogSize'
-                            data-ng-model='#{model}.pessimisticTxLogSize'
-                            data-placeholder='0'
-                        )
+                    +number('Pessimistic log size:', model + '.pessimisticTxLogSize', 'pessimisticTxLogSize',
'true', '0', '0',
+                        'Size of pessimistic transactions log stored on node in order to
recover transaction commit if originating node has left grid before it has sent all messages
to transaction nodes')
                 .settings-row
-                    ignite-form-field
-                        ignite-form-field-label
-                            | Manager factory
-                        ignite-form-field-tooltip 
-                            | Class name of transaction manager factory for integration with
JEE app servers
-                        ignite-form-field-java-class(
-                            data-id='txManagerFactory'
-                            data-name='txManagerFactory'
-                            data-ng-model='#{model}.txManagerFactory'
-                            data-placeholder='Enter fully qualified class name'
-                        )
-            ignite-ui-ace-tabs.col-sm-6
-                .preview-panel(ng-init='mode = false')
-                    .preview-legend
-                        a(ng-class='{active: !mode, inactive: mode}' ng-click='mode = false')
XML
-                        |  
-                        a(ng-class='{active: mode, inactive: !mode}' ng-click='mode = true')
Java
-                    .preview-content(ng-if='mode')
-                        ignite-ui-ace-java(data-master='backupItem' data-generator='clusterTransactions'
ng-model='$parent.data')
-                    .preview-content(ng-if='!mode')
-                        ignite-ui-ace-xml(data-master='backupItem' data-generator='clusterTransactions'
ng-model='$parent.data')
-                    .preview-content-empty(ng-if='!data')
-                        label All Defaults
+                    +java-class('Manager factory:', model + '.txManagerFactory', 'txManagerFactory',
'true', 'false',
+                        'Class name of transaction manager factory for integration with JEE
app servers')
+            .col-sm-6
+                +preview-xml-java(model, 'clusterTransactions')

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/app/modules/states/configuration/preview-panel.directive.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/states/configuration/preview-panel.directive.js
b/modules/control-center-web/src/main/js/app/modules/states/configuration/preview-panel.directive.js
new file mode 100644
index 0000000..fb67326
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/states/configuration/preview-panel.directive.js
@@ -0,0 +1,239 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import ace from 'ace';
+
+export default ['previewPanel', ['$interval', '$timeout', ($interval, $timeout) => {
+    let animation = {editor: null, stage: 0, start: 0, stop: 0};
+    let prevContent = [];
+
+    const Range = ace.require('ace/range').Range;
+
+    const _clearSelection = (editor) => {
+        _.forEach(editor.session.getMarkers(false), (marker) => {
+            editor.session.removeMarker(marker.id);
+        });
+    };
+
+    /**
+     * Switch to next stage of animation.
+     */
+    const _animate = () => {
+        animation.stage += animation.step;
+
+        const stage = animation.stage;
+        const editor = animation.editor;
+
+        _clearSelection(editor);
+
+        animation.selections.forEach((selection) => {
+            editor.session.addMarker(new Range(selection.start, 0, selection.stop, 0),
+                'preview-highlight-' + stage, 'line', false);
+        });
+
+        if (stage === animation.finalStage) {
+            editor.animatePromise = null;
+
+            if (animation.clearOnFinal)
+                _clearSelection(editor);
+        }
+    };
+
+    /**
+     * Selection with animation.
+     *
+     * @param editor Editor to show selection animation.
+     * @param selections Array of selection intervals.
+     * @param step Step of animation (1 or -1).
+     * @param stage Start stage of animation.
+     * @param finalStage Final stage of animation.
+     * @param clearOnFinal Boolean flat to clear selection on animation finish.
+     */
+    const _fade = (editor, selections, step, stage, finalStage, clearOnFinal) => {
+        const promise = editor.animatePromise;
+
+        if (promise) {
+            $interval.cancel(promise);
+
+            _clearSelection(editor);
+        }
+
+        animation = {editor, selections, step, stage, finalStage, clearOnFinal};
+
+        editor.animatePromise = $interval(_animate, 100, 10, false);
+    };
+
+    /**
+     * Show selections with animation.
+     *
+     * @param editor Editor to show selection.
+     * @param selections Array of selection intervals.
+     */
+    const _fadeIn = (editor, selections) => {
+        _fade(editor, selections, 1, 0, 10, false);
+    };
+
+    /**
+     * Hide selections with animation.
+     *
+     * @param editor Editor to show selection.
+     * @param selections Array of selection intervals.
+     */
+    const _fadeOut = (editor, selections) => {
+        _fade(editor, selections, -1, 10, 0, true);
+    };
+
+    const onChange = ([content, editor]) => {
+        const {clearPromise} = editor;
+        const {lines} = content;
+
+        if (content.action === 'remove')
+            prevContent = lines;
+        else if (prevContent.length > 0 && lines.length > 0 && editor.attractAttention)
{
+            if (clearPromise) {
+                $timeout.cancel(clearPromise);
+
+                _clearSelection(editor);
+            }
+
+            const selections = [];
+
+            let newIx = 0;
+            let prevIx = 0;
+
+            let prevLen = prevContent.length - (prevContent[prevContent.length - 1] === ''
? 1 : 0);
+            let newLen = lines.length - (lines[lines.length - 1] === '' ? 1 : 0);
+
+            const removed = newLen < prevLen;
+
+            let skipEnd = 0;
+
+            let selected = false;
+            let scrollTo = -1;
+
+            while (lines[newLen - 1] === prevContent[prevLen - 1] && newLen >
0 && prevLen > 0) {
+                prevLen -= 1;
+                newLen -= 1;
+
+                skipEnd += 1;
+            }
+
+            while (newIx < newLen || prevIx < prevLen) {
+                let start = -1;
+                let stop = -1;
+
+                // Find an index of a first line with different text.
+                for (; (newIx < newLen || prevIx < prevLen) && start < 0;
newIx++, prevIx++) {
+                    if (newIx >= newLen || prevIx >= prevLen || lines[newIx] !== prevContent[prevIx])
{
+                        start = newIx;
+
+                        break;
+                    }
+                }
+
+                if (start >= 0) {
+                    // Find an index of a last line with different text by checking last
string of old and new content in reverse order.
+                    for (let i = start; i < newLen && stop < 0; i++) {
+                        for (let j = prevIx; j < prevLen && stop < 0; j++)
{
+                            if (lines[i] === prevContent[j] && lines[i] !== '') {
+                                stop = i;
+
+                                newIx = i;
+                                prevIx = j;
+
+                                break;
+                            }
+                        }
+                    }
+
+                    if (stop < 0) {
+                        stop = newLen;
+
+                        newIx = newLen;
+                        prevIx = prevLen;
+                    }
+
+                    if (start === stop) {
+                        if (removed)
+                            start = Math.max(0, start - 1);
+
+                        stop = Math.min(newLen + skipEnd, stop + 1);
+                    }
+
+                    if (start <= stop) {
+                        selections.push({start, stop});
+
+                        if (!selected)
+                            scrollTo = start;
+
+                        selected = true;
+                    }
+                }
+            }
+
+            // Run clear selection one time.
+            if (selected) {
+                _fadeIn(editor, selections);
+
+                editor.clearPromise = $timeout(() => {
+                    _fadeOut(editor, selections);
+
+                    editor.clearPromise = null;
+                }, 2000);
+
+                editor.scrollToRow(scrollTo);
+            }
+
+            prevContent = [];
+        }
+        else
+            editor.attractAttention = true;
+    };
+
+
+    const link = (scope, $element, $attrs, [igniteUiAceTabs1, igniteUiAceTabs2]) => {
+        const igniteUiAceTabs = igniteUiAceTabs1 || igniteUiAceTabs2;
+
+        if (!igniteUiAceTabs)
+            return;
+
+        igniteUiAceTabs.onLoad = (editor) => {
+            editor.setReadOnly(true);
+            editor.setOption('highlightActiveLine', false);
+            editor.setAutoScrollEditorIntoView(true);
+            editor.$blockScrolling = Infinity;
+            editor.attractAttention = false;
+
+            const renderer = editor.renderer;
+
+            renderer.setHighlightGutterLine(false);
+            renderer.setShowPrintMargin(false);
+            renderer.setOption('fontSize', '10px');
+            renderer.setOption('maxLines', '50');
+
+            editor.setTheme('ace/theme/chrome');
+        };
+
+        igniteUiAceTabs.onChange = onChange;
+    };
+
+    return {
+        restrict: 'C',
+        link,
+        require: ['?igniteUiAceTabs', '?^igniteUiAceTabs']
+    };
+}]];

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/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 9469305..e39be4f 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
@@ -263,7 +263,12 @@ consoleModule.controller('clustersController', [
                     msg = errors[firstErrorKey][0].$errorMessages[actualError.$name][firstErrorKey];
                 }
                 catch(ignored) {
-                    msg = 'Invalid value';
+                    try {
+                        msg = form[firstError.$name].$errorMessages[actualError.$name][firstErrorKey];
+                    }
+                    catch(ignited) {
+                        // No-op.
+                    }
                 }
 
                 return showPopoverMessage($scope.ui, firstError.$name, actualError.$name,
msg);

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
index 45fa410..fe65b45 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-java.js
@@ -631,12 +631,10 @@ $generatorJava.clusterGeneral = function (cluster, clientNearCfg, res)
{
 };
 
 // Generate atomics group.
-$generatorJava.clusterAtomics = function (cluster, res) {
+$generatorJava.clusterAtomics = function (atomics, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    var atomics = cluster.atomicConfiguration;
-
     if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize',
'backups'])) {
         res.startSafeBlock();
 
@@ -667,12 +665,10 @@ $generatorJava.clusterAtomics = function (cluster, res) {
 };
 
 // Generate binary group.
-$generatorJava.clusterBinary = function (cluster, res) {
+$generatorJava.clusterBinary = function (binary, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    var binary = cluster.binaryConfiguration;
-
     if ($generatorCommon.binaryIsDefined(binary)) {
         var varName = 'binary';
 
@@ -808,19 +804,19 @@ $generatorJava.clusterCommunication = function (cluster, res) {
 };
 
 // Generate REST access group.
-$generatorJava.clusterConnector = function (cluster, res) {
+$generatorJava.clusterConnector = function (connector, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
+    if ($commonUtils.isDefined(connector) && connector.enabled) {
         var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
 
-        if (cluster.connector.sslEnabled) {
+        if (connector.sslEnabled) {
             cfg.fields.sslClientAuth = {dflt: false};
             cfg.fields.sslFactory = {type: 'bean'};
         }
 
-        $generatorJava.beanProperty(res, 'cfg', cluster.connector, 'connectorConfiguration',
'clientCfg',
+        $generatorJava.beanProperty(res, 'cfg', connector, 'connectorConfiguration', 'clientCfg',
             cfg.className, cfg.fields, true);
 
         res.needEmptyLine = true;
@@ -860,54 +856,56 @@ $generatorJava.clusterDiscovery = function (disco, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorJava.property(res, 'discovery', disco, 'localAddress');
-    $generatorJava.property(res, 'discovery', disco, 'localPort', null, null, 47500);
-    $generatorJava.property(res, 'discovery', disco, 'localPortRange', null, null, 100);
+    if (disco) {
+        $generatorJava.property(res, 'discovery', disco, 'localAddress');
+        $generatorJava.property(res, 'discovery', disco, 'localPort', null, null, 47500);
+        $generatorJava.property(res, 'discovery', disco, 'localPortRange', null, null, 100);
 
-    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'addressResolver', 'addressResolver',
disco.addressResolver, {}, true);
-        res.needEmptyLine = false;
-    }
+        if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver)) {
+            $generatorJava.beanProperty(res, 'discovery', disco, 'addressResolver', 'addressResolver',
disco.addressResolver, {}, true);
+            res.needEmptyLine = false;
+        }
 
-    $generatorJava.property(res, 'discovery', disco, 'socketTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'ackTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'maxAckTimeout', null, null, 600000);
-    $generatorJava.property(res, 'discovery', disco, 'networkTimeout', null, null, 5000);
-    $generatorJava.property(res, 'discovery', disco, 'joinTimeout', null, null, 0);
-    $generatorJava.property(res, 'discovery', disco, 'threadPriority', null, null, 10);
-    $generatorJava.property(res, 'discovery', disco, 'heartbeatFrequency', null, null, 2000);
-    $generatorJava.property(res, 'discovery', disco, 'maxMissedHeartbeats', null, null, 1);
-    $generatorJava.property(res, 'discovery', disco, 'maxMissedClientHeartbeats', null, null,
5);
-    $generatorJava.property(res, 'discovery', disco, 'topHistorySize', null, null, 1000);
-
-    if ($commonUtils.isDefinedAndNotEmpty(disco.listener)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'listener', 'listener', disco.listener,
{}, true);
-        res.needEmptyLine = false;
-    }
+        $generatorJava.property(res, 'discovery', disco, 'socketTimeout', null, null, 5000);
+        $generatorJava.property(res, 'discovery', disco, 'ackTimeout', null, null, 5000);
+        $generatorJava.property(res, 'discovery', disco, 'maxAckTimeout', null, null, 600000);
+        $generatorJava.property(res, 'discovery', disco, 'networkTimeout', null, null, 5000);
+        $generatorJava.property(res, 'discovery', disco, 'joinTimeout', null, null, 0);
+        $generatorJava.property(res, 'discovery', disco, 'threadPriority', null, null, 10);
+        $generatorJava.property(res, 'discovery', disco, 'heartbeatFrequency', null, null,
2000);
+        $generatorJava.property(res, 'discovery', disco, 'maxMissedHeartbeats', null, null,
1);
+        $generatorJava.property(res, 'discovery', disco, 'maxMissedClientHeartbeats', null,
null, 5);
+        $generatorJava.property(res, 'discovery', disco, 'topHistorySize', null, null, 1000);
+
+        if ($commonUtils.isDefinedAndNotEmpty(disco.listener)) {
+            $generatorJava.beanProperty(res, 'discovery', disco, 'listener', 'listener',
disco.listener, {}, true);
+            res.needEmptyLine = false;
+        }
 
-    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'dataExchange', 'dataExchange',
disco.dataExchange, {}, true);
-        res.needEmptyLine = false;
-    }
+        if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange)) {
+            $generatorJava.beanProperty(res, 'discovery', disco, 'dataExchange', 'dataExchange',
disco.dataExchange, {}, true);
+            res.needEmptyLine = false;
+        }
 
-    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'metricsProvider', 'metricsProvider',
disco.metricsProvider, {}, true);
-        res.needEmptyLine = false;
-    }
+        if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider)) {
+            $generatorJava.beanProperty(res, 'discovery', disco, 'metricsProvider', 'metricsProvider',
disco.metricsProvider, {}, true);
+            res.needEmptyLine = false;
+        }
 
-    $generatorJava.property(res, 'discovery', disco, 'reconnectCount', null, null, 10);
-    $generatorJava.property(res, 'discovery', disco, 'statisticsPrintFrequency', null, null,
0);
-    $generatorJava.property(res, 'discovery', disco, 'ipFinderCleanFrequency', null, null,
60000);
+        $generatorJava.property(res, 'discovery', disco, 'reconnectCount', null, null, 10);
+        $generatorJava.property(res, 'discovery', disco, 'statisticsPrintFrequency', null,
null, 0);
+        $generatorJava.property(res, 'discovery', disco, 'ipFinderCleanFrequency', null,
null, 60000);
 
-    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator)) {
-        $generatorJava.beanProperty(res, 'discovery', disco, 'authenticator', 'authenticator',
disco.authenticator, {}, true);
-        res.needEmptyLine = false;
-    }
+        if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator)) {
+            $generatorJava.beanProperty(res, 'discovery', disco, 'authenticator', 'authenticator',
disco.authenticator, {}, true);
+            res.needEmptyLine = false;
+        }
 
-    $generatorJava.property(res, 'discovery', disco, 'forceServerMode', null, null, false);
-    $generatorJava.property(res, 'discovery', disco, 'clientReconnectDisabled', null, null,
false);
+        $generatorJava.property(res, 'discovery', disco, 'forceServerMode', null, null, false);
+        $generatorJava.property(res, 'discovery', disco, 'clientReconnectDisabled', null,
null, false);
 
-    res.needEmptyLine = true;
+        res.needEmptyLine = true;
+    }
 
     return res;
 };
@@ -1059,11 +1057,11 @@ $generatorJava.clusterPools = function (cluster, res) {
 };
 
 // Generate transactions group.
-$generatorJava.clusterTransactions = function (cluster, res) {
+$generatorJava.clusterTransactions = function (transactionConfiguration, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorJava.beanProperty(res, 'cfg', cluster.transactionConfiguration, 'transactionConfiguration',
+    $generatorJava.beanProperty(res, 'cfg', transactionConfiguration, 'transactionConfiguration',
         'transactionConfiguration', $generatorCommon.TRANSACTION_CONFIGURATION.className,
         $generatorCommon.TRANSACTION_CONFIGURATION.fields, false);
 
@@ -2474,13 +2472,13 @@ $generatorJava.igfsMisc = function(igfs, varName, res) {
 $generatorJava.clusterConfiguration = function (cluster, clientNearCfg, res) {
     $generatorJava.clusterGeneral(cluster, clientNearCfg, res);
 
-    $generatorJava.clusterAtomics(cluster, res);
+    $generatorJava.clusterAtomics(cluster.atomicConfiguration, res);
 
-    $generatorJava.clusterBinary(cluster, res);
+    $generatorJava.clusterBinary(cluster.binaryConfiguration, res);
 
     $generatorJava.clusterCommunication(cluster, res);
 
-    $generatorJava.clusterConnector(cluster, res);
+    $generatorJava.clusterConnector(cluster.connector, res);
 
     $generatorJava.clusterDeployment(cluster, res);
 
@@ -2496,7 +2494,7 @@ $generatorJava.clusterConfiguration = function (cluster, clientNearCfg,
res) {
 
     $generatorJava.clusterPools(cluster, res);
 
-    $generatorJava.clusterTransactions(cluster, res);
+    $generatorJava.clusterTransactions(cluster.transactionConfiguration, res);
 
     var isSrvCfg = !$commonUtils.isDefined(clientNearCfg);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
index 3cb7ed2..64c5bd5 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-xml.js
@@ -485,12 +485,10 @@ $generatorXml.clusterGeneral = function (cluster, res) {
 };
 
 // Generate atomics group.
-$generatorXml.clusterAtomics = function (cluster, res) {
+$generatorXml.clusterAtomics = function (atomics, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    var atomics = cluster.atomicConfiguration;
-
     if ($commonUtils.hasAtLeastOneProperty(atomics, ['cacheMode', 'atomicSequenceReserveSize',
'backups'])) {
         res.startSafeBlock();
 
@@ -523,19 +521,17 @@ $generatorXml.clusterAtomics = function (cluster, res) {
 };
 
 // Generate binary group.
-$generatorXml.clusterBinary = function (cluster, res) {
+$generatorXml.clusterBinary = function (binary, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    var binary = cluster.binaryConfiguration;
-
     if ($generatorCommon.binaryIsDefined(binary)) {
         res.startBlock('<property name="binaryConfiguration">');
         res.startBlock('<bean class="org.apache.ignite.configuration.BinaryConfiguration">');
 
         $generatorXml.simpleBeanProperty(res, binary, 'idMapper');
-        $generatorXml.simpleBeanProperty(res, binary, 'serializer');
         $generatorXml.simpleBeanProperty(res, binary, 'nameMapper');
+        $generatorXml.simpleBeanProperty(res, binary, 'serializer');
 
         if ($commonUtils.isDefinedAndNotEmpty(binary.typeConfigurations)) {
             res.startBlock('<property name="typeConfigurations">');
@@ -590,23 +586,23 @@ $generatorXml.clusterCommunication = function (cluster, res) {
 /**
  * XML generator for cluster's REST access configuration.
  *
- * @param cluster Cluster to get REST configuration.
+ * @param connector Cluster REST connector configuration.
  * @param res Optional configuration presentation builder object.
  * @returns Configuration presentation builder object
  */
-$generatorXml.clusterConnector = function(cluster, res) {
+$generatorXml.clusterConnector = function(connector, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    if ($commonUtils.isDefined(cluster.connector) && cluster.connector.enabled) {
+    if ($commonUtils.isDefined(connector) && connector.enabled) {
         var cfg = _.cloneDeep($generatorCommon.CONNECTOR_CONFIGURATION);
 
-        if (cluster.connector.sslEnabled) {
+        if (connector.sslEnabled) {
             cfg.fields.sslClientAuth = {dflt: false};
             cfg.fields.sslFactory = {type: 'bean'};
         }
 
-        $generatorXml.beanProperty(res, cluster.connector, 'connectorConfiguration', cfg,
true);
+        $generatorXml.beanProperty(res, connector, 'connectorConfiguration', cfg, true);
 
         res.needEmptyLine = true;
     }
@@ -644,36 +640,38 @@ $generatorXml.clusterDiscovery = function (disco, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorXml.property(res, disco, 'localAddress');
-    $generatorXml.property(res, disco, 'localPort', null, 47500);
-    $generatorXml.property(res, disco, 'localPortRange', null, 100);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver))
-        $generatorXml.beanProperty(res, disco, 'addressResolver', {className: disco.addressResolver},
true);
-    $generatorXml.property(res, disco, 'socketTimeout', null, 5000);
-    $generatorXml.property(res, disco, 'ackTimeout', null, 5000);
-    $generatorXml.property(res, disco, 'maxAckTimeout', null, 600000);
-    $generatorXml.property(res, disco, 'networkTimeout', null, 5000);
-    $generatorXml.property(res, disco, 'joinTimeout', null, 0);
-    $generatorXml.property(res, disco, 'threadPriority', null, 10);
-    $generatorXml.property(res, disco, 'heartbeatFrequency', null, 2000);
-    $generatorXml.property(res, disco, 'maxMissedHeartbeats', null, 1);
-    $generatorXml.property(res, disco, 'maxMissedClientHeartbeats', null, 5);
-    $generatorXml.property(res, disco, 'topHistorySize', null, 1000);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.listener))
-        $generatorXml.beanProperty(res, disco, 'listener', {className: disco.listener}, true);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange))
-        $generatorXml.beanProperty(res, disco, 'dataExchange', {className: disco.dataExchange},
true);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider))
-        $generatorXml.beanProperty(res, disco, 'metricsProvider', {className: disco.metricsProvider},
true);
-    $generatorXml.property(res, disco, 'reconnectCount', null, 10);
-    $generatorXml.property(res, disco, 'statisticsPrintFrequency', null, 0);
-    $generatorXml.property(res, disco, 'ipFinderCleanFrequency', null, 60000);
-    if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator))
-        $generatorXml.beanProperty(res, disco, 'authenticator', {className: disco.authenticator},
true);
-    $generatorXml.property(res, disco, 'forceServerMode', null, false);
-    $generatorXml.property(res, disco, 'clientReconnectDisabled', null, false);
+    if (disco) {
+        $generatorXml.property(res, disco, 'localAddress');
+        $generatorXml.property(res, disco, 'localPort', null, 47500);
+        $generatorXml.property(res, disco, 'localPortRange', null, 100);
+        if ($commonUtils.isDefinedAndNotEmpty(disco.addressResolver))
+            $generatorXml.beanProperty(res, disco, 'addressResolver', {className: disco.addressResolver},
true);
+        $generatorXml.property(res, disco, 'socketTimeout', null, 5000);
+        $generatorXml.property(res, disco, 'ackTimeout', null, 5000);
+        $generatorXml.property(res, disco, 'maxAckTimeout', null, 600000);
+        $generatorXml.property(res, disco, 'networkTimeout', null, 5000);
+        $generatorXml.property(res, disco, 'joinTimeout', null, 0);
+        $generatorXml.property(res, disco, 'threadPriority', null, 10);
+        $generatorXml.property(res, disco, 'heartbeatFrequency', null, 2000);
+        $generatorXml.property(res, disco, 'maxMissedHeartbeats', null, 1);
+        $generatorXml.property(res, disco, 'maxMissedClientHeartbeats', null, 5);
+        $generatorXml.property(res, disco, 'topHistorySize', null, 1000);
+        if ($commonUtils.isDefinedAndNotEmpty(disco.listener))
+            $generatorXml.beanProperty(res, disco, 'listener', {className: disco.listener},
true);
+        if ($commonUtils.isDefinedAndNotEmpty(disco.dataExchange))
+            $generatorXml.beanProperty(res, disco, 'dataExchange', {className: disco.dataExchange},
true);
+        if ($commonUtils.isDefinedAndNotEmpty(disco.metricsProvider))
+            $generatorXml.beanProperty(res, disco, 'metricsProvider', {className: disco.metricsProvider},
true);
+        $generatorXml.property(res, disco, 'reconnectCount', null, 10);
+        $generatorXml.property(res, disco, 'statisticsPrintFrequency', null, 0);
+        $generatorXml.property(res, disco, 'ipFinderCleanFrequency', null, 60000);
+        if ($commonUtils.isDefinedAndNotEmpty(disco.authenticator))
+            $generatorXml.beanProperty(res, disco, 'authenticator', {className: disco.authenticator},
true);
+        $generatorXml.property(res, disco, 'forceServerMode', null, false);
+        $generatorXml.property(res, disco, 'clientReconnectDisabled', null, false);
 
-    res.needEmptyLine = true;
+        res.needEmptyLine = true;
+    }
 
     return res;
 };
@@ -803,11 +801,11 @@ $generatorXml.clusterPools = function (cluster, res) {
 };
 
 // Generate transactions group.
-$generatorXml.clusterTransactions = function (cluster, res) {
+$generatorXml.clusterTransactions = function (transactionConfiguration, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorXml.beanProperty(res, cluster.transactionConfiguration, 'transactionConfiguration',
$generatorCommon.TRANSACTION_CONFIGURATION, false);
+    $generatorXml.beanProperty(res, transactionConfiguration, 'transactionConfiguration',
$generatorCommon.TRANSACTION_CONFIGURATION, false);
 
     res.needEmptyLine = true;
 
@@ -1663,13 +1661,13 @@ $generatorXml.clusterConfiguration = function (cluster, clientNearCfg,
res) {
 
     $generatorXml.clusterGeneral(cluster, res);
 
-    $generatorXml.clusterAtomics(cluster, res);
+    $generatorXml.clusterAtomics(cluster.atomicConfiguration, res);
 
-    $generatorXml.clusterBinary(cluster, res);
+    $generatorXml.clusterBinary(cluster.binaryConfiguration, res);
 
     $generatorXml.clusterCommunication(cluster, res);
 
-    $generatorXml.clusterConnector(cluster, res);
+    $generatorXml.clusterConnector(cluster.connector, res);
 
     $generatorXml.clusterDeployment(cluster, res);
 
@@ -1685,7 +1683,7 @@ $generatorXml.clusterConfiguration = function (cluster, clientNearCfg,
res) {
 
     $generatorXml.clusterPools(cluster, res);
 
-    $generatorXml.clusterTransactions(cluster, res);
+    $generatorXml.clusterTransactions(cluster.transactionConfiguration, res);
 
     $generatorXml.clusterCaches(cluster.caches, cluster.igfss, isSrvCfg, res);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/f8a690ec/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 4c4fb52..3d15324 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
@@ -51,8 +51,8 @@ include ../includes/infos
                             ignite-configuration-clusters-metrics
                             ignite-configuration-clusters-ssl
                             ignite-configuration-clusters-swap
-                            ignite-configuration-clusters-time
                             ignite-configuration-clusters-thread
+                            ignite-configuration-clusters-time
                             ignite-configuration-clusters-transactions
 
                             ignite-advanced-options-toggle


Mime
View raw message