ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject ignite git commit: IGNITE-1867 Fixed generation, preview. Rename
Date Wed, 11 Nov 2015 09:29:21 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 ce83ff394 -> fa7b0c9cb


IGNITE-1867 Fixed generation, preview. Rename


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

Branch: refs/heads/ignite-843-rc1
Commit: fa7b0c9cbbe54ce0c5ee5fd9c27d1c8627110f4c
Parents: ce83ff3
Author: Andrey <anovikov@gridgain.com>
Authored: Wed Nov 11 16:29:06 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Wed Nov 11 16:29:06 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    |   6 +-
 .../src/main/js/controllers/common-module.js    |  16 +--
 .../main/js/controllers/metadata-controller.js  |  26 ++--
 .../main/js/controllers/summary-controller.js   |   3 +-
 modules/control-center-web/src/main/js/db.js    |   4 +-
 .../js/helpers/generator/generator-common.js    |   4 +-
 .../main/js/helpers/generator/generator-java.js | 131 +++++++++----------
 .../main/js/helpers/generator/generator-pom.js  |   9 ++
 .../main/js/helpers/generator/generator-xml.js  | 124 ++++++++++--------
 .../src/main/js/views/includes/controls.jade    |  10 +-
 10 files changed, 175 insertions(+), 158 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 2ee1690..41584b8 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
