ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject [1/2] ignite git commit: IGNITE-843 WIP reworking import domain model and rename rename metadata to domain model.
Date Tue, 19 Jan 2016 06:42:35 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 11781de44 -> dd05e1b33


http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/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 840dcc2..cb41ea8 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
@@ -765,17 +765,17 @@ $generatorXml.cacheQuery = function(cache, res) {
     $generatorXml.property(res, cache, 'sqlOnheapRowCacheSize');
     $generatorXml.property(res, cache, 'longQueryWarningTimeout');
 
-    var indexedTypes = _.filter(cache.metadatas, function (meta) {
-        return meta.queryMetadata === 'Annotations'
+    var indexedTypes = _.filter(cache.domains, function (domain) {
+        return domain.queryMetadata === 'Annotations'
     });
 
     if (indexedTypes.length > 0) {
         res.startBlock('<property name="indexedTypes">');
         res.startBlock('<list>');
 
-        _.forEach(indexedTypes, function(meta) {
-            res.line('<value>' + $dataStructures.fullClassName(meta.keyType) + '</value>');
-            res.line('<value>' + $dataStructures.fullClassName(meta.valueType) + '</value>');
+        _.forEach(indexedTypes, function(domain) {
+            res.line('<value>' + $dataStructures.fullClassName(domain.keyType) + '</value>');
+            res.line('<value>' + $dataStructures.fullClassName(domain.valueType) +
'</value>');
         });
 
         res.endBlock('</list>');
@@ -794,7 +794,7 @@ $generatorXml.cacheQuery = function(cache, res) {
 };
 
 // Generate cache store group.
-$generatorXml.cacheStore = function(cache, metadatas, res) {
+$generatorXml.cacheStore = function(cache, domains, res) {
     if (!res)
         res = $generatorCommon.builder();
 
@@ -814,23 +814,23 @@ $generatorXml.cacheStore = function(cache, metadatas, res) {
                 res.line('<bean class="' + $generatorCommon.jdbcDialectClassName(storeFactory.dialect)
+ '"/>');
                 res.endBlock('</property>');
 
-                var metaConfigs = _.filter(metadatas, function (meta) {
-                    return $commonUtils.isDefinedAndNotEmpty(meta.databaseTable);
+                var domainConfigs = _.filter(domains, function (domain) {
+                    return $commonUtils.isDefinedAndNotEmpty(domain.databaseTable);
                 });
 
-                if ($commonUtils.isDefinedAndNotEmpty(metaConfigs)) {
+                if ($commonUtils.isDefinedAndNotEmpty(domainConfigs)) {
                     res.startBlock('<property name="types">');
                     res.startBlock('<list>');
 
-                    _.forEach(metaConfigs, function (meta) {
+                    _.forEach(domainConfigs, function (domain) {
                         res.startBlock('<bean class="org.apache.ignite.cache.store.jdbc.JdbcType">');
 
                         $generatorXml.property(res, cache, 'name', 'cacheName');
 
-                        $generatorXml.classNameProperty(res, meta, 'keyType');
-                        $generatorXml.property(res, meta, 'valueType');
+                        $generatorXml.classNameProperty(res, domain, 'keyType');
+                        $generatorXml.property(res, domain, 'valueType');
 
-                        $generatorXml.metadataStore(meta, res);
+                        $generatorXml.domainStore(domain, res);
 
                         res.endBlock('</bean>');
                     });
@@ -988,8 +988,8 @@ $generatorXml.cacheStatistics = function(cache, res) {
 };
 
 // Generate domain model query fields.
-$generatorXml.metadataQueryFields = function (res, meta) {
-    var fields = meta.fields;
+$generatorXml.domainModelQueryFields = function (res, domain) {
+    var fields = domain.fields;
 
     if (fields && fields.length > 0) {
         res.emptyLineIfNeeded();
@@ -1009,8 +1009,8 @@ $generatorXml.metadataQueryFields = function (res, meta) {
 };
 
 // Generate domain model query fields.
-$generatorXml.metadataQueryAliases = function (res, meta) {
-    var aliases = meta.aliases;
+$generatorXml.domainModelQueryAliases = function (res, domain) {
+    var aliases = domain.aliases;
 
     if (aliases && aliases.length > 0) {
         res.emptyLineIfNeeded();
@@ -1030,8 +1030,8 @@ $generatorXml.metadataQueryAliases = function (res, meta) {
 };
 
 // Generate domain model indexes.
-$generatorXml.metadataQueryIndexes = function (res, meta) {
-    var indexes = meta.indexes;
+$generatorXml.domainModelQueryIndexes = function (res, domain) {
+    var indexes = domain.indexes;
 
     if (indexes && indexes.length > 0) {
         res.emptyLineIfNeeded();
@@ -1070,8 +1070,8 @@ $generatorXml.metadataQueryIndexes = function (res, meta) {
 };
 
 // Generate domain model db fields.
-$generatorXml.metadataDatabaseFields = function (res, meta, fieldProp) {
-    var fields = meta[fieldProp];
+$generatorXml.domainModelDatabaseFields = function (res, domain, fieldProp) {
+    var fields = domain[fieldProp];
 
     if (fields && fields.length > 0) {
         res.emptyLineIfNeeded();
@@ -1104,12 +1104,12 @@ $generatorXml.metadataDatabaseFields = function (res, meta, fieldProp)
{
 };
 
 // Generate domain model general group.
-$generatorXml.metadataGeneral = function(meta, res) {
+$generatorXml.domainModelGeneral = function(domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorXml.classNameProperty(res, meta, 'keyType');
-    $generatorXml.property(res, meta, 'valueType');
+    $generatorXml.classNameProperty(res, domain, 'keyType');
+    $generatorXml.property(res, domain, 'valueType');
 
     res.needEmptyLine = true;
 
@@ -1117,16 +1117,14 @@ $generatorXml.metadataGeneral = function(meta, res) {
 };
 
 // Generate domain model for query group.
-$generatorXml.metadataQuery = function(meta, res) {
+$generatorXml.domainModelQuery = function(domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    if ($generatorCommon.domainQueryMetadata(meta) === 'Configuration') {
-        $generatorXml.metadataQueryFields(res, meta);
-
-        $generatorXml.metadataQueryAliases(res, meta);
-
-        $generatorXml.metadataQueryIndexes(res, meta);
+    if ($generatorCommon.domainQueryMetadata(domain) === 'Configuration') {
+        $generatorXml.domainModelQueryFields(res, domain);
+        $generatorXml.domainModelQueryAliases(res, domain);
+        $generatorXml.domainModelQueryIndexes(res, domain);
 
         res.needEmptyLine = true;
     }
@@ -1135,35 +1133,35 @@ $generatorXml.metadataQuery = function(meta, res) {
 };
 
 // Generate domain model for store group.
-$generatorXml.metadataStore = function(meta, res) {
+$generatorXml.domainStore = function(domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    $generatorXml.property(res, meta, 'databaseSchema');
-    $generatorXml.property(res, meta, 'databaseTable');
+    $generatorXml.property(res, domain, 'databaseSchema');
+    $generatorXml.property(res, domain, 'databaseTable');
 
     res.needEmptyLine = true;
 
-    if (!$dataStructures.isJavaBuiltInClass(meta.keyType))
-        $generatorXml.metadataDatabaseFields(res, meta, 'keyFields');
+    if (!$dataStructures.isJavaBuiltInClass(domain.keyType))
+        $generatorXml.domainModelDatabaseFields(res, domain, 'keyFields');
 
-    $generatorXml.metadataDatabaseFields(res, meta, 'valueFields');
+    $generatorXml.domainModelDatabaseFields(res, domain, 'valueFields');
 
     res.needEmptyLine = true;
 
     return res;
 };
 
-$generatorXml.cacheQueryMetadata = function(meta, res) {
+$generatorXml.cacheQueryMetadata = function(domain, res) {
     if (!res)
         res = $generatorCommon.builder();
 
     res.startBlock('<bean class="org.apache.ignite.cache.QueryEntity">');
 
-    $generatorXml.classNameProperty(res, meta, 'keyType');
-    $generatorXml.property(res, meta, 'valueType');
+    $generatorXml.classNameProperty(res, domain, 'keyType');
+    $generatorXml.property(res, domain, 'valueType');
 
-    $generatorXml.metadataQuery(meta, res);
+    $generatorXml.domainModelQuery(domain, res);
 
     res.endBlock('</bean>');
 
@@ -1173,23 +1171,23 @@ $generatorXml.cacheQueryMetadata = function(meta, res) {
 };
 
 // Generate domain models configs.
-$generatorXml.cacheMetadatas = function(metadatas, res) {
+$generatorXml.cacheDomains = function(domains, res) {
     if (!res)
         res = $generatorCommon.builder();
 
-    var metaConfigs = _.filter(metadatas, function (meta) {
-        return $generatorCommon.domainQueryMetadata(meta) === 'Configuration' &&
-            $commonUtils.isDefinedAndNotEmpty(meta.fields);
+    var domainConfigs = _.filter(domains, function (domain) {
+        return $generatorCommon.domainQueryMetadata(domain) === 'Configuration' &&
+            $commonUtils.isDefinedAndNotEmpty(domain.fields);
     });
 
-    if ($commonUtils.isDefinedAndNotEmpty(metaConfigs)) {
+    if ($commonUtils.isDefinedAndNotEmpty(domainConfigs)) {
         res.emptyLineIfNeeded();
 
         res.startBlock('<property name="queryEntities">');
         res.startBlock('<list>');
 
-        _.forEach(metaConfigs, function (meta) {
-            $generatorXml.cacheQueryMetadata(meta, res);
+        _.forEach(domainConfigs, function (domain) {
+            $generatorXml.cacheQueryMetadata(domain, res);
         });
 
         res.endBlock('</list>');
@@ -1219,22 +1217,14 @@ $generatorXml.cacheConfiguration = function(cache, res) {
         res = $generatorCommon.builder();
 
     $generatorXml.cacheGeneral(cache, res);
-
     $generatorXml.cacheMemory(cache, res);
-
     $generatorXml.cacheQuery(cache, res);
-
-    $generatorXml.cacheStore(cache, cache.metadatas, res);
-
+    $generatorXml.cacheStore(cache, cache.domains, res);
     $generatorXml.cacheConcurrency(cache, res);
-
     $generatorXml.cacheRebalance(cache, res);
-
     $generatorXml.cacheServerNearCache(cache, res);
-
     $generatorXml.cacheStatistics(cache, res);
-
-    $generatorXml.cacheMetadatas(cache.metadatas, res);
+    $generatorXml.cacheDomains(cache.domains, res);
 
     return res;
 };

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/routes/admin.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/admin.js b/modules/control-center-web/src/main/js/routes/admin.js
index 6d948f6..8c02507 100644
--- a/modules/control-center-web/src/main/js/routes/admin.js
+++ b/modules/control-center-web/src/main/js/routes/admin.js
@@ -46,7 +46,7 @@ router.post('/remove', function (req, res) {
             _.forEach(spaces, function (space) {
                 db.Cluster.remove({space: space._id}).exec();
                 db.Cache.remove({space: space._id}).exec();
-                db.CacheTypeMetadata.remove({space: space._id}).exec();
+                db.DomainModel.remove({space: space._id}).exec();
                 db.Notebook.remove({space: space._id}).exec();
                 db.Space.remove({owner: space._id}).exec();
             });

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/routes/caches.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/caches.js b/modules/control-center-web/src/main/js/routes/caches.js
index 5455c6a..fa52bd5 100644
--- a/modules/control-center-web/src/main/js/routes/caches.js
+++ b/modules/control-center-web/src/main/js/routes/caches.js
@@ -39,7 +39,7 @@ router.post('/list', function (req, res) {
             db.Cluster.find({space: {$in: space_ids}}, '_id name caches').sort('name').exec(function
(err, clusters) {
                 if (db.processed(err, res)) {
                     // Get all domain models for spaces.
-                    db.CacheTypeMetadata.find({space: {$in: space_ids}}).sort('name').exec(function
(err, metadatas) {
+                    db.DomainModel.find({space: {$in: space_ids}}).sort('name').exec(function
(err, domains) {
                         if (db.processed(err, res)) {
                             // Get all caches for spaces.
                             db.Cache.find({space: {$in: space_ids}}).sort('name').exec(function
(err, caches) {
@@ -53,9 +53,9 @@ router.post('/list', function (req, res) {
                                         });
 
                                         // Remove deleted domain models.
-                                        cache.metadatas = _.filter(cache.metadatas, function
(metaId) {
-                                            return _.findIndex(metadatas, function (meta)
{
-                                                    return meta._id.equals(metaId);
+                                        cache.domains = _.filter(cache.domains, function
(metaId) {
+                                            return _.findIndex(domains, function (domain)
{
+                                                    return domain._id.equals(metaId);
                                                 }) >= 0;
                                         });
                                     });
@@ -65,7 +65,7 @@ router.post('/list', function (req, res) {
                                         clusters: clusters.map(function (cluster) {
                                             return {value: cluster._id, label: cluster.name,
caches: cluster.caches};
                                         }),
-                                        metadatas: metadatas,
+                                        domains: domains,
                                         caches: caches
                                     });
                                 }
@@ -85,7 +85,7 @@ router.post('/save', function (req, res) {
     var params = req.body;
     var cacheId = params._id;
     var clusters = params.clusters;
-    var metadatas = params.metadatas;
+    var domains = params.domains;
 
     if (params._id) {
         db.Cache.update({_id: cacheId}, params, {upsert: true}, function (err) {
@@ -94,9 +94,9 @@ router.post('/save', function (req, res) {
                     if (db.processed(err, res))
                         db.Cluster.update({_id: {$nin: clusters}}, {$pull: {caches: cacheId}},
{multi: true}, function (err) {
                             if (db.processed(err, res))
-                                db.CacheTypeMetadata.update({_id: {$in: metadatas}}, {$addToSet:
{caches: cacheId}}, {multi: true}, function (err) {
+                                db.DomainModel.update({_id: {$in: domains}}, {$addToSet:
{caches: cacheId}}, {multi: true}, function (err) {
                                     if (db.processed(err, res))
-                                        db.CacheTypeMetadata.update({_id: {$nin: metadatas}},
{$pull: {caches: cacheId}}, {multi: true}, function (err) {
+                                        db.DomainModel.update({_id: {$nin: domains}}, {$pull:
{caches: cacheId}}, {multi: true}, function (err) {
                                             if (db.processed(err, res))
                                                 res.send(params._id);
                                         });
@@ -117,7 +117,7 @@ router.post('/save', function (req, res) {
 
                         db.Cluster.update({_id: {$in: clusters}}, {$addToSet: {caches: cacheId}},
{multi: true}, function (err) {
                             if (db.processed(err, res))
-                                db.CacheTypeMetadata.update({_id: {$in: metadatas}}, {$addToSet:
{caches: cacheId}}, {multi: true}, function (err) {
+                                db.DomainModel.update({_id: {$in: domains}}, {$addToSet:
{caches: cacheId}}, {multi: true}, function (err) {
                                     if (db.processed(err, res))
                                         res.send(cacheId);
                                 });

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/routes/clusters.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/clusters.js b/modules/control-center-web/src/main/js/routes/clusters.js
index 311dcef..cf56c49 100644
--- a/modules/control-center-web/src/main/js/routes/clusters.js
+++ b/modules/control-center-web/src/main/js/routes/clusters.js
@@ -36,7 +36,7 @@ router.post('/list', function (req, res) {
             });
 
             // Get all caches for spaces.
-            db.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('metadatas').exec(function
(err, caches) {
+            db.Cache.find({space: {$in: space_ids}}).sort('name').deepPopulate('domains').exec(function
(err, caches) {
                 if (db.processed(err, res)) {
                     // Get all IGFSs for spaces.
                     db.Igfs.find({space: {$in: space_ids}}).sort('name').exec(function (err,
igfss) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/routes/domains.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/domains.js b/modules/control-center-web/src/main/js/routes/domains.js
index 5c78ac0..429ee19 100644
--- a/modules/control-center-web/src/main/js/routes/domains.js
+++ b/modules/control-center-web/src/main/js/routes/domains.js
@@ -43,11 +43,11 @@ router.post('/list', function (req, res) {
                     db.Cache.find({space: {$in: space_ids}}).sort('name').exec(function (err,
caches) {
                         if (db.processed(err, res)) {
                             // Get all domain models for spaces.
-                            db.CacheTypeMetadata.find({space: {$in: space_ids}}).sort('valueType').exec(function
(err, metadatas) {
+                            db.DomainModel.find({space: {$in: space_ids}}).sort('valueType').exec(function
(err, domains) {
                                 if (db.processed(err, res)) {
                                     // Remove deleted caches.
-                                    _.forEach(metadatas, function (meta) {
-                                        meta.caches = _.filter(meta.caches, function (cacheId)
{
+                                    _.forEach(domains, function (domain) {
+                                        domain.caches = _.filter(domain.caches, function
(cacheId) {
                                             return _.findIndex(caches, function (cache) {
                                                     return cache._id.equals(cacheId);
                                                 }) >= 0;
@@ -59,10 +59,8 @@ router.post('/list', function (req, res) {
                                         clusters: clusters.map(function (cluster) {
                                             return {value: cluster._id, label: cluster.name};
                                         }),
-                                        caches: caches.map(function (cache) {
-                                            return {value: cache._id, label: cache.name};
-                                        }),
-                                        metadatas: metadatas
+                                        caches: caches,
+                                        domains: domains
                                     });
                                 }
                             });
@@ -74,24 +72,24 @@ router.post('/list', function (req, res) {
     });
 });
 
-function _saveMeta(meta, savedMetas, callback) {
-    var metaId = meta._id;
-    var caches = meta.caches;
+function _saveDomainModel(domain, savedDomains, callback) {
+    var domainId = domain._id;
+    var caches = domain.caches;
 
-    if (metaId)
-        db.CacheTypeMetadata.update({_id: meta._id}, meta, {upsert: true}, function (err)
{
+    if (domainId)
+        db.DomainModel.update({_id: domain._id}, domain, {upsert: true}, function (err) {
             if (err)
                 callback(err);
             else
-                db.Cache.update({_id: {$in: caches}}, {$addToSet: {metadatas: metaId}}, {multi:
true}, function (err) {
+                db.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}}, {multi:
true}, function (err) {
                     if (err)
                         callback(err);
                     else
-                        db.Cache.update({_id: {$nin: caches}}, {$pull: {metadatas: metaId}},
{multi: true}, function (err) {
+                        db.Cache.update({_id: {$nin: caches}}, {$pull: {domains: domainId}},
{multi: true}, function (err) {
                             if (err)
                                 callback(err);
                             else {
-                                savedMetas.push(meta);
+                                savedDomains.push(domain);
 
                                 callback();
                             }
@@ -99,24 +97,23 @@ function _saveMeta(meta, savedMetas, callback) {
                 });
         });
     else
-        db.CacheTypeMetadata.findOne({space: meta.space, valueType: meta.valueType}, function
(err, metadata) {
+        db.DomainModel.findOne({space: domain.space, valueType: domain.valueType}, function
(err, found) {
             if (err)
                 callback(err);
-            else
-            if (metadata)
-                return callback('Domain model with value type: "' + metadata.valueType +
'" already exist.');
+            else if (found)
+                return callback('Domain model with value type: "' + found.valueType + '"
already exist.');
 
-            (new db.CacheTypeMetadata(meta)).save(function (err, metadata) {
+            (new db.DomainModel(domain)).save(function (err, domain) {
                 if (err)
                     callback(err);
                 else {
-                    metaId = metadata._id;
+                    domainId = domain._id;
 
-                    db.Cache.update({_id: {$in: caches}}, {$addToSet: {metadatas: metaId}},
{multi: true}, function (err) {
+                    db.Cache.update({_id: {$in: caches}}, {$addToSet: {domains: domainId}},
{multi: true}, function (err) {
                         if (err)
                             callback(err);
                         else {
-                            savedMetas.push(metadata);
+                            savedDomains.push(domain);
 
                             callback();
                         }
@@ -126,96 +123,50 @@ function _saveMeta(meta, savedMetas, callback) {
         });
 }
 
-function _saveCacheAndMeta(res, generatedCaches, savedMetas, newCache, callback) {
-    // If cache not found, then create it and associate with domain model.
-    (new db.Cache(newCache)).save(function (err, cache) {
-        var cacheId = cache._id;
-
-        if (db.processed(err, res)) {
-            db.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet: {caches: cacheId}},
{multi: true}, function (err) {
-                if (db.processed(err, res)) {
-                    meta.caches = [cacheId];
-                    generatedCaches.push({ value: cacheId, label: cache.name });
-
-                    _saveMeta(meta, savedMetas, callback);
-                }
-            });
-        }
-    });
-}
-
-function _save(metas, res) {
-    var savedMetas = [];
+function _save(domains, res) {
+    var savedDomains = [];
     var generatedCaches = [];
 
-    if (metas && metas.length > 0)
-        async.forEachOf(metas, function(meta, idx, callback) {
-            if (meta.newCache) {
-                db.Cache.findOne({space: meta.space, name: meta.newCache.name}, function
(err, cache) {
+    if (domains && domains.length > 0)
+        async.forEachOf(domains, function(domain, idx, callback) {
+            if (domain.newCache) {
+                db.Cache.findOne({space: domain.space, name: domain.newCache.name}, function
(err, cache) {
                     if (db.processed(err, res))
                         if (cache) {
                             // Cache already exists, just save domain model.
-                            meta.caches = [cache._id];
+                            domain.caches = [cache._id];
 
-                            _saveMeta(meta, savedMetas, callback);
+                            _saveDomainModel(domain, savedDomains, callback);
                         }
                         else {
-                            var newCache = {
-                                space: meta.space,
-                                name: meta.newCache.name,
-                                clusters: meta.newCache.clusters,
-                                cacheMode: 'PARTITIONED',
-                                atomicityMode: 'ATOMIC',
-                                cacheStoreFactory: {
-                                    kind: 'CacheJdbcPojoStoreFactory',
-                                    CacheJdbcPojoStoreFactory: {
-                                        dataSourceBean: 'dataSource',
-                                        dialect: meta.newCache.dialect
-                                    }
-                                },
-                                readThrough: true,
-                                writeThrough: true,
-                                demo: meta.demo
-                            };
+                            // If cache not found, then create it and associate with domain
model.
+                            var newCache = domain.newCache;
+                            newCache.space = domain.space;
 
-                            if (meta.cache === 'IMPORT_DM_NEW_CACHE') {
-                                if (meta.template === 'IMPORT_DM_DFLT_REPLICATED_CACHE')
-                                    newCache.cacheMode = 'REPLICATED';
-                                else {
-                                    db.Cache.findOne({_id: meta.template}, function (err,
cacheTemplate) {
-                                        if (db.processed(err, res)) {
-                                            if (cacheTemplate) {
-                                                newCache.cacheMode = cacheTemplate.cacheMode;
-                                                newCache.atomicityMode = cacheTemplate.atomicityMode;
+                            (new db.Cache(newCache)).save(function (err, cache) {
+                                var cacheId = cache._id;
 
-                                                if (cacheTemplate.cacheStoreFactory &&
cacheTemplate.cacheStoreFactory.kind === 'CacheJdbcPojoStoreFactory') {
-                                                    newCache.cacheStoreFactory.dataSourceBean
= cacheTemplate.cacheStoreFactory.dataSourceBean;
-                                                    newCache.cacheStoreFactory.dialect =
cacheTemplate.cacheStoreFactory.dialect;
-                                                    newCache.readThrough = cacheTemplate.readThrough;
-                                                    newCache.writeThrough = cacheTemplate.writeThrough
-                                                }
-                                            }
+                                if (db.processed(err, res)) {
+                                    db.Cluster.update({_id: {$in: cache.clusters}}, {$addToSet:
{caches: cacheId}}, {multi: true}, function (err) {
+                                        if (db.processed(err, res)) {
+                                            domain.caches = [cacheId];
+                                            generatedCaches.push({ value: cacheId, label:
cache.name });
 
-                                            _saveCacheAndMeta(res, generatedCaches, savedMetas,
newCache, callback);
+                                            _saveDomainModel(domain, savedDomains, callback);
                                         }
                                     });
                                 }
-                            }
-                            else {
-                                if (meta.template !== 'IMPORT_DM_DO_NOT_GENERATE')
-
-                                _saveMeta(res, generatedCaches, savedMetas, newCache, callback);
-                            }
+                            });
                         }
                 });
             }
             else
-                _saveMeta(meta, savedMetas, callback);
+                _saveDomainModel(domain, savedDomains, callback);
         }, function (err) {
             if (err)
                 res.status(500).send(err);
             else
-                res.send({ savedMetas: savedMetas, generatedCaches: generatedCaches });
+                res.send({ savedDomains: savedDomains, generatedCaches: generatedCaches });
         });
     else
         res.status(500).send('Nothing to save!');
@@ -239,7 +190,7 @@ router.post('/save/batch', function (req, res) {
  * Remove domain model by ._id.
  */
 router.post('/remove', function (req, res) {
-    db.CacheTypeMetadata.remove(req.body, function (err) {
+    db.DomainModel.remove(req.body, function (err) {
         if (db.processed(err, res))
             res.sendStatus(200);
     })
@@ -258,7 +209,7 @@ router.post('/remove/all', function (req, res) {
                 return value._id;
             });
 
-            db.CacheTypeMetadata.remove({space: {$in: space_ids}}, function (err) {
+            db.DomainModel.remove({space: {$in: space_ids}}, function (err) {
                 if (err)
                     return res.status(500).send(err.message);
 
@@ -282,7 +233,7 @@ router.post('/remove/demo', function (req, res) {
             });
 
             // Remove all demo domain models.
-            db.CacheTypeMetadata.remove({$and: [{space: {$in: space_ids}}, {demo: true}]},
function (err) {
+            db.DomainModel.remove({$and: [{space: {$in: space_ids}}, {demo: true}]}, function
(err) {
                 if (err)
                     return res.status(500).send(err.message);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/views/configuration/domains.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/domains.jade b/modules/control-center-web/src/main/js/views/configuration/domains.jade
index 72d7eb5..37cd9ac 100644
--- a/modules/control-center-web/src/main/js/views/configuration/domains.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/domains.jade
@@ -35,20 +35,20 @@ include ../includes/controls
             li Back to #[a(ui-sref='base.configuration.caches') Caches]
             li Back to #[a(ui-sref='base.configuration.clusters') Clusters]
                         
-    div(dw-loading='loadingMetadataScreen' dw-loading-options='{text: "Loading domain models
screen...", className: "page-loading-overlay"}')
+    div(dw-loading='loadingDomainModelsScreen' dw-loading-options='{text: "Loading domain
models screen...", className: "page-loading-overlay"}')
         div(ng-show='ui.ready')
             hr
-            .padding-bottom-dflt(ng-show='metadatas && metadatas.length > 0')
-                table.links(st-table='displayedRows' st-safe-src='metadatas')
+            .padding-bottom-dflt(ng-show='domains && domains.length > 0')
+                table.links(st-table='displayedRows' st-safe-src='domains')
                     thead
                         tr
                             th
                                 .col-sm-8
                                     .col-sm-5
-                                        lable.labelHeader.labelFormField {{metadataTitle()}}
+                                        lable.labelHeader.labelFormField {{domainModelTitle()}}
                                     .col-sm-7
-                                        .pull-right.labelLogin.additional-filter(ng-if='(metadatas
| domainsValidation:false:true).length > 0')
-                                            a.labelFormField(ng-if='ui.showValid' ng-click='toggleValid()')
Key fields should be configured: {{(displayedRows | domainsValidation:false:true).length}}&nbsp
+                                        .pull-right.labelLogin.additional-filter(ng-if='(domains
| domainsValidation:false:true).length > 0')
+                                            a.labelFormField(ng-if='ui.showValid' ng-click='toggleValid()'
bs-tooltip='' data-title='{{::ui.invalidKeyFieldsTooltip}}') Key fields should be configured:
{{(displayedRows | domainsValidation:false:true).length}}&nbsp
                                             a.labelFormField(ng-if='!ui.showValid' ng-click='toggleValid()')
Show all domain models: {{displayedRows.length}}&nbsp
                                 .col-sm-4
                                     input.form-control.pull-right(type='text' st-search='valueType'
placeholder='Filter domain models...')

http://git-wip-us.apache.org/repos/asf/ignite/blob/dd05e1b3/modules/control-center-web/src/main/js/views/configuration/summary.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/summary.jade b/modules/control-center-web/src/main/js/views/configuration/summary.jade
index c7dc00a..f59b83a 100644
--- a/modules/control-center-web/src/main/js/views/configuration/summary.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/summary.jade
@@ -163,4 +163,4 @@ mixin ignite-form-field-tooltip(message)
                                 div(bs-pane title='POM')
                                     ignite-ui-ace-pom(data-cluster='cluster')
                                 div(bs-pane title='POJO' ng-show='cluster | hasPojo')
-                                    ignite-ui-ace-pojos(data-cluster='cluster' ng-model='ctrl.data.metadatas')
+                                    ignite-ui-ace-pojos(data-cluster='cluster' ng-model='ctrl.data.pojos')


Mime
View raw message