示例#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();
      }
    }
  }
示例#2
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();
      }
    }
  }
 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");
 }
  protected void copyTo(AbstractParams copy) {
    copy.name = name;
    copy.uuid = uuid;

    copy.useAccount = useAccount;
    copy.username = username;
    copy.password = password;

    copy.every = every;
    copy.oneRunOnly = oneRunOnly;

    copy.importXslt = importXslt;
    copy.validate = validate;

    for (Privileges p : alPrivileges) copy.alPrivileges.add(p.copy());

    for (String s : alCategories) copy.alCategories.add(s);

    copy.node = node;
  }