コード例 #1
0
  public void applyChain(String name, boolean ordersRecoverable, boolean visible) {
    String oldjobChainName = Utils.getAttributeValue("name", _chain);
    if (oldjobChainName != null && oldjobChainName.length() > 0) {
      _dom.setChangedForDirectory("job_chain", oldjobChainName, SchedulerDom.DELETE);
    }
    Utils.setAttribute("name", name, _chain);
    Utils.setAttribute("orders_recoverable", ordersRecoverable, _chain);
    Utils.setAttribute("visible", visible, _chain);

    if (_chains == null) {
      _chains = new Element("job_chains");
      _config.addContent(_chains);
    }

    if (!_chains.getChildren("job_chain").contains(_chain)) _chains.addContent(_chain);

    update.updateJobChains();
    _dom.setChanged(true);
    // _dom.setChangedForDirectory("job_chain", name, SchedulerDom.MODIFY);
    _dom.setChangedForDirectory("job_chain", name, SchedulerDom.NEW);
  }
コード例 #2
0
 public void deleteChain(int index) {
   List chains = _chains.getChildren("job_chain");
   String delname = Utils.getAttributeValue("name", (Element) chains.get(index));
   ((Element) chains.get(index)).detach();
   if (chains.size() == 0) {
     _config.removeChild("job_chains");
     _chains = null;
   }
   //
   _chainNames = new String[chains.size()];
   int i = 0;
   Iterator it = chains.iterator();
   while (it.hasNext()) {
     Element chain = (Element) it.next();
     String name = Utils.getAttributeValue("name", chain);
     _chainNames[i++] = name;
   }
   //
   _dom.setChanged(true);
   _dom.setChangedForDirectory("job_chain", delname, SchedulerDom.DELETE);
   _chain = null;
   update.updateJobChains();
 }
コード例 #3
0
 private void getJobDocumentation() {
   if (jobname != null && jobname.length() > 0) {
     try {
       XPath x = XPath.newInstance("//job[@name='" + jobname + "']/description/include");
       List listOfElement = x.selectNodes(schedulerDom.getDoc());
       if (!listOfElement.isEmpty()) {
         Element include = (Element) listOfElement.get(0);
         if (include != null) {
           jobDocumentation = Utils.getAttributeValue("file", include);
         }
       }
       if (jobDocumentation != null && jobDocumentation.length() > 0 && txtParamsFile != null) {
         txtParamsFile.setText(jobDocumentation);
       }
     } catch (Exception e) {
       System.out.println(JOE_M_0010.params("setParamsForWizzard", e.toString()));
     }
   }
 }