Project Wonder 5.0.0.8654

er.extensions.appserver
Class ERXWOContext

java.lang.Object
  extended by com.webobjects.appserver.WOContext
      extended by er.extensions.appserver.ajax.ERXAjaxContext
          extended by er.extensions.appserver.ERXWOContext
All Implemented Interfaces:
NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, ERXMutableUserInfoHolderInterface, Cloneable

public class ERXWOContext
extends ERXAjaxContext
implements ERXMutableUserInfoHolderInterface

Replacement of WOContext. This subclass is installed when the frameworks loads.


Nested Class Summary
static class ERXWOContext.Observer
           
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Field Summary
static String CONTEXT_KEY
           
 
Fields inherited from class com.webobjects.appserver.WOContext
_pageFragementID, _session, _userInfo, EscapeQueryDictionary, SessionIDBindingKey, WOURLEncoding
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Constructor Summary
ERXWOContext(WORequest worequest)
           
 
Method Summary
protected static NSMutableDictionary _contextDictionary()
           
static String _directActionURL(WOContext context, String actionName, NSDictionary queryParams, boolean secure)
          Call this anywhere you would have called _directActionURL in 5.3 if you want to be 5.4 compatible.
 void _generateCompleteURLs()
           
 void _generateRelativeURLs()
           
 boolean _generatingCompleteURLs()
           
static String _htmlCloseHeadTag()
          Deprecated. replaced by ERXResponseRewriter
 void _setCurrentComponent(WOComponent wocomponent)
          Implemented so the the thread checks if it should get interrupted.
 String _urlWithRequestHandlerKey(String requestHandlerKey, String requestHandlerPath, String queryString, boolean secure)
           
static void addResourceInHead(WOContext context, WOResponse response, String framework, String fileName, String startTag, String endTag)
          Deprecated. replaced by ERXResponseRewriter
static void addResourceInHead(WOContext context, WOResponse response, String framework, String fileName, String startTag, String endTag, ERXResponseRewriter.TagMissingBehavior tagMissingBehavior)
          Deprecated. replaced by ERXResponseRewriter
static void addScriptCodeInHead(WOContext context, WOResponse response, String script)
          Deprecated. replaced by ERXResponseRewriter
static void addScriptCodeInHead(WOContext context, WOResponse response, String script, String scriptName)
          Deprecated. replaced by ERXResponseRewriter
static void addScriptResourceInHead(WOContext context, WOResponse response, String framework, String fileName)
          Deprecated. replaced by ERXResponseRewriter
static void addStylesheetResourceInHead(WOContext context, WOResponse response, String framework, String fileName)
          Deprecated. replaced by ERXResponseRewriter
static NSArray<String> componentPath(WOContext context)
          Debugging help, returns the path to current component.
static NSMutableDictionary contextDictionary()
          Public constructor
static WOContext currentContext()
           
static String directActionUrl(WOContext context, String directActionName, Boolean secure, boolean includeSessionID)
          Generates direct action URLs with support for various overrides.
static String directActionUrl(WOContext context, String host, Integer port, String path, String directActionName, NSDictionary<String,? extends Object> queryParameters, Boolean secure, boolean includeSessionID)
          Generates direct action URLs with support for various overrides.
static String directActionUrl(WOContext context, String host, Integer port, String path, String directActionName, String key, Object value, Boolean secure, boolean includeSessionID)
          Generates direct action URLs with support for various overrides.
static String directActionUrl(WOContext context, String directActionName, NSDictionary<String,? extends Object> queryParameters, Boolean secure, boolean includeSessionID)
          Generates direct action URLs with support for various overrides.
static String directActionUrl(WOContext context, String directActionName, String key, String value, Boolean secure, boolean includeSessionID)
          Generates direct action URLs with support for various overrides.
 String directActionURLForActionNamed(String actionName, NSDictionary queryDict, boolean includeSessionID)
          Returns a complete URL for the specified action.
 WOSession existingSession()
          Returns the existing session if any is given in the form values or url.
 boolean hasSession()
          Returns true if there is an existing session.
static void insertInResponseBeforeTag(WOContext context, WOResponse response, String content, String tag, ERXResponseRewriter.TagMissingBehavior tagMissingBehavior)
          Deprecated. replaced by ERXResponseRewriter
 NSMutableDictionary mutableUserInfo()
          Returns the mutableUserInfo.
