Retrieves the config.xml's pereferences for a given platform and parses them into JSON data
@param configData
@param platform
762495
function (rootdir, configData, platform, preferenceMappingData) {
        var preferences = lib.getPreferences(rootdir, platform),
            type = 'preference';

        if (!platform) {
            platform = 'generic';
        }

        preferences.forEach(function (preference) {
            // check if there are specific configuration to map to config for this platform
            if (!preferenceMappingData || !preferenceMappingData[platform]) {
                return;
            }

            var prefMappingData = preferenceMappingData[platform][preference.attrib.name],
                target,
                prefData;

            if (prefMappingData) {
                prefData = {
                    parent: prefMappingData.parent,
                    type: type,
                    destination: prefMappingData.destination,
                    data: preference,
                    map: prefMappingData
                };

                target = prefMappingData.target;
                if (!configData[target]) {
                    configData[target] = [];
                }
                configData[target].push(prefData);
            }
        });
    }
899823
private void printConfigData(String dataId, ConfigData configData) {

        StringBuilder sb = new StringBuilder();
        int count = 0;

        if (configData != null && StringUtils.isNotBlank(configData.getData())) {
            final String[] split = StringUtils.split(configData.getData(), CONFIG_SEPARATOR);
            List<String> dataList = Arrays.asList(split);
            for (String provider : dataList) {
                sb.append("  >>> ").append(provider).append("\n");
                count++;
            }
        }

        if (LOGGER.isInfoEnabled()) {
            LOGGER.info(LogCodes.getLiteLog(
                "Receive RPC config info: service[{0}]\n  usable config info[{1}]\n{2}",
                dataId, count, sb.toString()));
        }
    }
