Project Wonder 5.0

er.extensions.appserver.ajax
Class ERXAjaxApplication

java.lang.Object
  extended by com.webobjects.appserver.WOApplication
      extended by er.extensions.appserver.ajax.ERXAjaxApplication
All Implemented Interfaces:
com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions
Direct Known Subclasses:
ERXApplication

public abstract class ERXAjaxApplication
extends com.webobjects.appserver.WOApplication

ERXAjaxApplication is the part of ERXApplication that handles Ajax requests. If you want to use the Ajax framework without using other parts of Project Wonder (i.e. ERXSession or ERXApplication), you should steal all of the code in ERXAjaxSession, ERXAjaxApplication, and ERXAjaxContext.

Author:
mschrag

Nested Class Summary
static interface ERXAjaxApplication.ERXAjaxResponseDelegate
          ERXAjaxResponseDelegate receives callbacks from within the R-R loop when certain situations occur.
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOApplication
com.webobjects.appserver.WOApplication._EventLoggingEnabler, com.webobjects.appserver.WOApplication.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
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.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Field Summary
static java.lang.String KEY_AJAX_SUBMIT_BUTTON
           
static java.lang.String KEY_PARTIAL_FORM_SENDER_ID
           
static java.lang.String KEY_REPLACED
           
static java.lang.String KEY_UPDATE_CONTAINER_ID
           
 
Fields inherited from class com.webobjects.appserver.WOApplication
_adminRequestHandlerKey, _TheLastApplicationAccessTime, _unsetHost, _wasMainInvoked, ApplicationDidDispatchRequestNotification, ApplicationDidFinishLaunchingNotification, ApplicationWillDispatchRequestNotification, ApplicationWillFinishLaunchingNotification
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
ERXAjaxApplication()
           
 
Method Summary
static java.lang.String ajaxSubmitButtonName(com.webobjects.appserver.WORequest request)
          Returns the form name of the submitting ajax button.
static void cleanUpHeaders(com.webobjects.appserver.WOResponse response)
          Removes Ajax response headers that are no longer necessary.
static boolean forceStorePage(com.webobjects.appserver.WOMessage message)
          Checks if the page should not be stored in the cache
 com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
          Overridden to allow for redirected responses.
static boolean isAjaxReplacement(com.webobjects.appserver.WORequest request)
          Returns true if this is an ajax replacement (_r key is set).
static boolean isAjaxRequest(com.webobjects.appserver.WORequest request)
          Return whether or not the given request is an Ajax request.
static boolean isAjaxSubmit(com.webobjects.appserver.WORequest request)
          Returns true if this is an ajax submit.
static boolean isAjaxUpdate(com.webobjects.appserver.WORequest request)
          Returns true if this request will update an AjaxUpdateContainer.
static java.lang.String partialFormSenderID(com.webobjects.appserver.WORequest request)
          Returns the form name of the partial form submission.
static void setForceStorePage(com.webobjects.appserver.WOMessage message)
           
 void setResponseDelegate(ERXAjaxApplication.ERXAjaxResponseDelegate responseDelegate)
          Sets the response delegate for this application.
static boolean shouldIgnoreResults(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context, com.webobjects.appserver.WOActionResults results)
           
static boolean shouldNotStorePage(com.webobjects.appserver.WOContext context)
          Checks if the page should not be stored in the cache
static boolean shouldNotStorePage(com.webobjects.appserver.WOMessage message)
          Checks if the page should not be stored in the cache
 void takeValuesFromRequest(com.webobjects.appserver.WORequest request, com.webobjects.appserver.WOContext context)
          Ajax links have a ?_u=xxx&2309482093 in the url which makes it look like a form submission to WebObjects.
 
