Package org.zkoss.zk.ui.sys

Examples of org.zkoss.zk.ui.sys.ConfigParser


  }
  private static void load0() throws java.io.IOException {
    final ClassLocator locator = new ClassLocator();

    //1. parse config.xml
    final ConfigParser parser = new ConfigParser();
    parser.parseConfigXml(null); //only system default configs

    //2. process lang.xml (no particular dependency)
    for (Enumeration en = locator.getResources("metainfo/zk/lang.xml");
    en.hasMoreElements();) {
      final URL url = (URL)en.nextElement();
View Full Code Here


    Servlets.setBrowserIdentifier(new BrowserIdentifier());
      //plugin device-dependent browser identifier

    //load config as soon as possible since it might set some system props
    final Configuration config = new Configuration();
    final ConfigParser parser = new ConfigParser();

    //load metainfo/zk/config.xml
    try {
      parser.parseConfigXml(config);
    } catch (Throwable ex) {
      log.error("Unable to load metainfo/zk/config.xml", ex);
    }

    //load metainfo/zk/zk.xml
    try {
      final ClassLocator loc = new ClassLocator();
      for (Enumeration en = loc.getResources("metainfo/zk/zk.xml");
      en.hasMoreElements();) {
        final URL cfgUrl = (URL)en.nextElement();
        try {
          parser.parse(cfgUrl, config, loc);
        } catch (Throwable ex) {
          log.error("Unable to load "+cfgUrl, ex);
        }
      }
    } catch (Throwable ex) {
      log.error("Unable to load metainfo/zk/zk.xml", ex);
    }

    //load /WEB-INF/zk.xml
    try {
      final URL cfgUrl = _ctx.getResource("/WEB-INF/zk.xml");
      if (cfgUrl != null)
        parser.parse(cfgUrl, config, new ServletContextLocator(_ctx));
    } catch (Throwable ex) {
      log.error("Unable to load /WEB-INF/zk.xml", ex);
    }

    //after zk.xml is loaded since it depends on the configuration
View Full Code Here

TOP

Related Classes of org.zkoss.zk.ui.sys.ConfigParser

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.