ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: IGNITE-843: Fixed generation of type metadata for cache store.
Date Wed, 19 Aug 2015 09:26:45 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 da1751ff6 -> 510139132


IGNITE-843: Fixed generation of type metadata for cache store.


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

Branch: refs/heads/ignite-843
Commit: 510139132d25f826799adbd5061dc70bd4aa97f5
Parents: da1751f
Author: Alexey Kuznetsov <akuznetsov@apache.org>
Authored: Wed Aug 19 16:26:59 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Wed Aug 19 16:26:59 2015 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/models/caches.json  |  1 -
 .../src/main/js/routes/generator/xml.js         | 15 +++++-
 .../src/main/js/routes/metadata.js              | 54 +++++++++-----------
 3 files changed, 36 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51013913/modules/control-center-web/src/main/js/controllers/models/caches.json
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/models/caches.json b/modules/control-center-web/src/main/js/controllers/models/caches.json
index 0636a94..a0b3a0c 100644
--- a/modules/control-center-web/src/main/js/controllers/models/caches.json
+++ b/modules/control-center-web/src/main/js/controllers/models/caches.json
@@ -449,7 +449,6 @@
                 {
                   "label": "Metadata",
                   "type": "dropdown-multiple",
-                  "path": "cacheStoreFactory.CacheJdbcPojoStoreFactory",
                   "model": "storeMetadata",
                   "placeholder": "Choose metadata",
                   "items": "storeMetadata",

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51013913/modules/control-center-web/src/main/js/routes/generator/xml.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/generator/xml.js b/modules/control-center-web/src/main/js/routes/generator/xml.js
index 34f964d..75b590b 100644
--- a/modules/control-center-web/src/main/js/routes/generator/xml.js
+++ b/modules/control-center-web/src/main/js/routes/generator/xml.js
@@ -357,7 +357,7 @@ function addCacheTypeMetadataDatabaseFields(res, meta, fieldProperty)
{
 
             addProperty(res, field, 'javaName');
 
-            addElement(res, 'property', 'name', 'javaType', 'value', generatorCommon.javaBuildInClass(field.javaType));
+            addClassNameProperty(res, field, 'javaType');
 
             res.endBlock('</bean>');
         });
@@ -428,7 +428,8 @@ function generateCacheTypeMetadataConfiguration(res, meta) {
 
     var kind = meta.kind;
 
-    var keyType = addProperty(res, meta, 'keyType');
+    var keyType = addClassNameProperty(res, meta, 'keyType');
+
     addProperty(res, meta, 'valueType');
 
     if (kind != 'query') {
@@ -655,6 +656,15 @@ function addProperty(res, obj, propName, setterName) {
     return val;
 }
 
+function addClassNameProperty(res, obj, propName) {
+    var val = obj[propName];
+
+    if (generatorCommon.isDefined(val))
+        addElement(res, 'property', 'name', propName, 'value', generatorCommon.javaBuildInClass(val));
+
+    return val;
+}
+
 function addBeanWithProperties(res, bean, beanPropName, beanClass, props, createBeanAlthoughNoProps)
{
     if (bean && generatorCommon.hasProperty(bean, props)) {
         res.emptyLineIfNeeded();
@@ -715,6 +725,7 @@ function addBeanWithProperties(res, bean, beanPropName, beanClass, props,
create
         res.line('</property>');
     }
 }
+
 function addListProperty(res, obj, propName, listType, rowFactory) {
     var val = obj[propName];
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/51013913/modules/control-center-web/src/main/js/routes/metadata.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/routes/metadata.js b/modules/control-center-web/src/main/js/routes/metadata.js
index 67bee96..6158f27 100644
--- a/modules/control-center-web/src/main/js/routes/metadata.js
+++ b/modules/control-center-web/src/main/js/routes/metadata.js
@@ -39,20 +39,17 @@ router.post('/list', function (req, res) {
 
     // Get owned space and all accessed space.
     db.Space.find({$or: [{owner: user_id}, {usedBy: {$elemMatch: {account: user_id}}}]},
function (err, spaces) {
-        if (err)
-            return res.status(500).send(err.message);
-
-        var space_ids = spaces.map(function (value) {
-            return value._id;
-        });
-
-        // Get all metadata for spaces.
-        db.CacheTypeMetadata.find({space: {$in: space_ids}}).sort('name').exec(function (err,
metadatas) {
-            if (err)
-                return res.status(500).send(err.message);
+        if (db.processed(err, res)) {
+            var space_ids = spaces.map(function (value) {
+                return value._id;
+            });
 
-            res.json({spaces: spaces, metadatas: metadatas});
-        });
+            // Get all metadata for spaces.
+            db.CacheTypeMetadata.find({space: {$in: space_ids}}).sort('name').exec(function
(err, metadatas) {
+                if (db.processed(err, res))
+                    res.json({spaces: spaces, metadatas: metadatas});
+            });
+        }
     });
 });
 
@@ -62,25 +59,22 @@ router.post('/list', function (req, res) {
 router.post('/save', function (req, res) {
     if (req.body._id)
         db.CacheTypeMetadata.update({_id: req.body._id}, req.body, {upsert: true}, function
(err) {
-            if (err)
-                return res.status(500).send(err.message);
-
-            res.send(req.body._id);
+            if (db.processed(err, res))
+                res.send(req.body._id);
         });
     else {
         db.CacheTypeMetadata.findOne({space: req.body.space, name: req.body.name}, function
(err, metadata) {
-            if (err)
-                return res.status(500).send(err.message);
-
-            if (metadata)
-                return res.status(500).send('Cache type metadata with name: "' + metadata.name
+ '" already exist.');
+            if (db.processed(err, res)) {
+                if (metadata)
+                    return res.status(500).send('Cache type metadata with name: "' + metadata.name
+ '" already exist.');
 
-            (new db.CacheTypeMetadata(req.body)).save(function (err, metadata) {
-                if (err)
-                    return res.status(500).send(err.message);
+                (new db.CacheTypeMetadata(req.body)).save(function (err, metadata) {
+                    if (err)
+                        return res.status(500).send(err.message);
 
-                res.send(metadata._id);
-            });
+                    res.send(metadata._id);
+                });
+            }
         });
     }
 });
@@ -90,10 +84,8 @@ router.post('/save', function (req, res) {
  */
 router.post('/remove', function (req, res) {
     db.CacheTypeMetadata.remove(req.body, function (err) {
-        if (err)
-            return res.status(500).send(err.message);
-
-        res.sendStatus(200);
+        if (db.processed(err, res))
+            res.sendStatus(200);
     })
 });
 


Mime
View raw message