ERXWOContext Class Reference

Inherits er::extensions::appserver::ajax::ERXAjaxContext, and er::extensions::foundation::ERXMutableUserInfoHolderInterface.

Inherited by ERXWOContext54.

Collaboration diagram for ERXWOContext:

Collaboration graph
[legend]

List of all members.

Classes

class  Observer

Public Member Functions

void _generateCompleteURLs ()
void _generateRelativeURLs ()
boolean _generatingCompleteResourceURLs ()
boolean _generatingCompleteURLs ()
void _setCurrentComponent (WOComponent wocomponent)
void _setGenerateCompleteResourceURLs (boolean generateCompleteResourceURLs)
String _urlWithRequestHandlerKey (String requestHandlerKey, String requestHandlerPath, String queryString, boolean secure)
Object clone ()
String directActionURLForActionNamed (String actionName, NSDictionary queryDict, boolean includeSessionID)
 ERXWOContext (WORequest worequest)
WOSession existingSession ()
boolean hasSession ()
NSMutableDictionary mutableUserInfo ()
String safeElementID ()
void setMutableUserInfo (NSMutableDictionary userInfo)
NSDictionary userInfo ()

Static Public Member Functions

static NSArray< WOComponent > _componentPath (WOContext context)
static String _directActionURL (WOContext context, String actionName, NSDictionary queryParams, boolean secure)
static String _htmlCloseHeadTag ()
static void addResourceInHead (WOContext context, WOResponse response, String framework, String fileName, String startTag, String endTag, TagMissingBehavior tagMissingBehavior)
static void addResourceInHead (WOContext context, WOResponse response, String framework, String fileName, String startTag, String endTag)
static void addScriptCodeInHead (WOContext context, WOResponse response, String script, String scriptName)
static void addScriptCodeInHead (WOContext context, WOResponse response, String script)
static void addScriptResourceInHead (WOContext context, WOResponse response, String framework, String fileName)
static void addStylesheetResourceInHead (WOContext context, WOResponse response, String framework, String fileName)
static String ajaxActionUrl (WOContext context)
static NSArray< StringcomponentPath (WOContext context)
static NSMutableDictionary contextDictionary ()
static WOContext currentContext ()
static String directActionUrl (WOContext context, String host, Integer port, String path, String directActionName, NSDictionary< String,?extends Object > queryParameters, Boolean secure, boolean includeSessionID)
static String directActionUrl (WOContext context, String host, Integer port, String path, String directActionName, String key, Object value, Boolean secure, boolean includeSessionID)
static String directActionUrl (WOContext context, String directActionName, NSDictionary< String,?extends Object > queryParameters, Boolean secure, boolean includeSessionID)
static String directActionUrl (WOContext context, String directActionName, String key, String value, Boolean secure, boolean includeSessionID)
static String directActionUrl (WOContext context, String directActionName, Boolean secure, boolean includeSessionID)
static void insertInResponseBeforeTag (WOContext context, WOResponse response, String content, String tag, TagMissingBehavior tagMissingBehavior)
static WOContext newContext ()
static String safeIdentifierName (WOContext context, boolean willCache)
static void setCurrentContext (Object object)
static String stripSessionIDFromURL (String url)
static String toSafeElementID (String elementID)

Static Public Attributes

static final String CONTEXT_DICTIONARY_KEY = "ERXWOContext.dict"
static final String CONTEXT_KEY = "wocontext"

Protected Member Functions

String _postprocessURL (String url)
void _preprocessURL ()

Static Protected Member Functions

static NSMutableDictionary _contextDictionary ()

Private Attributes

boolean _generateCompleteResourceURLs
boolean _generateCompleteURLs

Static Private Attributes

static Observer observer
static final String SAFE_IDENTIFIER_NAME_KEY = "ERXWOContext.safeIdentifierName"


Detailed Description

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

Constructor & Destructor Documentation

ERXWOContext ( WORequest  worequest  ) 


Member Function Documentation

static NSArray<WOComponent> _componentPath ( WOContext  context  )  [static]

Debugging help, returns the path to current component as WOComponent objects.

Parameters:
context the current context
Returns:
an array of components

static NSMutableDictionary _contextDictionary (  )  [static, protected]

static String _directActionURL ( WOContext  context,
String  actionName,
NSDictionary  queryParams,
boolean  secure 
) [static]

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

void _generateCompleteURLs (  ) 

void _generateRelativeURLs (  ) 

boolean _generatingCompleteResourceURLs (  ) 

Returns whether or not resources generate complete URLs.

Returns:
whether or not resources generate complete URLs

