コード例 #1
0
  public void update(Element node) throws BadInputEx {
    Element site = node.getChild("site");
    Element opt = node.getChild("options");
    Element content = node.getChild("content");

    Element account = (site == null) ? null : site.getChild("account");
    Element privil = node.getChild("privileges");
    Element categ = node.getChild("categories");

    name = Util.getParam(site, "name", name);

    useAccount = Util.getParam(account, "use", useAccount);
    username = Util.getParam(account, "username", username);
    password = Util.getParam(account, "password", password);

    every = Util.getParam(opt, "every", every);
    oneRunOnly = Util.getParam(opt, "oneRunOnly", oneRunOnly);

    getTrigger();

    importXslt = Util.getParam(content, "importxslt", importXslt);
    validate = Util.getParam(content, "validate", validate);

    if (privil != null) addPrivileges(privil);

    if (categ != null) addCategories(categ);

    this.node = node;
  }
コード例 #2
0
  public void create(Element node) throws BadInputEx {
    Element site = node.getChild("site");
    Element opt = node.getChild("options");
    Element content = node.getChild("content");

    Element account = (site == null) ? null : site.getChild("account");

    name = Util.getParam(site, "name", "");
    uuid = Util.getParam(site, "uuid", UUID.randomUUID().toString());

    useAccount = Util.getParam(account, "use", false);
    username = Util.getParam(account, "username", "");
    password = Util.getParam(account, "password", "");

    every = Util.getParam(opt, "every", "0 0 0 * * ?");

    oneRunOnly = Util.getParam(opt, "oneRunOnly", false);

    getTrigger();

    importXslt = Util.getParam(content, "importxslt", "none");
    validate = Util.getParam(content, "validate", false);

    addPrivileges(node.getChild("privileges"));
    addCategories(node.getChild("categories"));

    this.node = node;
  }