Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 28c180bae -> c1e4f2e00


IGNITE-843: Java classes validation.


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

Branch: refs/heads/ignite-843
Commit: c1e4f2e0009cd22149433cc51abd3e93e8b0c4eb
Parents: 28c180b
Author: AKuznetsov <akuznet...@gridgain.com>
Authored: Tue Aug 18 17:55:46 2015 +0700
Committer: AKuznetsov <akuznet...@gridgain.com>
Committed: Tue Aug 18 17:55:46 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    | 41 +++++------
 .../main/js/controllers/clusters-controller.js  | 29 ++++----
 .../src/main/js/controllers/common-module.js    | 72 ++++++++++++--------
 .../main/js/controllers/metadata-controller.js  | 57 +++++++---------
 4 files changed, 98 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1e4f2e0/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 c8dd1fa..3229604 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
@@ -41,6 +41,7 @@ controlCenterModule.controller('cachesController', [
             $scope.compactJavaName = $common.compactJavaName;
 
             $scope.hidePopover = $common.hidePopover;
+            var showPopoverMessage = $common.showPopoverMessage;
 
             $scope.atomicities = $common.mkOptions(['ATOMIC', 
'TRANSACTIONAL']);
 
@@ -124,15 +125,9 @@ controlCenterModule.controller('cachesController', [
                 return false;
             };
 
-            function focusInvalidField(index, id) {
-                $focus(index < 0 ? 'new' + id : 'cur' + id);
-
-                return false;
-            }
-
             $scope.tableSimpleValid = function (item, field, fx, index) {
-                if (!$common.isValidJavaClass('SQL function', fx, false))
-                    return focusInvalidField(index, 'SqlFx');
+                if (!$common.isValidJavaClass('SQL function', fx, false, 
$table.tableFieldId(index, 'SqlFx')))
+                    return $table.tableFocusInvalidField(index, 'SqlFx');
 
                 var model = item[field.model];
 
@@ -143,7 +138,7 @@ controlCenterModule.controller('cachesController', [
                     if (idx >= 0 && idx != index) {
                         $common.showError('SQL function with such class name 
already exists!');
 
-                        return focusInvalidField(index, 'SqlFx');
+                        return $table.tableFocusInvalidField(index, 'SqlFx');
                     }
                 }
 
@@ -153,11 +148,11 @@ controlCenterModule.controller('cachesController', [
             $scope.tablePairValid = function (item, field, index) {
                 var pairValue = $table.tablePairValue(field, index);
 
-                if (!$common.isValidJavaClass('Indexed type key', 
pairValue.key, true))
-                    return focusInvalidField(index, 'KeyIndexedType');
+                if (!$common.isValidJavaClass('Indexed type key', 
pairValue.key, true, $table.tableFieldId(index, 'KeyIndexedType')))
+                    return $table.tableFocusInvalidField(index, 
'KeyIndexedType');
 
-                if (!$common.isValidJavaClass('Indexed type value', 
pairValue.value, true))
-                    return focusInvalidField(index, 'ValueIndexedType');
+                if (!$common.isValidJavaClass('Indexed type value', 
pairValue.value, true, $table.tableFieldId(index, 'ValueIndexedType')))
+                    return $table.tableFocusInvalidField(index, 
'ValueIndexedType');
 
                 var model = item[field.model];
 
@@ -170,7 +165,7 @@ controlCenterModule.controller('cachesController', [
                     if (idx >= 0 && idx != index) {
                         $common.showError('Indexed type with such key class 
already exists!');
 
-                        return focusInvalidField(index, 'KeyIndexedType');
+                        return $table.tableFocusInvalidField(index, 
'KeyIndexedType');
                     }
                 }
 
@@ -284,10 +279,10 @@ controlCenterModule.controller('cachesController', [
             // Check cache logical consistency.
             function validate(item) {
                 if ($common.isEmptyString(item.name))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'cacheName', 'Name should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'cacheName', 'Name should not be empty');
 
                 if (item.memoryMode == 'OFFHEAP_TIERED' && 
item.offHeapMaxMemory == null)
-                    return $common.showPopoverMessage($scope.panels, 
'memory-data', 'offHeapMaxMemory',
+                    return showPopoverMessage($scope.panels, 'memory-data', 
'offHeapMaxMemory',
                         'Off-heap max memory should be specified');
 
                 var cacheStoreFactorySelected = item.cacheStoreFactory && 
item.cacheStoreFactory.kind;
@@ -295,37 +290,37 @@ controlCenterModule.controller('cachesController', [
                 if (cacheStoreFactorySelected) {
                     if (item.cacheStoreFactory.kind == 
'CacheJdbcPojoStoreFactory') {
                         if 
($common.isEmptyString(item.cacheStoreFactory.CacheJdbcPojoStoreFactory.dataSourceBean))
-                            return $common.showPopoverMessage($scope.panels, 
'store-data', 'dataSourceBean',
+                            return showPopoverMessage($scope.panels, 
'store-data', 'dataSourceBean',
                                 'Data source bean should not be empty');
 
                         if 
(!item.cacheStoreFactory.CacheJdbcPojoStoreFactory.dialect)
-                            return $common.showPopoverMessage($scope.panels, 
'store-data', 'dialect',
+                            return showPopoverMessage($scope.panels, 
'store-data', 'dialect',
                                 'Dialect should not be empty');
                     }
 
                     if (item.cacheStoreFactory.kind == 
'CacheJdbcBlobStoreFactory') {
                         if 
($common.isEmptyString(item.cacheStoreFactory.CacheJdbcBlobStoreFactory.user))
-                            return $common.showPopoverMessage($scope.panels, 
'store-data', 'user',
+                            return showPopoverMessage($scope.panels, 
'store-data', 'user',
                                 'User should not be empty');
 
                         if 
($common.isEmptyString(item.cacheStoreFactory.CacheJdbcBlobStoreFactory.dataSourceBean))
-                            return $common.showPopoverMessage($scope.panels, 
'store-data', 'dataSourceBean',
+                            return showPopoverMessage($scope.panels, 
'store-data', 'dataSourceBean',
                                 'Data source bean should not be empty');
                     }
                 }
 
                 if (cacheStoreFactorySelected && !(item.readThrough || 
item.writeThrough)) {
-                    return $common.showPopoverMessage($scope.panels, 
'store-data', 'readThrough',
+                    return showPopoverMessage($scope.panels, 'store-data', 
'readThrough',
                         'Store is configured but read/write through are not 
enabled!');
                 }
 
                 if ((item.readThrough || item.writeThrough) && 
!cacheStoreFactorySelected) {
-                    return $common.showPopoverMessage($scope.panels, 
'store-data', 'cacheStoreFactory',
+                    return showPopoverMessage($scope.panels, 'store-data', 
'cacheStoreFactory',
                         'Read / write through are enabled but store is not 
configured!');
                 }
 
                 if (item.writeBehindEnabled && !cacheStoreFactorySelected) {
-                    return $common.showPopoverMessage($scope.panels, 
'store-data', 'cacheStoreFactory',
+                    return showPopoverMessage($scope.panels, 'store-data', 
'cacheStoreFactory',
                         'Write behind enabled but store is not configured!');
                 }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1e4f2e0/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 9b47cd3..1ad20d7 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
@@ -34,6 +34,7 @@ controlCenterModule.controller('clustersController', 
['$scope', '$http', '$commo
         $scope.tableSimpleDownVisible = $table.tableSimpleDownVisible;
 
         $scope.hidePopover = $common.hidePopover;
+        var showPopoverMessage = $common.showPopoverMessage;
 
         $scope.templates = [
             {value: {discovery: {kind: 'Multicast', Vm: {addresses: 
['127.0.0.1:47500..47510']}, Multicast: {}}},label: 'multicast'},
@@ -116,12 +117,6 @@ controlCenterModule.controller('clustersController', 
['$scope', '$http', '$commo
             zones: {msg: 'Such zone already exists!', id: 'Zone'}
         };
 
-        function focusInvalidField(index, id) {
-            $focus(index < 0 ? 'new' + id : 'cur' + id);
-
-            return false;
-        }
-
         $scope.tableSimpleValid = function (item, field, val, index) {
             var model = $common.getModel(item, field)[field.model];
 
@@ -135,7 +130,7 @@ controlCenterModule.controller('clustersController', 
['$scope', '$http', '$commo
                     if (simpleTable) {
                         $common.showError(simpleTable.msg);
 
-                        return focusInvalidField(index, simpleTable.id);
+                        return $table.tableFocusInvalidField(index, 
simpleTable.id);
                     }
                 }
             }
@@ -254,34 +249,34 @@ controlCenterModule.controller('clustersController', 
['$scope', '$http', '$commo
         // Check cluster logical consistency.
         function validate(item) {
             if ($common.isEmptyString(item.name))
-                return $common.showPopoverMessage($scope.panels, 
'general-data', 'clusterName', 'Name should not be empty');
+                return showPopoverMessage($scope.panels, 'general-data', 
'clusterName', 'Name should not be empty');
 
             if (item.discovery.kind == 'Vm' && 
item.discovery.Vm.addresses.length == 0)
-                return $common.showPopoverMessage($scope.panels, 
'general-data', 'addresses', 'Addresses are not specified');
+                return showPopoverMessage($scope.panels, 'general-data', 
'addresses', 'Addresses are not specified');
 
             if (item.discovery.kind == 'S3' && 
$common.isEmptyString(item.discovery.S3.bucketName))
-                return $common.showPopoverMessage($scope.panels, 
'general-data', 'bucketName', 'Bucket name should not be empty');
+                return showPopoverMessage($scope.panels, 'general-data', 
'bucketName', 'Bucket name should not be empty');
 
             if (item.discovery.kind == 'Cloud') {
                 if ($common.isEmptyString(item.discovery.Cloud.identity))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'identity', 'Identity should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'identity', 'Identity should not be empty');
 
                 if ($common.isEmptyString(item.discovery.Cloud.provider))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'provider', 'Provider should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'provider', 'Provider should not be empty');
             }
 
             if (item.discovery.kind == 'GoogleStorage') {
                 if 
($common.isEmptyString(item.discovery.GoogleStorage.projectName))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'projectName', 'Project name should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'projectName', 'Project name should not be empty');
 
                 if 
($common.isEmptyString(item.discovery.GoogleStorage.bucketName))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'bucketName', 'Bucket name should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'bucketName', 'Bucket name should not be empty');
 
                 if 
($common.isEmptyString(item.discovery.GoogleStorage.serviceAccountP12FilePath))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'serviceAccountP12FilePath', 'Private key path should not be 
empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'serviceAccountP12FilePath', 'Private key path should not be empty');
 
                 if 
($common.isEmptyString(item.discovery.GoogleStorage.serviceAccountId))
-                    return $common.showPopoverMessage($scope.panels, 
'general-data', 'serviceAccountId', 'Account ID should not be empty');
+                    return showPopoverMessage($scope.panels, 'general-data', 
'serviceAccountId', 'Account ID should not be empty');
             }
 
             if (!item.swapSpaceSpi || !item.swapSpaceSpi.kind && item.caches) {
@@ -294,7 +289,7 @@ controlCenterModule.controller('clustersController', 
['$scope', '$http', '$commo
                         if (cache.swapEnabled) {
                             $scope.ui.expanded = true;
 
-                            return $common.showPopoverMessage($scope.panels, 
'swap-data', 'swapSpaceSpi',
+                            return showPopoverMessage($scope.panels, 
'swap-data', 'swapSpaceSpi',
                                 'Swap space SPI is not configured, but cache 
"' + cache.label + '" configured to use swap!');
                         }
                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1e4f2e0/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 0c2ff72..6d91134 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
@@ -145,15 +145,15 @@ controlCenterModule.service('$common', [
 
         var VALID_JAVA_IDENTIFIER = new RegExp('^[a-zA-Z_$][a-zA-Z\d_$]*');
 
-        function isValidJavaIdentifier(msg, ident) {
+        function isValidJavaIdentifier(msg, ident, elemId) {
             if (isEmptyString(ident))
-                return showError(msg + ' could not be empty!');
+                return showPopoverMessage(null, null, elemId, msg + ' could 
not be empty!');
 
             if (_.contains(JAVA_KEYWORDS, ident))
-                return showError(msg + ' could not contains reserved java 
keyword: "' + ident + '"!');
+                return showPopoverMessage(null, null, elemId, msg + ' could 
not contains reserved java keyword: "' + ident + '"!');
 
             if (!VALID_JAVA_IDENTIFIER.test(ident))
-                return showError(msg + ' contains invalid identifier: "' + 
ident + '"!');
+                return showPopoverMessage(null, null, elemId, msg + ' contains 
invalid identifier: "' + ident + '"!');
 
             return true;
         }
@@ -415,6 +415,31 @@ controlCenterModule.service('$common', [
             }
         }
 
+        function showPopoverMessage(panels, panelId, id, message) {
+            ensureActivePanel(panels, panelId);
+
+            var el = $('body').find('#' + id);
+
+            if (popover)
+                popover.hide();
+
+            var newPopover = $popover(el, {content: message});
+
+            $timeout(function () {
+                $focus(id);
+            }, 50);
+
+            $timeout(function () {
+                newPopover.show();
+
+                popover = newPopover;
+            }, 100);
+
+            $timeout(function () { newPopover.hide() }, 3000);
+
+            return false;
+        }
+
         return {
             getModel: function (obj, field) {
                 var path = field.path;
@@ -480,19 +505,19 @@ controlCenterModule.service('$common', [
             javaBuildInClasses: javaBuildInClasses,
             isJavaBuildInClass: isJavaBuildInClass,
             isValidJavaIdentifier: isValidJavaIdentifier,
-            isValidJavaClass: function (msg, ident, allowBuildInClass) {
+            isValidJavaClass: function (msg, ident, allowBuildInClass, elemId) 
{
                 if (isEmptyString(ident))
-                    return showError(msg + ' could not be empty!');
+                    return showPopoverMessage(null, null, elemId, msg + ' 
could not be empty!');
 
                 var parts = ident.split('.');
 
                 var len = parts.length;
 
                 if (!allowBuildInClass && isJavaBuildInClass(ident))
-                    return showError(msg + ' should not be the Java build-in 
class!');
+                    return showPopoverMessage(null, null, elemId, msg + ' 
should not be the Java build-in class!');
 
                 if (len < 2 && !isJavaBuildInClass(ident))
-                    return showError(msg + ' does not have package 
specified!');
+                    return showPopoverMessage(null, null, elemId, msg + ' does 
not have package specified!');
 
                 for (var i = 0; i < parts.length; i++) {
                     var part = parts[i];
@@ -541,28 +566,7 @@ controlCenterModule.service('$common', [
                 ensureActivePanel(panels, id);
             },
             showPopoverMessage: function (panels, panelId, id, message) {
-                ensureActivePanel(panels, panelId);
-
-                var el = $('body').find('#' + id);
-
-                if (popover)
-                    popover.hide();
-
-                var newPopover = $popover(el, {content: message});
-
-                $timeout(function () {
-                    $focus(id);
-                }, 50);
-
-                $timeout(function () {
-                    newPopover.show();
-
-                    popover = newPopover;
-                }, 100);
-
-                $timeout(function () { newPopover.hide() }, 3000);
-
-                return false;
+                return showPopoverMessage(panels, panelId, id, message)
             },
             hidePopover: function () {
                 if (popover)
@@ -839,6 +843,14 @@ controlCenterModule.service('$table', [
                 var pairValue = _tablePairValue(field, index);
 
                 return !$common.isEmptyString(pairValue.key) && 
!$common.isEmptyString(pairValue.value);
+            },
+            tableFocusInvalidField: function (index, id) {
+                _tableFocus(id, index);
+
+                return false;
+            },
+            tableFieldId: function(index, id) {
+                return (index < 0 ? 'new' : 'cur') + id;
             }
         }
     }]);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/c1e4f2e0/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 17ed895..743413e 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
@@ -45,6 +45,7 @@ controlCenterModule.controller('metadataController', [
             $scope.compactJavaName = $common.compactJavaName;
 
             $scope.hidePopover = $common.hidePopover;
+            var showPopoverMessage = $common.showPopoverMessage;
 
             var presets = [
                 {
@@ -349,17 +350,17 @@ controlCenterModule.controller('metadataController', [
             // Check metadata logical consistency.
             function validate(item) {
                 if ($common.isEmptyString(item.name))
-                    return $common.showPopoverMessage($scope.panels, 
'metadata-data', 'metadataName', 'Name should not be empty');
+                    return showPopoverMessage($scope.panels, 'metadata-data', 
'metadataName', 'Name should not be empty');
 
                 if ($common.isEmptyString(item.keyType))
-                    return $common.showPopoverMessage($scope.panels, 
'metadata-data', 'keyType', 'Key type should not be empty');
-                else if (!$common.isValidJavaClass('Key type', item.keyType, 
true))
-                    return $common.showPopoverMessage($scope.panels, 
'metadata-data', 'keyType', 'Key type should be valid Java class');
+                    return showPopoverMessage($scope.panels, 'metadata-data', 
'keyType', 'Key type should not be empty');
+                else if (!$common.isValidJavaClass('Key type', item.keyType, 
true, 'keyType'))
+                    return showPopoverMessage($scope.panels, 'metadata-data', 
'keyType', 'Key type should be valid Java class');
 
                 if ($common.isEmptyString(item.valueType))
-                    return $common.showPopoverMessage($scope.panels, 
'metadata-data', 'valueType', 'Value type should not be empty');
-                else if (!$common.isValidJavaClass('Value type', 
item.valueType, false))
-                    return $common.showPopoverMessage($scope.panels, 
'metadata-data', 'valueType', 'Value type should valid Java class');
+                    return showPopoverMessage($scope.panels, 'metadata-data', 
'valueType', 'Value type should not be empty');
+                else if (!$common.isValidJavaClass('Value type', 
item.valueType, false, 'valueType'))
+                    return showPopoverMessage($scope.panels, 'metadata-data', 
'valueType', 'Value type should valid Java class');
 
                 var qry = queryConfigured(item);
 
@@ -372,10 +373,10 @@ controlCenterModule.controller('metadataController', [
                             var fields = group.fields;
 
                             if ($common.isEmptyArray(fields))
-                                return 
$common.showPopoverMessage($scope.panels, 'metadataQuery-data', 'groups' + i, 
'Group fields are not specified');
+                                return showPopoverMessage($scope.panels, 
'metadataQuery-data', 'groups' + i, 'Group fields are not specified');
 
                             if (fields.length == 1) {
-                                return 
$common.showPopoverMessage($scope.panels, 'metadataQuery-data', 'groups' + i, 
'Group has only one field. Consider to use ascending or descending fields.');
+                                return showPopoverMessage($scope.panels, 
'metadataQuery-data', 'groups' + i, 'Group has only one field. Consider to use 
ascending or descending fields.');
                             }
                         }
                     }
@@ -385,19 +386,19 @@ controlCenterModule.controller('metadataController', [
 
                 if (str) {
                     if ($common.isEmptyString(item.databaseSchema))
-                        return $common.showPopoverMessage($scope.panels, 
'metadataCache-data', 'databaseSchema', 'Database schema should not be empty');
+                        return showPopoverMessage($scope.panels, 
'metadataCache-data', 'databaseSchema', 'Database schema should not be empty');
 
                     if ($common.isEmptyString(item.databaseTable))
-                        return $common.showPopoverMessage($scope.panels, 
'metadataCache-data', 'databaseTable', 'Database table should not be empty');
+                        return showPopoverMessage($scope.panels, 
'metadataCache-data', 'databaseTable', 'Database table should not be empty');
 
                     if ($common.isEmptyArray(item.keyFields) && 
!$common.isJavaBuildInClass(item.keyType))
-                        return $common.showPopoverMessage($scope.panels, 
'metadataCache-data', 'keyFields-add', 'Key fields are not specified');
+                        return showPopoverMessage($scope.panels, 
'metadataCache-data', 'keyFields-add', 'Key fields are not specified');
 
                     if ($common.isEmptyArray(item.valueFields))
-                        return $common.showPopoverMessage($scope.panels, 
'metadataCache-data', 'valueFields-add', 'Value fields are not specified');
+                        return showPopoverMessage($scope.panels, 
'metadataCache-data', 'valueFields-add', 'Value fields are not specified');
                 }
                 else if (!qry) {
-                    return $common.showPopoverMessage($scope.panels, 
'metadataQuery-data', 'metadataQuery-data-title', 'SQL query metadata should be 
configured');
+                    return showPopoverMessage($scope.panels, 
'metadataQuery-data', 'metadataQuery-data-title', 'SQL query metadata should be 
configured');
                 }
 
                 return true;
@@ -501,12 +502,6 @@ controlCenterModule.controller('metadataController', [
                     });
             };
 
-            function focusInvalidField(index, id) {
-                $focus(index < 0 ? 'new' + id : 'cur' + id);
-
-                return false;
-            }
-
             $scope.tableSimpleValid = function (item, field, name, index) {
                 var model = item[field.model];
 
@@ -517,7 +512,7 @@ controlCenterModule.controller('metadataController', [
                     if (idx >= 0 && idx != index) {
                         $common.showError('Field with such name already 
exists!');
 
-                        return focusInvalidField(index, 'TextField');
+                        return $table.tableFocusInvalidField(index, 
'TextField');
                     }
                 }
 
@@ -536,8 +531,8 @@ controlCenterModule.controller('metadataController', [
                 var pairValue = $table.tablePairValue(field, index);
 
                 if (pairField) {
-                    if (!$common.isValidJavaClass(pairField.msg, 
pairValue.value, true))
-                        return focusInvalidField(index, 'Value' + 
pairField.id);
+                    if (!$common.isValidJavaClass(pairField.msg, 
pairValue.value, true, $table.tableFieldId(index, 'Value' + pairField.id)))
+                        return $table.tableFocusInvalidField(index, 'Value' + 
pairField.id);
 
                     var model = item[field.model];
 
@@ -550,7 +545,7 @@ controlCenterModule.controller('metadataController', [
                         if (idx >= 0 && idx != index) {
                             $common.showError('Field with such name already 
exists!');
 
-                            return focusInvalidField(index, 'Key' + 
pairField.id);
+                            return $table.tableFocusInvalidField(index, 'Key' 
+ pairField.id);
                         }
                     }
                 }
@@ -587,7 +582,7 @@ controlCenterModule.controller('metadataController', [
                     var model = item[field.model];
 
                     if (!$common.isValidJavaIdentifier(dbFieldTable.msg + ' 
java name', dbFieldValue.javaName))
-                        return focusInvalidField(index, 'JavaName' + 
dbFieldTable.id);
+                        return $table.tableFocusInvalidField(index, 'JavaName' 
+ dbFieldTable.id);
 
                     if ($common.isDefined(model)) {
                         var idx = _.findIndex(model, function (dbMeta) {
@@ -598,7 +593,7 @@ controlCenterModule.controller('metadataController', [
                         if (idx >= 0 && index != idx) {
                             $common.showError('Field with such database name 
already exists!');
 
-                            return focusInvalidField(index, 'DatabaseName' + 
dbFieldTable.id);
+                            return $table.tableFocusInvalidField(index, 
'DatabaseName' + dbFieldTable.id);
                         }
 
                         idx = _.findIndex(model, function (dbMeta) {
@@ -609,7 +604,7 @@ controlCenterModule.controller('metadataController', [
                         if (idx >= 0 && index != idx) {
                             $common.showError('Field with such java name 
already exists!');
 
-                            return focusInvalidField(index, 'JavaName' + 
dbFieldTable.id);
+                            return $table.tableFocusInvalidField(index, 
'JavaName' + dbFieldTable.id);
                         }
 
                         if (index < 0) {
@@ -661,7 +656,7 @@ controlCenterModule.controller('metadataController', [
                     if (idx >= 0 && idx != index) {
                         $common.showError('Group with such name already 
exists!');
 
-                        return focusInvalidField(index, 'GroupName');
+                        return $table.tableFocusInvalidField(index, 
'GroupName');
                     }
                 }
 
@@ -760,8 +755,8 @@ controlCenterModule.controller('metadataController', [
             $scope.tableGroupItemSave = function (field, groupIndex, index) {
                 var groupItemValue = tableGroupItemValue(field, index);
 
-                if (!$common.isValidJavaClass('Group field', 
groupItemValue.className, true))
-                    return focusInvalidField(index, 'ClassName');
+                if (!$common.isValidJavaClass('Group field', 
groupItemValue.className, true, $table.tableFieldId(index, 'ClassName')))
+                    return $table.tableFocusInvalidField(index, 'ClassName');
 
                 var fields = $scope.backupItem.groups[groupIndex].fields;
 
@@ -774,7 +769,7 @@ controlCenterModule.controller('metadataController', [
                     if (idx >= 0 && idx != index) {
                         $common.showError('Field with such name already exists 
in group!');
 
-                        return focusInvalidField(index, 'FieldName');
+                        return $table.tableFocusInvalidField(index, 
'FieldName');
                     }
                 }
 

Reply via email to