Class HttpSessionWrapper

java.lang.Object
com.saperion.ngc.main.HttpSessionWrapper

public class HttpSessionWrapper extends Object
This is a http session wrapper class. This class needs to be changed according to the session handling of the specific frame work used.
  • Field Details

  • Constructor Details

    • HttpSessionWrapper

      public HttpSessionWrapper()
      Constructs a new SessionWrapper using an internal http session.
    • HttpSessionWrapper

      public HttpSessionWrapper(jakarta.servlet.http.HttpSession httpSession)
      Constructs a new SessionWrapper with a given http session.
      Parameters:
      httpSession - The http session to use.
  • Method Details

    • setAttribute

      public void setAttribute(String key, Object value)
      Set attribute in the current session.
      Parameters:
      key - The key of the attribute.
      value - The value of the attribute.
    • removeAttribute

      public void removeAttribute(String key)
      Removes the attribute with the specified key from the current session.
      Parameters:
      key - of the attribute to remove
    • getAttribute

      public Object getAttribute(String key)
      Get the attribute for the given key.
      Parameters:
      key - The key to get the attribute for.
      Returns:
      The object for the given key.
    • getAttribute

      public <T> T getAttribute(String key, Class<T> type)
      This method returns the session attribute with the specified key.
      Type Parameters:
      T - type parameter
      Parameters:
      key - key of the attribute
      type - expected type of the attribute
      Returns:
      the attribute or null if no such attribute exists.
    • getUserAttribute

      public User getUserAttribute()
      Convenience method to retrieve the user attribute. Same as getAttribute(USER_ATTR).
      Returns:
      User attribute
    • getAlfMap

      public Map<String,LinkedList<String>> getAlfMap()
      Convenience method to retrieve the alf-map attribute. Same as getAttribute(ALF_MAP_ATTR). The alf-map contains the files the user has opened in the current session.
      Returns:
      ALD map.
    • getPopupBeans

      public Map<String,OpenDocumentBean> getPopupBeans()
      Convenience method to retrieve the map with the viewer-popup-beans. Same as getAttribute(VIEWER_POPUP_BEANS). The map contains beans that define the document that is shown in a viewer-popup.
      Returns:
      OpenPopupBean map
    • getDocumentSessions

      public Set<String> getDocumentSessions()
      Convenience method to retrieve the set with the document sessions id. Same as getAttribute(DOCUMENT_SESSION_ATTR). The set contains the session id of documents generated by the Hyland Rendering and Conversion service.
      Returns:
      document sessions set attribute
    • isSingleTenant

      public boolean isSingleTenant()
      Returns true if the current session is working on a single-tenant-system.
      Returns:
      is single tenant
    • getSession

      public jakarta.servlet.http.HttpSession getSession()
      Gets the session.
      Returns:
      the session
    • getMainWindow

      public org.zkoss.zul.Window getMainWindow()
      Returns:
      the main window of the application. Never null.
    • isIndexUser

      public boolean isIndexUser()
      Checks if the currently logged-on user uses an index-license.
      Returns:
      is index user
    • getOpenDialogs

      public Set<String> getOpenDialogs()
      Returns the set containing the dialogs that are open in the current session.
      Returns:
      a set of dialog-IDs