737288
function PlatformInfo(PlatformCtor, platformId) {

    this._Ctor = PlatformCtor;
    this._platformId = platformId;

    // Prefix all platform-specific args with the platform name
    var argSpec = PlatformCtor.getArgs ? PlatformCtor.getArgs() : {};
    this._argSpec = {};
    for (var cmd in argSpec) {
        var cmdArgSpec = argSpec[cmd];
        var platformCmdArgSpec = {};
        for (var key in cmdArgSpec) {
            platformCmdArgSpec["--" + platformId + "-" + key] = cmdArgSpec[key];
        }
        this._argSpec[cmd] = platformCmdArgSpec;
    }

    // Look for platforms env vars
    this._envSpec = PlatformCtor.getEnv ? PlatformCtor.getEnv() : {};
}
1131720
function(configPath, configNames, config) {
	var configsUsed = [];

	config = config || projectConfig;

	// work with the raw configuration object
	if (config && config.root) {
		config = config.root();
	}

	config = convict(config);
	configPath = path.resolve(appPath, configPath);
	configNames = configNames || [];

	configNames.forEach(function(configName) {
		var file;

		// Ignore local config in production mode
		if (configName == 'local' && nodeEnv === 'production') { return; }

		file = path.join(configPath, 'config-'+configName);
		file += configName === 'default' ? '.js' : '.json';

		if (fs.existsSync(file)) {

			if (configName === 'default') {
				config = convict( require(file) );
				config.load(dynamicDefaults);
			}
			else {
				config.loadFile( file );
			}

			// logging
			configName === 'default' ? configsUsed.push('xtc defaults') : configsUsed.push(configName);
		}
	});

	// be informative
	!process.env.testRun
		&& configsUsed.push('env', 'args')
		&& console.log('configuration:', configsUsed.join(' < '));

	return config;
}
791794
function parseAndroidPreferences(preferences, configData){
        var type = 'preference';

        _.each(preferences, function (preference) {
            // Extract pre-defined preferences (deprecated)
            var target,
                prefData;

            if(preference.attrib.name.match(/^android-manifest\//)){
                // Extract manifest Xpath preferences
                var parts = preference.attrib.name.split("/"),
                    destination = parts.pop();
                parts.shift();

                prefData = {
                    parent: parts.join("/") || "./",
                    type: type,
                    destination: destination,
                    data: preference
                };
                target = "AndroidManifest.xml";
            }

            if(prefData){
                if(!configData[target]) {
                    configData[target] = [];
                }
                configData[target].push(prefData);
            }
        });
    }
23181
private void parseLoggingConfig(final Node node, final ConfigSettings config)
	{

		String name;
		String value;
		Node nnode;
		NodeList list = node.getChildNodes();

		int length = list.getLength();
		for (int i = 0; i < length; i++) {
			nnode = list.item(i);

			name = nnode.getNodeName().toUpperCase();
			if (name.equals(KEY_ROOT_FOLDER)) {

				value = nnode.getChildNodes().item(0).getNodeValue();
				value = value.substring(1, value.length() - 1);

				config.setConfigParameter(
						ConfigurationKeys.LOGGING_PATH_DIFFTOOL, value);

			}
			else if (name.equals(SUBSUBSECTION_DIFF_TOOL)) {

				parseLoggerConfig(nnode, config, null,
						ConfigurationKeys.LOGGING_LOGLEVEL_DIFFTOOL);

			}
		}
	}
757302
public void updateConfigAll(AbstractInterfaceConfig config, String overridePath, List<ChildData> currentData)
        throws UnsupportedEncodingException {
        if (CommonUtils.isEmpty(currentData)) {
            if (LOGGER.isInfoEnabled(config.getAppName())) {
                LOGGER.infoWithApp(config.getAppName(), "Receive updateAll data is null");
            }
        } else {
            if (LOGGER.isInfoEnabled(config.getAppName())) {
                for (ChildData data : currentData) {
                    LOGGER.infoWithApp(config.getAppName(),
                        "Receive updateAll data: path=[" + data.getPath() + "], data=[" +
                            StringSerializer.decode(data.getData()) + "]" + ", stat=[" + data.getStat() + "]");
                }
            }
            List<ConfigListener> configListeners = configListenerMap.get(config);
            if (CommonUtils.isNotEmpty(configListeners)) {
                List<Map<String, String>> attributes = ZookeeperRegistryHelper.convertOverrideToAttributes(
                    config, overridePath, currentData);
                for (ConfigListener listener : configListeners) {
                    for (Map<String, String> attribute : attributes) {
                        listener.attrUpdated(attribute);
                    }
                }
            }
        }
    }
860805
public void setPlatforms(java.util.Collection<EnvironmentPlatform> platforms) {
        if (platforms == null) {
            this.platforms = null;
            return;
        }

        this.platforms = new java.util.ArrayList<EnvironmentPlatform>(platforms);
    }
813408
function setConfig(configs) {
    configProperties = platformConfigs;
    provider.platform[platformName] = {};

    addConfig(configProperties, configProperties.platform[platformName]);

    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');
  }
165360
function injectOptions(options) {
  platforms.forEach(function(platform) {
    var configXmlFilePath = getPlatformSpecificConfigXml(platform);
    if (configXmlFilePath == null) {
      return;
    }

    // read data from config.xml
    var configData = xmlHelper.readXmlAsJson(configXmlFilePath);
    if (configData == null) {
      console.warn('Configuration file ' + configXmlFilePath + ' not found');
      return;
    }

    // inject new options
    var chcpXmlConfig = {};
    for (var preferenceName in options) {
      injectPreference(chcpXmlConfig, preferenceName, options[preferenceName]);
    }

    // write them back to config.xml
    configData.widget['chcp'] = [];
    configData.widget.chcp.push(chcpXmlConfig);
    xmlHelper.writeJsonAsXml(configData, configXmlFilePath);
  });
}
518541
public static final void xmlConfig(File configFile) throws IOException
    {
        try
        {
            JAXBContext jaxbCtx = JAXBContext.newInstance("org.vesalainen.util.jaxb");
            Unmarshaller unmarshaller = jaxbCtx.createUnmarshaller();
            JavaLoggingConfig javaLoggingConfig = (JavaLoggingConfig) unmarshaller.unmarshal(configFile);
            Map<String,String> expressionMap = new HashMap<>();
            Properties properties = javaLoggingConfig.getProperties();
            if (properties != null)
            {
                for (Element element : properties.getAny())
                {
                    String property = element.getTagName();
                    String expression = element.getTextContent();
                    expressionMap.put(property, expression);
                }
            }
            ExpressionParser ep = new ExpressionParser(expressionMap);
            for (LoggerType loggerType : javaLoggingConfig.getLogger())
            {
                String name = ep.replace(loggerType.getName());
                JavaLogging javaLogging = getLogger(name);
                Logger logger = javaLogging.getLogger();
                String lev = ep.replace(loggerType.getLevel());
                Level level = lev != null ? BaseLogging.parseLevel(lev) : null;
                if (level != null)
                {
                    logger.setLevel(level);
                }
                logger.setUseParentHandlers(parseBoolean(ep.replace(loggerType.getUseParentHandlers())));
                String resourceBundleString = ep.replace(loggerType.getResourceBundle());
                if (resourceBundleString != null)
                {
                    Locale locale;
                    String languageTag = ep.replace(loggerType.getLocale());
                    if (languageTag != null)
                    {
                        locale = Locale.forLanguageTag(languageTag);
                    }
                    else
                    {
                        locale = Locale.getDefault();
                    }
                    ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleString, locale);
                    logger.setResourceBundle(resourceBundle);
                }
                logger.setFilter(getInstance(ep.replace(loggerType.getFilter())));
                for (ConsoleHandlerType consoleHandlerType : loggerType.getConsoleHandler())
                {
                    logger.addHandler(createConsoleHandler(ep, consoleHandlerType, level));
                }
                for (FileHandlerType fileHandlerType : loggerType.getFileHandler())
                {
                    logger.addHandler(createFileHandler(ep, fileHandlerType, level));
                }
                for (MemoryHandlerType memoryHandlerType : loggerType.getMemoryHandler())
                {
                    logger.addHandler(createMemoryHandler(ep, memoryHandlerType, level));
                }
                for (SocketHandlerType socketHandlerType : loggerType.getSocketHandler())
                {
                    logger.addHandler(createSocketHandler(ep, socketHandlerType, level));
                }
            }
        }
        catch (JAXBException ex)
        {
            throw new RuntimeException(ex);
        }
    }
