Esempio n. 1
0
  /**
   * called when a new entry must be added. Reads values from the provided entry, providing default
   * values.
   *
   * @param node
   * @throws BadInputEx
   */
  public void create(Element node) throws BadInputEx {
    super.create(node);

    Element site = node.getChild("site");
    Element searches = node.getChild("searches");

    capabUrl = Util.getParam(site, "capabilitiesUrl", "");
    rejectDuplicateResource = Util.getParam(site, "rejectDuplicateResource", false);

    try {
      capabUrl = URLDecoder.decode(capabUrl, Jeeves.ENCODING);
    } catch (UnsupportedEncodingException x) {
      System.out.println(x.getMessage());
      x.printStackTrace();
      // TODO should not swallow
    }
    icon = Util.getParam(site, "icon", "default.gif");

    addSearches(searches);

    if (searches != null) {
      if (searches.getChild("search") != null) {
        eltSearches = searches.getChild("search").getChildren();
      }
    }
  }
 /**
  * --------------------------------------------------------------------------- //--- //--- Create
  * : called when a new entry must be added. Reads values from the //--- provided entry, providing
  * default values //---
  * //---------------------------------------------------------------------------
  */
 public void create(Element node) throws BadInputEx {
   super.create(node);
   Element site = node.getChild("site");
   server = Util.getParam(site, "server", "");
   port = Util.getParam(site, "port", 0);
   setUsername(Util.getParam(site, "username", ""));
   setPassword(Util.getParam(site, "password", ""));
   database = Util.getParam(site, "database", "");
   icon = Util.getParam(site, "icon", "arcsde.gif");
 }