You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2015/07/02 10:26:58 UTC
[3/9] incubator-ignite git commit: # ignite-843 Cleanup module.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/routes/persistences.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/routes/persistences.js b/modules/webconfig/nodejs/routes/persistences.js
deleted file mode 100644
index 409ff5f..0000000
--- a/modules/webconfig/nodejs/routes/persistences.js
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- * 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.
- */
-
-var router = require('express').Router();
-var db = require('../db');
-var ds = require('../public/javascripts/dataStructures.js'), jdbcTypes = ds.jdbcTypes, javaTypes = ds.javaTypes;
-
-/**
- * Send spaces and persistences accessed for user account.
- *
- * @param req Request.
- * @param res Response.
- */
-function selectAll(req, res) {
- var user_id = req.user._id;
-
- // 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 persistences for spaces.
- db.Persistence.find({space: {$in: space_ids}}, function (err, persistences) {
- if (err)
- return res.status(500).send(err.message);
-
- res.json({spaces: spaces, persistences: persistences});
- });
- });
-}
-
-/**
- * Get spaces and persistences accessed for user account.
- */
-router.get('/', function(req, res) {
- selectAll(req, res);
-});
-
-/**
- * Save persistence.
- */
-router.post('/save', function(req, res) {
- if (req.body._id)
- db.Persistence.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);
- });
- else {
- var persistence = new db.Persistence(req.body);
-
- persistence.save(function(err, persistence) {
- if (err)
- return res.status(500).send(err.message);
-
- res.send(persistence._id);
- });
- }
-});
-
-/**
- * Remove persistence by ._id.
- */
-router.post('/remove', function(req, res) {
- db.Persistence.remove(req.body, function (err) {
- if (err)
- return res.status(500).send(err.message);
-
- res.sendStatus(200);
- })
-});
-
-// simple countdown latch
-function CDL(countdown, completion) {
- this.countDown = function() {
- if(--countdown < 1) completion();
- };
-}
-
-/**
- * @param name Source name.
- * @return String converted to java class name notation.
- */
-function toJavaClassName(name) {
- var len = name.length;
-
- var buf = [];
-
- var capitalizeNext = true;
-
- for (var i = 0; i < len; i++) {
- var ch = name.charAt(i);
-
- if (' ' == ch || '_' == ch)
- capitalizeNext = true;
- else if (capitalizeNext) {
- buf.push(ch.toUpperCase());
-
- capitalizeNext = false;
- }
- else
- buf.push(ch.toLowerCase());
- }
-
- return buf.join("");
-}
-
-/**
- * @param name Source name.
- * @return String converted to java field name notation.
- */
-function toJavaFieldName(name) {
- var javaName = toJavaClassName(name);
-
- return javaName.charAt(0).toLowerCase() + javaName.substring(1);
-}
-
-
-//
-router.post('/pg', function(req, res) {
- var pg = require('pg');
- var util = require('util');
-
- var host = req.body.host;
- var port = req.body.port;
-
- var username = req.body.username;
- var password = req.body.password;
-
- var dbName = req.body.dbName;
-
- var connectionString = util.format('postgres://%s:%s@%s:%d/%s', username, password, host, port, dbName);
-
- pg.connect(connectionString, function(err, client, done) {
- var sendError = function (err) {
- done();
-
- res.status(500).send(err.message);
- };
-
- if(err)
- return sendError(err);
-
- var sendResponse = function () {
- done();
-
- console.log(JSON.stringify(tables));
-
- res.status(200).send(tables);
- }, jdbcType = function (dataType) {
- switch (dataType) {
- case 'smallint':
- case 'int2':
- return jdbcTypes.SMALLINT;
- case 'integer':
- case 'int':
- case 'int4':
- return jdbcTypes.INTEGER;
- case 'oid':
- case 'bigint':
- case 'int8':
- return jdbcTypes.BIGINT;
- case 'money':
- return jdbcTypes.DOUBLE;
- case 'decimal':
- case 'numeric':
- return jdbcTypes.NUMERIC;
- case 'float4':
- return jdbcTypes.REAL;
- case 'float':
- case 'float8':
- return jdbcTypes.DOUBLE;
- case 'char':
- case 'bpchar':
- return jdbcTypes.CHAR;
- case 'varchar':
- case 'text':
- case 'name':
- return jdbcTypes.VARCHAR;
- case 'bytea':
- return jdbcTypes.BINARY;
- case 'boolean':
- case 'bool':
- case 'bit':
- return jdbcTypes.BIT;
- case 'date':
- return jdbcTypes.DATE;
- case 'time':
- case 'timetz':
- return jdbcTypes.TIME;
- case 'timestamp':
- case 'timestamptz':
- return jdbcTypes.TIMESTAMP;
- }
- }, javaType = function (dataType) {
- switch (dataType) {
- case jdbcTypes.SMALLINT:
- case jdbcTypes.INTEGER:
- return javaTypes.INTEGER;
- case jdbcTypes.BIGINT:
- return javaTypes.LONG;
- case jdbcTypes.DOUBLE:
- return javaTypes.DOUBLE;
- case jdbcTypes.NUMERIC:
- return javaTypes.BIGDECIMAL;
- case jdbcTypes.REAL:
- return javaTypes.FLOAT;
- case jdbcTypes.CHAR:
- case jdbcTypes.VARCHAR:
- return javaTypes.STRING;
- case jdbcTypes.BINARY:
- return javaTypes.BYTE_ARRAY;
- case jdbcTypes.BIT:
- return javaTypes.BOOLEAN;
- case jdbcTypes.DATE:
- return javaTypes.DATE;
- case jdbcTypes.TIME:
- return javaTypes.TIME;
- case jdbcTypes.TIMESTAMP:
- return javaTypes.TIMESTAMP;
- }
- };
-
- var tables = [];
-
- client.query(
- 'SELECT table_schema, table_name ' +
- 'FROM information_schema.tables ' +
- 'WHERE table_schema = ANY (current_schemas(false)) ' +
- 'ORDER BY table_schema, table_name', function(err, result) {
-
- if(err)
- return sendError(err);
-
- if (result.rows.length > 0) {
- // usage
- var latch = new CDL(result.rows.length, sendResponse);
-
- result.rows.forEach(function (table) {
-
- var indisprimary = client.query(
- "SELECT a.attname " +
- "FROM pg_index i " +
- "JOIN pg_attribute a " +
- " ON a.attrelid = i.indrelid AND a.attnum = ANY(i.indkey) " +
- "WHERE i.indrelid = $1::regclass AND i.indisprimary", [table.table_schema + '.' + table.table_name],
- function (err, result) {
- if (err)
- return sendError(err);
-
- var pks = result.rows.map(function(row) {
- return row.attname;
- });
-
- client.query(
- 'SELECT column_name, udt_name, is_nullable ' +
- 'FROM information_schema.columns ' +
- 'WHERE table_schema = $1 AND table_name = $2', [table.table_schema, table.table_name],
- function (err, result) {
- if (err)
- return sendError(err);
-
- var cols = [];
-
- result.rows.forEach(function (column) {
- var dataType = jdbcType(column.udt_name);
-
- cols.push({
- pk: pks.indexOf(column.column_name) >= 0,
- use: true,
- notNull: column.is_nullable == 'NO',
- dbName: column.column_name, dbType: dataType,
- javaName: toJavaFieldName(column.column_name), javaType: javaType(dataType) });
- });
-
- var valClsName = toJavaClassName(table.table_name);
-
- tables.push({
- use: pks.length > 0,
- schemaName: table.table_schema, tableName: table.table_name,
- keyClass: valClsName + 'Key', valueClass: valClsName,
- columns: cols
- });
-
- latch.countDown();
- })
- });
- });
- }
- });
- });
-});
-
-module.exports = router;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/test/routes/persistence.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/test/routes/persistence.js b/modules/webconfig/nodejs/test/routes/persistence.js
deleted file mode 100644
index e5d8390..0000000
--- a/modules/webconfig/nodejs/test/routes/persistence.js
+++ /dev/null
@@ -1,32 +0,0 @@
-var request = require('supertest'),
- should = require('should'),
- express = require('express'),
- persistenceRouter = require('../../routes/persistences');
-
-var app = express();
-
-app.use(require('body-parser').json());
-
-app.use('/rest/persistence', persistenceRouter);
-
-describe('request.persistence', function(){
- var agent = request.agent(app);
-
- it('should return 200', function(done){
- agent
- .post('/rest/persistence/pg')
- .send({
- username: 'nva',
- password: 'nva.141',
- host: 'localhost',
- port: '5432',
- dbName: 'ggmonitor'
- })
- .end(function(err, res) {
- if (err)
- throw err;
-
- done();
- });
- });
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/utils/generatorJava.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/utils/generatorJava.js b/modules/webconfig/nodejs/utils/generatorJava.js
deleted file mode 100644
index 223f85f..0000000
--- a/modules/webconfig/nodejs/utils/generatorJava.js
+++ /dev/null
@@ -1,555 +0,0 @@
-/*
- * 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.
- */
-
-var generatorUtils = require("./generatorUtils");
-
-exports.generateClusterConfiguration = function(cluster, generateJavaClass) {
- var res = generatorUtils.builder();
-
- if (generateJavaClass) {
- res.line('/**');
- res.line(' * ' + generatorUtils.mainComment());
- res.line(' */');
- res.startBlock('public class ConfigurationFactory {');
- res.line();
- res.startBlock('public IgniteConfiguration createConfiguration() {');
- }
-
- res.importClass('org.apache.ignite.configuration.IgniteConfiguration');
-
- res.line('IgniteConfiguration cfg = new IgniteConfiguration();');
- res.line();
-
- if (cluster.discovery) {
- var d = cluster.discovery;
-
- res.importClass('org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi');
- res.line('TcpDiscoverySpi discovery = new TcpDiscoverySpi();');
- switch (d.kind) {
- case 'Multicast':
- addBeanWithProperties(res, d.Multicast, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder', {
- multicastGroup: null,
- multicastPort: null,
- responseWaitTime: null,
- addressRequestAttempts: null,
- localAddress: null
- }, true);
-
- break;
-
- case 'Vm':
- addBeanWithProperties(res, d.Vm, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder', {
- addresses: {type: 'list'}
- }, true);
-
- break;
-
- case 'S3':
- if (d.S3) {
- addBeanWithProperties(res, d.S3, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder', {bucketName: null},
- true);
- }
- else {
- res.importClass('org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder');
-
- res.line('discovery.setIpFinder(new TcpDiscoveryS3IpFinder());');
- }
-
- break;
-
- case 'Cloud':
- addBeanWithProperties(res, d.Cloud, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder', {
- credential: null,
- credentialPath: null,
- identity: null,
- provider: null
- }, true);
-
- break;
-
- case 'GoogleStorage':
- addBeanWithProperties(res, d.GoogleStorage, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder', {
- projectName: null,
- bucketName: null,
- serviceAccountP12FilePath: null
- }, true);
-
- //if (d.GoogleStorage.addrReqAttempts) todo ????
- // res.line('<property name="serviceAccountP12FilePath" value="' + escapeAttr(d.GoogleStorage.addrReqAttempts) + '"/>');
-
- break;
-
- case 'Jdbc':
- res.importClass('org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder');
-
- res.line();
- res.line('TcpDiscoveryJdbcIpFinder ipFinder = new TcpDiscoveryJdbcIpFinder();');
- res.line('ipFinder.setInitSchema(' + (d.Jdbc.initSchema != null || d.Jdbc.initSchema) + ');');
- res.line('discovery.setIpFinder(ipFinder);');
- res.needEmptyLine = true;
-
- break;
-
- case 'SharedFs':
- addBeanWithProperties(res, d.SharedFs, 'discovery', 'ipFinder', 'ipFinder',
- 'org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder', {path: null},
- true);
-
- break;
-
- default:
- throw "Unknown discovery kind: " + d.kind;
- }
-
- res.emptyLineIfNeeded();
-
- res.line('cfg.setDiscoverySpi(discovery);');
-
- res.needEmptyLine = true;
- }
-
- if (cluster.caches && cluster.caches.length > 0) {
- res.emptyLineIfNeeded();
-
- var names = [];
-
- for (var i = 0; i < cluster.caches.length; i++) {
- res.emptyLineIfNeeded();
-
- var cache = cluster.caches[i];
-
- var cacheName = cache.name.replace(/[^A-Za-z_0-9]+/, '_');
- cacheName = 'cache' + cacheName.charAt(0).toLocaleUpperCase() + cacheName.slice(1);
-
- names.push(cacheName);
-
- generateCacheConfiguration(cache, cacheName, res);
-
- res.needEmptyLine = true;
- }
-
- res.emptyLineIfNeeded();
-
- res.append('cfg.setCacheConfiguration(');
-
- for (i = 0; i < names.length; i++) {
- if (i > 0)
- res.append(', ');
-
- res.append(names[i]);
- }
-
- res.line(');');
-
- res.needEmptyLine = true;
- }
-
- addBeanWithProperties(res, cluster.atomicConfiguration, 'cfg', 'atomicConfiguration', 'atomicCfg',
- generatorUtils.atomicConfiguration.className, generatorUtils.atomicConfiguration.fields);
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'networkTimeout');
- addProperty(res, cluster, 'cfg', 'networkSendRetryDelay');
- addProperty(res, cluster, 'cfg', 'networkSendRetryCount');
- addProperty(res, cluster, 'cfg', 'segmentCheckFrequency');
- addProperty(res, cluster, 'cfg', 'waitForSegmentOnStart');
- addProperty(res, cluster, 'cfg', 'discoveryStartupDelay');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'deploymentMode', 'DeploymentMode');
-
- res.needEmptyLine = true;
-
- if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
- res.emptyLineIfNeeded();
-
- if (cluster.includeEventTypes.length == 1) {
- res.importClass('org.apache.ignite.events.EventType');
-
- res.line('cfg.setIncludeEventTypes(EventType.' + cluster.includeEventTypes[0] + ');');
- }
- else {
- res.append('int[] events = new int[EventType.' + cluster.includeEventTypes[0] + '.length');
-
- for (i = 1; i < cluster.includeEventTypes.length; i++) {
- res.line();
-
- res.append(' + EventType.' + cluster.includeEventTypes[i] + '.length');
- }
-
- res.line('];');
- res.line();
- res.line('int k = 0;');
-
- for (i = 0; i < cluster.includeEventTypes.length; i++) {
- res.line();
-
- var e = cluster.includeEventTypes[i];
-
- res.line('System.arraycopy(EventType.' + e + ', 0, events, k, EventType.' + e + '.length);');
- res.line('k += EventType.' + e + '.length;');
- }
-
- res.line();
- res.line('cfg.setIncludeEventTypes(events);');
- }
-
- res.needEmptyLine = true;
- }
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'marshalLocalJobs');
- addProperty(res, cluster, 'cfg', 'marshCacheKeepAliveTime');
- addProperty(res, cluster, 'cfg', 'marshCachePoolSize');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'metricsExpireTime');
- addProperty(res, cluster, 'cfg', 'metricsHistorySize');
- addProperty(res, cluster, 'cfg', 'metricsLogFrequency');
- addProperty(res, cluster, 'cfg', 'metricsUpdateFrequency');
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'peerClassLoadingEnabled');
- addMultiparamProperty(res, cluster, 'cfg', 'peerClassLoadingLocalClassPathExclude');
- addProperty(res, cluster, 'cfg', 'peerClassLoadingMissedResourcesCacheSize');
- addProperty(res, cluster, 'cfg', 'peerClassLoadingThreadPoolSize');
- res.needEmptyLine = true;
-
- if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
- addBeanWithProperties(res, cluster.swapSpaceSpi.FileSwapSpaceSpi, 'cfg', 'swapSpaceSpi', 'swapSpi',
- generatorUtils.swapSpaceSpi.className, generatorUtils.swapSpaceSpi.fields, true);
-
- res.needEmptyLine = true;
- }
-
- addProperty(res, cluster, 'cfg', 'clockSyncSamples');
- addProperty(res, cluster, 'cfg', 'clockSyncFrequency');
- addProperty(res, cluster, 'cfg', 'timeServerPortBase');
- addProperty(res, cluster, 'cfg', 'timeServerPortRange');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'publicThreadPoolSize');
- addProperty(res, cluster, 'cfg', 'systemThreadPoolSize');
- addProperty(res, cluster, 'cfg', 'managementThreadPoolSize');
- addProperty(res, cluster, 'cfg', 'igfsThreadPoolSize');
-
- res.needEmptyLine = true;
-
- addBeanWithProperties(res, cluster.transactionConfiguration, 'cfg', 'transactionConfiguration',
- 'transactionConfiguration', generatorUtils.transactionConfiguration.className,
- generatorUtils.transactionConfiguration.fields);
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'cacheSanityCheckEnabled');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cfg', 'utilityCacheKeepAliveTime');
- addProperty(res, cluster, 'cfg', 'utilityCachePoolSize');
-
- if (generateJavaClass) {
- res.line('return cfg;');
- res.endBlock('}');
- res.endBlock('}');
-
- return res.generateImports() + '\n\n' + res.join('')
- }
-
- return res.join('');
-};
-
-function createEvictionPolicy(res, evictionPolicy, varName, propertyName) {
- if (evictionPolicy && evictionPolicy.kind) {
- var e = generatorUtils.evictionPolicies[evictionPolicy.kind];
-
- var obj = evictionPolicy[evictionPolicy.kind.toUpperCase()];
-
- addBeanWithProperties(res, obj, varName, propertyName, propertyName, e.className, e.fields, true);
- }
-}
-
-exports.generateCacheConfiguration = generateCacheConfiguration;
-
-function generateCacheConfiguration(cacheCfg, varName, res) {
- if (!res)
- res = generatorUtils.builder();
-
- res.emptyLineIfNeeded();
-
- res.importClass('org.apache.ignite.configuration.CacheConfiguration');
-
- res.line('CacheConfiguration ' + varName + ' = new CacheConfiguration();');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'name');
-
- addProperty(res, cacheCfg, varName, 'mode', 'CacheMode', 'cacheMode');
-
- addProperty(res, cacheCfg, varName, 'atomicityMode', 'CacheAtomicityMode');
- addProperty(res, cacheCfg, varName, 'backups');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'memoryMode', 'CacheMemoryMode');
- addProperty(res, cacheCfg, varName, 'offHeapMaxMemory');
- addProperty(res, cacheCfg, varName, 'swapEnabled');
-
- res.needEmptyLine = true;
-
- createEvictionPolicy(res, cacheCfg.evictionPolicy, varName, 'evictionPolicy');
-
- if (cacheCfg.nearConfiguration && (cacheCfg.nearConfiguration.nearStartSize || cacheCfg.nearConfiguration.nearEvictionPolicy.kind)) {
- res.needEmptyLine = true;
-
- addBeanWithProperties(res, cacheCfg.nearConfiguration, varName, 'nearConfiguration', 'nearConfiguration',
- 'org.apache.ignite.configuration.NearCacheConfiguration',
- {nearStartSize: null, atomicSequenceReserveSize: null}, true);
-
- if (cacheCfg.nearConfiguration && cacheCfg.nearConfiguration.nearEvictionPolicy && cacheCfg.nearConfiguration.nearEvictionPolicy.kind) {
- createEvictionPolicy(res, cacheCfg.nearConfiguration.nearEvictionPolicy, 'nearConfiguration', 'nearEvictionPolicy');
- }
- }
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'sqlEscapeAll');
- addProperty(res, cacheCfg, varName, 'sqlOnheapRowCacheSize');
- addProperty(res, cacheCfg, varName, 'longQueryWarningTimeout');
-
- if (cacheCfg.indexedTypes && cacheCfg.indexedTypes.length > 0) {
- res.emptyLineIfNeeded();
-
- res.append(varName + '.setIndexedTypes(');
-
- for (var i = 0; i < cacheCfg.indexedTypes.length; i++) {
- if (i > 0)
- res.append(', ');
-
- var pair = cacheCfg.indexedTypes[i];
-
- res.append(toJavaCode(pair.keyClass, 'class')).append(', ').append(toJavaCode(pair.valueClass, 'class'))
- }
-
- res.line(');');
- }
-
- addMultiparamProperty(res, cacheCfg, varName, 'sqlFunctionClasses', 'class');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'rebalanceMode', 'CacheRebalanceMode');
- addProperty(res, cacheCfg, varName, 'rebalanceThreadPoolSize');
- addProperty(res, cacheCfg, varName, 'rebalanceBatchSize');
- addProperty(res, cacheCfg, varName, 'rebalanceOrder');
- addProperty(res, cacheCfg, varName, 'rebalanceDelay');
- addProperty(res, cacheCfg, varName, 'rebalanceTimeout');
- addProperty(res, cacheCfg, varName, 'rebalanceThrottle');
-
- res.needEmptyLine = true;
-
- if (cacheCfg.cacheStoreFactory && cacheCfg.cacheStoreFactory.kind) {
- var obj = cacheCfg.cacheStoreFactory[cacheCfg.cacheStoreFactory.kind];
- var data = generatorUtils.storeFactories[cacheCfg.cacheStoreFactory.kind];
-
- addBeanWithProperties(res, obj, varName, 'cacheStoreFactory', 'cacheStoreFactory', data.className,
- data.fields, true);
- }
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'invalidate');
- addProperty(res, cacheCfg, varName, 'defaultLockTimeout');
- addProperty(res, cacheCfg, varName, 'transactionManagerLookupClassName');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'writeBehindEnabled');
- addProperty(res, cacheCfg, varName, 'writeBehindBatchSize');
- addProperty(res, cacheCfg, varName, 'writeBehindFlushSize');
- addProperty(res, cacheCfg, varName, 'writeBehindFlushFrequency');
- addProperty(res, cacheCfg, varName, 'writeBehindFlushThreadCount');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, varName, 'statisticsEnabled');
- addProperty(res, cacheCfg, varName, 'managementEnabled');
- addProperty(res, cacheCfg, varName, 'readFromBackup');
- addProperty(res, cacheCfg, varName, 'copyOnRead');
- addProperty(res, cacheCfg, varName, 'maxConcurrentAsyncOperations');
-
- return res;
-}
-
-function toJavaCode(val, type) {
- if (val == null)
- return 'null';
-
- if (type == 'float')
- return val + 'f';
-
- if (type == 'class')
- return val + '.class';
-
- if (type)
- return type + '.' + val;
-
- if (typeof(val) == 'string')
- return '"' + val.replace('"', '\\"') + '"';
-
- if (typeof(val) == 'number' || typeof(val) == 'boolean')
- return '' + val;
-
- throw "Unknown type: " + typeof(val) + ' (' + val + ')';
-}
-
-function addProperty(res, obj, objVariableName, propName, enumType, setterName) {
- var val = obj[propName];
-
- if (val) {
- res.emptyLineIfNeeded();
-
- res.line(objVariableName + '.' + getSetterName(setterName ? setterName : propName)
- + '(' + toJavaCode(val, enumType) + ');');
- }
-}
-
-function getSetterName(propName) {
- return 'set' + propName.charAt(0).toLocaleUpperCase() + propName.slice(1);
-}
-
-function addListProperty(res, obj, objVariableName, propName, enumType, setterName) {
- var val = obj[propName];
-
- if (val && val.length > 0) {
- res.append(objVariableName + '.' + getSetterName(setterName ? setterName : propName) + '(Arrays.asList(');
-
- for (var i = 0; i < val.length; i++) {
- if (i > 0)
- res.append(', ');
-
- res.append(toJavaCode(val[i], enumType));
- }
-
- res.line('));');
- }
-}
-
-function addMultiparamProperty(res, obj, objVariableName, propName, type, setterName) {
- var val = obj[propName];
-
- if (val && val.length > 0) {
- res.append(objVariableName + '.' + getSetterName(setterName ? setterName : propName) + '(');
-
- for (var i = 0; i < val.length; i++) {
- if (i > 0)
- res.append(', ');
-
- res.append(toJavaCode(val[i], type));
- }
-
- res.line(');');
- }
-}
-
-function addBeanWithProperties(res, bean, objVarName, beanPropName, beanVarName, beanClass, props, createBeanAlthoughNoProps) {
- if (!bean)
- return;
-
- if (generatorUtils.hasProperty(bean, props)) {
- if (!res.emptyLineIfNeeded()) {
- res.line();
- }
-
- res.line(beanClass + ' ' + beanVarName + ' = new ' + beanClass + '();');
- for (var propName in props) {
- if (props.hasOwnProperty(propName)) {
- var descr = props[propName];
-
- if (descr) {
- switch (descr.type) {
- case 'list':
- addListProperty(res, bean, beanVarName, propName, descr.elementsType, descr.setterName);
- break;
-
- case 'enum':
- addProperty(res, bean, beanVarName, propName, descr.enumClass, descr.setterName);
- break;
-
- case 'float':
- addProperty(res, bean, beanVarName, propName, 'float', descr.setterName);
- break;
-
- case 'propertiesAsList':
- var val = bean[propName];
-
- if (val && val.length > 0) {
- res.line('Properties ' + descr.propVarName + ' = new Properties();');
-
- for (var i = 0; i < val.length; i++) {
- var nameAndValue = val[i];
-
- var eqIndex = nameAndValue.indexOf('=');
- if (eqIndex >= 0) {
- res.line(descr.propVarName + '.setProperty('
- + nameAndValue.substring(0, eqIndex) + ', '
- + nameAndValue.substr(eqIndex + 1) + ');');
- }
-
- }
-
- res.line(beanVarName + '.' + getSetterName(propName) + '(' + descr.propVarName + ');');
- }
- break;
-
- case 'className':
- if (bean[propName]) {
- res.line(beanVarName + '.' + getSetterName(propName) + '(new ' + bean[propName] + '());');
- }
- break;
-
- default:
- addProperty(res, bean, beanVarName, propName, null, descr.setterName);
- }
- }
- else {
- addProperty(res, bean, beanVarName, propName);
- }
- }
- }
-
- res.line(objVarName + '.' + getSetterName(beanPropName) + '(' + beanVarName + ');');
-
- res.needEmptyLine = true;
- }
- else if (createBeanAlthoughNoProps) {
- res.emptyLineIfNeeded();
-
- res.line(objVarName + '.' + getSetterName(beanPropName) + '(new ' + beanClass + '());');
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/utils/generatorUtils.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/utils/generatorUtils.js b/modules/webconfig/nodejs/utils/generatorUtils.js
deleted file mode 100644
index 82df5bb..0000000
--- a/modules/webconfig/nodejs/utils/generatorUtils.js
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * 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.
- */
-
-exports.mainComment = function() {
- return 'This configuration was generated by automatically by Ignite ('
- + formatDate(new Date()) + ')';
-};
-
-function addLeadingZero(numberStr, minSize) {
- if (typeof (numberStr) != 'string')
- numberStr = '' + numberStr;
-
- while (numberStr.length < minSize) {
- numberStr = '0' + numberStr;
- }
-
- return numberStr;
-}
-
-exports.formatDate = formatDate;
-
-function formatDate(date) {
- var dd = addLeadingZero(date.getDate(), 2);
- var mm = addLeadingZero(date.getMonth() + 1, 2);
-
- var yyyy = date.getFullYear();
-
- return mm + '/' + dd + '/' + yyyy + ' ' + addLeadingZero(date.getHours(), 2) + ':' + addLeadingZero(date.getMinutes(), 2);
-}
-
-exports.builder = function () {
- var res = [];
-
- res.deep = 0;
- res.lineStart = true;
-
- res.append = function(s) {
- if (this.lineStart) {
- for (var i = 0; i < this.deep; i++)
- this.push(' ');
-
- this.lineStart = false;
- }
-
- this.push(s);
-
- return this;
- };
-
- res.line = function(s) {
- if (s)
- this.append(s);
-
- this.push('\n');
- this.lineStart = true;
-
- return this;
- };
-
- res.startBlock = function(s) {
- if (s)
- this.append(s);
-
- this.push('\n');
- this.lineStart = true;
- this.deep++;
-
- return this;
- };
-
- res.endBlock = function(s) {
- this.deep--;
-
- if (s)
- this.append(s);
-
- this.push('\n');
- this.lineStart = true;
-
- return this;
- };
-
- res.emptyLineIfNeeded = function() {
- if (this.needEmptyLine) {
- this.line();
-
- this.needEmptyLine = false;
-
- return true;
- }
-
- return false;
- };
-
- res.imports = {};
-
- res.importClass = function(fullClassName) {
- var dotIdx = fullClassName.lastIndexOf('.');
-
- var shortName;
-
- if (dotIdx > 0)
- shortName = fullClassName.substr(dotIdx + 1);
- else
- shortName = fullClassName;
-
- if (this.imports[shortName]) {
- if (this.imports[shortName] != fullClassName)
- throw "Class name conflict: " + this.imports[shortName] + ' and ' + fullClassName;
- }
- else {
- this.imports[shortName] = fullClassName;
- }
-
- return shortName;
- };
-
- res.generateImports = function() {
- var res = [];
-
- for (var clsName in this.imports) {
- if (this.imports.hasOwnProperty(clsName))
- res.push('import ' + this.imports[clsName] + ';');
- }
-
- return res.join('\n')
- };
-
- return res;
-};
-
-function ClassDescriptor(className, fields) {
- this.className = className;
-
- this.fields = fields;
-}
-
-exports.evictionPolicies = {
- 'LRU': new ClassDescriptor('org.apache.ignite.cache.eviction.lru.LruEvictionPolicy',
- {batchSize: null, maxMemorySize: null, maxSize: null}),
- 'RND': new ClassDescriptor('org.apache.ignite.cache.eviction.random.RandomEvictionPolicy', {maxSize: null}),
- 'FIFO': new ClassDescriptor('org.apache.ignite.cache.eviction.fifo.FifoEvictionPolicy',
- {batchSize: null, maxMemorySize: null, maxSize: null}),
- 'SORTED': new ClassDescriptor('org.apache.ignite.cache.eviction.sorted.SortedEvictionPolicy',
- {batchSize: null, maxMemorySize: null, maxSize: null})
-};
-
-exports.knownClasses = {
-
-
- OracleDialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.OracleDialect', {}),
- BasicJdbcDialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect', {}),
- DB2Dialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect', {}),
- SQLServerDialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect', {}),
- MySQLDialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect', {}),
- H2Dialect: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.dialect.H2Dialect', {})
-};
-
-exports.storeFactories = {
- CacheJdbcPojoStoreFactory: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory', {
- dataSourceBean: null,
- dialect: {type: 'className'}
- }),
-
- CacheJdbcBlobStoreFactory: new ClassDescriptor('org.apache.ignite.cache.store.jdbc.CacheJdbcBlobStoreFactory', {
- user: null,
- dataSourceBean: null,
- initSchema: null,
- createTableQuery: null,
- loadQuery: null,
- insertQuery: null,
- updateQuery: null,
- deleteQuery: null
- }),
-
- CacheHibernateBlobStoreFactory: new ClassDescriptor('org.apache.ignite.cache.store.hibernate.CacheHibernateBlobStoreFactory', {
- hibernateProperties: {type: 'propertiesAsList', propVarName: 'props'}
- })
-};
-
-exports.atomicConfiguration = new ClassDescriptor('org.apache.ignite.configuration.AtomicConfiguration', {
- backups: null,
- cacheMode: {type: 'enum', enumClass: 'CacheMode'},
- atomicSequenceReserveSize: null
-});
-
-exports.swapSpaceSpi = new ClassDescriptor('org.apache.ignite.spi.swapspace.file.FileSwapSpaceSpi', {
- baseDirectory: null,
- readStripesNumber: null,
- maximumSparsity: {type: 'float'},
- maxWriteQueueSize: null,
- writeBufferSize: null
-});
-
-exports.transactionConfiguration = new ClassDescriptor('org.apache.ignite.configuration.TransactionConfiguration', {
- defaultTxConcurrency: {type: 'enum', enumClass: 'TransactionConcurrency'},
- transactionIsolation: {type: 'TransactionIsolation', setterName: 'defaultTxIsolation'},
- defaultTxTimeout: null,
- pessimisticTxLogLinger: null,
- pessimisticTxLogSize: null,
- txSerializableEnabled: null
-});
-
-exports.hasProperty = function(obj, props) {
- for (var propName in props) {
- if (props.hasOwnProperty(propName)) {
- if (obj[propName])
- return true;
- }
- }
-
- return false;
-};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/utils/generatorXml.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/utils/generatorXml.js b/modules/webconfig/nodejs/utils/generatorXml.js
deleted file mode 100644
index ae7ffbc..0000000
--- a/modules/webconfig/nodejs/utils/generatorXml.js
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
- * 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.
- */
-
-var generatorUtils = require("./generatorUtils");
-var dataStructures = require("../public/javascripts/dataStructures.js");
-
-exports.generateClusterConfiguration = function(cluster) {
- var res = generatorUtils.builder();
-
- res.push('' +
- '<?xml version="1.0" encoding="UTF-8"?>\n' +
- '\n' +
- '<!-- ' + generatorUtils.mainComment() + ' -->\n' +
- '<beans xmlns="http://www.springframework.org/schema/beans"\n' +
- ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n' +
- ' xmlns:util="http://www.springframework.org/schema/util"\n' +
- ' xsi:schemaLocation="http://www.springframework.org/schema/beans\n' +
- ' http://www.springframework.org/schema/beans/spring-beans.xsd\n' +
- ' http://www.springframework.org/schema/util\n' +
- ' http://www.springframework.org/schema/util/spring-util.xsd">\n' +
- ' <bean class="org.apache.ignite.configuration.IgniteConfiguration">\n');
-
- res.deep = 2;
-
- if (cluster.discovery) {
- res.startBlock('<property name="discoverySpi">');
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">');
- res.startBlock('<property name="ipFinder">');
-
- var d = cluster.discovery;
-
- switch (d.kind) {
- case 'Multicast':
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">');
-
- addProperty(res, d.Multicast, 'multicastGroup');
- addProperty(res, d.Multicast, 'multicastPort');
- addProperty(res, d.Multicast, 'responseWaitTime');
- addProperty(res, d.Multicast, 'addressRequestAttempts');
- addProperty(res, d.Multicast, 'localAddress');
-
- res.endBlock('</bean>');
-
- break;
-
- case 'Vm':
- if (d.Vm.addresses.length > 0) {
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">');
-
- addListProperty(res, d.Vm, 'addresses');
-
- res.endBlock('</bean>');
- }
- else {
- res.line('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder"/>');
- }
-
- break;
-
- case 'S3':
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.s3.TcpDiscoveryS3IpFinder">');
-
- if (d.S3 && d.S3.bucketName)
- res.line('<property name="bucketName" value="' + escapeAttr(d.S3.bucketName) + '" />');
-
- res.endBlock('</bean>');
-
- break;
-
- case 'Cloud':
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.cloud.TcpDiscoveryCloudIpFinder">');
-
- addProperty(res, d.Cloud, 'credential');
- addProperty(res, d.Cloud, 'credentialPath');
- addProperty(res, d.Cloud, 'identity');
- addProperty(res, d.Cloud, 'provider');
-
- res.endBlock('</bean>');
-
- break;
-
- case 'GoogleStorage':
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.gce.TcpDiscoveryGoogleStorageIpFinder">');
-
- addProperty(res, d.GoogleStorage, 'projectName');
- addProperty(res, d.GoogleStorage, 'bucketName');
- addProperty(res, d.GoogleStorage, 'serviceAccountP12FilePath');
-
- //if (d.GoogleStorage.addrReqAttempts) todo ????
- // res.line('<property name="serviceAccountP12FilePath" value="' + escapeAttr(d.GoogleStorage.addrReqAttempts) + '"/>');
-
- res.endBlock('</bean>');
-
- break;
-
- case 'Jdbc':
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.jdbc.TcpDiscoveryJdbcIpFinder">');
- res.line('<property name="initSchema" value="' + (d.Jdbc.initSchema != null || d.Jdbc.initSchema) + '"/>');
- res.endBlock('</bean>');
-
- break;
-
- case 'SharedFs':
- if (d.SharedFs.path) {
- res.startBlock('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder">');
- addProperty(res, d.SharedFs, 'path');
- res.endBlock('</bean>');
- }
- else {
- res.line('<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.sharedfs.TcpDiscoverySharedFsIpFinder"/>');
- }
-
- break;
-
- default:
- throw "Unknown discovery kind: " + d.kind;
- }
-
- res.endBlock('</property>');
- res.endBlock('</bean>');
- res.endBlock('</property>');
-
- res.needEmptyLine = true
- }
-
- if (cluster.caches && cluster.caches.length > 0) {
- res.emptyLineIfNeeded();
-
- res.startBlock('<property name="cacheConfiguration">');
- res.startBlock('<list>');
-
- for (var i = 0; i < cluster.caches.length; i++) {
- if (i > 0)
- res.line();
-
- generateCacheConfiguration(cluster.caches[i], res);
- }
-
- res.endBlock('</list>');
- res.endBlock('</property>');
-
- res.needEmptyLine = true;
- }
-
- if (cluster.includeEventTypes && cluster.includeEventTypes.length > 0) {
- res.emptyLineIfNeeded();
-
- res.startBlock('<property name="includeEventTypes">');
-
- if (cluster.includeEventTypes.length == 1) {
- res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + cluster.includeEventTypes[0] + '"/>')
- }
- else {
- res.startBlock('<array>');
-
- for (i = 0; i < cluster.includeEventTypes.length; i++) {
- if (i > 0)
- res.line();
-
- var eventGroup = cluster.includeEventTypes[i];
-
- res.line('<!-- EventType.' + eventGroup + ' -->');
-
- var eventList = dataStructures.eventGroups[eventGroup];
-
- for (var k = 0; k < eventList.length; k++) {
- res.line('<util:constant static-field="org.apache.ignite.events.EventType.' + eventList[k] + '"/>')
- }
- }
-
- res.endBlock('</array>');
- }
-
- res.endBlock('</property>');
-
- res.needEmptyLine = true;
- }
-
- addBeanWithProperties(res, cluster.atomicConfiguration, 'atomicConfiguration',
- generatorUtils.atomicConfiguration.className, generatorUtils.atomicConfiguration.fields);
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'networkTimeout');
- addProperty(res, cluster, 'networkSendRetryDelay');
- addProperty(res, cluster, 'networkSendRetryCount');
- addProperty(res, cluster, 'segmentCheckFrequency');
- addProperty(res, cluster, 'waitForSegmentOnStart');
- addProperty(res, cluster, 'discoveryStartupDelay');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'deploymentMode');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'marshalLocalJobs');
- addProperty(res, cluster, 'marshCacheKeepAliveTime');
- addProperty(res, cluster, 'marshCachePoolSize');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'metricsExpireTime');
- addProperty(res, cluster, 'metricsHistorySize');
- addProperty(res, cluster, 'metricsLogFrequency');
- addProperty(res, cluster, 'metricsUpdateFrequency');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'peerClassLoadingEnabled');
- addListProperty(res, cluster, 'peerClassLoadingLocalClassPathExclude');
- addProperty(res, cluster, 'peerClassLoadingMissedResourcesCacheSize');
- addProperty(res, cluster, 'peerClassLoadingThreadPoolSize');
-
- res.needEmptyLine = true;
-
- if (cluster.swapSpaceSpi && cluster.swapSpaceSpi.kind == 'FileSwapSpaceSpi') {
- addBeanWithProperties(res, cluster.swapSpaceSpi.FileSwapSpaceSpi, 'swapSpaceSpi',
- generatorUtils.swapSpaceSpi.className, generatorUtils.swapSpaceSpi.fields, true);
-
- res.needEmptyLine = true;
- }
-
- addProperty(res, cluster, 'clockSyncSamples');
- addProperty(res, cluster, 'clockSyncFrequency');
- addProperty(res, cluster, 'timeServerPortBase');
- addProperty(res, cluster, 'timeServerPortRange');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'publicThreadPoolSize');
- addProperty(res, cluster, 'systemThreadPoolSize');
- addProperty(res, cluster, 'managementThreadPoolSize');
- addProperty(res, cluster, 'igfsThreadPoolSize');
-
- res.needEmptyLine = true;
-
- addBeanWithProperties(res, cluster.transactionConfiguration, 'transactionConfiguration',
- generatorUtils.transactionConfiguration.className, generatorUtils.transactionConfiguration.fields);
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'cacheSanityCheckEnabled');
-
- res.needEmptyLine = true;
-
- addProperty(res, cluster, 'utilityCacheKeepAliveTime');
- addProperty(res, cluster, 'utilityCachePoolSize');
-
- res.push(' </bean>\n');
- res.push('</beans>');
-
- return res.join('');
-};
-
-function createEvictionPolicy(res, evictionPolicy, propertyName) {
- if (evictionPolicy && evictionPolicy.kind) {
- var e = generatorUtils.evictionPolicies[evictionPolicy.kind];
-
- var obj = evictionPolicy[evictionPolicy.kind.toUpperCase()];
-
- addBeanWithProperties(res, obj, propertyName, e.className, e.fields, true);
- }
-}
-
-function generateCacheConfiguration(cacheCfg, res) {
- if (!res)
- res = generatorUtils.builder();
-
- res.startBlock('<bean class="org.apache.ignite.configuration.CacheConfiguration">');
-
- addProperty(res, cacheCfg, 'name');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'mode', 'cacheMode');
-
- addProperty(res, cacheCfg, 'atomicityMode');
- addProperty(res, cacheCfg, 'backups');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'memoryMode');
- addProperty(res, cacheCfg, 'offHeapMaxMemory');
- addProperty(res, cacheCfg, 'swapEnabled');
-
- res.needEmptyLine = true;
-
- createEvictionPolicy(res, cacheCfg.evictionPolicy, 'evictionPolicy');
-
- res.needEmptyLine = true;
-
- if (cacheCfg.nearConfiguration && (cacheCfg.nearConfiguration.nearStartSize || cacheCfg.nearConfiguration.nearEvictionPolicy.kind)) {
- res.emptyLineIfNeeded();
-
- res.startBlock('<property name="nearConfiguration">');
- res.startBlock('<bean class="org.apache.ignite.configuration.NearCacheConfiguration">');
-
- addProperty(res, cacheCfg.nearConfiguration, 'nearStartSize');
-
- createEvictionPolicy(res, cacheCfg.nearConfiguration.nearEvictionPolicy, 'nearEvictionPolicy');
-
- res.endBlock('</bean>');
- res.endBlock('</property>');
- }
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'sqlEscapeAll');
- addProperty(res, cacheCfg, 'sqlOnheapRowCacheSize');
- addProperty(res, cacheCfg, 'longQueryWarningTimeout');
-
- if (cacheCfg.indexedTypes && cacheCfg.indexedTypes.length > 0) {
- res.startBlock('<property name="indexedTypes">');
- res.startBlock('<array>');
-
- for (var i = 0; i < cacheCfg.indexedTypes.length; i++) {
- var pair = cacheCfg.indexedTypes[i];
-
- res.line('<value>' + escape(pair.keyClass) + '</value>');
- res.line('<value>' + escape(pair.valueClass) + '</value>');
- }
-
- res.endBlock('</array>');
- res.endBlock('</property>');
- }
-
- addListProperty(res, cacheCfg, 'sqlFunctionClasses', 'array');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'rebalanceMode');
- addProperty(res, cacheCfg, 'rebalanceThreadPoolSize');
- addProperty(res, cacheCfg, 'rebalanceBatchSize');
- addProperty(res, cacheCfg, 'rebalanceOrder');
- addProperty(res, cacheCfg, 'rebalanceDelay');
- addProperty(res, cacheCfg, 'rebalanceTimeout');
- addProperty(res, cacheCfg, 'rebalanceThrottle');
-
- res.needEmptyLine = true;
-
- if (cacheCfg.cacheStoreFactory && cacheCfg.cacheStoreFactory.kind) {
- var obj = cacheCfg.cacheStoreFactory[cacheCfg.cacheStoreFactory.kind];
- var data = generatorUtils.storeFactories[cacheCfg.cacheStoreFactory.kind];
-
- addBeanWithProperties(res, obj, 'cacheStoreFactory', data.className, data.fields, true);
- }
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'invalidate');
- addProperty(res, cacheCfg, 'defaultLockTimeout');
- addProperty(res, cacheCfg, 'transactionManagerLookupClassName');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'writeBehindEnabled');
- addProperty(res, cacheCfg, 'writeBehindBatchSize');
- addProperty(res, cacheCfg, 'writeBehindFlushSize');
- addProperty(res, cacheCfg, 'writeBehindFlushFrequency');
- addProperty(res, cacheCfg, 'writeBehindFlushThreadCount');
-
- res.needEmptyLine = true;
-
- addProperty(res, cacheCfg, 'statisticsEnabled');
- addProperty(res, cacheCfg, 'managementEnabled');
- addProperty(res, cacheCfg, 'readFromBackup');
- addProperty(res, cacheCfg, 'copyOnRead');
- addProperty(res, cacheCfg, 'maxConcurrentAsyncOperations');
-
- res.endBlock('</bean>');
-
- return res;
-}
-
-exports.generateCacheConfiguration = generateCacheConfiguration;
-
-function addProperty(res, obj, propName, setterName) {
- var val = obj[propName];
-
- if (val) {
- res.emptyLineIfNeeded();
-
- res.line('<property name="' + (setterName ? setterName : propName) + '" value="' + escapeAttr(val) + '"/>');
- }
-}
-
-function addBeanWithProperties(res, bean, beanPropName, beanClass, props, createBeanAlthoughNoProps) {
- if (!bean)
- return;
-
- if (generatorUtils.hasProperty(bean, props)) {
- res.emptyLineIfNeeded();
- res.startBlock('<property name="' + beanPropName + '">');
- res.startBlock('<bean class="' + beanClass + '">');
-
- for (var propName in props) {
- if (props.hasOwnProperty(propName)) {
- var descr = props[propName];
-
- if (descr) {
- if (descr.type == 'list') {
- addListProperty(res, bean, propName, descr.setterName);
- }
- else if (descr.type == 'className') {
- if (bean[propName]) {
- res.startBlock('<property name="' + propName + '">');
- res.line('<bean class="' + generatorUtils.knownClasses[bean[propName]].className + '"/>');
- res.endBlock('</property>');
- }
- }
- else if (descr.type == 'propertiesAsList') {
- var val = bean[propName];
-
- if (val && val.length > 0) {
- res.startBlock('<property name="' + propName + '">');
- res.startBlock('<props>');
-
- for (var i = 0; i < val.length; i++) {
- var nameAndValue = val[i];
-
- var eqIndex = nameAndValue.indexOf('=');
- if (eqIndex >= 0) {
- res.line('<prop key="' + escapeAttr(nameAndValue.substring(0, eqIndex)) + '">' +
- + escape(nameAndValue.substr(eqIndex + 1)) + '</prop>');
- }
- }
-
- res.endBlock('</props>');
- res.endBlock('</property>');
- }
- }
- else {
- addProperty(res, bean, propName, descr.setterName);
- }
- }
- else {
- addProperty(res, bean, propName);
- }
- }
- }
-
- res.endBlock('</bean>');
- res.endBlock('</property>');
- }
- else if (createBeanAlthoughNoProps) {
- res.emptyLineIfNeeded();
- res.line('<property name="' + beanPropName + '">');
- res.line(' <bean class="' + beanClass + '"/>');
- res.line('</property>');
- }
-}
-function addListProperty(res, obj, propName, listType, rowFactory) {
- var val = obj[propName];
-
- if (val && val.length > 0) {
- res.emptyLineIfNeeded();
-
- if (!listType)
- listType = 'list';
-
- if (!rowFactory)
- rowFactory = function(val) { return '<value>' + escape(val) + '</value>' };
-
- res.startBlock('<property name="' + propName + '">');
- res.startBlock('<' + listType + '>');
-
- for (var i = 0; i < val.length; i++)
- res.line(rowFactory(val[i]));
-
- res.endBlock('</' + listType + '>');
- res.endBlock('</property>');
- }
-}
-
-function escapeAttr(s) {
- if (typeof(s) != 'string')
- return s;
-
- return s.replace(/&/g, '&').replace(/"/g, '"');
-}
-
-function escape(s) {
- if (typeof(s) != 'string')
- return s;
-
- return s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
-}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/caches.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/caches.jade b/modules/webconfig/nodejs/views/caches.jade
deleted file mode 100644
index d6bda10..0000000
--- a/modules/webconfig/nodejs/views/caches.jade
+++ /dev/null
@@ -1,68 +0,0 @@
-//-
- 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.
-
-extends layout-sidebar
-
-append scripts
- script(src='/javascripts/controllers/caches.js')
-
-include includes/controls
-
-block content
- .docs-header
- h1 Caches
- p Create and configure Ignite caches.
- hr
- .docs-body(ng-controller='cachesController')
- .links(ng-hide='caches.length == 0')
- table.col-sm-12(st-table='caches')
- tbody
- tr(ng-repeat='row in caches track by row._id')
- td.col-sm-6(ng-class='{active: row._id == selectedItem._id}')
- a(ng-click='selectItem(row)') {{$index + 1}}. {{row.name}}, {{row.mode | displayValue:modes:'Cache mode not set'}}, {{row.atomicityMode | displayValue:atomicities:'Cache atomicity not set'}}
- button.btn.btn-primary(ng-click='createItem()') Add cache
- hr
- form.form-horizontal(name='inputForm' ng-if='backupItem' novalidate)
- div(bs-collapse data-start-collapsed='false')
- .panel.panel-default
- .panel-heading
- h3
- a(bs-collapse-toggle) General
- .panel-collapse(bs-collapse-target)
- .panel-body
- .settings-row(ng-repeat='field in general')
- +form-row
- div(bs-collapse data-start-collapsed='true')
- .panel-title(ng-show='expanded')
- h3
- a(bs-collapse-toggle='0' ng-click='expanded = !expanded;') {{expanded ? 'Hide advanced settings...' : 'Show advanced settings...'}}
- .panel-collapse(bs-collapse-target)
- .span(bs-collapse data-start-collapsed='true' data-allow-multiple='true')
- .panel.panel-default(ng-repeat='group in advanced')
- .panel-heading
- h3
- a(bs-collapse-toggle) {{group.label}}
- i.tipLabel.fa.fa-question-circle(ng-if='group.tip' bs-tooltip='joinTip(group.tip)' type='button')
- i.tipLabel.fa.fa-question-circle.blank(ng-if='!group.tip')
- .panel-collapse(bs-collapse-target)
- .panel-body
- .settings-row(ng-repeat='field in group.fields')
- +form-row
- .panel-title
- h3
- a(bs-collapse-toggle='0' ng-click='expanded = !expanded;') {{expanded ? 'Hide advanced settings...' : 'Show advanced settings...'}}
- button#save-btn.btn.btn-primary(ng-disabled='inputForm.$invalid' ng-click='saveItem()') Save
- button.btn.btn-primary.btn-second(ng-show='backupItem._id' ng-click='removeItem()') Remove
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/clients.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/clients.jade b/modules/webconfig/nodejs/views/clients.jade
deleted file mode 100644
index 6b55449..0000000
--- a/modules/webconfig/nodejs/views/clients.jade
+++ /dev/null
@@ -1,26 +0,0 @@
-//-
- 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.
-
-extends layout-sidebar
-block head
-block content
- .docs-header
- h1 Clients
- p Create and configure Ignite clients.
- hr
- .docs-body(ng-controller='clientsRouter')
-block body
- script(src='/javascripts/controllers/clients.js')
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/clusters.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/clusters.jade b/modules/webconfig/nodejs/views/clusters.jade
deleted file mode 100644
index 8bb8ef9..0000000
--- a/modules/webconfig/nodejs/views/clusters.jade
+++ /dev/null
@@ -1,71 +0,0 @@
-//-
- 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.
-
-extends layout-sidebar
-
-append scripts
- script(src='/javascripts/controllers/clusters.js')
-
-include includes/controls
-
-block content
- .docs-header
- h1 Clusters
- p Create and configure Ignite clusters.
- hr
- .docs-body(ng-controller='clustersController')
- .links(ng-hide='clusters.length == 0')
- table.col-sm-12(st-table='clusters')
- tbody
- tr(ng-repeat='row in clusters track by row._id')
- td.col-sm-6(ng-class='{active: row._id == selectedItem._id}')
- a(ng-click='selectItem(row)') {{$index + 1}}. {{row.name}}, {{row.discovery.kind | displayValue:discoveries:'Discovery not set'}}
- button.btn.btn-primary(ng-click='createItem()' ng-disabled='!create.template')  Add cluster
- label(style='margin-left: 15px; margin-right: 10px') Use template:
- button.btn.btn-default(ng-init='create.template = templates[0].value' ng-model='create.template' data-template='/select' data-placeholder='Choose cluster template' bs-options='item.value as item.label for item in templates' bs-select)
- i.tiplabel.fa.fa-question-circle(bs-tooltip data-title='{{joinTip(templateTip)}}' type='button')
- hr
- form.form-horizontal(name='inputForm' ng-if='backupItem' novalidate)
- div(bs-collapse data-start-collapsed='false')
- .panel.panel-default
- .panel-heading
- h3
- a(bs-collapse-toggle) General
- .panel-collapse(bs-collapse-target)
- .panel-body
- .settings-row(ng-repeat='field in general')
- +form-row
- div(bs-collapse data-start-collapsed='true')
- .panel-title(ng-show='expanded')
- h3
- a(bs-collapse-toggle='0' ng-click='expanded = !expanded;') {{expanded ? 'Hide advanced settings...' : 'Show advanced settings...'}}
- .panel-collapse(bs-collapse-target)
- .span(bs-collapse data-start-collapsed='true' data-allow-multiple='true')
- .panel.panel-default(ng-repeat='group in advanced')
- .panel-heading
- h3
- a(bs-collapse-toggle) {{group.label}}
- i.tipLabel.fa.fa-question-circle(ng-if='group.tip' bs-tooltip='joinTip(group.tip)' type='button')
- i.tipLabel.fa.fa-question-circle.blank(ng-if='!group.tip')
- .panel-collapse(bs-collapse-target)
- .panel-body
- .settings-row(ng-repeat='field in group.fields')
- +form-row
- .panel-title
- h3
- a(bs-collapse-toggle='0' ng-click='expanded = !expanded;') {{expanded ? 'Hide advanced settings...' : 'Show advanced settings...'}}
- button#save-btn.btn.btn-primary(ng-disabled='inputForm.$invalid' ng-click='saveItem()') Save
- button.btn.btn-primary(ng-show='backupItem._id' ng-click='removeItem()') Remove
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/error.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/error.jade b/modules/webconfig/nodejs/views/error.jade
deleted file mode 100644
index cfa2ad1..0000000
--- a/modules/webconfig/nodejs/views/error.jade
+++ /dev/null
@@ -1,22 +0,0 @@
-//-
- 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.
-
-extends layout
-
-block container
- h1= message
- h2= error.status
- pre #{error.stack}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/includes/controls.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/includes/controls.jade b/modules/webconfig/nodejs/views/includes/controls.jade
deleted file mode 100644
index 028b187..0000000
--- a/modules/webconfig/nodejs/views/includes/controls.jade
+++ /dev/null
@@ -1,193 +0,0 @@
-//-
- 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.
-
-mixin tipField(lines)
- i.tipField.fa.fa-question-circle(ng-if=lines bs-tooltip='joinTip(#{lines})' type='button')
- i.tipField.fa.fa-question-circle.blank(ng-if='!#{lines}')
-
-mixin tipLabel(lines)
- i.tipLabel.fa.fa-question-circle(ng-if=lines bs-tooltip='joinTip(#{lines})' type='button')
- i.tipLabel.fa.fa-question-circle.blank(ng-if='!#{lines}')
-
-mixin exclamation(mdl, err, msg)
- i.fa.fa-exclamation-triangle.form-control-feedback(ng-show='inputForm["#{mdl}"].$error.#{err}' bs-tooltip data-title='#{msg}' type='button')
-
-mixin details-row
- - var lblDetailClasses = ['col-sm-4', 'details-label']
-
- - var detailMdl = 'getModel(backupItem, detail.path)[detail.model]';
- - var detailCommon = {'ng-model': detailMdl};
-
- div(ng-switch='detail.type')
- div.checkbox(ng-switch-when='check')
- label
- input(type='checkbox')&attributes(detailCommon)
- |{{detail.label}}
- +tipLabel('detail.tip')
- div(ng-switch-when='text')
- label(class=lblDetailClasses) {{detail.label}}:
- .col-sm-8
- +tipField('detail.tip')
- .input-tip
- input.form-control(type='text' placeholder='{{detail.placeholder}}')&attributes(detailCommon)
- div(ng-switch-when='number' )
- label(class=lblDetailClasses) {{detail.label}}:
- .col-sm-8
- +tipField('detail.tip')
- .input-tip
- input.form-control(name='{{detail.model}}' type='number' placeholder='{{detail.placeholder}}' min='{{detail.min ? detail.min : 0}}' max='{{detail.max ? detail.max : Number.MAX_VALUE}}')&attributes(detailCommon)
- +exclamation('{{detail.model}}', 'min', 'Value is less than allowable minimum.')
- +exclamation('{{detail.model}}', 'max', 'Value is more than allowable maximum.')
- +exclamation('{{detail.model}}', 'number', 'Invalid value. Only numbers allowed.')
- div(ng-switch-when='dropdown')
- label(class=lblDetailClasses) {{detail.label}}:
- .col-sm-8
- +tipField('detail.tip')
- .input-tip
- button.form-control(bs-select data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in {{detail.items}}')&attributes(detailCommon)
- div(ng-switch-when='dropdown-multiple')
- label(class=lblDetailClasses) {{detail.label}}:
- .col-sm-8
- button.form-control(bs-select data-multiple='1' data-placeholder='{{detail.placeholder}}' bs-options='item.value as item.label for item in {{detail.items}}')&attributes(detailCommon)
- +tipField('detail.tip')
- div(ng-switch-when='table-simple' style='margin-right: 5px; margin-top: -0.65em')&attributes(detailCommon)
- table.col-sm-12.links-edit(st-table='#{detailMdl}' ng-show='#{detailMdl}.length > 0')
- tbody
- tr(ng-repeat='item in #{detailMdl} track by $index')
- td.col-sm-11
- div(ng-show='detail.editIdx != {{$index}}')
- a(ng-click='detail.editIdx = $index; curValue = #{detailMdl}[$index]') {{$index + 1}}) {{item}}
- i.tipField.fa.fa-remove(ng-click='detail.editIdx = -1; #{detailMdl}.splice($index, 1)')
- div(ng-show='detail.editIdx == {{$index}}')
- label.labelField {{$index + 1}})
- i.tipField.fa.fa-floppy-o(ng-click='detail.editIdx = -1; #{detailMdl}[$index]=curValue')
- .input-tip
- input.form-control(type='text' ng-model='curValue' placeholder='{{detail.placeholder}}')
- td.col-sm-1(ng-if='detail.reordering')
- i.fa.fa-arrow-up(ng-show='$index > 0' ng-click='swapSimpleItems(detailMdl, $index, $index - 1); detail.editIdx = -1;')
- i.fa.fa-arrow-down(ng-show='$index < #{detailMdl}.length - 1' ng-click='swapSimpleItems(#{detailMdl}, $index, $index + 1); detail.editIdx = -1;')
- button.btn.btn-primary.fieldButton(ng-disabled='!newValue || #{detailMdl}.indexOf(newValue) >= 0' ng-click='detail.editIdx = -1; #{detailMdl} ? #{detailMdl}.push(newValue) : #{detailMdl} = [newValue];') Add
- +tipField('detail.tip')
- .input-tip
- input.form-control(type='text' ng-model='newValue' ng-focus='detail.editIdx = -1' placeholder='{{detail.placeholder}}')
-
-mixin form-row
- - var lblClasses = ['col-sm-2']
-
- - var fieldMdl = 'getModel(backupItem, field.path)[field.model]';
- - var fieldCommon = {'ng-model': fieldMdl};
-
- div(ng-switch='field.type')
- div.checkbox.col-sm-6(ng-switch-when='check')
- label
- input(type='checkbox')&attributes(fieldCommon)
- | {{field.label}}
- +tipLabel('field.tip')
- div(ng-switch-when='text')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- input.form-control(type='text' placeholder='{{field.placeholder}}' ng-required='field.required')&attributes(fieldCommon)
- div(ng-switch-when='password')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- input.form-control(type='password' placeholder='{{field.placeholder}}' ng-required='field.required')&attributes(fieldCommon)
- div(ng-switch-when='number')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- input.form-control(name='{{field.model}}' type='number' placeholder='{{field.placeholder}}' min='{{field.min ? field.min : 0}}' max='{{field.max ? field.max : Number.MAX_VALUE}}' ng-required='field.required')&attributes(fieldCommon)
- +exclamation('{{field.model}}', 'min', 'Value is less than allowable minimum.')
- +exclamation('{{field.model}}', 'max', 'Value is more than allowable maximum.')
- +exclamation('{{field.model}}', 'number', 'Invalid value. Only numbers allowed.')
- div(ng-switch-when='dropdown')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- button.form-control(bs-select ng-required='field.required' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')&attributes(fieldCommon)
- div(ng-switch-when='dropdown-multiple')
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- button.form-control(bs-select ng-disabled='{{field.items}}.length == 0' data-multiple='1' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')&attributes(fieldCommon)
- a.customize(ng-show='field.addLink' ng-href='{{field.addLink.ref}}') {{field.addLink.label}}
- div(ng-switch-when='dropdown-details')
- - var expanded = 'field.details[' + fieldMdl + '].expanded'
-
- label(class=lblClasses ng-class='{required: field.required}') {{field.label}}:
- .col-sm-4
- +tipField('field.tip')
- .input-tip
- button.form-control(bs-select ng-required='field.required' data-placeholder='{{field.placeholder}}' bs-options='item.value as item.label for item in {{field.items}}')&attributes(fieldCommon)
- a.customize(ng-show='#{fieldMdl} && field.details[#{fieldMdl}].fields' ng-click='#{expanded} = !#{expanded}') {{#{expanded} ? "Hide settings" : "Show settings"}}
- .col-sm-6.panel-details(ng-show='#{expanded} && #{fieldMdl}')
- .details-row(ng-repeat='detail in field.details[#{fieldMdl}].fields')
- +details-row
- div(ng-switch-when='table-simple')&attributes(fieldCommon)
- div
- label {{field.tableLabel}}: {{#{fieldMdl}.length}}
- +tipLabel('field.tip')
- table.links-edit.col-sm-12(st-table='#{fieldMdl}' ng-show='#{fieldMdl}.length > 0')
- tbody
- tr.col-sm-12(ng-repeat='item in #{fieldMdl} track by $index')
- td.col-sm-6
- div(ng-show='field.editIdx != {{$index}}')
- a(ng-click='field.editIdx = $index; curValue = #{fieldMdl}[$index]') {{$index + 1}}) {{item | compact}}
- i.tipField.fa.fa-remove(ng-click='field.editIdx = -1; #{fieldMdl}.splice($index, 1)')
- div(ng-show='field.editIdx == {{$index}}')
- label.labelField {{$index + 1}})
- i.tipField.fa.fa-floppy-o(ng-click='field.editIdx = -1; #{fieldMdl}[$index]=curValue')
- .input-tip
- input.form-control(type='text' ng-model='curValue' placeholder='{{field.placeholder}}')
- td.col-sm-1(ng-if='field.reordering')
- i.fa.fa-arrow-up(ng-show='$index > 0' ng-click='swapSimpleItems(fieldMdl, $index, $index - 1); field.editIdx = -1;')
- i.fa.fa-arrow-down(ng-show='$index < #{fieldMdl}.length - 1' ng-click='swapSimpleItems(#{fieldMdl}, $index, $index + 1); field.editIdx = -1;')
- .col-sm-6
- button.btn.btn-primary.fieldButton(ng-disabled='!newValue || #{fieldMdl}.indexOf(newValue) >= 0' ng-click='field.editIdx = -1; #{fieldMdl} ? #{fieldMdl}.push(newValue) : #{fieldMdl} = [newValue];') Add
- +tipField('field.tip')
- .input-tip
- input.form-control(type='text' ng-model='newValue' ng-focus='field.editIdx = -1' placeholder='{{field.placeholder}}')
- div(ng-switch-when='indexedTypes')
- - var tblMdl = 'backupItem.indexedTypes'
- div
- label Indexed types: {{#{tblMdl}.length}}
- +tipLabel('field.tip')
- table.links-edit.col-sm-12(st-table=tblMdl ng-show='#{tblMdl}.length > 0')
- tbody
- tr.col-sm-12(ng-repeat='item in #{tblMdl}')
- td.col-sm-6
- div(ng-show='field.editIdx != {{$index}}')
- a(ng-click='field.editIdx = $index; curKeyClass = #{tblMdl}[$index].keyClass; curValueClass = #{tblMdl}[$index].valueClass') {{$index + 1}}) {{item.keyClass}} / {{item.valueClass}}
- i.tipField.fa.fa-remove(ng-click='field.editIdx = -1; #{tblMdl}.splice($index, 1)')
- div(ng-show='field.editIdx == {{$index}}')
- label.labelField {{$index + 1}})
- i.tipField.fa.fa-floppy-o(ng-click='field.editIdx = -1; #{tblMdl}[$index]={keyClass: curKeyClass, valueClass: curValueClass}')
- .input-tip
- .col-sm-12
- input.form-control.table-form-control(type='text' ng-model='curKeyClass' placeholder='Key class full name')
- label /
- input.form-control.table-form-control(type='text' ng-model='curValueClass' placeholder='Value class full name')
- .col-sm-6
- input.form-control(type='text' ng-model='newKeyClass' ng-focus='field.editIdx = -1' placeholder='Key class full name')
- .settings-row
- input.form-control(type='text' ng-model='newValueClass' ng-focus='field.editIdx = -1' placeholder='Value class full name')
- button.btn.btn-primary.fieldButton(ng-click='field.editIdx = -1; addIndexedTypes(newKeyClass, newValueClass)') Add
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/8e792605/modules/webconfig/nodejs/views/includes/footer.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/includes/footer.jade b/modules/webconfig/nodejs/views/includes/footer.jade
deleted file mode 100644
index 3cc0f86..0000000
--- a/modules/webconfig/nodejs/views/includes/footer.jade
+++ /dev/null
@@ -1,23 +0,0 @@
-//-
- 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.
-
-.container.container-footer
- footer
- center
- p
- | Powered by
- a(href='http://ignite.incubator.apache.org') Apache Ignite
- | , version 1.1.0
\ No newline at end of file