ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [1/2] incubator-ignite git commit: # ignite-843 Route rename.
Date Tue, 07 Jul 2015 10:32:37 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 047c41b02 -> 73d08d60d


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/73d08d60/modules/web-control-center/nodejs/utils/generatorJava.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/utils/generatorJava.js b/modules/web-control-center/nodejs/utils/generatorJava.js
deleted file mode 100644
index 2e32900..0000000
--- a/modules/web-control-center/nodejs/utils/generatorJava.js
+++ /dev/null
@@ -1,570 +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.line(' * Configure grid.');
-        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,
-                        regions: {type: 'list'},
-                        zones: {type: 'list'}
-                    }, 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();
-        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');
-    addProperty(res, cacheCfg, varName, 'startSize');
-    addProperty(res, cacheCfg, varName, 'readFromBackup');
-
-    res.needEmptyLine = true;
-    
-    addProperty(res, cacheCfg, varName, 'memoryMode', 'CacheMemoryMode');
-    addProperty(res, cacheCfg, varName, 'offHeapMaxMemory');
-    addProperty(res, cacheCfg, varName, 'swapEnabled');
-    addProperty(res, cacheCfg, varName, 'copyOnRead');
-
-    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, 'loadPreviousValue');
-    addProperty(res, cacheCfg, varName, 'readThrough');
-    addProperty(res, cacheCfg, varName, 'writeThrough');
-
-    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');
-
-    res.needEmptyLine = true;
-
-    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/73d08d60/modules/web-control-center/nodejs/utils/generatorUtils.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/utils/generatorUtils.js b/modules/web-control-center/nodejs/utils/generatorUtils.js
deleted file mode 100644
index 2469c2e..0000000
--- a/modules/web-control-center/nodejs/utils/generatorUtils.js
+++ /dev/null
@@ -1,225 +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 Ignite Control Center ('
-        + 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/73d08d60/modules/web-control-center/nodejs/utils/generatorXml.js
----------------------------------------------------------------------
diff --git a/modules/web-control-center/nodejs/utils/generatorXml.js b/modules/web-control-center/nodejs/utils/generatorXml.js
deleted file mode 100644
index e29d465..0000000
--- a/modules/web-control-center/nodejs/utils/generatorXml.js
+++ /dev/null
@@ -1,516 +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');
-                addListProperty(res, d.Cloud, 'regions');
-                addListProperty(res, d.Cloud, 'zones');
-
-                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');
-    addProperty(res, cacheCfg, 'startSize');
-    addProperty(res, cacheCfg, 'readFromBackup');
-
-    res.needEmptyLine = true;
-
-    addProperty(res, cacheCfg, 'memoryMode');
-    addProperty(res, cacheCfg, 'offHeapMaxMemory');
-    addProperty(res, cacheCfg, 'swapEnabled');
-    addProperty(res, cacheCfg, 'copyOnRead');
-
-    res.needEmptyLine = true;
-
-    createEvictionPolicy(res, cacheCfg.evictionPolicy, 'evictionPolicy');
-
-    res.needEmptyLine = true;
-
-    if (cacheCfg.nearCacheEnabled) {
-        res.emptyLineIfNeeded();
-
-        res.startBlock('<property name="nearConfiguration">');
-        res.startBlock('<bean class="org.apache.ignite.configuration.NearCacheConfiguration">');
-
-        if (cacheCfg.nearConfiguration && cacheCfg.nearConfiguration.nearStartSize)
-            addProperty(res, cacheCfg.nearConfiguration, 'nearStartSize');
-
-        if (cacheCfg.nearConfiguration && cacheCfg.nearConfiguration.nearEvictionPolicy.kind)
-            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, 'loadPreviousValue');
-    addProperty(res, cacheCfg, 'readThrough');
-    addProperty(res, cacheCfg, 'writeThrough');
-
-    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');
-
-    res.needEmptyLine = true;
-
-    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, '&amp;').replace(/"/g, '&quot;');
-}
-
-function escape(s) {
-    if (typeof(s) != 'string')
-        return s;
-
-    return s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
-}


Mime
View raw message