} else {
form = (SchedulerForm)tab.getEditor(pathFromHotFolderDirectory);//hot folder
x2 = XPath.newInstance("//job[@name='"+new File(jobname).getName()+"']/monitor/script[@java_class='sos.scheduler.managed.configuration.ConfigurationOrderMonitor']");
}
SchedulerDom currdom = (SchedulerDom)form.getDom();
listOfElement2 = x2.selectNodes(currdom.getDoc());
if(listOfElement2.isEmpty()) {
XPath x3 = null;
XPath x4 = null;
if(tab.getFilelist().contains(hotFolderfilename)) {
x3 = XPath.newInstance("//job/monitor/script[@java_class='sos.scheduler.managed.configuration.ConfigurationOrderMonitor']");
x4 = XPath.newInstance("//job");;
} else {
x3 = XPath.newInstance("//job[@name='"+new File(jobname).getName()+"']/monitor/script[@java_class='sos.scheduler.managed.configuration.ConfigurationOrderMonitor']");
x4 = XPath.newInstance("//job[@name='"+new File(jobname).getName()+"']");
}
List listOfElement3 = x3.selectNodes(currdom.getDoc());
if(listOfElement3.isEmpty()) {
List listOfElement4 = x4.selectNodes(currdom.getDoc());
Element job = (Element)listOfElement4.get(0);
addMonitoring(job, currdom);
if(currdom.isLifeElement())
form.getTree().setSelection(new org.eclipse.swt.widgets.TreeItem[] { form.getTree().getItem(0) });
else if(currdom.isDirectory())
form.selectTreeItem(SchedulerListener.JOBS , SchedulerListener.JOB + new File(jobname).getName());
currdom.setChanged(true);
if(form != null) {
form.updateJob(job);
form.updateJob();
form.update();
}
currdom.setChanged(true);
form.dataChanged();
dom.setChanged(true);
if(tab.getFilelist().contains(hotFolderfilename)) {
form.dataChanged(tab.getFolderTab(hotFolderfilename));
} else {
form.dataChanged(tab.getFolderTab(pathFromHotFolderDirectory));
}
}
}
} else {
// Hot Folder Element ist nicht offen in einem Tabraiter
SchedulerDom currDom = new SchedulerDom(SchedulerDom.LIFE_JOB);
currDom.read(hotFolderfilename);
if(x2==null)
x2 = XPath.newInstance("//job/monitor/script[@java_class='sos.scheduler.managed.configuration.ConfigurationOrderMonitor']");
listOfElement2 = x2.selectNodes(currDom.getDoc());
if(listOfElement2.isEmpty()) {
XPath x3 = XPath.newInstance("//job");
List listOfElement3 = x3.selectNodes(currDom.getDoc());
if(!listOfElement3.isEmpty()) {
Element job = (Element)listOfElement3.get(0);
addMonitoring(job, currDom);
currDom.writeElement(currDom.getFilename(), currDom.getDoc());
MainWindow.getContainer().getCurrentTab().setData("ftp_details_parameter_file", hotFolderfilename);
MainWindow.saveFTP(new java.util.HashMap());
}
}