package de.dass_it.vanhelsing.gui;



import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
import java.util.ResourceBundle;



//import org.apache.log4j.Logger;

/*
 * Helper class to encapsulate common bean methods.
 * Managed beans will extend this class either directly or 
 * via a data structure helper class like TreeNavigation
 */
public class BeanUtil {
	//Logging
    
	//protected final Logger logger = Logger.getLogger(this.getClass());
    
	//Messagebundles
	

    //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);
	}
	
}
