Package com.saperion.ngc.main
Class HttpSessionWrapper
- java.lang.Object
-
- com.saperion.ngc.main.HttpSessionWrapper
-
public class HttpSessionWrapper extends java.lang.ObjectThis is a http session wrapper class. This class needs to be changed according to the session handling of the specific frame work used.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALF_MAP_ATTRAttribute name for the ALF map.static java.lang.StringCLIENT_INFO_UTIL_ATTRSession attribute for the ClientInfoUtil instance.static java.lang.StringCONNECTOR_ATTRName for http session attribute of a connector-instance.static java.lang.StringDIALOGS_SET_ATTRAttribute name for the set containing the IDs of open dialogs.static java.lang.StringDOCUMENT_SESSION_ATTRName for http session attribute of the document sessions.static java.lang.StringIS_ONEDRIVE_LOGGED_INstatic java.lang.StringIS_SHAREBASE_LOGGED_INstatic java.lang.StringIS_SSO_LOGINSession attribute set to true if SSO is used for login.static java.lang.StringLOCK_SETAttribute name for a set of locked document IDs.static java.lang.StringMAIN_WINDOWAttribute name for the main window.static java.lang.StringONEDRIVE_CLIENTstatic java.lang.StringSHAREBASE_CHECKOUT_FOLDERstatic java.lang.StringSHAREBASE_CLIENTstatic java.lang.StringSSO_DISABLE_LOGOFF_BUTTONSession attribute used to disable the logoff button when SSO is used.static java.lang.StringUSER_ATTRName for http session attribute of the user.static java.lang.StringUSER_WEB_SESSION_ATTRName for web session attributestatic java.lang.StringVIEWER_POPUP_BEANSName for http session attribute of the viewer-popup beans.static java.lang.StringWF_CONNECTOR_ATTRName for http session attribute of a workflow connector-instance.static java.lang.StringWF_DDC_ATTRAttribute name for the workflow ddc name.
-
Constructor Summary
Constructors Constructor Description HttpSessionWrapper()Constructs a new SessionWrapper using an internal http session.HttpSessionWrapper(javax.servlet.http.HttpSession httpSession)Constructs a new SessionWrapper with a given http session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.util.LinkedList<java.lang.String>>getAlfMap()Convenience method to retrieve the alf-map attribute.java.lang.ObjectgetAttribute(java.lang.String key)Get the attribute for the given key.<T> TgetAttribute(java.lang.String key, java.lang.Class<T> type)This method returns the session attribute with the specified key.java.util.Set<java.lang.String>getDocumentSessions()Convenience method to retrieve the set with the document sessions id.org.zkoss.zul.WindowgetMainWindow()java.util.Set<java.lang.String>getOpenDialogs()Returns the set containing the dialogs that are open in the current session.java.util.Map<java.lang.String,OpenDocumentBean>getPopupBeans()Convenience method to retrieve the map with the viewer-popup-beans.javax.servlet.http.HttpSessiongetSession()Gets the session.UsergetUserAttribute()Convenience method to retrieve the user attribute.booleanisIndexUser()Checks if the currently logged-on user uses an index-license.booleanisSingleTenant()Returns true if the current session is working on a single-tenant-system.voidremoveAttribute(java.lang.String key)Removes the attribute with the specified key from the current session.voidsetAttribute(java.lang.String key, java.lang.Object value)Set attribute in the current session.
-
-
-
Field Detail
-
CONNECTOR_ATTR
public static final java.lang.String CONNECTOR_ATTR
Name for http session attribute of a connector-instance.- See Also:
- Constant Field Values
-
WF_CONNECTOR_ATTR
public static final java.lang.String WF_CONNECTOR_ATTR
Name for http session attribute of a workflow connector-instance.- See Also:
- Constant Field Values
-
USER_ATTR
public static final java.lang.String USER_ATTR
Name for http session attribute of the user.- See Also:
- Constant Field Values
-
USER_WEB_SESSION_ATTR
public static final java.lang.String USER_WEB_SESSION_ATTR
Name for web session attribute- See Also:
- Constant Field Values
-
VIEWER_POPUP_BEANS
public static final java.lang.String VIEWER_POPUP_BEANS
Name for http session attribute of the viewer-popup beans.- See Also:
- Constant Field Values
-
DOCUMENT_SESSION_ATTR
public static final java.lang.String DOCUMENT_SESSION_ATTR
Name for http session attribute of the document sessions.- See Also:
- Constant Field Values
-
LOCK_SET
public static final java.lang.String LOCK_SET
Attribute name for a set of locked document IDs.- See Also:
- Constant Field Values
-
MAIN_WINDOW
public static final java.lang.String MAIN_WINDOW
Attribute name for the main window.- See Also:
- Constant Field Values
-
ALF_MAP_ATTR
public static final java.lang.String ALF_MAP_ATTR
Attribute name for the ALF map.- See Also:
- Constant Field Values
-
WF_DDC_ATTR
public static final java.lang.String WF_DDC_ATTR
Attribute name for the workflow ddc name.- See Also:
- Constant Field Values
-
DIALOGS_SET_ATTR
public static final java.lang.String DIALOGS_SET_ATTR
Attribute name for the set containing the IDs of open dialogs.- See Also:
- Constant Field Values
-
SSO_DISABLE_LOGOFF_BUTTON
public static final java.lang.String SSO_DISABLE_LOGOFF_BUTTON
Session attribute used to disable the logoff button when SSO is used.- See Also:
- Constant Field Values
-
IS_SSO_LOGIN
public static final java.lang.String IS_SSO_LOGIN
Session attribute set to true if SSO is used for login.- See Also:
- Constant Field Values
-
CLIENT_INFO_UTIL_ATTR
public static final java.lang.String CLIENT_INFO_UTIL_ATTR
Session attribute for the ClientInfoUtil instance.- See Also:
- Constant Field Values
-
IS_SHAREBASE_LOGGED_IN
public static final java.lang.String IS_SHAREBASE_LOGGED_IN
- See Also:
- Constant Field Values
-
IS_ONEDRIVE_LOGGED_IN
public static final java.lang.String IS_ONEDRIVE_LOGGED_IN
- See Also:
- Constant Field Values
-
SHAREBASE_CLIENT
public static final java.lang.String SHAREBASE_CLIENT
- See Also:
- Constant Field Values
-
ONEDRIVE_CLIENT
public static final java.lang.String ONEDRIVE_CLIENT
- See Also:
- Constant Field Values
-
SHAREBASE_CHECKOUT_FOLDER
public static final java.lang.String SHAREBASE_CHECKOUT_FOLDER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HttpSessionWrapper
public HttpSessionWrapper()
Constructs a new SessionWrapper using an internal http session.
-
HttpSessionWrapper
public HttpSessionWrapper(javax.servlet.http.HttpSession httpSession)
Constructs a new SessionWrapper with a given http session.- Parameters:
httpSession- The http session to use.
-
-
Method Detail
-
setAttribute
public void setAttribute(java.lang.String key, java.lang.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(java.lang.String key)
Removes the attribute with the specified key from the current session.- Parameters:
key- of the attribute to remove
-
getAttribute
public java.lang.Object getAttribute(java.lang.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(java.lang.String key, java.lang.Class<T> type)This method returns the session attribute with the specified key.- Type Parameters:
T- type parameter- Parameters:
key- key of the attributetype- 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 asgetAttribute(USER_ATTR).- Returns:
- User attribute
-
getAlfMap
public java.util.Map<java.lang.String,java.util.LinkedList<java.lang.String>> getAlfMap()
Convenience method to retrieve the alf-map attribute. Same asgetAttribute(ALF_MAP_ATTR). The alf-map contains the files the user has opened in the current session.- Returns:
- ALD map.
-
getPopupBeans
public java.util.Map<java.lang.String,OpenDocumentBean> getPopupBeans()
Convenience method to retrieve the map with the viewer-popup-beans. Same asgetAttribute(VIEWER_POPUP_BEANS). The map contains beans that define the document that is shown in a viewer-popup.- Returns:
- OpenPopupBean map
-
getDocumentSessions
public java.util.Set<java.lang.String> getDocumentSessions()
Convenience method to retrieve the set with the document sessions id. Same asgetAttribute(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 javax.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 java.util.Set<java.lang.String> getOpenDialogs()
Returns the set containing the dialogs that are open in the current session.- Returns:
- a set of dialog-IDs
-
-