Index: vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/BeanUtil.java
===================================================================
--- vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/BeanUtil.java	(revision 862)
+++ vanHelsing/trunk/gui/src/de/dass_it/vanhelsing/gui/BeanUtil.java	(revision 864)
@@ -1,5 +1,3 @@
 package de.dass_it.vanhelsing.gui;
-
-
 
 import javax.faces.application.FacesMessage;
@@ -9,10 +7,9 @@
 import java.util.ResourceBundle;
 import java.util.Locale;
-
-
+import java.util.HashMap;
 
 //import org.apache.log4j.Logger;
 
-/*
+/**
  * Helper class to encapsulate common bean methods.
  * Managed beans will extend this class either directly or 
@@ -20,41 +17,80 @@
  */
 public class BeanUtil {
-	//Logging
-    
-	//protected final Logger logger = Logger.getLogger(this.getClass());
-    
-	//Messagebundles
-	public static String getProperty(String key){
+	// Logging
+
+	// protected final Logger logger = Logger.getLogger(this.getClass());
+
+	// Messagebundles
+	/**
+	 * getter method for a property value
+	 * @param key	key of the queried property, e.g. director.client.name.type
+	 * @return s	value of the property
+	 */
+	public static String getProperty(String key) {
 		String s = PropertyBundle.getProperty(key);
 		return s;
 	}
-	
-	public static String[] getProperties(String key){
-		String[] suffix = {"ref", "type", "required", "def"};
+	/**
+	 * 
+	 * @param key	key contains the key value of the set of properties for a given attribute<br/>
+	 * 				except for the suffix which defines the content type of the property.
+	 * @return	bundle	contains all four properties of an attribute
+	 */
+	public static String[] getProperties(String key) {
+		String[] suffix = { "ref", "type", "required", "def" };
 		String[] bundle = new String[4];
 		for (int i = 0; i < 4; i++) {
-			bundle[i] = BeanUtil.getProperty(key+"."+suffix[i]);
+			bundle[i] = BeanUtil.getProperty(key + "." + suffix[i]);
 		}
 		return bundle;
 	}
-	public static boolean getRequired(String type, String key){
+	/**
+	 * 
+	 * @param type	resource type of the attribute, like Client
+	 * @param key	attribute name of the resource, like Port
+	 * @return		true if the field is required or false
+	 */
+	public static boolean getRequired(String type, String key) {
 		String s = getFieldProperty(type, key, 2);
-		if (s.equals("true") )return true;
+		if (s.equals("true"))
+			return true;
 		return false;
 	}
-	public static String getDataType(String type, String key){
+	/**
+	 * returns the data type of a given attribute.
+	 * @param type	resource type of the attribute, like Client
+	 * @param key	attribute name of the resource, like Port
+	 * @return		data type of the attribute
+	 */
+	public static String getDataType(String type, String key) {
 		return getFieldProperty(type, key, 1);
 	}
-	//getRenderer returns rendererType based on properties
-	public static String getRenderer(String type, String key){
+
+	// getRenderer returns rendererType based on properties
+	/**
+	 * returns the renderer for a given attribute
+	 * @param type	resource type of the attribute, like Client
+	 * @param key	attribute name of the resource, like Port
+	 * @return		"inputText", "radioGroup" or "selectOneMenu"
+	 * 				
+	 */
+	public static String getRenderer(String type, String key) {
 		return getFieldProperty(type, key, 0);
 	}
-	public static String getFieldProperty(String type, String key, int i){
+	/**
+	 * returns properties for a given attribute depending on the value of i.
+	 * One should use the getter method for the property.
+	 * @param type	resource type of the attribute, like Client
+	 * @param key	attribute name of the resource, like Port
+	 * @param i		i maybe between 0 and 3. The return value of the method is selected by the value of i
+	 * @return		one of the four properties as a String of a given attribute. 
+	 */
+	public static String getFieldProperty(String type, String key, int i) {
 		String daemon = "director";
 		String res = "inputText";
-		if (type.startsWith("SD")){
+		if (type.startsWith("SD")) {
 			daemon = "storagedaemon";
 		}
-		if (type.startsWith("FD")){
+		if (type.startsWith("FD")) {
 			daemon = "filedaemon";
 		}
@@ -62,42 +98,80 @@
 		key = key.toLowerCase();
 		key = key.replaceAll(" ", "");
-		String result[] = getProperties((daemon+"."+type+"."+key));
+		String result[] = getProperties((daemon + "." + type + "." + key));
 		if (i == 0) {
-			if (result[1].equals("boolean")){
-				return "radioGroup"; 
+			if (result[1].equals("boolean")) {
+				return "radioGroup";
 			}
-			if (!(result[0].equals("0"))){
+			if (!(result[0].equals("0"))) {
 				return "selectOneMenu";
-			}		
+			}
 			return res;
 		}
-		if (i == 2) return result[2];
-		if (i == 1) return result[1];
-		if (i == 3) return result[3];
+		if (i == 2)
+			return result[2];
+		if (i == 1)
+			return result[1];
+		if (i == 3)
+			return result[3];
 		return res;
 	}
-	
-    //Statusmeldungen an den Client
-    public static void setInfoMessage(String client, String message){
-    	FacesContext.getCurrentInstance().addMessage(client, new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
-    }
-    public static void setErrorMessage(String client, String message){
-    	FacesContext.getCurrentInstance().addMessage(client, new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
-    }
-    
-	//Linkout to Bacula documentation
-	//ListItemsConfigView
-	//ListItemsTopologyView
-	//ListItemsJobSchedule
-	
-	//GetParameterFromContext
-	public static String getRequestParameter(String name){
-		return (String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(name);
+
+	// Statusmeldungen an den Client
+	/**
+	 * sends an information type message to the message field at the bottom of the screen
+	 * @param client	could contain an identifier of a client. value can be set to null
+	 * @param message	the message to be displayed at the clients view
+	 */
+	public static void setInfoMessage(String client, String message) {
+		FacesContext.getCurrentInstance().addMessage(client,
+				new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));
 	}
-	
-	public static String getAccessType(String type){
-		if (type.equals("jobdefs")) return "job";
+	/**
+	 * sends an error type message to the message field at the bottom of the screen 
+	 * @param client	could contain an identifier of a client. value can be set to null
+	 * @param message	the message to be displayed at the clients view
+	 */
+	public static void setErrorMessage(String client, String message) {
+		FacesContext.getCurrentInstance()
+				.addMessage(
+						client,
+						new FacesMessage(FacesMessage.SEVERITY_ERROR, message,
+								message));
+	}
+
+	// Linkout to Bacula documentation
+	// ListItemsConfigView
+	// ListItemsTopologyView
+	// ListItemsJobSchedule
+
+	// GetParameterFromContext
+	/**
+	 * returns values of a given parameter of the FacesContext
+	 * @param name	name of the parameter e.g. the id of a parameter in the view.	
+	 * @return 	value of a given parameter
+	 */
+	public static String getRequestParameter(String name) {
+		return (String) FacesContext.getCurrentInstance().getExternalContext()
+				.getRequestParameterMap().get(name);
+	}
+	/**
+	 * translation method for resource or object names.
+	 * @param type	untranslated name 
+	 * @return 		translated name if there is a translation. Otherwise type will be returned.
+	 */
+	public static String getAccessType(String type) {
+		String result = new String();
+		HashMap<String, String> map = new HashMap<String, String>();
+		map.put("jobdefs", "job");
+		map.put("SDStorage", "Storage");
+		map.put("Storage", "SDStorage");
+		map.put("SDDevice", "Device");
+		map.put("Device", "SDDevice");
+		map.put("SDDevice", "Device");
+		result = map.get(type);
+		if (result != null)
+			return result;
 		return type;
 	}
-	
+
 }