static WOContext newContext()
          Creates a WOContext using a dummy WORequest.
 String safeElementID()
           
static String safeIdentifierName(WOContext context, boolean willCache)
          Returns a safe identifier for the current component.
static void setCurrentContext(Object object)
           
 void setMutableUserInfo(NSMutableDictionary userInfo)
          Set the mutableUserInfo
static String stripSessionIDFromURL(String url)
          Removes Session ID (wosid) query key/value pair from the given URL string.
static String toSafeElementID(String elementID)
          Deprecated. for ERXStringUtilities.safeIdentifierName(String)
 NSDictionary userInfo()
           
 
Methods inherited from class er.extensions.appserver.ajax.ERXAjaxContext
_wasFormSubmitted
 
Methods inherited from class com.webobjects.appserver.WOContext
_componentActionURL, _componentName, _directActionURL, _directActionURL, _incrementContextID, _isMultipleSubmitForm, _languages, _originalContextID, _pageChanged, _pageComponent, _pageElement, _putAwakeComponentsToSleep, _refuseThisRequest, _removeSessionIDFromDictionary, _requestContextID, _requestSessionID, _session, _sessionIDInURL, _set_refuseThisRequest, _setActionInvoked, _setComponentName, _setFormSubmitted, _setIsMultipleSubmitForm, _setOriginalContextID, _setPageChanged, _setPageComponent, _setPageElement, _setRequest, _setRequestContextID, _setRequestSessionID, _setResponse, _setSenderID, _setSession, _setTempComponentDefinition, _setUserInfo, _stripSessionIDFromURL, _synchronizeForDistribution, _takeAwakeComponent, _tempComponentDefinition, _url, _urlForResourceNamed, _urlWithRequestHandlerKey, _userInfo, _wasActionInvoked, appendElementIDComponent, appendZeroElementIDComponent, canAccessFieldsDirectly, clone, completeApplicationURLPrefix, completeURLWithRequestHandlerKey, completeURLWithRequestHandlerKey, component, componentActionURL, componentActionURL, componentActionURL, computeQueryDictionary, contextID, contextWithRequest, deleteAllElementIDComponents, deleteLastElementIDComponent, directActionURLForActionNamed, directActionURLForActionNamed, directActionURLForActionNamed, directConnect, doesGenerateCompleteURLs, elementID, generateCompleteURLs, generateRelativeURLs, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, incrementLastElementIDComponent, isInForm, isMultipleSubmitForm, javaScriptElementID, javaScriptElementIDPrefix, javaScriptElementIDSeparator, page, pageFragementID, relativeURLWithRequestHandlerKey, request, response, secureMode, secureRequest, senderID, session, sessionIDInQueryDictionary, setActionInvoked, setFormSubmitted, setInForm, setIsMultipleSubmitForm, setJavaScriptElementIDPrefix, setJavaScriptElementIDSeparator, setPageFragmentID, setSecureMode, setUserInfo, setUserInfoForKey, shouldNotStorePageInBacktrackCache, takeValueForKey, takeValueForKeyPath, toString, unableToSetNullForKey, urlWithRequestHandlerKey, userInfoForKey, valueForKey, valueForKeyPath, wasActionInvoked, wasFormSubmitted
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTEXT_KEY

public static final String CONTEXT_KEY
See Also:
Constant Field Values
Constructor Detail

ERXWOContext

public ERXWOContext(WORequest worequest)
Method Detail

existingSession

public WOSession existingSession()
Returns the existing session if any is given in the form values or url.


hasSession

public boolean hasSession()
Returns true if there is an existing session.

Overrides:
hasSession in class WOContext

contextDictionary

public static NSMutableDictionary contextDictionary()
Public constructor


currentContext

public static WOContext currentContext()

setCurrentContext

public static void setCurrentContext(Object object)

_contextDictionary

protected static NSMutableDictionary _contextDictionary()

_setCurrentComponent

public void _setCurrentComponent(WOComponent wocomponent)
Implemented so the the thread checks if it should get interrupted.

Overrides:
_setCurrentComponent in class WOContext
Parameters:
eoadaptorchannel -
nsmutabledictionary -

_generateCompleteURLs

public void _generateCompleteURLs()
Overrides:
_generateCompleteURLs in class WOContext

