Package de.innovationgate.wga.modules.options

Examples of de.innovationgate.wga.modules.options.OptionDefinition


            try {
                return getWgaConfiguration().getCachingOptionReader().readOptionValueOrDefault(options, optionName, modDef);
            }
            catch (OptionConversionException e) {
                getLog().error("Exception reading server option '" + optionName + "'. Falling back to default", e);
                OptionDefinition optDef = modDef.getOptionDefinitions().get(optionName);
                if (optDef != null) {
                    try {
                        return OptionReader.unconvertOptionValue(optDef, optDef.getDefaultValue());
                    }
                    catch (OptionConversionException e1) {
                        getLog().error("Exception unconverting default value of server option '" + optionName + "'. Falling back to null", e);
                    }
                }
View Full Code Here


    }
   
    public Object readPublisherOptionOrDefault(WGDatabase db, String name) {

        // Fetch option definition
        OptionDefinition optionDef = null;
       
        Class typeClass = ContentDatabasePublisherOptionsModuleType.class;
        Class collectorClass = ContentDatabasePublisherOptionsCollector.class;
        if (db.hasFeature(WGDatabase.FEATURE_FULLCONTENTFEATURES)) {
            typeClass = ContentStorePublisherOptionsModuleType.class;
            collectorClass = ContentStorePublisherOptionsCollector.class;
        }
       
        if (getModuleRegistry() != null) {
            ModuleDefinition pOptionDefs = getModuleRegistry().getModuleDefinition(typeClass, collectorClass);
            optionDef = pOptionDefs.getOptionDefinitions().get(name);
        }
       

        // Read the option value, default it if neccessary
        Object value = db.getAttribute(name);
        if (value == null && optionDef != null && optionDef.getDefaultValue() != null) {
            value = optionDef.getDefaultValue();
        }
       
        if (optionDef != null) {
            try {
                return OptionReader.unconvertOptionValue(optionDef, value);
View Full Code Here

                        Map<String,String> options = (Map<String, String>) desc.getReadMethod().invoke(configBean);
                        Iterator<Map.Entry<String,String>> optionsIt = options.entrySet().iterator();
                       
                        while (optionsIt.hasNext()) {
                            Map.Entry option = optionsIt.next();
                            OptionDefinition optionDef = optionDefs.get(option.getKey());
                            if (optionDef != null && optionDef.isOptional() && optionDef.getDefaultValue() != null && optionDef.getDefaultValue().equals(option.getValue())) {
                                LOG.info("Removing option '" + option.getKey() + "' on default value '" + optionDef.getDefaultValue() + "' from configuration object '" + configBean.getClass().getName());
                                optionsIt.remove();
                            }
                        }
                       
                    }
View Full Code Here

TOP

Related Classes of de.innovationgate.wga.modules.options.OptionDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.