ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [31/50] [abbrv] ignite git commit: IGNITE-843 Common properties generator.
Date Tue, 01 Dec 2015 09:02:43 GMT
IGNITE-843 Common properties generator.


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

Branch: refs/heads/ignite-843-rc2
Commit: 3d1a6c08bc49394123d583498e81968ac58b5784
Parents: 0c53621
Author: Andrey <anovikov@gridgain.com>
Authored: Mon Nov 30 15:52:35 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Mon Nov 30 15:52:35 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/summary-controller.js    |  4 +---
 .../js/helpers/generator/generator-common.js     | 19 +++++++++++++------
 .../js/helpers/generator/generator-properties.js | 15 +++++++++++++++
 3 files changed, 29 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1a6c08/modules/control-center-web/src/main/js/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/summary-controller.js b/modules/control-center-web/src/main/js/controllers/summary-controller.js
index 163e7f6..d4d3c58 100644
--- a/modules/control-center-web/src/main/js/controllers/summary-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/summary-controller.js
@@ -206,9 +206,7 @@ consoleModule.controller('summaryController', [
 
         zip.file('Dockerfile', $scope.dockerServer);
 
-        var builder = $generatorProperties.sslProperties(cluster);
-
-        builder = $generatorProperties.dataSourcesProperties(cluster, builder);
+        var builder = $generatorProperties.generateProperties(cluster);
 
         if (builder)
             zip.file('src/main/resources/secret.properties', builder.asString());

http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1a6c08/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
index 9fcd784..c0bbdea 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-common.js
@@ -63,16 +63,23 @@ $generatorCommon.builder = function (deep) {
     res.safePoint = -1;
 
     res.mergeProps = function (fromRes) {
-        res.datasources = fromRes.datasources;
+        if ($commonUtils.isDefinedAndNotEmpty(fromRes)) {
+            res.datasources = fromRes.datasources;
 
-        angular.extend(res.imports, fromRes.imports);
-        angular.extend(res.vars, fromRes.datasources);
+            angular.extend(res.imports, fromRes.imports);
+            angular.extend(res.vars, fromRes.vars);
+        }
     };
 
     res.mergeLines = function (fromRes) {
-        _.forEach(fromRes, function (line) {
-            res.append(line);
-        })
+        if ($commonUtils.isDefinedAndNotEmpty(fromRes)) {
+            if (res.needEmptyLine)
+                res.push('');
+
+            _.forEach(fromRes, function (line) {
+                res.append(line);
+            });
+        }
     };
 
     res.startSafeBlock = function () {

http://git-wip-us.apache.org/repos/asf/ignite/blob/3d1a6c08/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
b/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
index 06328c6..d273eae 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-properties.js
@@ -97,3 +97,18 @@ $generatorProperties.sslProperties = function (cluster, res) {
 
     return res;
 };
+
+/**
+ * Generate properties file with all possible properties.
+ *
+ * @param cluster Cluster to get configurations.
+ * @param res Optional configuration presentation builder object.
+ * @returns Configuration presentation builder object
+ */
+$generatorProperties.generateProperties = function (cluster, res) {
+    res = $generatorProperties.dataSourcesProperties(cluster, res);
+
+    res = $generatorProperties.sslProperties(cluster, res);
+
+    return res;
+};


Mime
View raw message