_generateRelativeURLs

public void _generateRelativeURLs()
Overrides:
_generateRelativeURLs in class WOContext

_generatingCompleteURLs

public boolean _generatingCompleteURLs()

newContext

public static WOContext newContext()
Creates a WOContext using a dummy WORequest.

Returns:
the new WOContext

mutableUserInfo

public NSMutableDictionary mutableUserInfo()
Description copied from interface: ERXMutableUserInfoHolderInterface
Returns the mutableUserInfo.

Specified by:
mutableUserInfo in interface ERXMutableUserInfoHolderInterface

setMutableUserInfo

public void setMutableUserInfo(NSMutableDictionary userInfo)
Description copied from interface: ERXMutableUserInfoHolderInterface
Set the mutableUserInfo

Specified by:
setMutableUserInfo in interface ERXMutableUserInfoHolderInterface

userInfo

public NSDictionary userInfo()
Overrides:
userInfo in class WOContext

_urlWithRequestHandlerKey

public String _urlWithRequestHandlerKey(String requestHandlerKey,
                                        String requestHandlerPath,
                                        String queryString,
                                        boolean secure)
Overrides:
_urlWithRequestHandlerKey in class WOContext

directActionURLForActionNamed

public String directActionURLForActionNamed(String actionName,
                                            NSDictionary queryDict,
                                            boolean includeSessionID)
Returns a complete URL for the specified action. Works like WOContext.directActionURLForActionNamed(java.lang.String, com.webobjects.foundation.NSDictionary) but has one extra parameter to specify whether or not to include the current Session ID (wosid) in the URL. Convenient if you embed the link for the direct action into an email message and don't want to keep the Session ID in it.

actionName can be either an action -- "ActionName" -- or an action on a class -- "ActionClass/ActionName". You can also specify queryDict to be an NSDictionary which contains form values as key/value pairs. includeSessionID indicates if you want to include the Session ID (wosid) in the URL.

Parameters:
actionName - String action name
queryDict - NSDictionary containing query key/value pairs
includeSessionID - true: to include the Session ID (if has one),
false: not to include the Session ID
Returns:
a String containing the URL for the specified action
See Also:
WODirectAction

stripSessionIDFromURL

public static String stripSessionIDFromURL(String url)
Removes Session ID (wosid) query key/value pair from the given URL string.

Parameters:
url - String URL
Returns:
a String with the Session ID removed

componentPath

public static NSArray<String> componentPath(WOContext context)
Debugging help, returns the path to current component.

Parameters:
context -

_htmlCloseHeadTag

public static String _htmlCloseHeadTag()
Deprecated. replaced by ERXResponseRewriter


insertInResponseBeforeTag

public static void insertInResponseBeforeTag(WOContext context,
                                             WOResponse response,
                                             String content,
                                             String tag,
                                             ERXResponseRewriter.TagMissingBehavior tagMissingBehavior)
Deprecated. replaced by ERXResponseRewriter


addScriptResourceInHead

public static void addScriptResourceInHead(WOContext context,
                                           WOResponse response,
                                           String framework,
                                           String fileName)
Deprecated. replaced by ERXResponseRewriter


addStylesheetResourceInHead

public static void addStylesheetResourceInHead(WOContext context,
                                               WOResponse response,
                                               String framework,
                                               String fileName)
Deprecated. replaced by ERXResponseRewriter


addScriptCodeInHead

public static void addScriptCodeInHead(WOContext context,
                                       WOResponse response,
                                       String script)
Deprecated. replaced by ERXResponseRewriter


addScriptCodeInHead

public static void addScriptCodeInHead(WOContext context,
                                       WOResponse response,
                                       String script,
                                       String scriptName)
Deprecated. replaced by ERXResponseRewriter


addResourceInHead

public static void addResourceInHead(WOContext context,
                                     WOResponse response,
                                     String framework,
                                     String fileName,
                                     String startTag,
                                     String endTag)
Deprecated. replaced by ERXResponseRewriter


addResourceInHead

public static void addResourceInHead(WOContext context,
                                     WOResponse response,
                                     String framework,
                                     String fileName,
                                     String startTag,
                                     String endTag,
                                     ERXResponseRewriter.TagMissingBehavior tagMissingBehavior)
Deprecated. replaced by ERXResponseRewriter


