Package de.odysseus.calyxo.control.conf

Examples of de.odysseus.calyxo.control.conf.ParamConfig


   */
  public void init(PluginConfig config, PluginContext context) throws ConfigException {
    log.trace("init() start");

    module = context.getModuleContext();
    ParamConfig param = config.getParamConfig("config");
    if (param == null) {
      throw new ConfigException("Missing parameter 'config' in " + config.toInlineString());
    }
    service.init(module, param.getValue());

    Dispatcher dispatcher = new PanelsDispatcher(module);
    context.setDispatcher("panels", dispatcher);
   
    param = config.getParamConfig("global");
    if (param != null && "true".equals(param.getValue())) {
      context.setDefaultDispatcher(dispatcher);
    }

    AccessSupport access = AccessSupport.getInstance(module);
    access.put("panels", new PanelsAccessor(module));
View Full Code Here


    formsSupport = (FormsSupport)FormsSupport.getInstance(context);
    if (formsSupport == null) {
      throw new ConfigException("No forms support! Forms plugin loaded?");
    }
    dispatch = config.getDispatchConfig(null);
    ParamConfig param = config.getParamConfig("dispatch");
    if ((param == null) == (dispatch == null)) {
      throw new ConfigException("One of 'dispatch' parameter or anonymous <dispatch> child must be given for filter '" + config.toInlineString() + "'");
    }
    if (dispatch == null) {
      dispatch = config.getActionConfig().findDispatchConfig(param.getValue());
      if (dispatch == null) {
        throw new ConfigException("Cannot find dispatch '" + param.getValue() + "' for filter '" + config.toInlineString() + "'");
      }
    }
    messageSupport = MessageSupport.getInstance(context);
    param = config.getParamConfig("commit");
    if (param == null) {
        commit = false;
    } else {
        try {
            commit = ((Boolean)ParseUtils.parse(Boolean.class, param.getValue())).booleanValue();
        } catch (Exception e) {
        throw new ConfigException("Bad commit value '" + param.getValue() + "' in " + config.toInlineString());
        }
    }
    formsSupport.add(config);
    this.config = config;
  }
View Full Code Here

  public void init(PluginConfig config, PluginContext context) throws ConfigException {
    log.trace("init() start");

    module = context.getModuleContext();

    ParamConfig param = config.getParamConfig("default-class");
    Class dataClass = null;
    if (param != null) {
      try {
        dataClass = module.getClassLoader().loadClass(param.getValue());
      } catch (Exception e) {
        throw new ConfigException("Could not load data class in " + config.toInlineString(), e);
      }
    }
    String factoryClass = DEFAULT_FACTORY;
    param = config.getParamConfig("factory-class");
    if (param != null) {
      factoryClass = param.getValue();
    }
    FormFactory factory = null;
    try {
      factory = (FormFactory)module.getClassLoader().loadClass(factoryClass).newInstance();
    } catch (Exception e) {
      throw new ConfigException("Could not create form factory in " + config.toInlineString(), e);
    }
    factory.init(module);
    param = config.getParamConfig("config");
    if (param == null) {
      throw new ConfigException("Missing parameter 'config' in " + config.toInlineString());
    }
    FormsSupport support = new FormsSupport(module.getClassLoader(), dataClass);
    service.init(module, support, factory, param.getValue());

    context.setFilterClass("forms", FormsFilter.class);

    AccessSupport access = AccessSupport.getInstance(module);
    access.put("forms", new FormsAccessor(module));
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.control.conf.ParamConfig

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.