1317310
function updateXCConfigs(configItems, platformPath){
        xcconfigs.forEach(function(fileName){
            updateXCConfig(platformPath, fileName, configItems);
        });
    }
633542
@RequestMapping(value = "/{configId}", method = RequestMethod.GET)
    @ResponseBody
    public JsonObjectBase getConfig(@PathVariable long configId) {

        // 业务校验
        configValidator.valideConfigExist(configId);

        ConfListVo config = configMgr.getConfVo(configId);

        return buildSuccess(config);
    }
883079
private ComposeUserData composeUserAndConfigData(UserData userData, ConfigData configData) {

        ComposeUserData result = new ComposeUserData();

        Map<String, List<ProviderInfo>> zoneData = new HashMap<String, List<ProviderInfo>>();
        if (userData == null) {
            return result;
        } else {
            result.setLocalZone(userData.getLocalZone());

            final Map<String, List<String>> listZoneData = userData.getZoneData();
            final String[] configDatas = StringUtils.split(
                configData == null ? StringUtils.EMPTY : configData.getData(), CONFIG_SEPARATOR);
            final List<String> attrData = Arrays.asList(configDatas);
            for (String key : listZoneData.keySet()) {
                final List<ProviderInfo> providerInfos = mergeProviderInfo(listZoneData.get(key), attrData);
                zoneData.put(key, providerInfos);
            }

            result.setZoneData(zoneData);

        }

        return result;
    }
447476
function getConfig(config) {
    // Read a RESTBase configuration from a (optional) path argument, an (optional) CONFIG
    // env var, or from /etc/restbase/config.yaml
    var conf;

    if (config) {
        conf = config;
    } else if (process.env.CONFIG) {
        conf = process.env.CONFIG;
    } else {
        conf = '/etc/restbase/config.yaml';
    }

    var confObj = yaml.safeLoad(fs.readFileSync(conf));
    return confObj.default_project['x-modules'][0].options.table;
}
1228382
function save(projectRoot, platform, version) {
    var platformsDir = path.join(projectRoot, 'platforms');
    var platformJsonFile = path.join(platformsDir, 'platforms.json');

    var data = {};
    if(fs.existsSync(platformJsonFile)){
        data = getJson(platformJsonFile);
    }
    data[platform] = version;
    fs.writeFileSync(platformJsonFile, JSON.stringify(data, null, 4), 'utf-8');
}
1203019
static final Properties getProperties(final KunderaMetadata kunderaMetadata, final String persistenceUnit)
    {
        PersistenceUnitMetadata persistenceUnitMetadatata = kunderaMetadata.getApplicationMetadata()
                .getPersistenceUnitMetadata(persistenceUnit);
        Properties props = persistenceUnitMetadatata.getProperties();
        return props;
    }