public class ERXSession extends ERXAjaxSession implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ERXSession.Observer
The Observer inner class encapsulates functions
to handle various notifications.
|
com.webobjects.appserver.WOSession.PageFragmentCache
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.MapImplementation, com.webobjects.foundation.NSKeyValueCoding.Null<T>, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
Modifier and Type | Field and Description |
---|---|
protected NSMutableDictionary |
_debuggingStore
holds a debugging store for a given session.
|
protected Boolean |
_didBacktrack
flag to indicate if the user is currently backtracking,
meaning they hit the back button and then clicked on a
link.
|
protected Boolean |
_javaScriptEnabled
flag for if java script is enabled
|
String |
_originalThreadName
_originalThreadName holds the original name from the WorkerThread which
is the value before executing
awake() |
static String |
JAVASCRIPT_ENABLED_COOKIE_NAME
cookie name that if set it means that the user has cookies enabled
|
boolean |
lastActionWasDA
flag to indicate if the last action was a direct action
|
static String |
SessionWillSleepNotification
Notification name that is posted when a session is about to sleep.
|
_permanentContextIDArray, _permanentPageCache, DONT_STORE_PAGE, FORCE_STORE_PAGE, PAGE_REPLACEMENT_CACHE_LOOKUP_KEY
_componentState, _httpSession, _httpSessionWatcher, SessionDidCreateNotification, SessionDidRestoreNotification, SessionDidTimeOutNotification
Constructor and Description |
---|
ERXSession() |
ERXSession(String sessionID) |
Modifier and Type | Method and Description |
---|---|
void |
_appendCookieToResponse(com.webobjects.appserver.WOResponse response) |
com.webobjects.foundation.NSTimestamp |
_birthDate() |
void |
_clearCookieFromResponse(com.webobjects.appserver.WOResponse response) |
protected void |
_convertSessionCookiesToHttpOnly(com.webobjects.appserver.WOResponse response) |
protected void |
_convertSessionCookiesToSecure(com.webobjects.appserver.WOResponse response) |
protected void |
_setCookieSameSite(com.webobjects.appserver.WOResponse response) |
static com.webobjects.appserver.WOSession |
anySession() |
void |
appendToResponse(com.webobjects.appserver.WOResponse aResponse,
com.webobjects.appserver.WOContext aContext)
Provides automatic encoding support for component action
with
messageEncoding object. |
ERXApplication |
application()
Bringing application into KVC.
|
static boolean |
autoAdjustTimeZone()
If the property er.extensions.ERXSession.autoAdjustTimeZone=true then
WOStrings and WOTextFields with dateFormat bindings will be have their
formatter automatically adjusted for the selected session time zone.
|
NSArray |
availableLanguagesForTheApplication()
Returns the NSArray of language names available for
this application.
|
NSArray |
availableLanguagesForThisSession()
Returns the NSArray of language names available for
this particular session.
|
void |
awake()
Overridden to provide a few checks to
see if javascript is enabled.
|
ERXBrowser |
browser()
Returns the browser object representing the web
browser's "user-agent" string.
|
String |
currentD2WLook()
Get the current Look for this Session.
|
static String |
currentSessionID() |
NSMutableDictionary |
debuggingStore()
Simple mutable dictionary that can be used at
runtime to stash objects that can be useful for
debugging.
|
com.webobjects.eocontrol.EOEditingContext |
defaultEditingContext()
Ensures that the returned editingContext was created with
the
ERXEC factory. |
boolean |
didBacktrack()
Method inspects the passed in request to see if
the user backtracked.
|
boolean |
javaScriptEnabled()
Returns if this user has javascript enabled.
|
String |
language()
Returns the primary language of the current
session's localizer.
|
ERXLocalizer |
localizer()
Method to get the current localizer for this
session.
|
ERXMessageEncoding |
messageEncoding()
Returns the message encoding of the current session.
|
com.webobjects.eocontrol.EOEditingContext |
newDefaultEditingContext() |
com.webobjects.foundation.NSKeyValueCodingAdditions |
objectStore()
This is a cover method which enables use of the session's object store
which is usually access with setObjectForKey and objectForKey.
|
ERXSession.Observer |
observer()
returns the observer object for this session.
|
String |
requestsContextID(com.webobjects.appserver.WORequest aRequest)
Utility method that gets the context ID string
from the passed in request.
|
static ERXSession |
session() |
void |
setCurrentD2WLook(String currentD2WLook)
set the current Look for this Session
|
void |
setDefaultEditingContext(com.webobjects.eocontrol.EOEditingContext ec) |
void |
setJavaScriptEnabled(boolean newValue)
Sets if javascript is enabled for this session.
|
void |
setLanguage(String language)
Cover method to set the current localizer
to the localizer for that language.
|
void |
setLanguages(NSArray languageList)
Sets the languages list for which the session is localized.
|
static void |
setSession(ERXSession session) |
void |
setTimeZone(TimeZone timeZone) |
void |
sleep()
Overridden to post the notification that
the session will sleep.
|
void |
takeValuesFromRequest(com.webobjects.appserver.WORequest aRequest,
com.webobjects.appserver.WOContext aContext)
Provides automatic encoding support for component action
with
messageEncoding object. |
void |
terminate()
Overrides terminate to free up resources and unregister for notifications.
|
String |
threadName()
Override this method in order to provide a different name for the WorkerThread for this
request-response loop very useful for logging stuff: assign a log statement to a log entry.
|
TimeZone |
timeZone() |
String |
toString() |
static boolean |
useHttpOnlySessionCookies()
Override and return true, or set er.extensions.ERXSession.useHttpOnlySessionCookies if you want http-only session
and instance cookies.
|
boolean |
useSecureSessionCookies()
Override and return true, or set er.extensions.ERXSession.useSecureSessionCookies if you want
secure-only session and instance cookies.
|
_permanentPageCache, _permanentPageWithContextID, _saveCurrentPage, _shouldPutInPermanentCache, cleanPageReplacementCacheIfNecessary, cleanPageReplacementCacheIfNecessary, pageInfoDictionary, restorePageForContextID, savePage, savePageInPermanentCache, storesPageInfo
_allowToViewEvents, _allowToViewStatistics, _awakeInContext, _contextCounter, _contextDidIncrementContextID, _contextIDMatchingIDs, _formattedStatistics, _lifeInMillis, _requestCounter, _setContext, _setHttpSession, _setHttpSessionWatcher, _setSessionID, _sleepInContext, _terminateByJ2EE, _terminateByTimeout, allowedToViewEvents, allowedToViewStatistics, canAccessFieldsDirectly, clone, context, debugString, domainForIDCookies, expirationDateForIDCookies, getPageFromPageCacheForContextID, getPageFromPageFragmentCacheForContextID, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, invokeAction, isDistributionEnabled, isTerminating, keyEnumerator, keySet, languages, lockDefaultEditingContext, logString, objectForKey, removeObjectForKey, savePageInPageCache, savePageInPageFragmentCache, sessionID, setDistributionEnabled, setObjectForKey, setStoresIDsInCookies, setStoresIDsInURLs, setTimeOut, statistics, storesIDsInCookies, storesIDsInURLs, takeValueForKey, takeValueForKeyPath, timeOut, timeOutForIDCookies, timeOutMillis, unableToSetNullForKey, validateEventsLogin, validateStatisticsLogin, validationFailedWithException, valueForKey, valueForKeyPath
public static final String SessionWillSleepNotification
public static final String JAVASCRIPT_ENABLED_COOKIE_NAME
protected Boolean _javaScriptEnabled
protected NSMutableDictionary _debuggingStore
public String _originalThreadName
awake()
protected Boolean _didBacktrack
public boolean lastActionWasDA
public ERXSession()
public ERXSession(String sessionID)
public ERXSession.Observer observer()
public ERXLocalizer localizer()
languages
array. See ERXLocalizer
for more information about using a localizer.public String language()
localizer().language()
.public void setLanguage(String language)
Also updates languages list with the new single language.
language
- to set the current localizer for.language()
,
setLanguages(com.webobjects.foundation.NSArray)
public void setLanguages(NSArray languageList)
Also updates localizer and messageEncodings.
setLanguages
in class com.webobjects.appserver.WOSession
languageList
- the array of languages for the sessionlanguage()
,
setLanguage(java.lang.String)
public NSArray availableLanguagesForTheApplication()
ERXLocalizer.availableLanguages
,
but will be convenient for binding to dynamic elements
like language selector popup.availableLanguagesForThisSession()
,
ERXLocalizer.availableLanguages
public NSArray availableLanguagesForThisSession()
ERXRequest.browserLanguages()
)
and localizer's available language array
(ERXLocalizer.availableLanguages()
).
Note that the order of the resulting language names is not defined at this moment.
availableLanguagesForTheApplication()
,
ERXRequest.browserLanguages()
,
ERXLocalizer.availableLanguages
public ERXMessageEncoding messageEncoding()
language()
available for the session, it creates one with
the default encoding.public ERXBrowser browser()
public NSMutableDictionary debuggingStore()
public com.webobjects.eocontrol.EOEditingContext defaultEditingContext()
ERXEC
factory.defaultEditingContext
in class com.webobjects.appserver.WOSession
public void setDefaultEditingContext(com.webobjects.eocontrol.EOEditingContext ec)
setDefaultEditingContext
in class com.webobjects.appserver.WOSession
public boolean javaScriptEnabled()
public void setJavaScriptEnabled(boolean newValue)
newValue
- says if javascript is enabledpublic void awake()
awake
in class com.webobjects.appserver.WOSession
public void sleep()
sleep
in class com.webobjects.appserver.WOSession
public String threadName()
return session().sessionID() + valueForKeyPath("user.username");
public String requestsContextID(com.webobjects.appserver.WORequest aRequest)
aRequest
- request to get the context id frompublic boolean didBacktrack()
public void takeValuesFromRequest(com.webobjects.appserver.WORequest aRequest, com.webobjects.appserver.WOContext aContext)
messageEncoding
object.takeValuesFromRequest
in class com.webobjects.appserver.WOSession
aRequest
- current requestaContext
- current contextpublic void appendToResponse(com.webobjects.appserver.WOResponse aResponse, com.webobjects.appserver.WOContext aContext)
messageEncoding
object.appendToResponse
in class com.webobjects.appserver.WOSession
aResponse
- current response objectaContext
- current context objectpublic ERXApplication application()
public void terminate()
terminate
in class com.webobjects.appserver.WOSession
public com.webobjects.foundation.NSKeyValueCodingAdditions objectStore()
myString: WOString {
value = session.objectStore.myLastSearchResult.count;
}
public com.webobjects.foundation.NSTimestamp _birthDate()
_birthDate
in class com.webobjects.appserver.WOSession
public String toString()
toString
in class com.webobjects.appserver.WOSession
public com.webobjects.eocontrol.EOEditingContext newDefaultEditingContext()
newDefaultEditingContext
in class com.webobjects.appserver.WOSession
public static com.webobjects.appserver.WOSession anySession()
public static ERXSession session()
public static String currentSessionID()
public static void setSession(ERXSession session)
public boolean useSecureSessionCookies()
public static boolean useHttpOnlySessionCookies()
protected void _setCookieSameSite(com.webobjects.appserver.WOResponse response)
protected void _convertSessionCookiesToSecure(com.webobjects.appserver.WOResponse response)
protected void _convertSessionCookiesToHttpOnly(com.webobjects.appserver.WOResponse response)
public void _appendCookieToResponse(com.webobjects.appserver.WOResponse response)
_appendCookieToResponse
in class com.webobjects.appserver.WOSession
public void _clearCookieFromResponse(com.webobjects.appserver.WOResponse response)
_clearCookieFromResponse
in class com.webobjects.appserver.WOSession
public TimeZone timeZone()
public void setTimeZone(TimeZone timeZone)
public static boolean autoAdjustTimeZone()
public void setCurrentD2WLook(String currentD2WLook)
90 : *true* => look = "session.currentD2WLook" [er.directtoweb.assignments.delayed.ERDDelayedKeyValueAssignment]
currentD2WLook
- - Look Namepublic String currentD2WLook()
Copyright © 2002 – 2020 Project Wonder.