Ejemplo n.º 1
0
  /**
   * called when an entry has changed and variables must be updated.
   *
   * @param node
   * @throws BadInputEx
   */
  public void update(Element node) throws BadInputEx {
    super.update(node);

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

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

    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", icon);

    // --- if some search queries are given, we drop the previous ones and
    // --- set these new ones

    if (searches != null) {
      addSearches(searches);

      if (searches.getChild("search") != null) {
        eltSearches = searches.getChild("search").getChildren();
      }
    }
  }
 public void update(Element node) throws BadInputEx {
   super.update(node);
   Element site = node.getChild("site");
   server = Util.getParam(site, "server", "");
   port = Util.getParam(site, "port", 5151);
   setUsername(Util.getParam(site, "username", ""));
   setPassword(Util.getParam(site, "password", ""));
   database = Util.getParam(site, "database", "");
   icon = Util.getParam(site, "icon", "arcsde.gif");
 }