You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by an...@apache.org on 2016/01/13 11:55:13 UTC

ignite git commit: IGNITE-843 JavaType service

Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc2 e3397ecb1 -> b3324fa58


IGNITE-843 JavaType service


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

Branch: refs/heads/ignite-843-rc2
Commit: b3324fa58a1137392eb7c71a0e8dc93c123b2778
Parents: e3397ec
Author: Andrey <an...@gridgain.com>
Authored: Wed Jan 13 17:55:12 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Wed Jan 13 17:55:12 2016 +0700

----------------------------------------------------------------------
 .../ui-ace-pojos/ui-ace-pojos.controller.js     |  4 +-
 .../control-center-web/src/main/js/app/index.js |  2 +
 .../src/main/js/app/modules/JavaTypes/index.js  | 51 ++++++++++++++++++++
 3 files changed, 55 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/b3324fa5/modules/control-center-web/src/main/js/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js b/modules/control-center-web/src/main/js/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
index 53d78e4..f0d844a 100644
--- a/modules/control-center-web/src/main/js/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
+++ b/modules/control-center-web/src/main/js/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-export default ['$scope', 'IgniteUiAceOnLoad', function($scope, onLoad) {
+export default ['$scope', 'IgniteUiAceOnLoad', 'JavaTypes', function($scope, onLoad, JavaTypes) {
     const ctrl = this;
 
     // Scope methods.
@@ -50,7 +50,7 @@ export default ['$scope', 'IgniteUiAceOnLoad', function($scope, onLoad) {
         const classes = ctrl.classes = [];
 
         _.forEach(ctrl.metadatas, (meta) => {
-            if (meta.keyType)
+            if (meta.keyType && !JavaTypes.isBuildInClass(meta.keyType))
                 classes.push(meta.keyType);
 
             classes.push(meta.valueType);

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3324fa5/modules/control-center-web/src/main/js/app/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/index.js b/modules/control-center-web/src/main/js/app/index.js
index 1b35b44..a552939 100644
--- a/modules/control-center-web/src/main/js/app/index.js
+++ b/modules/control-center-web/src/main/js/app/index.js
@@ -58,6 +58,7 @@ window.pdfMake = pdfMake;
 import './modules/User/index';
 import './modules/Auth/index';
 import './modules/Form/index';
+import './modules/JavaTypes/index';
 
 import './modules/states/login/index';
 import './modules/states/logout/index';
@@ -100,6 +101,7 @@ angular
     'ignite-console.Auth',
     'ignite-console.User',
     'ignite-console.Form',
+    'ignite-console.JavaTypes',
     // States.
     'ignite-console.states.login',
     'ignite-console.states.logout',

http://git-wip-us.apache.org/repos/asf/ignite/blob/b3324fa5/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js b/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
new file mode 100644
index 0000000..bdaf1f6
--- /dev/null
+++ b/modules/control-center-web/src/main/js/app/modules/JavaTypes/index.js
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import angular from 'angular';
+
+angular
+    .module('ignite-console.JavaTypes', [])
+    .provider('JavaTypes', function () {
+        // Java built-in short class names.
+        const _classes = [
+            'BigDecimal', 'Boolean', 'Byte', 'Date', 'Double', 'Float', 'Integer', 'Long', 'Short', 'String', 'Time', 'Timestamp', 'UUID'
+        ];
+
+        const _types = [
+            'BigDecimal', 'boolean', 'Boolean', 'byte', 'Byte', 'Date', 'double', 'Double', 'float', 'Float',
+            'int', 'Integer', 'long', 'Long', 'short', 'Short', 'String', 'Time', 'Timestamp', 'UUID'
+        ];
+
+        // Java built-in full class names.
+        const _fullNameClasses = [
+            'java.math.BigDecimal', 'java.lang.Boolean', 'java.lang.Byte', 'java.sql.Date', 'java.lang.Double',
+            'java.lang.Float', 'java.lang.Integer', 'java.lang.Long', 'java.lang.Short', 'java.lang.String',
+            'java.sql.Time', 'java.sql.Timestamp', 'java.util.UUID'
+        ];
+
+        this.$get = [function () {
+            return {
+                /**
+                 * @param cls Class name to check.
+                 * @returns 'true' if given class name is a java build-in type.
+                 */
+                isBuildInClass(cls) {
+                    return _.contains(_classes, cls) || _.contains(_fullNameClasses, cls);
+                }
+            };
+        }];
+    });