Methods inherited from class com.webobjects.appserver.WOApplication
_addToExpectedLanguages, _allowsCacheControlHeader, _checksForSpecialHeaders, _componentDefinition, _componentDefinitionFromClassNamed, _debugString, _discountTerminatedSession, _expectedLanguages, _finishInitializingSession, _initializeSessionInContext, _isDebuggingEnabled, _isDomesticSupportedDevelopmentPlatform, _isForeignSupportedDevelopmentPlatform, _isPageRecreationEnabled, _isSupportedDevelopmentPlatform, _lockDefaultEditingContext, _newLocationForRequest, _openInitialURL, _quitTimer, _rapidTurnaroundActiveForAnyProject, _removeComponentDefinitionCacheContents, _runLoop, _sessionClass, _setAllowsCacheControlHeader, _setChecksForSpecialHeaders, _setHost, _setHostAddress, _setLifebeatDestinationPort, _setLockDefaultEditingContext, _terminateFromMonitor, _terminateOrResetTimer, activeSessionsCount, adaptor, adaptors, adaptorsDispatchRequestsConcurrently, adaptorWithName, additionalAdaptors, allowsConcurrentRequestHandling, appendToResponse, application, applicationBaseURL, autoOpenClientApplication, autoOpenInBrowser, awake, baseURL, canAccessFieldsDirectly, cgiAdaptorURL, componentRequestHandlerKey, contextClassName, createContextForRequest, createRequest, createResourceManager, createResponseInContext, createSessionForRequest, debugString, defaultRequestHandler, defaultRequestHandlerClassName, defaultUndoStackLimit, directActionRequestHandlerKey, directConnectURL, dispatchRequest, dynamicElementWithName, frameworksBaseURL, handleActionRequestError, handleException, handleMalformedCookieString, handlePageRestorationErrorInContext, handleQueryWithUnboundKey, handlerForRequest, handleSessionCreationErrorInContext, handleSessionRestorationErrorInContext, handleTakeValueForUnboundKey, host, hostAddress, includeCommentsInResponses, isCachingEnabled, isConcurrentRequestHandlingEnabled, isDebuggingEnabled, isDirectConnectEnabled, isMonitorEnabled, isPageRefreshOnBacktrackEnabled, isRefusingNewSessions, isTerminating, licensedRequestLimit, licensedRequestWindow, licensingAllowsMultipleInstances, licensingAllowsMultipleThreads, lifebeatDestinationPort, lifebeatEnabled, lifebeatInterval, listenQueueSize, loadFrameworks, lock, logSetValueForDeclarationNamed, logString, logTakeValueForDeclarationNamed, main, main, maxSocketIdleTime, minimumActiveSessionsCount, monitorEnabled, monitorHost, monitoringEnabled, name, number, outputPath, pageCacheSize, pageWithName, path, permanentPageCacheSize, port, primeApplication, primeApplication, printsHTMLParserDiagnostics, projectSearchPath, recordingPath, refuseNewSessions, registeredRequestHandlerKeys, registerRequestHandler, removeRequestHandlerForKey, requestHandlerForKey, requestHandlingLock, resourceManager, resourceRequestHandlerKey, responseForComponentWithName, responseForDirectActionWithNameAndClass, restoreSessionWithID, run, saveSessionForContext, servletConnectURL, sessionStore, sessionStoreClassName, sessionTimeOut, setAdaptor, setAdditionalAdaptors, setAllowsConcurrentRequestHandling, setApplicationBaseURL, setAutoOpenClientApplication, setAutoOpenInBrowser, setCachingEnabled, setCGIAdaptorURL, setComponentRequestHandlerKey, setContextClassName, setDefaultRequestHandler, setDefaultUndoStackLimit, setDirectActionRequestHandlerKey, setDirectConnectEnabled, setFrameworksBaseURL, setIncludeCommentsInResponses, setListenQueueSize, setLoadFrameworks, setMaxSocketIdleTime, setMinimumActiveSessionsCount, setMonitorEnabled, setMonitorHost, setPageCacheSize, setPageRefreshOnBacktrackEnabled, setPermanentPageCacheSize, setPort, setPrintsHTMLParserDiagnostics, setProjectSearchPath, setRecordingPath, setResourceManager, setResourceRequestHandlerKey, setSessionStore, setSessionStoreClassName, setSessionTimeOut, setSMTPHost, setSocketCacheSize, setSocketMonitorSleepTime, setStatisticsStore, setTimeOut, setWebServiceRequestHandlerKey, setWorkerThreadCount, setWorkerThreadCountMax, setWorkerThreadCountMin, sharedEditingContext, shouldRestoreSessionOnCleanEntry, sleep, SMTPHost, socketCacheSize, socketMonitorSleepTime, statistics, statisticsStore, streamActionRequestHandlerKey, takeValueForKey, takeValueForKeyPath, terminate, terminateAfterTimeInterval, timeOut, toString, unableToSetNullForKey, unlock, validationFailedWithException, valueForKey, valueForKeyPath, wasMainInvoked, webserverConnectURL, webServiceRequestHandlerKey, workerThreadCount, workerThreadCountMax, workerThreadCountMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_AJAX_SUBMIT_BUTTON

