Package de.xima.fc.gui.common.utils.msg
Class AJSFContext
- java.lang.Object
-
- de.xima.fc.gui.common.utils.msg.I18nUtils
-
- de.xima.fc.gui.common.utils.msg.MessageUtils
-
- de.xima.fc.gui.common.utils.msg.AMessaging
-
- de.xima.fc.gui.common.utils.msg.AJSFContext
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ABackendJSFContext
,AContextBean
,AppointmentFilterBean
,AppointmentScheduleBean
,CurrentViewBean
,FeedbackBean
,InboxFilterBean
,InboxPermissionBean
,InboxProfileBean
,InboxProjectListBean
,LoginBean
,MenuTemplateBean
,MetaFilterBean
,NotificationBean
,ProcessAttachmentBean
,ProcessExportBean
,ProcessHistoryBean
,ProcessListBean
,ProcessMoveBean
,ProcessReviewBean
,ProcessStateChangeBean
,ProcessViewBean
,ResourceContentBean
,SearchFilterBean
,SelectionBean
,SessionBean
,SupportBean
,ViewBean
,ViewFilterBean
public abstract class AJSFContext extends AMessaging implements Serializable
Stellt globale Funktionalität zur Verfügung- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AJSFContext.RedirectOptions
Additional options forredirect(String, RedirectOptions)
.static class
AJSFContext.RedirectOptionsBuilder
-
Constructor Summary
Constructors Constructor Description AJSFContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
destroySessionBean(String name)
String
encodeURL(String url)
static <T> T
findBean(Class<T> beanClass)
static <T> T
findBean(Class<T> beanClass, boolean create)
static <T> T
findBean(Class<T> beanClass, javax.faces.context.FacesContext context)
Finds the given bean in the current scope, creating a new bean instance if it does not exist yet.static <T> T
findBean(Class<T> beanClass, javax.faces.context.FacesContext context, boolean create)
static <T> T
findBean(String beanName, Class<T> beanClass)
static <T> T
findBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext)
static <T> T
findBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext, boolean create)
IViewModel
findCurrentView()
static UserContext
findUserContext()
protected String
getBeanName(Class<?> beanClass)
Deprecated.UseFacesHelper.getBeanName(Class, Annotation...)
if required.protected String
getBeanName(Object bean)
protected String
getContext()
CurrentViewBean
getCurrentViewBean()
LocaleBean
getLocaleBean()
protected javax.servlet.http.HttpServletRequest
getRequest()
protected javax.servlet.http.HttpServletResponse
getResponse()
javax.servlet.http.HttpSession
getSession()
Methode zum Auslesen derHttpSession
javax.servlet.http.HttpSession
getSession(boolean create)
protected Object
getSessionAttribute(String attribute)
Methode zum Ermitteln eines Session-Attributsstatic boolean
isMasterServerContext()
protected void
loadLazy(Object proxy)
void
redirect(IViewModel view)
void
redirect(IViewModel view, AJSFContext.RedirectOptions options)
Redirects to the given view.void
redirect(String location)
void
redirect(String location, AJSFContext.RedirectOptions options)
Performs a redirect to the given location.void
redirectToDashboard(Benutzer user)
void
redirectToDashboard(Benutzer user, AJSFContext.RedirectOptions options)
Redirects to the appropriate dashboard for the given user, ie. eitherEViews.DASHBOARD
orEViews.ADMIN_DASHBOARD
.void
setLocaleBean(LocaleBean localeBean)
protected void
setSessionAttribute(String attribute, Object o)
Methode zum Setzen eines Session-AttributsUserContext
uc()
-
Methods inherited from class de.xima.fc.gui.common.utils.msg.MessageUtils
addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsg, addErrorMsgFromString, addErrorMsgFromString, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addErrorMsgToComponent, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsg, addInfoMsgFromString, addInfoMsgFromString, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addInfoMsgToComponent, addMsg, addMsg, addMsg, addMsg, addMsgs, addMsgToComponent, addMsgToComponent, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsg, addWarnMsgFromString, addWarnMsgFromString, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, addWarnMsgToComponent, cleanErrorMsg, getErrorMessage, getNewErrorMsg, getNewErrorMsg, getNewErrorMsg, getNewInfoMsg, getNewInfoMsg, getNewMsg, getNewWarnMsg, getNewWarnMsg
-
-
-
-
Method Detail
-
getLocaleBean
public LocaleBean getLocaleBean()
-
setLocaleBean
public void setLocaleBean(LocaleBean localeBean)
-
getCurrentViewBean
public CurrentViewBean getCurrentViewBean()
-
uc
public UserContext uc()
-
destroySessionBean
public void destroySessionBean(String name)
-
loadLazy
protected void loadLazy(Object proxy)
-
getContext
protected String getContext()
-
getRequest
protected javax.servlet.http.HttpServletRequest getRequest()
-
getResponse
protected javax.servlet.http.HttpServletResponse getResponse()
-
getSession
public javax.servlet.http.HttpSession getSession()
Methode zum Auslesen derHttpSession
- Returns:
HttpSession
-
getSession
public javax.servlet.http.HttpSession getSession(boolean create)
-
getSessionAttribute
protected Object getSessionAttribute(String attribute)
Methode zum Ermitteln eines Session-Attributs
-
setSessionAttribute
protected void setSessionAttribute(String attribute, Object o)
Methode zum Setzen eines Session-Attributs
-
getBeanName
@Deprecated protected String getBeanName(Class<?> beanClass)
Deprecated.UseFacesHelper.getBeanName(Class, Annotation...)
if required.- Parameters:
beanClass
- Class of the bean to lookup.- Returns:
- The name of the bean.
-
findCurrentView
public IViewModel findCurrentView()
- Returns:
- The current
EViews
; ornull
if it could not be determined.
-
findUserContext
public static UserContext findUserContext()
-
findBean
public static <T> T findBean(Class<T> beanClass, javax.faces.context.FacesContext context)
Finds the given bean in the current scope, creating a new bean instance if it does not exist yet.- Type Parameters:
T
- Type of the bean- Parameters:
beanClass
- Class of the beancontext
- The current faces context.- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
findBean
@Deprecated public static <T> T findBean(Class<T> beanClass, javax.faces.context.FacesContext context, boolean create)
Deprecated.Finds the given bean in the current scope.- Type Parameters:
T
- Type of the bean- Parameters:
beanClass
- Class of the beancontext
- The current faces context.create
-true
to create the bean if it does not exists yet,false
otherwise.- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
findBean
@Deprecated public static <T> T findBean(Class<T> beanClass)
Deprecated.Finds the given bean in the current scope, creating a new bean instance if it does not exist yet.- Type Parameters:
T
- Type of the bean- Parameters:
beanClass
- Class of the bean- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created.
-
findBean
@Deprecated public static <T> T findBean(Class<T> beanClass, boolean create)
Deprecated.Finds the given bean in the current scope.- Type Parameters:
T
- Type of the bean- Parameters:
beanClass
- Class of the beancreate
-true
to create the bean if it does not exists yet,false
otherwise.- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
findBean
@Deprecated public static <T> T findBean(String beanName, Class<T> beanClass)
Deprecated.Finds the given bean in the current scope, creating a new bean instance if it does not exist yet.- Type Parameters:
T
- Type of the bean- Parameters:
beanName
- Name of the beanbeanClass
- Class of the bean- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
findBean
@Deprecated public static <T> T findBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext)
Deprecated.Finds the given bean in the current scope.- Type Parameters:
T
- Type of the bean- Parameters:
beanName
- Name of the beanbeanClass
- Class of the beanfacesContext
- Current faces context- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
findBean
@Deprecated public static <T> T findBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext, boolean create)
Deprecated.Finds the given bean in the current scope, creating a new bean instance if it does not exist yet.- Type Parameters:
T
- Type of the bean- Parameters:
beanName
- Name of the beanbeanClass
- Class of the beanfacesContext
- Current faces contextcreate
-true
to create the bean if it does not exists yet,false
otherwise.- Returns:
- The current instance of the bean, or
null
if the bean does not exist or could not be created..
-
redirectToDashboard
public void redirectToDashboard(Benutzer user)
-
redirectToDashboard
public void redirectToDashboard(Benutzer user, AJSFContext.RedirectOptions options)
Redirects to the appropriate dashboard for the given user, ie. eitherEViews.DASHBOARD
orEViews.ADMIN_DASHBOARD
.- Parameters:
user
- User that is to be redirected to their dashboard.options
- Additional settings for modifying how the redirect is performed.
-
isMasterServerContext
public static boolean isMasterServerContext()
-
redirect
public void redirect(IViewModel view)
-
redirect
public void redirect(IViewModel view, AJSFContext.RedirectOptions options)
Redirects to the given view. Optional settings may be given to add URL parameters etc.- Parameters:
view
- View to which to redirect the user.options
- Optional settings for modifying how the redirect is performed.
-
redirect
public void redirect(String location)
-
redirect
public void redirect(String location, AJSFContext.RedirectOptions options)
Performs a redirect to the given location. Optional settings may be given to add URL parameters etc.- Parameters:
location
- Location to which to redirect. Must be a relative URL without the context path.options
- Optional settings for modifying how the redirect is performed.
-
-