- Timestamp:
- Apr 16, 2010, 5:55:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/JobScheduleBean.java
r862 r864 6 6 import de.dass_it.www.vanhelsing.VanHelsingStub.*; 7 7 import de.dass_it.vanhelsing.gui.items.ConcreteUserObjectItem; 8 import javax.faces.context.FacesContext; 8 9 9 10 /* 10 * JobSchedule will list all schedules and the jobs which are associated with a given schedule. 11 * JobSchedule will list all schedules and the jobs which are associated 12 * with a given schedule. 11 13 */ 12 14 public class JobScheduleBean { … … 17 19 init(); 18 20 } 21 19 22 private void init(){ 20 23 Client c = new Client(); 21 24 UserObjectItemFactory UOFactory = new UserObjectItemFactory(); 22 23 25 ResourceInfo riSched[]; 24 26 ResourceInfo riJobs[]; 25 27 SimpleResource sr; 26 28 DefaultMutableTreeNode parent; 27 28 29 dataTree = new DataTree(); 29 30 dataTree.setTree("JobSchedule"); 30 31 32 //TODO: Director auslesen 33 riSched = c.getListResources("bacula-dir", "Schedule"); 31 riSched = c.getListResources(BeanUtil.getProperty("defaultdirector"), "Schedule"); 34 32 for (ResourceInfo rinfo : riSched){ 35 33 parent = dataTree.createNode(dataTree.getRoot(), 36 34 UOFactory.createUserObjectItem(rinfo)); 37 38 35 riJobs = c.getListResources(rinfo.getDirector(), "Job"); 39 36 for (ResourceInfo rJobs : riJobs){ 40 41 37 sr = c.getSimpleResource(rJobs.getDirector(), rJobs.getResId()); 42 38 for (ResourceAttributeType rat : sr.getResourceAttributeType()){ … … 64 60 } 65 61 public void deleteNodeListener(ActionEvent ae){ 66 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 62 DefaultMutableTreeNode node; 63 ae.getComponent().getAttributes(); 64 65 String idString = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("UserObject.resId"); 66 String name = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("UserObject.resName"); 67 67 68 if (idString == null && name != null && !name.equals("")){ 69 node = dataTree.getNodeByName(name); 70 try{ 71 node = dataTree.deleteNode(node); 72 }catch (ConstraintViolationException ecv){ 73 System.err.println(ecv.toString()); 74 } 75 } else if (idString != null) { 76 node = dataTree.getNodeById(new Integer(idString).intValue()); 77 try { 78 node = dataTree.deleteNode(node); 79 } catch (ConstraintViolationException ecv) { 80 ecv.printStackTrace(); 81 } 82 } else { 83 BeanUtil.setInfoMessage(null, "Knoten kann nicht referenziert werden"); 84 } 85 dataTree.getTree().reload(); 68 86 } 69 87 public void reloadTreeListener(ActionEvent ae){ … … 71 89 } 72 90 public void selectNode(ActionEvent ae){ 73 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 91 //BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 92 74 93 } 75 94
Note:
See TracChangeset
for help on using the changeset viewer.