org.ploin.web.faces
Class BaseBean

java.lang.Object
  extended by org.ploin.web.faces.Base
      extended by org.ploin.web.faces.BaseMessages
          extended by org.ploin.web.faces.BaseBean
All Implemented Interfaces:
Serializable

public class BaseBean
extends BaseMessages
implements Serializable

The BaseBean should extend all your ManagedBeans or your own BaseBean.

$HeadURL: https://ploinscm.de/svn/ploinFaces/trunk/src/main/java/org/ploin/web/faces/BaseBean.java $
$LastChangedBy: r.reiz $
$Revision: 91 $
$Date: 2010-01-18 22:26:53 +0100 (Mon, 18 Jan 2010) $

See Also:
Serialized Form

Constructor Summary
BaseBean()
           
 
Method Summary
static Map getApplicationMap()
          This method rerturns the ApplicationMap, containing some parameters.
 javax.faces.lifecycle.Lifecycle getCurrentDefaultLifecycleInstance()
          Returns the current LifecycleInstance of the Application.
static Integer getCurrentPhaseId()
          Returns the current PhaseId as Integer.
static String getFromViewId()
          Return the viewId from where the request is comming.
protected  Integer getIntegerFromRequestMap(String key)
          This method looks for a value in the requestMap with the given key, convert it to Integer and return the Integer value.
static Long getLifecycleId()
          Return the lifecycleId, which is generated by ploinFaces.
protected  Long getLongFromRequestMap(String key)
          This method looks for a value in the requestMap with the given key, convert it to Long and return the Long value.
static javax.servlet.http.HttpServletRequest getRequest()
          This methode returns the HttpServlet Object
static Map<String,String> getRequestMap()
          Returns the Parameter-Map from the Request.
static javax.servlet.http.HttpServletResponse getResponse()
          This methode returns the HttpServlet Response
static javax.servlet.http.HttpSession getSession()
          This methode returns the HttpSession object
protected  String getStringFromRequestMap(String key)
          This method looks for a value in the requestMap with the given key, and return the String value.
static Object getValueFromApplicationMap(Object key)
          This method fetch a value from the ApplicationMap with the given key.
 boolean removeFlow(String flowId)
          removes all attributes/ManagedBeans containing to the flow from the session
 void setLifecycle(javax.faces.lifecycle.Lifecycle lifecycle)
          Set the lifecycle.
 
Methods inherited from class org.ploin.web.faces.BaseMessages
addErrorMessage, addErrorMessage, addErrorMessageText, addErrorMessageText, addFatalMessage, addFatalMessage, addFatalMessageText, addFatalMessageText, addHTMLMessage, addHTMLMessageFromBundle, addHTMLMessageFromBundle, addHTMLMessageFromBundle, addHTMLMessageFromBundle, addInfoMessage, addInfoMessage, addInfoMessageText, addInfoMessageText, addWarnMessage, addWarnMessage, addWarnMessageText, addWarnMessageText, getDetailSuffix, getStringFromResourceBundle, getStringFromResourceBundle, getStringFromResourceBundleDetail, getStringFromResourceBundleDetail, getStringFromResourceBundleSummary, getStringFromResourceBundleSummary, getSummarySuffix, setDetailSuffix, setSummarySuffix
 
Methods inherited from class org.ploin.web.faces.Base
getApplication, getFacesContext, getLocale, getResourceBundle, getViewRoot, getViewRootId, setLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseBean

public BaseBean()
Method Detail

getRequest

public static javax.servlet.http.HttpServletRequest getRequest()
This methode returns the HttpServlet Object

Returns:
HttpServletRequest

getSession

public static javax.servlet.http.HttpSession getSession()
This methode returns the HttpSession object

Returns:
HttpSession

getResponse

public static javax.servlet.http.HttpServletResponse getResponse()
This methode returns the HttpServlet Response

Returns:
HttpServletResponse

getApplicationMap

public static Map getApplicationMap()
This method rerturns the ApplicationMap, containing some parameters.

Returns:

getValueFromApplicationMap

public static Object getValueFromApplicationMap(Object key)
This method fetch a value from the ApplicationMap with the given key.

Parameters:
key - - the selected key
Returns:
value

getRequestMap

public static Map<String,String> getRequestMap()
Returns the Parameter-Map from the Request.

Returns:
Map map

getLongFromRequestMap

protected Long getLongFromRequestMap(String key)
This method looks for a value in the requestMap with the given key, convert it to Long and return the Long value. If there is no value for the given key or the convertig process throws an Exception returning null.

Parameters:
key - - the key for the requestMap
Returns:
the value converted to Long

getIntegerFromRequestMap

protected Integer getIntegerFromRequestMap(String key)
This method looks for a value in the requestMap with the given key, convert it to Integer and return the Integer value. If there is no value for the given key or the convertig process throws an Exception returning null.

Parameters:
key - - the key for the requestMap
Returns:
the value converted to Long

getStringFromRequestMap

protected String getStringFromRequestMap(String key)
This method looks for a value in the requestMap with the given key, and return the String value. If there is no value for the given key returning null.

Parameters:
key - - the key for the requestMap
Returns:
the value converted to Long

getCurrentDefaultLifecycleInstance

public javax.faces.lifecycle.Lifecycle getCurrentDefaultLifecycleInstance()
Returns the current LifecycleInstance of the Application.

Returns:
the current LifecycleInstance

getCurrentPhaseId

public static Integer getCurrentPhaseId()
Returns the current PhaseId as Integer.

Returns:
1 ... 6

getFromViewId

public static String getFromViewId()
Return the viewId from where the request is comming.

Returns:
the viewId from where the request is comming.

getLifecycleId

public static Long getLifecycleId()
Return the lifecycleId, which is generated by ploinFaces.

Returns:
the lifecycleId, which is generated by ploinFaces.

setLifecycle

public void setLifecycle(javax.faces.lifecycle.Lifecycle lifecycle)
Set the lifecycle. Just For testing!!

Parameters:
lifecycle - instance

removeFlow

public boolean removeFlow(String flowId)
removes all attributes/ManagedBeans containing to the flow from the session

Parameters:
flowId - - the name of a flow
Returns:
true/false


Copyright © 2012 PLOIN GmbH. All Rights Reserved.