safeIdentifierName

public static String safeIdentifierName(WOContext context,
                                        boolean willCache)
Returns a safe identifier for the current component. If willCache is true, your component should cache the identifier name so that it does not change. In this case, your component will be given an incrementing counter value that is unique on the current page. If willCache is false (because you cannot cache the value), the identifier returned will be based on the context.elementID(). While unique on the page at any point in time, be aware that structural changes to the page can cause the elementID of your component to change.

Parameters:
context - the WOContext
willCache - if true, you should cache the resulting value in your component
Returns:
a safe identifier name

toSafeElementID

public static String toSafeElementID(String elementID)
Deprecated. for ERXStringUtilities.safeIdentifierName(String)

Returns a javascript-safe version of the given element ID.

Parameters:
elementID - the element ID
Returns:
a javascript-safe version (i.e. "_1_2_3_10")
See Also:
ERXStringUtilities#safeIdentifierName(String, String, char)

_directActionURL

public static String _directActionURL(WOContext context,
                                      String actionName,
                                      NSDictionary queryParams,
                                      boolean secure)
Call this anywhere you would have called _directActionURL in 5.3 if you want to be 5.4 compatible.

Parameters:
context - the WOContext to operate on
actionName - the name of the direct action to lookup
queryParams - the query parameters to use
secure - whether or not the URL should be HTTPS
Returns:
the URL to the given direct action

directActionUrl

public static String directActionUrl(WOContext context,
                                     String directActionName,
                                     Boolean secure,
                                     boolean includeSessionID)
Generates direct action URLs with support for various overrides.

Parameters:
context - the context to generate the URL within
directActionName - the direct action name
secure - true = https, false = http, null = same as request
includeSessionID - if false, removes wosid from query parameters
Returns:
the constructed direct action URL

directActionUrl

public static String directActionUrl(WOContext context,
                                     String directActionName,
                                     String key,
                                     String value,
                                     Boolean secure,
                                     boolean includeSessionID)
Generates direct action URLs with support for various overrides.

Parameters:
context - the context to generate the URL within
directActionName - the direct action name
key - the query parameter key to add (or null to skip)
value - the query parameter value to add (or null to skip)
secure - true = https, false = http, null = same as request
includeSessionID - if false, removes wosid from query parameters
Returns:
the constructed direct action URL

directActionUrl

public static String directActionUrl(WOContext context,
                                     String directActionName,
                                     NSDictionary<String,? extends Object> queryParameters,
                                     Boolean secure,
                                     boolean includeSessionID)
Generates direct action URLs with support for various overrides.

Parameters:
context - the context to generate the URL within
directActionName - the direct action name
queryParameters - the query parameters to append (or null)
secure - true = https, false = http, null = same as request
includeSessionID - if false, removes wosid from query parameters
Returns:
the constructed direct action URL

directActionUrl

public static String directActionUrl(WOContext context,
                                     String host,
                                     Integer port,
                                     String path,
                                     String directActionName,
                                     String key,
                                     Object value,
                                     Boolean secure,
                                     boolean includeSessionID)
Generates direct action URLs with support for various overrides.

Parameters:
context - the context to generate the URL within
host - the host name for the URL (or null for default)
port - the port number of the URL (or null for default)
path - the custom path prefix (or null for none)
directActionName - the direct action name
key - the query parameter key to add (or null to skip)
value - the query parameter value to add (or null to skip)
secure - true = https, false = http, null = same as request
includeSessionID - if false, removes wosid from query parameters
Returns:
the constructed direct action URL

directActionUrl

public static String directActionUrl(WOContext context,
                                     String host,
                                     Integer port,
                                     String path,
                                     String directActionName,
                                     NSDictionary<String,? extends Object> queryParameters,
                                     Boolean secure,
                                     boolean includeSessionID)
Generates direct action URLs with support for various overrides.

Parameters:
context - the context to generate the URL within
host - the host name for the URL (or null for default)
port - the port number of the URL (or null for default)
path - the custom path prefix (or null for none)
directActionName - the direct action name
queryParameters - the query parameters to append (or null)
secure - true = https, false = http, null = same as request
includeSessionID - if false, removes wosid from query parameters
Returns:
the constructed direct action URL

safeElementID

public String safeElementID()

Last updated: Thu, Nov 20, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.