boolean _generatingCompleteURLs (  ) 

static String _htmlCloseHeadTag (  )  [static]

String _postprocessURL ( String  url  )  [protected]

void _preprocessURL (  )  [protected]

If er.extensions.ERXWOContext.forceRemoveApplicationNumber is true, then always remove the application number from the generated URLs. You have to be aware of how your app is written to know if this is something you can do without causing problems. For instance, you MUST be using cookies, and you must not use WOImages with data bindings -- anything that requires a per-instance cache has the potential to fail when this is enabled (if you have more than one instance of your app deployed).

void _setCurrentComponent ( WOComponent  wocomponent  ) 

Implemented so the the thread checks if it should get interrupted.

Parameters:
wocomponent 

void _setGenerateCompleteResourceURLs ( boolean  generateCompleteResourceURLs  ) 

Turn on complete resource URL generation.

Parameters:
generateCompleteResourceURLs if true, resources will generate complete URLs.

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,
TagMissingBehavior  tagMissingBehavior 
) [static]

static void addResourceInHead ( WOContext  context,
WOResponse  response,
String  framework,
String  fileName,
String  startTag,
String  endTag 
) [static]

static void addScriptCodeInHead ( WOContext  context,
WOResponse  response,
String  script,
String  scriptName 
) [static]

static void addScriptCodeInHead ( WOContext  context,
WOResponse  response,
String  script 
) [static]

static void addScriptResourceInHead ( WOContext  context,
WOResponse  response,
String  framework,
String  fileName 
) [static]

static void addStylesheetResourceInHead ( WOContext  context,
WOResponse  response,
String  framework,
String  fileName 
) [static]

static String ajaxActionUrl ( WOContext  context  )  [static]

Workaround for missing componentActionUrl(String) in 5.3.

Parameters:
context 
Returns:
ajax action url

Object clone (  ) 

static NSArray<String> componentPath ( WOContext  context  )  [static]

Debugging help, returns the path to current component as a list of component names.

Parameters:
context the current context
Returns:
an array of component names

static NSMutableDictionary contextDictionary (  )  [static]

Public constructor

static WOContext currentContext (  )  [static]

static String directActionUrl ( WOContext  context,
String  host,
Integer  port,
String  path,
String  directActionName,
NSDictionary< String,?extends Object >  queryParameters,
Boolean  secure,
boolean  includeSessionID 
) [static]

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

static String directActionUrl ( WOContext  context,
String  host,
Integer  port,
String  path,
String  directActionName,
String  key,
Object  value,
Boolean  secure,
boolean  includeSessionID 
) [static]

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

static String directActionUrl ( WOContext  context,
String  directActionName,
NSDictionary< String,?extends Object >  queryParameters,
Boolean  secure,
boolean  includeSessionID 
) [static]

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

static String directActionUrl ( WOContext  context,
String  directActionName,
String  key,
String  value,
Boolean  secure,
boolean  includeSessionID 
) [static]

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

static String directActionUrl ( WOContext  context,
String  directActionName,
Boolean  secure,
boolean  includeSessionID 
) [static]

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

String directActionURLForActionNamed ( String  actionName,
NSDictionary  queryDict,
boolean  includeSessionID 
)

Returns a complete URL for the specified action. Works like WOContext#directActionURLForActionNamed 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

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,
TagMissingBehavior  tagMissingBehavior 
) [static]

NSMutableDictionary mutableUserInfo (  ) 

Returns the mutableUserInfo.

Implements ERXMutableUserInfoHolderInterface.

static WOContext newContext (  )  [static]

Creates a WOContext using a dummy WORequest.

Returns:
the new WOContext

String safeElementID (  ) 

static String safeIdentifierName ( WOContext  context,
boolean  willCache 
) [static]

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

static void setCurrentContext ( Object  object  )  [static]

void setMutableUserInfo ( NSMutableDictionary  userInfo  ) 

Set the mutableUserInfo

Implements ERXMutableUserInfoHolderInterface.

static String stripSessionIDFromURL ( String  url  )  [static]

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

static String toSafeElementID ( String  elementID  )  [static]

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

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

NSDictionary userInfo (  ) 


Member Data Documentation

boolean _generateCompleteResourceURLs [private]

boolean _generateCompleteURLs [private]

final String CONTEXT_DICTIONARY_KEY = "ERXWOContext.dict" [static]

final String CONTEXT_KEY = "wocontext" [static]

Observer observer [static, private]

final String SAFE_IDENTIFIER_NAME_KEY = "ERXWOContext.safeIdentifierName" [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:02 2012 for Project Wonder by  doxygen 1.5.8