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 interfaceAJSFContext.RedirectOptionsAdditional options forredirect(String, RedirectOptions).static classAJSFContext.RedirectOptionsBuilder
-
Field Summary
Fields Modifier and Type Field Description protected LocaleBeanlocaleBean
-
Constructor Summary
Constructors Constructor Description AJSFContext()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddestroySessionBean(String name)StringencodeURL(String url)static <T> TfindBean(Class<T> beanClass)static <T> TfindBean(Class<T> beanClass, boolean create)static <T> TfindBean(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> TfindBean(Class<T> beanClass, javax.faces.context.FacesContext context, boolean create)static <T> TfindBean(String beanName, Class<T> beanClass)static <T> TfindBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext)static <T> TfindBean(String beanName, Class<T> beanClass, javax.faces.context.FacesContext facesContext, boolean create)IViewModelfindCurrentView()static UserContextfindUserContext()protected StringgetBeanName(Class<?> beanClass)Deprecated.UseFacesHelper.getBeanName(Class, Annotation...)if required.protected StringgetBeanName(Object bean)protected StringgetContext()CurrentViewBeangetCurrentViewBean()LocaleBeangetLocaleBean()protected javax.servlet.http.HttpServletRequestgetRequest()protected javax.servlet.http.HttpServletResponsegetResponse()javax.servlet.http.HttpSessiongetSession()Methode zum Auslesen derHttpSessionjavax.servlet.http.HttpSessiongetSession(boolean create)protected ObjectgetSessionAttribute(String attribute)Methode zum Ermitteln eines Session-Attributsstatic booleanisMasterServerContext()protected voidloadLazy(Object proxy)voidredirect(IViewModel view)voidredirect(IViewModel view, AJSFContext.RedirectOptions options)Redirects to the given view.voidredirect(String location)voidredirect(String location, AJSFContext.RedirectOptions options)Performs a redirect to the given location.voidredirectToDashboard(Benutzer user)voidredirectToDashboard(Benutzer user, AJSFContext.RedirectOptions options)Redirects to the appropriate dashboard for the given user, ie.voidsetLocaleBean(LocaleBean localeBean)protected voidsetSessionAttribute(String attribute, Object o)Methode zum Setzen eines Session-AttributsUserContextuc()-
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
-
-
-
-
Field Detail
-
localeBean
@Inject protected LocaleBean localeBean
-
-
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; ornullif 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
nullif 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-trueto create the bean if it does not exists yet,falseotherwise.- Returns:
- The current instance of the bean, or
nullif 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
nullif 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-trueto create the bean if it does not exists yet,falseotherwise.- Returns:
- The current instance of the bean, or
nullif 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
nullif 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
nullif 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-trueto create the bean if it does not exists yet,falseotherwise.- Returns:
- The current instance of the bean, or
nullif 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.DASHBOARDorEViews.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.
-
-