Index: vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java
===================================================================
--- vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java	(revision 864)
+++ vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/ConfigurationBean.java	(revision 867)
@@ -22,4 +22,6 @@
 	private ArrayList<ViewItem> selectedObject;
 	private String selectedId;
+	private String selectedName;
+	private boolean createResource = false;
 
 	public ConfigurationBean() {
@@ -82,4 +84,5 @@
 		selectedObject = new ArrayList<ViewItem>();
 		String Id = BeanUtil.getRequestParameter("userObject.resId");
+		String name = BeanUtil.getRequestParameter("userObject.resName");
 		String selected = BeanUtil.getRequestParameter("ice.event.shift");
 		node = getNode(Id, tree);
@@ -169,19 +172,59 @@
 		return null;
 	}
+	
 	/**
 	 * 
 	 * @param ae
 	 */
+	public void newClientButtonListener(ActionEvent ae){
+		String type = "client";
+		ArrayList newResource = new ArrayList<ViewItem>();
+		ResourceInfo[] ri;
+		int i;
+		String s;
+		selectedObject = BeanUtil.getTypeProperties(type);
+		for (ViewItem vi : selectedObject){
+			vi.setRendererFlag(vi.getRenderer());
+			if (vi.getRenderer().equals("selectOneMenu")){
+				SelectItem[] keyValueList;
+				//TODO: implement getter for list of node types
+				Client c = new Client();
+				s = vi.getKey().replaceFirst(new Character(vi.getKey().charAt(0)).toString(),
+						new Character(Character.toUpperCase(vi.getKey().charAt(0))).toString());
+				
+				ri = c.getListResources("bacula-dir", s);
+				if (ri != null){
+					keyValueList = new SelectItem[ri.length];
+					i = 0;
+					for (ResourceInfo rinfo : ri){
+						keyValueList[i] = new SelectItem();
+						keyValueList[i].setValue(rinfo.getResName());
+						keyValueList[i].setLabel(rinfo.getResName());
+						i++;
+					}
+					vi.setKeyValueList(keyValueList);
+				}
+			
+			}
+			createResource = true;
+		}
+		
+		
+	}
+	
 	public void newResourceButtonListener(ActionEvent ae){
 		DefaultMutableTreeNode node;
 		UserObjectItem userObject;
+		String Id = BeanUtil.getRequestParameter("userObject.ResId");
+		String value = BeanUtil.getRequestParameter("userObject.resName");
+		String shift = BeanUtil.getRequestParameter("ice.event.shift");
 		selectedObject = new ArrayList<ViewItem>();
-		String Id = BeanUtil.getRequestParameter("userObject.ResId");
-		String shift = BeanUtil.getRequestParameter("ice.event.shift");
-		System.err.println(shift);
-		if (Id == null){
+		System.out.println("value: "+value+" id: "+Id);
+		
+		if (value.equals("")){
 			return;
 		}
-		node = getNode(Id, tree);
+		//node = getNode(Id, tree);
+		node = getNodeByName(value, tree);
 		String type = ((UserObjectItem) ((UserObjectItemType) node
 				.getUserObject()).getUserObject()).getResType();
@@ -189,5 +232,6 @@
 		String[] val;
 		try{
-			String type2 = "de.dass_it.vanhelsing.gui.items." +  type + "Item";
+			//value contains the header of the subtree
+			String type2 = "de.dass_it.vanhelsing.gui.items." +  value + "Item";
 			Class newClass = Class.forName(type2);
 			for (Method m : newClass.getDeclaredMethods()){
@@ -252,4 +296,24 @@
 		BeanUtil.setInfoMessage(null, "Diese Methode ist noch nicht implementiert.");
 	}
+	public void saveClientButtonListener(ActionEvent ae){
+		Client c = new Client();
+		String name = "";
+		ResourceAttributeType[] rat = new ResourceAttributeType[selectedObject.size()];
+		int i =0;
+		for (ViewItem vi : selectedObject){
+			rat[i] = new ResourceAttributeType();
+			rat[i].setKey(vi.getKey());
+			rat[i].setValue(vi.getKeyValue());
+			i++;
+			if (vi.getKey().equals("name")){
+				name = vi.getKeyValue();
+			}
+
+		}
+		int newResId = c.createSimpleResource(rat, 
+				c.makeResourceInfo("bacula-dir", 0, name, "Client") 
+				);
+		System.err.println(newResId);
+	}
 	/**
 	 * **EXPERIMENTAL** writes the selected resource to the data tree of the web service.
@@ -338,4 +402,18 @@
 		return -1;
 	}
+	public String getSelectedName(){
+		if (selectedObject != null){
+			if (selectedObject.size() > 0){
+				return selectedObject.get(0).getResName();
+			}
+		}
+		return "";
+	}
+	public void setCreateResource(boolean b){
+		this.createResource = b;
+	}
+	public boolean getCreateResource(){
+		return createResource;
+	}
 
 }
