Class AJSFContext

    • Constructor Detail

      • AJSFContext

        public AJSFContext()
    • Method Detail

      • getLocaleBean

        public LocaleBean getLocaleBean()
      • setLocaleBean

        public void setLocaleBean​(LocaleBean localeBean)
      • 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 der HttpSession
        Returns:
        HttpSession
      • getSession

        public javax.servlet.http.HttpSession getSession​(boolean create)
      • getSessionAttribute

        protected Object getSessionAttribute​(String attribute)
        Methode zum Ermitteln eines Session-Attributs
        Parameters:
        attribute - String der Name des Session-Attributs
        Returns:
        Object das hinterlegte Session-Attribut oder null wenn dieses nicht vorhanden ist
      • setSessionAttribute

        protected void setSessionAttribute​(String attribute,
                                           Object o)
        Methode zum Setzen eines Session-Attributs
        Parameters:
        attribute - String der Name des Session-Attributs
        o - Object der Wert des zu setzenden Session-Attributs
      • getBeanName

        protected String getBeanName​(Object bean)
      • findCurrentView

        public IViewModel findCurrentView()
        Returns:
        The current EViews; or null 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 bean
        context - 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​(String beanName,
                                     Class<T> beanClass,
                                     javax.faces.context.FacesContext facesContext,
                                     boolean create)
        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 bean
        beanClass - Class of the bean
        facesContext - 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..
      • 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. either EViews.DASHBOARD or EViews.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.