- Timestamp:
- Apr 15, 2010, 3:49:35 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/JobScheduleBean.java
r832 r862 1 1 package de.dass_it.vanhelsing.gui; 2 3 import javax.faces.event.ActionEvent; 4 import javax.swing.tree.DefaultMutableTreeNode; 5 import javax.swing.tree.DefaultTreeModel; 6 import de.dass_it.www.vanhelsing.VanHelsingStub.*; 7 import de.dass_it.vanhelsing.gui.items.ConcreteUserObjectItem; 8 2 9 /* 3 10 * JobSchedule will list all schedules and the jobs which are associated with a given schedule. 4 11 */ 5 public class JobScheduleBean extends TreeNavigation { 12 public class JobScheduleBean { 13 private DataTree dataTree; 14 private ConcreteUserObjectItem selectedObject; 6 15 16 public JobScheduleBean(){ 17 init(); 18 } 19 private void init(){ 20 Client c = new Client(); 21 UserObjectItemFactory UOFactory = new UserObjectItemFactory(); 22 23 ResourceInfo riSched[]; 24 ResourceInfo riJobs[]; 25 SimpleResource sr; 26 DefaultMutableTreeNode parent; 27 28 dataTree = new DataTree(); 29 dataTree.setTree("JobSchedule"); 30 31 32 //TODO: Director auslesen 33 riSched = c.getListResources("bacula-dir", "Schedule"); 34 for (ResourceInfo rinfo : riSched){ 35 parent = dataTree.createNode(dataTree.getRoot(), 36 UOFactory.createUserObjectItem(rinfo)); 37 38 riJobs = c.getListResources(rinfo.getDirector(), "Job"); 39 for (ResourceInfo rJobs : riJobs){ 40 41 sr = c.getSimpleResource(rJobs.getDirector(), rJobs.getResId()); 42 for (ResourceAttributeType rat : sr.getResourceAttributeType()){ 43 if (rat.getKey().toLowerCase().equals("schedule") && 44 rat.getValue().equals(rinfo.getResName())){ 45 dataTree.createNode(parent, 46 UOFactory.createUserObjectItem(rJobs)); 47 } 48 } 49 } 50 } 51 } 52 53 public void createNodeListener(ActionEvent ae){ 54 //Methode kann nur mit ausgewählten ParentNode ausgeführt werden 55 DefaultMutableTreeNode parent = dataTree.getNodeByName("horst"); 56 UserObjectItemFactory UOFactory = new UserObjectItemFactory(); 57 58 //UOFactory.createUserObjectItem(new ResourceAttributeType[], ) 59 //dataTree.createNode(parent, userObject); 60 } 61 public void updateNodeListener(ActionEvent ae){ 62 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 63 64 } 65 public void deleteNodeListener(ActionEvent ae){ 66 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 67 68 } 69 public void reloadTreeListener(ActionEvent ae){ 70 init(); 71 } 72 public void selectNode(ActionEvent ae){ 73 BeanUtil.setInfoMessage(null, "Die Methode ist noch nicht implementiert"); 74 } 75 76 public DataTree getDataTree(){ 77 return dataTree; 78 } 79 80 public void setDataTree(DataTree dataTree){ 81 this.dataTree = dataTree; 82 } 7 83 }
Note:
See TracChangeset
for help on using the changeset viewer.