Interface SessionContext


  • public interface SessionContext
    Author:
    arthurm
    • Method Detail

      • getHostName

        String getHostName()
        Returns the hostname for which the corresponding session has been created. This hostname can be used for retrieving hostname/website dependent configuration.
        Returns:
        The hostname for the corresponding session.
      • getUsername

        String getUsername()
        Return the name of the user for which the session has been created.
        Returns:
        The name of the user of the session.
      • getLocale

        Locale getLocale()
        Return the default locale for the session.
        Returns:
        The locale for the session
      • setLocale

        void setLocale​(Locale locale)
        Updates the locale in the session.
        Parameters:
        locale - The new locale.
      • getTimeZone

        TimeZone getTimeZone()
        Return the timezone for the session.
        Returns:
        The timezone for the session
      • setTimeZone

        void setTimeZone​(TimeZone timezone)
        Updates the timezone for the session.
        Parameters:
        timezone - The new timezone
      • getCurrentEditingLanguage

        Language getCurrentEditingLanguage()
        Returns the "current language", not only for the edit side, but also for the frontend (please don't mind the name).

        When called within an edit side ("in context") request, it returns the language that the user is currently editing in. This is the language shown in the language switch and the language of the content item version currently displayed on the canvas.

        When called within a frontend request, it returns the language of the current page version shown.

        In special cases (for example scheduled tasks) where no language can be decided this way the language of the current session is used if available and otherwise the default content language.

        Returns:
        the language that the user is currently editing in
      • getEditLanguage

        String getEditLanguage()
        Returns the language of the WebManager user interface of the current user. e.g. 'dutch'
        Returns:
        the language
      • getEditLanguageLocale

        String getEditLanguageLocale()
        Returns the language meta value of the WebManager user interface of the current user. e.g. 'nl_NL'
        Returns:
        the language
      • getSessionCreator

        String getSessionCreator()
        Returns a String identifying the creator of this session.
        Returns:
        a String identifying the creator of this session
      • setCurrentEditingLanguage

        void setCurrentEditingLanguage​(Language language)
        Sets the language that the user is currently editing in
        Parameters:
        language - the language that the user is currently editing in
      • getHttpServletRequest

        javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Returns the HttpServletRequest object associated with this session, if available.
        Returns:
        HttpServletRequest object or null.
      • getHttpServletResponse

        javax.servlet.http.HttpServletResponse getHttpServletResponse()
        Returns the HttpServletResponse object associated with this session, if available.
        Returns:
        HttpServletResponse or null.
      • getWebsite

        Website getWebsite()
        Returns the website within the current context
        Returns:
        Current active website