Examples of XMLConfig


Examples of de.mhus.lib.config.XmlConfig

     */
    public void testServiceRegister() throws Exception {
     
      ModManager manager = new ModManager(base);

      MyConfig a1 = new MyConfig( SimpleActivator.class.getCanonicalName(), new XmlConfig( null, MXml.loadXml("<c register_service='1'/>").getDocumentElement() ) );
      MyConfig a2 = new MyConfig( SimpleActivator.class.getCanonicalName(), new XmlConfig( null, MXml.loadXml("<c lookup_service='1'/>").getDocumentElement() ) );
      IModConfig[] ac1 = new IModConfig[] { a1, a2 };
      MyBundle b1 = new MyBundle("mybundle", false, ac1 );
     
      List<IModActivator> activators = new LinkedList<IModActivator>();
      manager.initializeBundle(b1,activators);
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

     */
    public void testServiceLookupException() throws Exception {
     
      ModManager manager = new ModManager(base);

      MyConfig a1 = new MyConfig( SimpleActivator.class.getCanonicalName(), new XmlConfig( null, MXml.loadXml("<c id='test1'/>").getDocumentElement() ) );
      MyConfig a2 = new MyConfig( SimpleActivator.class.getCanonicalName(), new XmlConfig( null, MXml.loadXml("<c id='test2' lookup_service='1'/>").getDocumentElement() ) );
      IModConfig[] ac1 = new IModConfig[] { a1, a2 };
      MyBundle b1 = new MyBundle("mybundle", false, ac1 );
     
      List<IModActivator> activators = new LinkedList<IModActivator>();
      manager.initializeBundle(b1,activators);
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

      res = res.substring(0, pos + 1);
    res = res + resource;
    // log.info("Load Resource: " + res);
    InputStream is = model.getTarget().getClass().getClassLoader()
        .getResourceAsStream(res);
    IConfig document = new XmlConfig(MXml.loadXml(is).getDocumentElement());
    load(document,root);
  }
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

     
      elementHandler.setBaseElement(doc, root);
      parser.parse(new ByteArrayInputStream(xml.getBytes()), elementHandler);
      Element out = elementHandler.first;
      if (out != null) {
        setLayout( new FormLayoutBuilder(this, new XmlConfig(out)));
        return;
      }
    }
   
    setLayout( new FormLayoutSimpleBuilder(this) );
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

      String name = method.getName();
      name = name.substring(3, 4).toLowerCase() + name.substring(4);
      out.setAttribute("name", name);
      out.setAttribute("id", prefix + name);
    }
    return new XmlConfig(out);
  }
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

      ccon.setProperty("user", "sa");
      ccon.setProperty("pass", "");
      cdb.setConfig("connection", ccon);
      config.setConfig("database", cdb);
           
      XmlConfig cdef = new XmlConfig(MXml.loadXml(
      "<applications><application name='content'>"
    + "<definitions><table name='blub' id_column='id' name_column='name'><column name='id' type='string' size='40'/><column name='name' type='string' size='200'/><column name='parent' type='string' size='40'/></table></definitions>"
    + "<element name='root'><query sql='select * from blub_ where parent is null' table='blub' children='sub'/></element>"
    + "<children name='sub'><query sql='select * from blub_ where parent=$id$' table='blub' children='sub'/></children>"
    + "</application></applications>").getDocumentElement());
View Full Code Here

Examples of de.mhus.lib.config.XmlConfig

      ccon.setProperty("user", "sa");
      ccon.setProperty("pass", "");
      cdb.setConfig("connection", ccon);
      config.setConfig("database", cdb);
           
      XmlConfig cdef = new XmlConfig(MXml.loadXml(
      "<applications><application name='content' type='adb' schema='de.mhus.lib.test.caodb.BlubSchema'>"
    + "<element name='root'><query table='de.mhus.lib.test.caodb.Blub' qualification='parent is null' children='sub'/></element>"
    + "<children name='sub'><query table='de.mhus.lib.test.caodb.Blub' qualification='parent=$id$' children='sub'/></children>"
    + "</application></applications>").getDocumentElement());
      config.setConfig("applications", cdef);
View Full Code Here

Examples of fr.eolya.utils.XMLConfig

    }

    /* TODO : V4 */
    // check geo localisation
    if (("1".equals(config.getProperty("/crawler/param[@name='geo_location']", "0")))) {
      XMLConfig srcExtra = this.src.getExtra();
      String srcIP = "";
      if (srcExtra!=null) {
        srcIP = srcExtra.getProperty("/geoip/ip", "");
      }
      GeoLocalisation geo;
      try {
        URL hostUrl = new URL(startingUrls.getUrlHome());
        geo = new GeoLocalisation (hostUrl.getHost(), srcIP, null);
      } catch (URISyntaxException e) {
        e.printStackTrace();
        return false;
      } catch (MalformedURLException e) {
        e.printStackTrace();
        return false;
      }
      if (geo.resolve("geoiptool") && geo.hasChanged()) {
        srcExtra.setProperty("/", "geoip", "");
        srcExtra.setProperty("/geoip", "ip", geo.getIp());
        srcExtra.setProperty("/geoip", "latitude", geo.getLatitude());
        srcExtra.setProperty("/geoip", "longitude", geo.getLongitude());
        srcExtra.setProperty("/geoip", "countrycode", geo.getCountryCode());
        srcExtra.setProperty("/geoip", "countryname", geo.getCountryName());
        srcExtra.setProperty("/geoip", "area", geo.getArea());
        srcExtra.setProperty("/geoip", "city", geo.getCity());
        this.src.setExtra(srcExtra);
      }
    }
   
    String scriptPath = config.getProperty("/crawler/param[@name='scripts_path']", "");
View Full Code Here

Examples of fr.eolya.utils.XMLConfig

    }

    propFileName = Utils.getValidPropertyPath(propFileName, null, "HOME");
    System.out.println("Config file = " + propFileName);

    XMLConfig config = new XMLConfig();
    try {
      File configFile =new File(propFileName);
      if (!configFile.exists()) {
        System.out.println("Error configuration file not found [" + propFileName + "]");
        System.exit(-1);
      }
      config.loadFile(propFileName);
    }
    catch(IOException e) {
      System.out.println("Error while reading properties file");
      e.printStackTrace();
      System.exit(-1);     
    }

    String witnessFilesPath = config.getProperty("/crawler/param[@name='witness_files_path']");
    witnessFilesPath = Utils.getValidPropertyPath(witnessFilesPath, null, "HOME");
    if (witnessFilesPath == null || "".equals(witnessFilesPath)) {
      System.out.println("Error : missing witness_files_path propertie");
      System.exit(-1);
    }
View Full Code Here

Examples of fr.eolya.utils.XMLConfig

  public static DocumentCacheItem doc2DocumentCacheItem(BasicDBObject doc) {
    try {
      String itemId = doc.get("item_id").toString();

      XMLConfig extra = null;
      if (doc.get("item_extra")!=null) {
        extra = new XMLConfig();
        extra.loadString(doc.get("item_extra").toString());
      }

      HashMap<String, String> params = new HashMap<String, String>();
      HashMap<String, String> metas = new HashMap<String, String>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.