public static final java.lang.String KEY_AJAX_SUBMIT_BUTTON
See Also:
Constant Field Values

KEY_PARTIAL_FORM_SENDER_ID

public static final java.lang.String KEY_PARTIAL_FORM_SENDER_ID
See Also:
Constant Field Values

KEY_UPDATE_CONTAINER_ID

public static final java.lang.String KEY_UPDATE_CONTAINER_ID
See Also:
Constant Field Values

KEY_REPLACED

public static final java.lang.String KEY_REPLACED
See Also:
Constant Field Values
Constructor Detail

ERXAjaxApplication

public ERXAjaxApplication()
Method Detail

setResponseDelegate

public void setResponseDelegate(ERXAjaxApplication.ERXAjaxResponseDelegate responseDelegate)
Sets the response delegate for this application.

Parameters:
responseDelegate - the response delegate

shouldIgnoreResults

public static boolean shouldIgnoreResults(com.webobjects.appserver.WORequest request,
                                          com.webobjects.appserver.WOContext context,
                                          com.webobjects.appserver.WOActionResults results)

takeValuesFromRequest

public void takeValuesFromRequest(com.webobjects.appserver.WORequest request,
                                  com.webobjects.appserver.WOContext context)
Ajax links have a ?_u=xxx&2309482093 in the url which makes it look like a form submission to WebObjects. Therefore takeValues is called on every update even though many many updates aren't submits. This method checks to see if all you have is a _u or _r and an ismap (the #) param for form values. If so, it's not a form submission and takeValues can be skipped.

Overrides:
takeValuesFromRequest in class com.webobjects.appserver.WOApplication
Parameters:
request -
context -
See Also:
WOApplication.takeValuesFromRequest(com.webobjects.appserver.WORequest, com.webobjects.appserver.WOContext)

invokeAction

public com.webobjects.appserver.WOActionResults invokeAction(com.webobjects.appserver.WORequest request,
                                                             com.webobjects.appserver.WOContext context)
Overridden to allow for redirected responses.

Overrides:
invokeAction in class com.webobjects.appserver.WOApplication
Parameters:
request - object
context - object

setForceStorePage

public static void setForceStorePage(com.webobjects.appserver.WOMessage message)

forceStorePage

public static boolean forceStorePage(com.webobjects.appserver.WOMessage message)
Checks if the page should not be stored in the cache


shouldNotStorePage

public static boolean shouldNotStorePage(com.webobjects.appserver.WOMessage message)
Checks if the page should not be stored in the cache


cleanUpHeaders

public static void cleanUpHeaders(com.webobjects.appserver.WOResponse response)
Removes Ajax response headers that are no longer necessary.

Parameters:
response - the response to clean up

shouldNotStorePage

public static boolean shouldNotStorePage(com.webobjects.appserver.WOContext context)
Checks if the page should not be stored in the cache


isAjaxRequest

public static boolean isAjaxRequest(com.webobjects.appserver.WORequest request)
Return whether or not the given request is an Ajax request.

Parameters:
request - the request the check

partialFormSenderID

public static java.lang.String partialFormSenderID(com.webobjects.appserver.WORequest request)
Returns the form name of the partial form submission.

Parameters:
request - the request
Returns:
the form name of the partial form submission

ajaxSubmitButtonName

public static java.lang.String ajaxSubmitButtonName(com.webobjects.appserver.WORequest request)
Returns the form name of the submitting ajax button.

Parameters:
request - the request
Returns:
the form name of the submitting ajax button

isAjaxSubmit

public static boolean isAjaxSubmit(com.webobjects.appserver.WORequest request)
Returns true if this is an ajax submit.


isAjaxReplacement

public static boolean isAjaxReplacement(com.webobjects.appserver.WORequest request)
Returns true if this is an ajax replacement (_r key is set).


isAjaxUpdate

public static boolean isAjaxUpdate(com.webobjects.appserver.WORequest request)
Returns true if this request will update an AjaxUpdateContainer.


Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.