@@ -300,8 +300,10 @@ consoleModule.controller('cachesController', [
                                     $scope.preview.query.java = $generatorJava.cacheQuery(val,
varName).asString();
                                     $scope.preview.query.allDefaults = $common.isEmptyString($scope.preview.query.xml);
 
-                                    $scope.preview.store.xml = $generatorXml.cacheStore(val).asString();
-                                    $scope.preview.store.java = $generatorJava.cacheStore(val,
varName).asString();
+                                    var storeFactory = $generatorXml.cacheStore(val, metas);
+
+                                    $scope.preview.store.xml = $generatorXml.generateDataSources(storeFactory.datasources).asString()
+ storeFactory.asString();
+                                    $scope.preview.store.java = $generatorJava.cacheStore(val,
metas, varName).asString();
                                     $scope.preview.store.allDefaults = $common.isEmptyString($scope.preview.store.xml);
 
                                     $scope.preview.concurrency.xml = $generatorXml.cacheConcurrency(val).asString();

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 680f3a4..3c784f5 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
@@ -1133,10 +1133,10 @@ consoleModule.service('$table', ['$common', '$focus', function ($common,
$focus)
             _tableFocus('Key' + field.focusId, index);
         }
         else if (ui == 'table-db-fields') {
-            field.curDatabaseName = val.databaseName;
-            field.curDatabaseType = val.databaseType;
-            field.curJavaName = val.javaName;
-            field.curJavaType = val.javaType;
+            field.curDatabaseFieldName = val.databaseFieldName;
+            field.curDatabaseFieldType = val.databaseFieldType;
+            field.curJavaFieldName = val.javaFieldName;
+            field.curJavaFieldType = val.javaFieldType;
 
             _tableFocus('DatabaseName' + field.focusId, index);
         }
@@ -1166,10 +1166,10 @@ consoleModule.service('$table', ['$common', '$focus', function ($common,
$focus)
             _tableFocus('Key' + field.focusId, -1);
         }
         else if (ui == 'table-db-fields') {
-            field.newDatabaseName = null;
-            field.newDatabaseType = null;
-            field.newJavaName = null;
-            field.newJavaType = null;
+            field.newDatabaseFieldName = null;
+            field.newDatabaseFieldType = null;
+            field.newJavaFieldName = null;
+            field.newJavaFieldType = null;
 
             _tableFocus('DatabaseName' + field.focusId, -1);
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 d2ea8b2..8e81c2c 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
@@ -503,8 +503,8 @@ consoleModule.controller('metadataController', [
                         }
 
                         function dbField(name, jdbcType) {
-                            return {databaseName: name, databaseType: jdbcType.dbName,
-                                javaName: toJavaName(name), javaType: jdbcType.javaType}
+                            return {databaseFieldName: name, databaseFieldType: jdbcType.dbName,
+                                javaFieldName: toJavaName(name), javaFieldType: jdbcType.javaType}
                         }
 
                         var _containKey = false;
@@ -1043,15 +1043,15 @@ consoleModule.controller('metadataController', [
 
             function tableDbFieldValue(field, index) {
                 return index < 0
-                    ? {databaseName: field.newDatabaseName, databaseType: field.newDatabaseType,
javaName: field.newJavaName, javaType: field.newJavaType}
-                    : {databaseName: field.curDatabaseName, databaseType: field.curDatabaseType,
javaName: field.curJavaName, javaType: field.curJavaType}
+                    ? {databaseFieldName: field.newDatabaseFieldName, databaseFieldType:
field.newDatabaseFieldType, javaFieldName: field.newJavaFieldName, javaFieldType: field.newJavaFieldType}
+                    : {databaseFieldName: field.curDatabaseFieldName, databaseFieldType:
field.curDatabaseFieldType, javaFieldName: field.curJavaFieldName, javaFieldType: field.curJavaFieldType}
             }
 
             $scope.tableDbFieldSaveVisible = function (field, index) {
                 var dbFieldValue = tableDbFieldValue(field, index);
 
-                return !$common.isEmptyString(dbFieldValue.databaseName) && $common.isDefined(dbFieldValue.databaseType)
&&
-                    !$common.isEmptyString(dbFieldValue.javaName) && $common.isDefined(dbFieldValue.javaType);
+                return !$common.isEmptyString(dbFieldValue.databaseFieldName) &&
$common.isDefined(dbFieldValue.databaseFieldType) &&
+                    !$common.isEmptyString(dbFieldValue.javaFieldName) && $common.isDefined(dbFieldValue.javaFieldType);
             };
 
             var dbFieldTables = {
@@ -1069,12 +1069,12 @@ consoleModule.controller('metadataController', [
 
                     var model = item[field.model];
 
-                    if (!$common.isValidJavaIdentifier(dbFieldTable.msg + ' java name', dbFieldValue.javaName,
$table.tableFieldId(index, 'JavaName' + dbFieldTable.id)))
+                    if (!$common.isValidJavaIdentifier(dbFieldTable.msg + ' java name', dbFieldValue.javaFieldName,
$table.tableFieldId(index, 'JavaName' + dbFieldTable.id)))
                         return false;
 
                     if ($common.isDefined(model)) {
                         var idx = _.findIndex(model, function (dbMeta) {
-                            return dbMeta.databaseName == dbFieldValue.databaseName;
+                            return dbMeta.databaseFieldName == dbFieldValue.databaseFieldName;
                         });
 
                         // Found duplicate.
@@ -1082,7 +1082,7 @@ consoleModule.controller('metadataController', [
                             return showPopoverMessage(null, null, $table.tableFieldId(index,
'DatabaseName' + dbFieldTable.id), 'Field with such database name already exists!');
 
                         idx = _.findIndex(model, function (dbMeta) {
-                            return dbMeta.javaName == dbFieldValue.javaName;
+                            return dbMeta.javaFieldName == dbFieldValue.javaFieldName;
                         });
 
                         // Found duplicate.
@@ -1095,10 +1095,10 @@ consoleModule.controller('metadataController', [
                         else {
                             var dbField = model[index];
 
-                            dbField.databaseName = dbFieldValue.databaseName;
-                            dbField.databaseType = dbFieldValue.databaseType;
-                            dbField.javaName = dbFieldValue.javaName;
-                            dbField.javaType = dbFieldValue.javaType;
+                            dbField.databaseFieldName = dbFieldValue.databaseFieldName;
+                            dbField.databaseFieldType = dbFieldValue.databaseFieldType;
+                            dbField.javaFieldName = dbFieldValue.javaFieldName;
+                            dbField.javaFieldType = dbFieldValue.javaFieldType;
                         }
                     }
                     else {

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 f443ac0..4fa27f5 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
@@ -215,8 +215,9 @@ consoleModule.controller('summaryController', [
 
         zip.file(srcPath + 'ServerConfigurationFactory.java', $generatorJava.cluster(cluster,
'ServerConfigurationFactory'));
         zip.file(srcPath + 'ClientConfigurationFactory.java', $generatorJava.cluster(cluster,
'ClientConfigurationFactory', clientNearConfiguration));
+        zip.file(srcPath + 'NodeStartup.java', $generatorJava.nodeStartup(cluster));
 
-        zip.file('pom.xml', $generatorPom.pom(cluster.caches, '1.5.0').asString());
+        zip.file('pom.xml', $generatorPom.pom(cluster.caches, '1.5.0-IWC').asString());
 
         zip.file('README.txt', $generatorReadme.readme().asString());
         zip.file('jdbc-drivers/README.txt', $generatorReadme.readmeJdbc().asString());

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/modules/control-center-web/src/main/js/db.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/db.js b/modules/control-center-web/src/main/js/db.js
index cce1976..6d4df8d 100644
--- a/modules/control-center-web/src/main/js/db.js
+++ b/modules/control-center-web/src/main/js/db.js
@@ -78,8 +78,8 @@ var CacheTypeMetadataSchema = new Schema({
     databaseTable: String,
     keyType: String,
     valueType: String,
-    keyFields: [{databaseName: String, databaseType: String, javaName: String, javaType:
String}],
-    valueFields: [{databaseName: String, databaseType: String, javaName: String, javaType:
String}],
+    keyFields: [{databaseFieldName: String, databaseFieldType: String, javaFieldName: String,
javaFieldType: String}],
+    valueFields: [{databaseFieldName: String, databaseFieldType: String, javaFieldName: String,
javaFieldType: String}],
     keepSerialized: Boolean,
     fields: [{name: String, className: String}],
     aliases: [{field: String, alias: String}],

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 16bb952..d9c903b 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
@@ -46,10 +46,10 @@ $generatorCommon.mainComment = function mainComment() {
 };
 
 // Create result holder with service functions and properties for XML and java code generation.
-$generatorCommon.builder = function () {
+$generatorCommon.builder = function (deep) {
     var res = [];
 
-    res.deep = 0;
+    res.deep = deep ? deep : 0;
     res.needEmptyLine = false;
     res.lineStart = true;
     res.datasources = [];

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 cda5db7..138aa7b 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
@@ -119,7 +119,7 @@ $generatorJava.property = function (res, varName, obj, propName, dataType,
sette
             res.emptyLineIfNeeded();
 
             res.line(varName + '.' + $generatorJava.setterName(propName, setterName)
-                + '(' + $generatorJava.toJavaCode(val, dataType) + ');');
+                + '(' + $generatorJava.toJavaCode(val, dataType ? res.importClass(dataType)
: null) + ');');
 
             return true;
         }
@@ -129,24 +129,6 @@ $generatorJava.property = function (res, varName, obj, propName, dataType,
sette
 };
 
 /**
- * Add property via setter assuming that it is a 'Class'.
- *
- * @param res Resulting output with generated code.
- * @param varName Variable name.
- * @param obj Source object with data.
- * @param propName Property name to take from source object.
- */
-$generatorJava.classNameProperty = function (res, varName, obj, propName) {
-    var val = obj[propName];
-
-    if ($commonUtils.isDefined(val)) {
-        res.emptyLineIfNeeded();
-
-        res.line(varName + '.' + $generatorJava.setterName(propName) + '(' + res.importClass(val)
+ '.class);');
-    }
-};
-
-/**
  * Add list property.
  *
  * @param res Resulting output with generated code.
@@ -259,7 +241,7 @@ $generatorJava.beanProperty = function (res, varName, bean, beanPropName,
beanVa
                             break;
 
                         case 'enum':
-                            $generatorJava.property(res, beanVarName, bean, propName, res.importClass(descr.enumClass),
descr.setterName);
+                            $generatorJava.property(res, beanVarName, bean, propName, descr.enumClass,
descr.setterName);
                             break;
 
                         case 'float':
@@ -844,7 +826,7 @@ $generatorJava.cacheQuery = function (cache, varName, res) {
  * @param res Resulting output with generated code.
  * @returns {*} Java code for cache store configuration.
  */
-$generatorJava.cacheStore = function (cache, cacheVarName, res) {
+$generatorJava.cacheStore = function (cache, metadatas, cacheVarName, res) {
     if (!res)
         res = $generatorCommon.builder();
 
@@ -886,6 +868,8 @@ $generatorJava.cacheStore = function (cache, cacheVarName, res) {
 
                     res.line('dataSource.setUser(props.getProperty("' + dataSourceBean +
'.jdbc.username"));');
                     res.line('dataSource.setPassword(props.getProperty("' + dataSourceBean
+ '.jdbc.password"));');
+
+                    res.needEmptyLine = true;
                 }
             }
 
@@ -893,22 +877,20 @@ $generatorJava.cacheStore = function (cache, cacheVarName, res) {
                 // Generate POJO store factory.
                 $generatorJava.declareVariable(res, 'storeFactory', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory');
 
-                $generatorJava.declareVariable(res, 'storeFactoryCfg', 'org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration');
-
                 if (dataSourceFound)
-                    res.line('storeFactoryCfg.setDataSource(dataSource);');
+                    res.line('storeFactory.setDataSource(dataSource);');
 
-                res.line('storeFactoryCfg.setDialect(new ' +
+                res.line('storeFactory.setDialect(new ' +
                     res.importClass($generatorCommon.jdbcDialectClassName(storeFactory.dialect))
+ '());');
 
                 res.needEmptyLine = true;
 
-                if (cache.metadatas && cache.metadatas.length > 0) {
+                if (metadatas && metadatas.length > 0) {
                     $generatorJava.declareVariable(res, 'jdbcTypes', 'java.util.Collection',
'java.util.ArrayList', 'org.apache.ignite.cache.store.jdbc.JdbcType');
 
                     res.needEmptyLine = true;
 
-                    _.forEach(cache.metadatas, function (meta) {
+                    _.forEach(metadatas, function (meta) {
                         $generatorJava.declareVariable(res, 'jdbcType', 'org.apache.ignite.cache.store.jdbc.JdbcType');
 
                         res.needEmptyLine = true;
@@ -922,12 +904,10 @@ $generatorJava.cacheStore = function (cache, cacheVarName, res) {
                         res.needEmptyLine = true;
                     });
 
-                    res.line('storeFactoryCfg.setTypes(jdbcTypes);');
+                    res.line('storeFactory.setTypes(jdbcTypes.toArray(new JdbcType[jdbcTypes.size()]));');
 
                     res.needEmptyLine = true;
                 }
-
-                res.line('storeFactory.setConfiguration(storeFactoryCfg);');
             }
             else {
                 $generatorJava.beanProperty(res, cacheVarName, storeFactory, 'cacheStoreFactory',
'storeFactory',
@@ -940,7 +920,7 @@ $generatorJava.cacheStore = function (cache, cacheVarName, res) {
             res.needEmptyLine = true;
         }
 
-        res.line(cacheVarName + '.setStoreFactory(storeFactory);');
+        res.line(cacheVarName + '.setCacheStoreFactory(storeFactory);');
 
         res.needEmptyLine = true;
     }
@@ -969,8 +949,8 @@ $generatorJava.cacheConcurrency = function (cache, varName, res) {
 
     $generatorJava.property(res, varName, cache, 'maxConcurrentAsyncOperations');
     $generatorJava.property(res, varName, cache, 'defaultLockTimeout');
-    $generatorJava.property(res, varName, cache, 'atomicWriteOrderMode', res.importClass('org.apache.ignite.cache.CacheAtomicWriteOrderMode'));
-    $generatorJava.property(res, varName, cache, 'writeSynchronizationMode', res.importClass('org.apache.ignite.cache.CacheWriteSynchronizationMode'));
+    $generatorJava.property(res, varName, cache, 'atomicWriteOrderMode', 'org.apache.ignite.cache.CacheAtomicWriteOrderMode');
+    $generatorJava.property(res, varName, cache, 'writeSynchronizationMode', 'org.apache.ignite.cache.CacheWriteSynchronizationMode');
 
     res.needEmptyLine = true;
 
@@ -1084,15 +1064,15 @@ $generatorJava.metadataQueryIndexes = function (res, meta) {
     if (indexes && indexes.length > 0) {
         res.needEmptyLine = true;
 
-        $generatorJava.declareVariable(res, 'indexes', 'java.util.Map', 'java.util.LinkedHashMap',
'String', 'org.apache.ignite.cache.store.QueryEntityIndex');
+        $generatorJava.declareVariable(res, 'indexes', 'java.util.Map', 'java.util.LinkedHashMap',
'String', 'org.apache.ignite.cache.QueryIndex');
 
         _.forEach(indexes, function (index) {
             res.needEmptyLine = true;
 
-            $generatorJava.declareVariable(res, 'index', 'org.apache.ignite.cache.store.QueryEntityIndex');
+            $generatorJava.declareVariable(res, 'index', 'org.apache.ignite.cache.QueryIndex');
 
             $generatorJava.property(res, 'index', index, 'name');
-            $generatorJava.property(res, 'index', index, 'type', 'org.apache.ignite.cache.store.QueryEntityIndex.Type');
+            $generatorJava.property(res, 'index', index, 'type', 'org.apache.ignite.cache.QueryIndexType');
 
             var fields = index.fields;
 
@@ -1135,9 +1115,11 @@ $generatorJava.metadataDatabaseFields = function (res, meta, fieldProperty)
{
         var lastIx = dbFields.length - 1;
 
         _.forEach(dbFields, function (field, ix) {
+            res.importClass('org.apache.ignite.cache.store.jdbc.JdbcTypeField');
+
             res.line('new JdbcTypeField(' +
-                'Types.' + field.databaseType + ', ' + '"' + field.databaseName + '", ' +
-                res.importClass(field.javaType) + '.class, ' + '"' + field.javaName + '"'+
')' + (ix < lastIx ? ',' : ''));
+                'Types.' + field.databaseFieldType + ', ' + '"' + field.databaseFieldName
+ '", ' +
+                res.importClass(field.javaFieldType) + '.class, ' + '"' + field.javaFieldName
+ '"'+ ')' + (ix < lastIx ? ',' : ''));
         });
 
         res.endBlock(');');
@@ -1151,8 +1133,8 @@ $generatorJava.metadataGeneral = function (meta, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'keyType');
-    $generatorJava.classNameProperty(res, 'typeMeta', meta, 'valueType');
+    $generatorJava.property(res, 'typeMeta', meta, 'keyType');
+    $generatorJava.property(res, 'typeMeta', meta, 'valueType');
 
     res.needEmptyLine = true;
 
@@ -1199,23 +1181,11 @@ $generatorJava.metadataStore = function (meta, withTypes, res) {
 };
 
 // Generate cache type metadata config.
-$generatorJava.cacheMetadata = function(meta, res) {
-    $generatorJava.declareVariable(res, 'typeMeta', 'org.apache.ignite.cache.CacheTypeMetadata');
-
-    $generatorJava.metadataGeneral(meta, res);
-
-    res.emptyLineIfNeeded();
-    res.line('types.add(typeMeta);');
-
-    res.needEmptyLine = true;
-};
-
-// Generate cache type metadata config.
 $generatorJava.cacheQueryMetadata = function(meta, res) {
-    $generatorJava.declareVariable(res, 'queryMeta', 'org.apache.ignite.cache.store.QueryEntity');
+    $generatorJava.declareVariable(res, 'queryMeta', 'org.apache.ignite.cache.QueryEntity');
 
-    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'keyType');
-    $generatorJava.classNameProperty(res, 'queryMeta', meta, 'valueType');
+    $generatorJava.property(res, 'queryMeta', meta, 'keyType');
+    $generatorJava.property(res, 'queryMeta', meta, 'valueType');
 
     res.needEmptyLine = true;
 
@@ -1234,17 +1204,7 @@ $generatorJava.cacheMetadatas = function (metadatas, varName, res)
{
 
     // Generate cache type metadata configs.
     if (metadatas && metadatas.length > 0) {
-        $generatorJava.declareVariable(res, 'types', 'java.util.Collection', 'java.util.ArrayList',
'org.apache.ignite.cache.CacheTypeMetadata');
-
-        _.forEach(metadatas, function (meta) {
-            $generatorJava.cacheMetadata(meta, res);
-        });
-
-        res.line(varName + '.setTypeMetadata(types);');
-
-        res.needEmptyLine = true;
-
-        $generatorJava.declareVariable(res, 'queryEntities', 'java.util.Collection', 'java.util.ArrayList',
'org.apache.ignite.cache.store.QueryEntity');
+        $generatorJava.declareVariable(res, 'queryEntities', 'java.util.Collection', 'java.util.ArrayList',
'org.apache.ignite.cache.QueryEntity');
 
         _.forEach(metadatas, function (meta) {
             $generatorJava.cacheQueryMetadata(meta, res);
@@ -1269,7 +1229,7 @@ $generatorJava.cache = function(cache, varName, res) {
 
     $generatorJava.cacheQuery(cache, varName, res);
 
-    $generatorJava.cacheStore(cache, varName, res);
+    $generatorJava.cacheStore(cache, cache.metadatas, varName, res);
 
     $generatorJava.cacheConcurrency(cache, varName, res);
 
@@ -1379,7 +1339,7 @@ $generatorJava.javaClassCode = function (meta, key, pkg, useConstructor,
include
 
         res.line('/** Value for ' + fldName + '. */');
 
-        res.line('private ' + res.importClass(field.javaType) + ' ' + fldName + ';');
+        res.line('private ' + res.importClass(field.javaFieldType) + ' ' + fldName + ';');
 
         res.needEmptyLine = true;
     });
@@ -1421,7 +1381,7 @@ $generatorJava.javaClassCode = function (meta, key, pkg, useConstructor,
include
     _.forEach(allFields, function (field) {
         var fldName = field.javaName;
 
-        var fldType = res.importClass(field.javaType);
+        var fldType = res.importClass(field.javaFieldType);
 
         res.line('/**');
         res.line(' * Gets ' + fldName + '.');
@@ -1793,7 +1753,7 @@ $generatorJava.igfsMisc = function(igfs, varName, res) {
 
     $generatorJava.property(res, varName, igfs, 'blockSize', null, null, 65536);
     $generatorJava.property(res, varName, igfs, 'streamBufferSize', null, null, 65536);
-    $generatorJava.property(res, varName, igfs, 'defaultMode', res.importClass('org.apache.ignite.igfs.IgfsMode'),
undefined, "DUAL_ASYNC");
+    $generatorJava.property(res, varName, igfs, 'defaultMode', 'org.apache.ignite.igfs.IgfsMode',
undefined, "DUAL_ASYNC");
     $generatorJava.property(res, varName, igfs, 'maxSpaceSize', null, null, 0);
     $generatorJava.property(res, varName, igfs, 'maximumTaskRangeLength', null, null, 0);
     $generatorJava.property(res, varName, igfs, 'managementPort', null, null, 11400);
@@ -1939,3 +1899,34 @@ $generatorJava.cluster = function (cluster, javaClass, clientNearCfg)
{
 
     return res.asString();
 };
+
+/**
+ * Function to generate java code for cluster configuration.
+ * @param cluster Cluster to process.
+ */
+$generatorJava.nodeStartup = function (cluster) {
+    var res = $generatorCommon.builder();
+
+    res.importClass('org.apache.ignite.IgniteException');
+    res.importClass('org.apache.ignite.Ignition');
+
+    res.line('/**');
+    res.line(' * ' + $generatorCommon.mainComment());
+    res.line(' */');
+    res.startBlock('public class NodeStartup {');
+
+    res.line('/**');
+    res.line(' * Start up an server node.');
+    res.line(' *');
+    res.line(' * @param args Command line arguments, none required.');
+    res.line(' * @throws IgniteException If failed.');
+    res.line(' */');
+
+    res.startBlock('public static void main(String[] args) throws IgniteException {');
+    res.line('Ignition.start("config/' + cluster.name + '-server.xml");');
+    res.endBlock('}');
+
+    res.endBlock('}');
+
+    return res.generateImports() + '\n\n' + res.asString();
+};

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
index 20ed535..182a6e1 100644
--- a/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
+++ b/modules/control-center-web/src/main/js/helpers/generator/generator-pom.js
@@ -92,6 +92,15 @@ $generatorPom.pom = function (caches, igniteVersion, res) {
 
     res.needEmptyLine = true;
 
+    res.startBlock('<repositories>');
+    res.startBlock('<repository>');
+    addProperty('id', 'GridGain External Repository');
+    addProperty('url', 'http://www.gridgainsystems.com/nexus/content/repositories/gridgain_staging-1549');
+    res.endBlock('</repository>');
+    res.endBlock('</repositories>');
+
+    res.needEmptyLine = true;
+
     res.startBlock('<dependencies>');
 
     addDependency('org.apache.ignite', 'ignite-core', igniteVersion);

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/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 9f7683a..94abf9a 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
@@ -728,7 +728,7 @@ $generatorXml.cacheQuery = function(cache, res) {
 };
 
 // Generate cache store group.
-$generatorXml.cacheStore = function(cache, res) {
+$generatorXml.cacheStore = function(cache, metadatas, res) {
     if (!res)
         res = $generatorCommon.builder();
 
@@ -741,8 +741,6 @@ $generatorXml.cacheStore = function(cache, res) {
             if (factoryKind == 'CacheJdbcPojoStoreFactory') {
                 res.startBlock('<property name="cacheStoreFactory">');
                 res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">');
-                res.startBlock('<property name="configuration">');
-                res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreConfiguration">');
 
                 $generatorXml.property(res, storeFactory, 'dataSourceBean');
 
@@ -750,8 +748,6 @@ $generatorXml.cacheStore = function(cache, res) {
                 res.line('<bean class="' + $generatorCommon.jdbcDialectClassName(storeFactory.dialect)
+ '"/>');
                 res.endBlock('</property>');
 
-                var metadatas = cache.metadatas;
-
                 if (metadatas && metadatas.length > 0) {
                     res.startBlock('<property name="types">');
                     res.startBlock('<list>');
@@ -763,6 +759,8 @@ $generatorXml.cacheStore = function(cache, res) {
                         $generatorXml.property(res, meta, 'valueType');
                         $generatorXml.property(res, meta, 'keepSerialized', null, null, false);
 
+                        $generatorXml.metadataStore(meta, res);
+
                         res.endBlock('</bean>');
                     });
 
@@ -771,23 +769,20 @@ $generatorXml.cacheStore = function(cache, res) {
                 }
 
                 res.endBlock('</bean>');
-                res.endBlock("</property>");
-                res.endBlock('</bean>');
                 res.endBlock("</property>")
             }
-            else {
+            else
                 $generatorXml.beanProperty(res, storeFactory, 'cacheStoreFactory', $generatorCommon.STORE_FACTORIES[factoryKind],
true);
 
-                if (storeFactory.dialect) {
-                    if (_.findIndex(res.datasources, function (ds) {
-                            return ds.dataSourceBean == storeFactory.dataSourceBean;
-                        }) < 0) {
-                        res.datasources.push({
-                            dataSourceBean: storeFactory.dataSourceBean,
-                            className: $generatorCommon.DATA_SOURCES[storeFactory.dialect],
-                            dialect: storeFactory.dialect
-                        });
-                    }
+            if (storeFactory.dialect && storeFactory.dataSourceBean) {
+                if (_.findIndex(res.datasources, function (ds) {
+                        return ds.dataSourceBean == storeFactory.dataSourceBean;
+                    }) < 0) {
+                    res.datasources.push({
+                        dataSourceBean: storeFactory.dataSourceBean,
+                        className: $generatorCommon.DATA_SOURCES[storeFactory.dialect],
+                        dialect: storeFactory.dialect
+                    });
                 }
             }
 
@@ -951,7 +946,7 @@ $generatorXml.metadataQueryIndexes = function (res, meta) {
         res.startBlock('<list>');
 
         _.forEach(indexes, function (index) {
-            res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntityIndex">');
+            res.startBlock('<bean class="org.apache.ignite.cache.QueryIndex">');
 
             $generatorXml.property(res, index, 'name');
             $generatorXml.property(res, index, 'type');
@@ -994,15 +989,15 @@ $generatorXml.metadataDatabaseFields = function (res, meta, fieldProp)
{
         _.forEach(fields, function (field) {
             res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcTypeField">');
 
-            $generatorXml.property(res, field, 'databaseName');
+            $generatorXml.property(res, field, 'databaseFieldName');
 
-            res.startBlock('<property name="databaseType">');
-            res.line('<util:constant static-field="java.sql.Types.' + field.databaseType
+ '"/>');
+            res.startBlock('<property name="databaseFieldType">');
+            res.line('<util:constant static-field="java.sql.Types.' + field.databaseFieldType
+ '"/>');
             res.endBlock('</property>');
 
-            $generatorXml.property(res, field, 'javaName');
+            $generatorXml.property(res, field, 'javaFieldName');
 
-            $generatorXml.classNameProperty(res, field, 'javaType');
+            $generatorXml.classNameProperty(res, field, 'javaFieldType');
 
             res.endBlock('</bean>');
         });
@@ -1068,9 +1063,9 @@ $generatorXml.cacheQueryMetadata = function(meta, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    res.startBlock('<bean class="org.apache.ignite.cache.store.QueryEntity">');
+    res.startBlock('<bean class="org.apache.ignite.cache.QueryEntity">');
 
-    $generatorXml.classNameProperty(res, meta, 'keyType');
+    $generatorXml.property(res, meta, 'keyType');
     $generatorXml.property(res, meta, 'valueType');
 
     $generatorXml.metadataQuery(meta, res);
@@ -1117,7 +1112,7 @@ $generatorXml.cache = function(cache, res) {
 
     $generatorXml.cacheQuery(cache, res);
 
-    $generatorXml.cacheStore(cache, res);
+    $generatorXml.cacheStore(cache, cache.metadatas, res);
 
     $generatorXml.cacheConcurrency(cache, res);
 
@@ -1358,11 +1353,51 @@ $generatorXml.igfsMisc = function(igfs, res) {
 };
 
 // Generate cluster config.
+$generatorXml.generateDataSources = function (datasources, res) {
+    if (!res)
+        res = $generatorCommon.builder();
+
+    if (datasources.length > 0) {
+        res.line('<!-- Data source beans will be initialized from external properties
file. -->');
+
+        _.forEach(datasources, function (item) {
+            var beanId = item.dataSourceBean;
+
+            res.startBlock('<bean id="' + beanId + '" class="' + item.className + '">');
+
+            switch (item.dialect) {
+                case 'DB2':
+                    res.line('<property name="serverName" value="${' + beanId + '.jdbc.server_name}"
/>');
+                    res.line('<property name="portNumber" value="${' + beanId + '.jdbc.port_number}"
/>');
+                    res.line('<property name="databaseName" value="${' + beanId + '.jdbc.database_name}"
/>');
+                    res.line('<property name="driverType" value="${' + beanId + '.jdbc.driver_type}"
/>');
+                    break;
+
+                default:
+                    res.line('<property name="URL" value="${' + beanId + '.jdbc.url}"
/>');
+            }
+
+            res.line('<property name="user" value="${' + beanId + '.jdbc.username}" />');
+            res.line('<property name="password" value="${' + beanId + '.jdbc.password}"
/>');
+
+            res.endBlock('</bean>');
+
+            res.needEmptyLine = true;
+
+            res.emptyLineIfNeeded();
+        });
+
+        res.needEmptyLine = true;
+
+        res.emptyLineIfNeeded();
+    }
+
+    return res;
+};
+
 $generatorXml.cluster = function (cluster, clientNearCfg) {
     if (cluster) {
-        var res = $generatorCommon.builder();
-
-        res.deep = 1;
+        var res = $generatorCommon.builder(1);
 
         if (clientNearCfg) {
             res.startBlock('<bean id="nearCacheBean" class="org.apache.ignite.configuration.NearCacheConfiguration">');
@@ -1375,7 +1410,9 @@ $generatorXml.cluster = function (cluster, clientNearCfg) {
 
             res.endBlock('</bean>');
 
-            res.line();
+            res.needEmptyLine = true;
+
+            res.emptyLineIfNeeded();
         }
 
         // Generate Ignite Configuration.
@@ -1441,30 +1478,7 @@ $generatorXml.cluster = function (cluster, clientNearCfg) {
         }
 
         // 3. Add data sources.
-        if (res.datasources.length > 0) {
-            xml += '    <!-- Data source beans will be initialized from external properties
file. -->\n';
-
-            _.forEach(res.datasources, function (item) {
-                var beanId = item.dataSourceBean;
-
-                xml += '    <bean id="' + beanId + '" class="' + item.className + '">\n';
-                switch (item.dialect) {
-                    case 'DB2':
-                        xml += '        <property name="serverName" value="${' + beanId
+ '.jdbc.server_name}" />\n';
-                        xml += '        <property name="portNumber" value="${' + beanId
+ '.jdbc.port_number}" />\n';
-                        xml += '        <property name="databaseName" value="${' + beanId
+ '.jdbc.database_name}" />\n';
-                        xml += '        <property name="driverType" value="${' + beanId
+ '.jdbc.driver_type}" />\n';
-                        break;
-
-                    default:
-                        xml += '        <property name="URL" value="${' + beanId + '.jdbc.url}"
/>\n';
-                }
-
-                xml += '        <property name="user" value="${' + beanId + '.jdbc.username}"
/>\n';
-                xml += '        <property name="password" value="${' + beanId + '.jdbc.password}"
/>\n';
-                xml += '    </bean>\n\n';
-            });
-        }
+        xml += $generatorXml.generateDataSources(res.datasources, $generatorCommon.builder(1)).asString();
 
         // 3. Add main content.
         xml += res.asString();

http://git-wip-us.apache.org/repos/asf/ignite/blob/fa7b0c9c/modules/control-center-web/src/main/js/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/includes/controls.jade b/modules/control-center-web/src/main/js/views/includes/controls.jade
index 336bf67..8262ccc 100644
--- a/modules/control-center-web/src/main/js/views/includes/controls.jade
+++ b/modules/control-center-web/src/main/js/views/includes/controls.jade
@@ -237,10 +237,10 @@ mixin details-row
                                         +ico-exclamation('{{detail.model}}', 'ipaddress',
'Invalid address, see help for format description.')
 
 mixin table-db-field-edit(prefix, focusId, index)
-    -var databaseName = prefix + 'DatabaseName'
-    -var databaseType = prefix + 'DatabaseType'
-    -var javaName = prefix + 'JavaName'
-    -var javaType = prefix + 'JavaType'
+    -var databaseName = prefix + 'DatabaseFieldName'
+    -var databaseType = prefix + 'DatabaseFieldType'
+    -var javaName = prefix + 'JavaFieldName'
+    -var javaType = prefix + 'JavaFieldType'
 
     -var databaseNameModel = 'field.' + databaseName
     -var databaseTypeModel = 'field.' + databaseType
@@ -434,7 +434,7 @@ mixin form-row-custom(lblClasses, fieldClasses, dataSource)
                             tr(ng-repeat='item in #{fieldMdl}')
                                 td
                                     div(ng-show='!tableEditing(field, $index)')
-                                        a.labelFormField(ng-click='tableStartEdit(backupItem,
field, $index)') {{$index + 1}}) {{item.databaseName}} / {{item.databaseType}} / {{item.javaName}}
/ {{item.javaType}}
+                                        a.labelFormField(ng-click='tableStartEdit(backupItem,
field, $index)') {{$index + 1}}) {{item.databaseFieldName}} / {{item.databaseFieldType}} /
{{item.javaFieldName}} / {{item.javaFieldType}}
                                         +btn-remove('tableRemove(backupItem, field, $index)',
'field.removeTip')
                                     div(ng-if='tableEditing(field, $index)')
                                         +table-db-field-edit('cur', '{{::field.focusId}}',
'$index')


Mime
View raw message