|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.appserver.WOSession er.extensions.ERXSession
The ERXSession aguments the regular WOSession object by adding a few nice additions. Of interest, notifications are now posted when a session when a session goes to sleep, David Neumann's browser backtracking detection has been added from his security framework, a somewhat comprehensive user-agent parsing is provided to know what type of browser is being used, flags have also been added to tell if javascript has been enabled, and enhanced localization support has been added.
Nested Class Summary | |
static class |
ERXSession.Observer
The Observer inner class encapsulates functions to handle various notifications. |
Nested classes inherited from class com.webobjects.foundation.NSKeyValueCodingAdditions |
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility |
Field Summary | |
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 whic 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 ERXLogger |
log
logging support |
static String |
SessionWillAwakeNotification
Notification name that is posted after a session wakes up. |
static String |
SessionWillSleepNotification
Notification name that is posted when a session is about to sleep. |
Fields inherited from class com.webobjects.appserver.WOSession |
_componentState, _httpSession, _httpSessionWatcher, SessionDidCreateNotification, SessionDidRestoreNotification, SessionDidTimeOutNotification |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
_CLASS, NullValue |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
_CLASS |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator |
Constructor Summary | |
ERXSession()
|
Method Summary | |
void |
appendToResponse(WOResponse aResponse,
WOContext aContext)
Provides automatic encoding support for component action with messageEncoding object. |
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. |
NSMutableDictionary |
debuggingStore()
Simple mutable dictionary that can be used at runtime to stash objects that can be useful for debugging. |
EOEditingContext |
defaultEditingContext()
|
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. |
ERXSession.Observer |
observer()
returns the observer object for this session. |
String |
requestsContextID(WORequest aRequest)
Utility method that gets the context ID string from the passed in request. |
void |
setDefaultEditingContext(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. |
void |
sleep()
Overridden to post the notification that the session will sleep. |
void |
takeValuesFromRequest(WORequest aRequest,
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 rr loop very useful for logging stuff: assign a log statement to a log entry. |
String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static ERXLogger log
public static final String SessionWillAwakeNotification
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
Constructor Detail |
public ERXSession()
Method Detail |
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.
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 morment.
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 EOEditingContext defaultEditingContext()
public void setDefaultEditingContext(EOEditingContext ec)
public boolean javaScriptEnabled()
public void setJavaScriptEnabled(boolean newValue)
newValue
- says if javascript is enabledpublic void awake()
public void sleep()
public String threadName()
return session().sessionID() + valueForKeyPath("user.username");
- Returns:
public String requestsContextID(WORequest aRequest)
aRequest
- request to get the context id from
public boolean didBacktrack()
public void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
messageEncoding
object.
aRequest
- current requestaContext
- current context
invokeAction
public void appendToResponse(WOResponse aResponse, WOContext aContext)
messageEncoding
object.
aResponse
- current response objectaContext
- current context objectpublic void terminate()
public String toString()
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |