Changeset 854 for vanHelsing/trunk/gui
- Timestamp:
- Mar 26, 2010, 6:01:33 PM (15 years ago)
- Location:
- vanHelsing/trunk/gui
- Files:
-
- 122 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
vanHelsing/trunk/gui/.classpath
r844 r854 84 84 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/smackx-3.0.4.jar"/> 85 85 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/soapmonitor-1.5.1.jar"/> 86 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/VanHelsing-test-client.jar"/>87 86 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/woden-api-1.0M8.jar"/> 88 87 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/woden-impl-dom-1.0M8.jar"/> … … 95 94 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xmlbeans-2.3.0.jar"/> 96 95 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/XmlSchema-1.4.3.jar"/> 96 <classpathentry kind="lib" path="WebContent/WEB-INF/lib/VanHelsing-test-client.jar"/> 97 97 <classpathentry kind="output" path="build/classes"/> 98 98 </classpath> -
vanHelsing/trunk/gui/WebContent/viewConfig.jspx
r849 r854 15 15 <head> 16 16 <title>vanHelsing GUI</title> 17 <!-- <link rel="stylesheet" type="text/css" href="css/treeComponents.css"/> --> 18 <link rel="stylesheet" type="text/css" href="css/showcase_style.css" /> 19 <link rel="stylesheet" type="text/css" href="css/showcase_overrides.css"/> 20 <link rel="stylesheet" type="text/css" href="css/showcase_layout.css"/> 21 <link rel="stylesheet" type="text/css" href="css/rime.css" /> 22 23 17 24 </head> 18 25 19 26 <body> 20 21 <ice:panelGroup style="float:left; width:20%; background-color=blue"> 27 <h1 style="color:grey">van Helsing GUI</h1> 28 <ice:panelDivider dividerPosition="45" style="float:left;height: 85%"> 29 <f:facet name="first"> 30 <ice:panelGroup style="exampleBox;float:left;width:350px"> 22 31 <ice:form> 23 32 <ice:tree id="baum" … … 25 34 var="item" 26 35 hideRootNode = "false" 27 hideNavigation ="false"> 36 hideNavigation ="false" 37 imageDir = "css/images/"> 28 38 29 39 <ice:treeNode id="knoten"> 30 40 <f:facet name="icon"> 41 <ice:panelGroup style="display: inline" > 42 <ice:graphicImage 43 value="/css/images/#{item.userObject.icon}"/> 44 </ice:panelGroup> 31 45 </f:facet> 32 46 <f:facet name="content"> 33 <ice:commandLink actionListener="#{configurationBean.userObjectItemNodeSelected}"> 47 <!-- <ice:panelGroup> --> 48 <!-- styleClass="selectedNode#{item.userObject eq treeController.selectedUserObject}" 49 style="display: inline" > --> 50 <ice:commandLink actionListener="#{configurationBean.userObjectItemNodeSelected}"> 34 51 <f:param name="userObject.resId" value="#{item.userObject.userObject.resId}"/> 35 52 <ice:outputText id="knoten" value="#{item.userObject.userObject.value}"/> 36 53 </ice:commandLink> 54 <!-- </ice:panelGroup> --> 37 55 </f:facet> 38 56 </ice:treeNode> … … 40 58 </ice:form> 41 59 </ice:panelGroup> 42 <ice:panelGroup style="margin: 0; padding: 0;width:350px;" > 60 </f:facet> 61 <f:facet name="second"> 62 63 <ice:panelGroup style="float:left;margin: 0; padding: 0" > 43 64 <ice:panelGrid cellpadding="0" cellspacing="3" 44 65 columns="2" rendered="#{configurationBean.selectedObject != null}"> 66 <ice:form> 45 67 <ice:dataTable 46 68 var="item" … … 57 79 <ice:outputText value="Value" /> 58 80 </f:facet> 59 <ice: outputTextvalue="#{item.keyValue}" />81 <ice:inputText partialSubmit="true" value="#{item.keyValue}" /> 60 82 </ice:column> 61 </ice:dataTable> 83 84 </ice:dataTable> 85 <ice:panelGroup> 86 <ice:commandButton id="saveRes" 87 value="Speichern" 88 actionListener="#{configurationBean.saveButtonListener}"/> 89 </ice:panelGroup> 90 <ice:panelGroup rendered="#{configurationBean.selectedObject != null}"> 91 <ice:commandButton id="newRes" 92 value="Neu" 93 actionListener="#{configurationBean.newResourceButtonListener}"/> 94 </ice:panelGroup> 95 </ice:form> 62 96 </ice:panelGrid> 63 97 </ice:panelGroup> 98 </f:facet> 99 </ice:panelDivider> 100 <ice:panelDivider style="float:left; width:450px; height:85%"> 101 <f:facet name="first"></f:facet> 102 <f:facet name="second">blub</f:facet> 103 </ice:panelDivider> 64 104 <ice:form> 65 105 <ice:messages/> -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/Client.java
r847 r854 46 46 return new SimpleResource(new ResourceInfo(), new ResourceAttributeType[0]); 47 47 } 48 48 49 public SetSimpleResourceResponse setSimpleResource(SetSimpleResource ssr){ 50 VanHelsingStub stub; 51 try { 52 stub = getStub(); 53 54 VanHelsingStub.SetSimpleResource req = new VanHelsingStub.SetSimpleResource(); 55 req.setResAttribute(ssr.getResAttribute()); 56 req.setResInfo(ssr.getResInfo()); 57 58 VanHelsingStub.SetSimpleResourceResponse res = stub.setSimpleResource(ssr); 59 60 return res; 61 } catch (Exception e) { 62 System.err.println(e.toString()); 63 } 64 return null; 65 } 66 49 67 private VanHelsingStub getStub() throws Exception { 50 68 String url = new String("http://localhost:8080/"); -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
r849 r854 20 20 private ArrayList<ViewItem> selectedObject; 21 21 22 public ConfigurationBean(){ 22 public ConfigurationBean() { 23 init(); 24 } 25 private void init(){ 23 26 DefaultMutableTreeNode root = new DefaultMutableTreeNode(); 24 27 DefaultMutableTreeNode header; … … 30 33 ResourceInfo[] ri; 31 34 SimpleResource sr; 32 // ((ClientItem)selectedObject).setName("ClientNameTest");33 35 // ((ClientItem)selectedObject).setName("ClientNameTest"); 36 34 37 Client c = new Client(); 35 String[] nodes = {"Director", "Storage", "Catalog", "Autochanger", "Client", "FileSet", "FDClient", "Schedule", "SDStorage", "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages", "Pool"}; 36 //String[] nodes = {"Client"}; 38 String[] nodes = { "Director", "Storage", "Catalog", "Autochanger", 39 "Client", "FileSet", "FDClient", "Schedule", "SDStorage", 40 "Console", "Catalog", "SDDevice", "Job", "JobDefs", "Messages", 41 "Pool" }; 42 // String[] nodes = {"Client"}; 37 43 setTree(super.createTree(root, nodes, "Configuration")); 38 44 39 //forall header wird eine ResourceList[] angefragt 40 for(int i = 0; i < tree.getChildCount(root); i++){ 41 header = (DefaultMutableTreeNode)tree.getChild(root, i); 42 type = ((UserObjectItemType)header.getUserObject()).getUserObject().getResType(); 45 // forall header wird eine ResourceList[] angefragt 46 for (int i = 0; i < tree.getChildCount(root); i++) { 47 header = (DefaultMutableTreeNode) tree.getChild(root, i); 48 type = ((UserObjectItemType) header.getUserObject()) 49 .getUserObject().getResType(); 43 50 lrt = new ListResourcesType(); 44 51 lrt.setDirector("bacula-dir"); 45 52 lrt.setResourceType(type); 46 53 ri = c.getListResources(lrt); 47 if (ri == null || ri.length == 0) continue; 48 for (int j = 0; j < ri.length; j++){ 49 //myNode = null; 54 if (ri == null || ri.length == 0) 55 continue; 56 for (int j = 0; j < ri.length; j++) { 57 // myNode = null; 50 58 myNode = addNode(header, type, ri[j]); 51 // Node mit Daten befüllen59 // Node mit Daten befüllen 52 60 grt = new GetResourceType(); 53 61 grt.setDirector(lrt.getDirector()); … … 55 63 sr = c.getSimpleResource(grt); 56 64 myNode = addNode(myNode, type, sr.getResourceAttributeType()); 57 if (myNode != null) {65 if (myNode != null) { 58 66 header.add(myNode); 59 67 } 60 68 } 61 69 } 62 /*for (int i = 0; i < tree.getChildCount(root); i++){ 63 header = (DefaultMutableTreeNode)tree.getChild(root, i); 64 65 for (int j = 0; j < tree.getChildCount(header); j++){ 66 leaf = (DefaultMutableTreeNode)tree.getChild(header, j); 67 type = ((UserObjectItemType)leaf.getUserObject()).getUserObject().getResType(); 68 grt = new GetResourceType(); 69 grt.setDirector("bacula-dir"); 70 grt.setResId(((ItemType)(((UserObjectItemType)leaf.getUserObject()).getUserObject())).getResId()); 71 sr = c.getSimpleResource(grt); 72 sr.getResourceAttributeType(); 73 myNode = addNode(leaf, type, sr.getResourceAttributeType()); 74 if (myNode != null){ 75 leaf.add(myNode); 76 } 77 78 } 79 }*/ 80 70 /* 71 * for (int i = 0; i < tree.getChildCount(root); i++){ header = 72 * (DefaultMutableTreeNode)tree.getChild(root, i); 73 * 74 * for (int j = 0; j < tree.getChildCount(header); j++){ leaf = 75 * (DefaultMutableTreeNode)tree.getChild(header, j); type = 76 * ((UserObjectItemType 77 * )leaf.getUserObject()).getUserObject().getResType(); grt = new 78 * GetResourceType(); grt.setDirector("bacula-dir"); 79 * grt.setResId(((ItemType 80 * )(((UserObjectItemType)leaf.getUserObject()).getUserObject 81 * ())).getResId()); sr = c.getSimpleResource(grt); 82 * sr.getResourceAttributeType(); myNode = addNode(leaf, type, 83 * sr.getResourceAttributeType()); if (myNode != null){ 84 * leaf.add(myNode); } 85 * 86 * } } 87 */ 81 88 82 89 } 83 public void userObjectItemNodeSelected(ActionEvent ae){ 90 91 92 public void userObjectItemNodeSelected(ActionEvent ae) { 84 93 DefaultMutableTreeNode node; 85 94 UserObjectItem userObject; … … 87 96 String Id = BeanUtil.getRequestParameter("userObject.resId"); 88 97 node = getNode(Id, tree); 89 String type = ((UserObjectItem)((UserObjectItemType)node.getUserObject()).getUserObject()).getResType(); 90 String classType = "de.dass_it.vanhelsing.gui.items." + type + "Item"; 91 //Daten aus dem UserObjectItem extrahieren 98 String type = ((UserObjectItem) ((UserObjectItemType) node 99 .getUserObject()).getUserObject()).getResType(); 100 String resName = ((ItemType)((UserObjectItem) ((UserObjectItemType) node 101 .getUserObject()).getUserObject())).getResName(); 102 String director = ((ItemType)((UserObjectItem) ((UserObjectItemType) node 103 .getUserObject()).getUserObject())).getDirector(); 104 String classType = "de.dass_it.vanhelsing.gui.items." + type + "Item"; 105 // Daten aus dem UserObjectItem extrahieren 92 106 try { 93 94 UserObjectItem item = ((UserObjectItemType)(node.getUserObject())).getUserObject();107 UserObjectItem item = ((UserObjectItemType) (node.getUserObject())) 108 .getUserObject(); 95 109 96 Class c = ((UserObjectItemType)(node.getUserObject())).getUserObject().getClass(); 97 Method[] m = c.getDeclaredMethods(); 98 String keyValue; 99 String key; 100 ViewItem vi; 101 for (Method n : m) { 102 if(n.getName().startsWith("get")) { 103 keyValue = (String)n.invoke(item, (Object[])null); 104 if (keyValue == null) continue; 105 key = n.getName().substring(3); 106 vi = new ViewItem(); 107 vi.setKey(key); vi.setKeyValue(keyValue); vi.setResType(type); 108 selectedObject.add(vi); 110 Class c = ((UserObjectItemType) (node.getUserObject())) 111 .getUserObject().getClass(); 112 Method[] m = c.getDeclaredMethods(); 113 String keyValue; 114 String key; 115 ViewItem vi; 116 for (Method n : m) { 117 if (n.getName().startsWith("get")) { 118 keyValue = (String) n.invoke(item, (Object[]) null); 119 if (keyValue == null) 120 continue; 121 key = n.getName().substring(3); 122 vi = new ViewItem(); 123 vi.setResId(new Integer(Id)); 124 vi.setKey(key); 125 vi.setKeyValue(keyValue); 126 vi.setResType(type); 127 vi.setResName(resName); 128 vi.setDirector(director); 129 selectedObject.add(vi); 130 } 131 selectedObject.trimToSize(); 109 132 } 110 } 111 } catch(Exception e) { 133 } catch (Exception e) { 112 134 e.printStackTrace(); 113 135 } 114 136 } 137 public void newResourceButtonListener(ActionEvent ae){ 138 } 115 139 140 public void saveButtonListener(ActionEvent ae) { 141 Client c = new Client(); 142 ResourceInfo ri = new ResourceInfo(); 143 SetSimpleResourceResponse s2r2; 144 ri.setDirector( selectedObject.get(0).getDirector() ); 145 ri.setResId( selectedObject.get(0).getResId() ); 146 ri.setResName( selectedObject.get(0).getResName() ); 147 ri.setResType( selectedObject.get(0).getResType() ); 148 // ResourceAttribute 149 String key, value; 150 ResourceAttributeType[] ra = new ResourceAttributeType[selectedObject.size()]; 151 for (int i = 0; i < selectedObject.size(); i++) { 152 key = selectedObject.get(i).getKey(); 153 value = selectedObject.get(i).getKeyValue(); 154 ra[i] = new ResourceAttributeType(); 155 ra[i].setKey(key); 156 ra[i].setValue(value); 157 } 158 SetSimpleResource s2r = new SetSimpleResource(); 159 s2r.setResAttribute(ra); 160 s2r.setResInfo(ri); 161 s2r2 = c.setSimpleResource(s2r); 162 /*String status = s2r2.getStatus(); 163 if (selectedObject.get(0) != null){ 164 selectedObject.get(0).setResId(s2r2.getResId()); 165 }*/ 166 // TODO: write ResId to selectedObject 167 // selectedObject.get(0).setResId(grt.getResId()); 168 // valueChangeEffect.setFired(false); 169 } 170 116 171 public void setTree(DefaultTreeModel tree) { 117 172 this.tree = tree; 118 173 } 174 119 175 public DefaultTreeModel getTree() { 120 176 return tree; 121 177 } 178 122 179 public ArrayList<ViewItem> getSelectedObject() { 123 180 return selectedObject; 124 181 } 182 125 183 public void setSelectedObject(ArrayList<ViewItem> selectedObject) { 126 184 this.selectedObject = selectedObject; 127 185 } 128 129 186 130 187 } -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/TreeNavigation.java
r849 r854 26 26 tree = new DefaultTreeModel(root); 27 27 UserObjectItemType item = new UserObjectItemType(root); 28 item.setLeaf(false); 28 29 UserObjectItem uoi = new TreeItem("Configuration"); 29 30 uoi.setResType("Tree"); … … 49 50 Object o; 50 51 UserObjectItemType userObject = new UserObjectItemType(node); 52 userObject.setLeaf(false); 51 53 String type2 = "de.dass_it.vanhelsing.gui.items." + type + "Item"; 52 54 -
vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/items/UserObjectItemType.java
r831 r854 6 6 public class UserObjectItemType extends IceUserObject { 7 7 private UserObjectItem userObject; 8 9 8 public UserObjectItemType(DefaultMutableTreeNode defaultMutableTreeNode){ 10 9 super(defaultMutableTreeNode); 10 setBranchContractedIcon("tree_folder_closed.gif"); 11 setBranchExpandedIcon("tree_folder_open.gif"); 12 setLeafIcon("tree_document.gif"); 13 setLeaf(true); 14 setExpanded(false); 15 11 16 } 12 17 public UserObjectItem getUserObject(){ … … 16 21 this.userObject = userObject; 17 22 } 23 18 24 }
Note:
See TracChangeset
for help on using the changeset viewer.