ariba.ui.aribaweb.core
Class AWRequestContext
java.lang.Object
ariba.ui.aribaweb.util.AWBaseObject
ariba.ui.aribaweb.core.AWRequestContext
- All Implemented Interfaces:
- AWObject, DebugState
public class AWRequestContext
- extends AWBaseObject
- implements DebugState
The context tracking state through all phases of a single request/response cycle.
The RequestContext encapsulates the incoming AWRequest and the outgoing
AWResponse. As the primary argument in the methods
it tracks the evolving ElementId as the document structure unfolds, providing Ids
through nextElementId(), pushElementIdLevel(), and @popElementIdLevel.
| Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject |
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber |
|
Method Summary |
boolean |
_debugIsInPlaybackMode()
|
boolean |
_debugIsInRecordingMode()
|
void |
_debugPopSemanticKeyPrefix()
|
void |
_debugPushSemanticKeyPrefix()
|
AWEncodedString |
_debugResponseIdAsIs()
|
String |
_debugSemanticKeyPrefix()
|
void |
_debugSetSemanticKeyPrefix(String prefix)
|
boolean |
_debugShouldRecord()
|
void |
_debugSkipRecordPlayback()
|
AWElementIdGenerator |
_getElementIdGenerator()
|
void |
_overrideRequest(AWRequest newRequest)
|
static AWRequestContext |
_requestContext()
Return the request context if there is one is associated with the
current thread and null otherwise |
void |
addCookie(AWCookie cookie)
|
boolean |
allowFailedComponentRendezvous()
|
boolean |
allowIncrementalUpdateApppend()
|
void |
allowIncrementalUpdateApppend(boolean flag)
|
AWApplication |
application()
|
void |
applyValues()
|
void |
assertFileDownloadCompatibleRequestRequired()
|
AWBacktrackState |
backtrackState()
|
String |
browserMaxWidth()
|
String |
browserMinWidth()
|
void |
checkInExistingHttpSession()
|
static void |
cleanupThreadLocalState()
|
void |
clear()
|
boolean |
componentPathDebuggingEnabled()
|
String |
cookieValueForKey(String key)
|
javax.servlet.http.HttpSession |
createHttpSession()
|
AWComponent |
createPageWithName(String name)
|
AWSession |
createSession()
Associates and returns a new AWSession. |
AWEncodedString |
currentElementId()
|
int |
currentElementIdLevel()
|
AWElementIdPath |
currentElementIdPath()
|
int |
currentElementIdPathLength()
|
String |
currentElementIdTrace()
|
AWHtmlForm |
currentForm()
|
int |
currentPhase()
|
boolean |
dataValuePushedInInvokeAction()
|
Object |
debugState()
Returns an object that will be toStringed when the debug
information needs to be printed. |
AWDebugTrace |
debugTrace()
|
void |
dequeueSenderId()
|
Map |
dict()
Deprecated. use put(key,value) and get(key) API's directly |
boolean |
didAddCookies()
|
void |
disableComponentPathDebugging()
|
void |
disableElementIdGeneration()
Disable element id generation is used for non-interactive page rendering |
void |
enableComponentPathDebugging()
This may change during a request as not all components want this enabled. |
void |
enqueueSenderId(String newId)
|
javax.servlet.http.HttpSession |
existingHttpSession()
|
AWSession |
existingSession()
Returns the session currently associated with this request context. |
void |
forceFullPageRefresh()
|
void |
forceRerender()
|
boolean |
forceRerenderRequired()
|
int |
formIndex()
|
String |
formValueForKey(String key)
|
Map |
formValues()
|
AWEncodedString |
frameName()
|
boolean |
fullPageRefreshRequired()
|
AWResponse |
generateResponse()
|
AWResponse |
generateResponse(AWResponse response)
|
Object |
get(String keyString)
|
AWComponent |
getCurrentComponent()
|
AWBaseElement |
getCurrentElement()
|
String |
getDirectActionClassName()
|
String |
getDirectActionName()
|
List |
getGlobalFormInputIdPaths()
|
AWResponse |
handleRequest(AWRequest request,
AWRequestHandler requestHandler)
|
boolean |
hasMoreSenderIds()
|
int |
historyAction()
|
javax.servlet.http.HttpSession |
httpSession()
|
javax.servlet.http.HttpSession |
httpSession(boolean required)
|
void |
incrementElementId()
|
void |
incrementElementId(int amount)
|
void |
incrementFormIndex()
|
void |
init(AWApplication application,
AWRequest request)
|
AWResponseGenerating |
invokeActionForRequest()
|
boolean |
isAccessibilityEnabled()
|
boolean |
isBrowserFirefox()
|
boolean |
isBrowserMicrosoft()
|
boolean |
isBrowserSafari()
|
boolean |
isContentGeneration()
|
void |
isContentGeneration(boolean flag)
|
boolean |
isDebuggingEnabled()
|
boolean |
isExportMode()
|
boolean |
isHistoryRequest()
|
boolean |
isIncrementalUpdateRequest()
|
boolean |
isMetaTemplateMode()
|
boolean |
isPathDebugRequest()
|
boolean |
isPollUpdateRequest()
|
boolean |
isPrintMode()
|
boolean |
isRequestSecure()
|
boolean |
isStaticGeneration()
|
boolean |
isXMLHttpIncrementalRequest()
|
AWDebugTrace |
lastDebugTrace()
|
void |
markNextComponentAsMainInTrace()
|
AWEncodedString |
nextElementId()
|
AWElementIdPath |
nextElementIdPath()
|
AWPage |
page()
|
AWComponent |
pageComponent()
|
AWComponent |
pageWithName(String pageName)
|
AWComponent |
pageWithName(String pageName,
Map<String,Object> assignments)
|
void |
popCurrentComponent(AWComponent parent)
|
void |
popCurrentElement(AWBaseElement prev)
|
void |
popElementIdLevel()
|
void |
popElementIdLevel(int elementIdComponent)
|
void |
popFormInputElementId()
|
void |
pushCurrentComponent(AWComponent component)
|
AWBaseElement |
pushCurrentElement(AWBaseElement element)
|
void |
pushElementIdLevel()
|
void |
pushElementIdLevel(int elementIdComponent)
|
void |
put(String keyString,
Object objectValue)
|
void |
recordFormInputId(AWElementIdPath elementIdPath)
|
void |
recordGlobalFormInputId(AWElementIdPath elementIdPath)
Keeps track of this element id for all subsequent forms and add the element id to
all existing forms. |
void |
registerNewPageComponent(AWComponent pageComponent)
|
Object |
remove(String keyString)
|
AWRequest |
request()
|
AWPage |
requestPage()
|
String |
requestSenderId()
|
AWElementIdPath |
requestSenderIdPath()
|
String |
requestUrl()
|
void |
resetForNextCycle()
|
AWResponse |
response()
|
AWEncodedString |
responseId()
|
javax.servlet.http.HttpSession |
restoreHttpSessionForId(String sessionId)
|
javax.servlet.http.HttpSession |
restoreHttpSessionForId(String sessionId,
boolean checkRemoteHostAddress,
boolean throwException)
|
void |
restoreOriginalResponse(AWResponse response)
|
AWSession |
session()
|
AWSession |
session(boolean required)
Returns the current AWSession associated with the client making the request or,
if if there is no current AWSession and required is true, throws
AWSessionRestorationException. |
int |
sessionTimeout()
|
void |
setBacktrackState(AWBacktrackState backtrackState)
|
void |
setCurrentComponent(AWComponent currentComponent)
|
void |
setCurrentDirectAction(String directActionClassName,
String directActionName)
|
void |
setCurrentElement(AWBaseElement element)
Deprecated. use pushCurrentElement / popCurrentElement instead |
void |
setCurrentForm(AWHtmlForm currentForm)
|
void |
setDataValuePushedInInvokeAction(boolean value)
|
void |
setDebugIsInRecordingMode(boolean value)
|
void |
setElementId(AWElementIdGenerator elementIdGenerator)
The name of this "setElementId" is retained for backward compatibility with code in the ariba.encoder.xml
package. |
void |
setExportMode(boolean isExportMode)
|
void |
setFormInputIds(AWArrayManager formInputIds)
|
void |
setFrameName(AWEncodedString frameName)
|
void |
setFrameName(String frameName)
|
void |
setHistoryAction(int historyAction)
|
void |
setHistoryRequest(boolean historyRequest)
|
void |
setHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
setIsDebuggingEnabled(boolean state)
|
void |
setIsPrintMode(boolean isPrintMode)
|
void |
setMetaTemplateMode(boolean flag)
|
void |
setPage(AWPage page)
|
void |
setRequestPage(AWPage page)
|
void |
setResponse(AWResponse response)
|
void |
setResponseCompleteCallback(AWBaseResponse.AWResponseCompleteCallback callback)
|
void |
setXHRRCompatibleResponse(AWResponse response)
|
void |
sleep()
|
String |
staticUrlForActionResults(AWResponseGenerating responseGenerating)
|
void |
stopComponentPathRecording()
|
void |
suppressTraceForCurrentScopingElement()
|
AWElementIdPath |
targetFormIdPath()
|
AWResponse |
temporarilySwapReponse(AWResponse response)
|
AWValidationContext |
validationContext()
|
boolean |
wasPathDebugRequest()
|
TopFrameName
public static final AWEncodedString TopFrameName
SelfFrameName
public static final AWEncodedString SelfFrameName
SessionIdKey
public static final String SessionIdKey
- See Also:
- Constant Field Values
ResponseIdKey
public static final String ResponseIdKey
- See Also:
- Constant Field Values
SessionSecureIdKey
public static final String SessionSecureIdKey
- See Also:
- Constant Field Values
SessionSecureIdKeyEquals
public static final String SessionSecureIdKeyEquals
- See Also:
- Constant Field Values
FrameNameKey
public static final String FrameNameKey
- See Also:
- Constant Field Values
PageScrollTopKey
public static final String PageScrollTopKey
- See Also:
- Constant Field Values
PageScrollLeftKey
public static final String PageScrollLeftKey
- See Also:
- Constant Field Values
SessionRendevousKey
public static final String SessionRendevousKey
- See Also:
- Constant Field Values
IncrementalUpdateKey
public static final String IncrementalUpdateKey
- See Also:
- Constant Field Values
RefreshRequestKey
public static final String RefreshRequestKey
- See Also:
- Constant Field Values
RecordingModeKey
public static final String RecordingModeKey
- See Also:
- Constant Field Values
UseXmlHttpRequests
public static boolean UseXmlHttpRequests
Phase_ApplyValues
public static final int Phase_ApplyValues
- See Also:
- Constant Field Values
Phase_InvokeAction
public static final int Phase_InvokeAction
- See Also:
- Constant Field Values
Phase_Render
public static final int Phase_Render
- See Also:
- Constant Field Values
AWRequestContext
public AWRequestContext()
init
public void init(AWApplication application,
AWRequest request)
_requestContext
public static AWRequestContext _requestContext()
- Return the request context if there is one is associated with the
current thread and null otherwise
- Returns:
- the request context or null
validationContext
public AWValidationContext validationContext()
isDebuggingEnabled
public boolean isDebuggingEnabled()
setIsDebuggingEnabled
public void setIsDebuggingEnabled(boolean state)
setMetaTemplateMode
public void setMetaTemplateMode(boolean flag)
isMetaTemplateMode
public boolean isMetaTemplateMode()
setPage
public void setPage(AWPage page)
page
public AWPage page()
pageComponent
public AWComponent pageComponent()
pageWithName
public AWComponent pageWithName(String pageName)
pageWithName
public AWComponent pageWithName(String pageName,
Map<String,Object> assignments)
setRequestPage
public void setRequestPage(AWPage page)
requestPage
public AWPage requestPage()
responseId
public AWEncodedString responseId()
setFrameName
public void setFrameName(AWEncodedString frameName)
setFrameName
public void setFrameName(String frameName)
frameName
public AWEncodedString frameName()
registerNewPageComponent
public void registerNewPageComponent(AWComponent pageComponent)
setElementId
public void setElementId(AWElementIdGenerator elementIdGenerator)
- The name of this "setElementId" is retained for backward compatibility with code in the ariba.encoder.xml
package. It would be better to call it "setElementIdGenerator", but then I've have to change more code
in ariba.encoder.xml.
- Parameters:
elementIdGenerator -
_getElementIdGenerator
public AWElementIdGenerator _getElementIdGenerator()
setBacktrackState
public void setBacktrackState(AWBacktrackState backtrackState)
backtrackState
public AWBacktrackState backtrackState()
application
public AWApplication application()
existingSession
public AWSession existingSession()
- Returns the session currently associated with this request context. Only returns
a session if a previous call has associated the session with this request. This
means that even if there is a valid session for this request, this method could
return null if there has not been a previous call to session() or httpSession().
Should only be used by calls made during session initialization (since
circular calls to session(false) are not allowed). All other checks for
session should use session(false).
setHttpSession
public void setHttpSession(javax.servlet.http.HttpSession httpSession)
existingHttpSession
public javax.servlet.http.HttpSession existingHttpSession()
createHttpSession
public javax.servlet.http.HttpSession createHttpSession()
restoreHttpSessionForId
public javax.servlet.http.HttpSession restoreHttpSessionForId(String sessionId,
boolean checkRemoteHostAddress,
boolean throwException)
restoreHttpSessionForId
public javax.servlet.http.HttpSession restoreHttpSessionForId(String sessionId)
httpSession
public javax.servlet.http.HttpSession httpSession()
httpSession
public javax.servlet.http.HttpSession httpSession(boolean required)
session
public AWSession session(boolean required)
- Returns the current AWSession associated with the client making the request or,
if if there is no current AWSession and required is true, throws
AWSessionRestorationException.
If required is false and the client making this request does not have a valid
AWSession, this method returns null.
- Parameters:
required -
session
public AWSession session()
createSession
public AWSession createSession()
- Associates and returns a new AWSession. If an existing session has been associated
with the current request, a FatalAssertionException will be thrown.
- Returns:
- newly created AWSession
request
public AWRequest request()
_overrideRequest
public void _overrideRequest(AWRequest newRequest)
setResponse
public void setResponse(AWResponse response)
temporarilySwapReponse
public AWResponse temporarilySwapReponse(AWResponse response)
restoreOriginalResponse
public void restoreOriginalResponse(AWResponse response)
setXHRRCompatibleResponse
public void setXHRRCompatibleResponse(AWResponse response)
response
public AWResponse response()
isBrowserFirefox
public boolean isBrowserFirefox()
isBrowserMicrosoft
public boolean isBrowserMicrosoft()
isBrowserSafari
public boolean isBrowserSafari()
browserMinWidth
public String browserMinWidth()
browserMaxWidth
public String browserMaxWidth()
requestSenderId
public String requestSenderId()
requestSenderIdPath
public AWElementIdPath requestSenderIdPath()
dequeueSenderId
public void dequeueSenderId()
enqueueSenderId
public void enqueueSenderId(String newId)
hasMoreSenderIds
public boolean hasMoreSenderIds()
nextElementIdPath
public AWElementIdPath nextElementIdPath()
nextElementId
public AWEncodedString nextElementId()
currentElementIdPath
public AWElementIdPath currentElementIdPath()
currentElementId
public AWEncodedString currentElementId()
currentElementIdPathLength
public int currentElementIdPathLength()
incrementElementId
public void incrementElementId()
incrementElementId
public void incrementElementId(int amount)
pushElementIdLevel
public void pushElementIdLevel(int elementIdComponent)
pushElementIdLevel
public void pushElementIdLevel()
popElementIdLevel
public void popElementIdLevel()
popElementIdLevel
public void popElementIdLevel(int elementIdComponent)
currentElementIdLevel
public int currentElementIdLevel()
disableElementIdGeneration
public void disableElementIdGeneration()
- Disable element id generation is used for non-interactive page rendering
currentElementIdTrace
public String currentElementIdTrace()
setFormInputIds
public void setFormInputIds(AWArrayManager formInputIds)
recordFormInputId
public void recordFormInputId(AWElementIdPath elementIdPath)
recordGlobalFormInputId
public void recordGlobalFormInputId(AWElementIdPath elementIdPath)
- Keeps track of this element id for all subsequent forms and add the element id to
all existing forms.
- Parameters:
elementIdPath -
getGlobalFormInputIdPaths
public List getGlobalFormInputIdPaths()
targetFormIdPath
public AWElementIdPath targetFormIdPath()
popFormInputElementId
public void popFormInputElementId()
resetForNextCycle
public void resetForNextCycle()
applyValues
public void applyValues()
invokeActionForRequest
public AWResponseGenerating invokeActionForRequest()
isPollUpdateRequest
public boolean isPollUpdateRequest()
generateResponse
public AWResponse generateResponse(AWResponse response)
addCookie
public void addCookie(AWCookie cookie)
didAddCookies
public boolean didAddCookies()
generateResponse
public AWResponse generateResponse()
handleRequest
public AWResponse handleRequest(AWRequest request,
AWRequestHandler requestHandler)
checkInExistingHttpSession
public void checkInExistingHttpSession()
sleep
public void sleep()
get
public Object get(String keyString)
put
public void put(String keyString,
Object objectValue)
remove
public Object remove(String keyString)
clear
public void clear()
setCurrentForm
public void setCurrentForm(AWHtmlForm currentForm)
currentForm
public AWHtmlForm currentForm()
incrementFormIndex
public void incrementFormIndex()
formIndex
public int formIndex()
debugState
public Object debugState()
- Description copied from interface:
DebugState
- Returns an object that will be toStringed when the debug
information needs to be printed. This method will only be
called when the information is to be printed out - which will
be rare. This method may safely be slow. It is also ok for the
value that would be returned to change over time, even after
the time that it is intially set in ThreadDebugState.
The most common implementation is to create a new Map
and set key and value pairs of information in that Map
which it will then return.
- Specified by:
debugState in interface DebugState
- Returns:
- an object that encapsulates the state of the current
application. The toString() method of the returned object
should be made safe even if the object that implements
DebugState is being modified at the time. Exceptions from
toString are tollerable in this case, but data corruption is
not.
- See Also:
ThreadDebugState.set(ariba.util.core.ThreadDebugKey, java.lang.Object)
setCurrentDirectAction
public void setCurrentDirectAction(String directActionClassName,
String directActionName)
getDirectActionClassName
public String getDirectActionClassName()
getDirectActionName
public String getDirectActionName()
setCurrentComponent
public void setCurrentComponent(AWComponent currentComponent)
getCurrentComponent
public AWComponent getCurrentComponent()
setCurrentElement
public void setCurrentElement(AWBaseElement element)
- Deprecated. use pushCurrentElement / popCurrentElement instead
pushCurrentElement
public AWBaseElement pushCurrentElement(AWBaseElement element)
popCurrentElement
public void popCurrentElement(AWBaseElement prev)
getCurrentElement
public AWBaseElement getCurrentElement()
enableComponentPathDebugging
public void enableComponentPathDebugging()
- This may change during a request as not all components want this enabled.
disableComponentPathDebugging
public void disableComponentPathDebugging()
componentPathDebuggingEnabled
public boolean componentPathDebuggingEnabled()
debugTrace
public AWDebugTrace debugTrace()
currentPhase
public int currentPhase()
lastDebugTrace
public AWDebugTrace lastDebugTrace()
pushCurrentComponent
public void pushCurrentComponent(AWComponent component)
popCurrentComponent
public void popCurrentComponent(AWComponent parent)
suppressTraceForCurrentScopingElement
public void suppressTraceForCurrentScopingElement()
markNextComponentAsMainInTrace
public void markNextComponentAsMainInTrace()
isPathDebugRequest
public boolean isPathDebugRequest()
wasPathDebugRequest
public boolean wasPathDebugRequest()
stopComponentPathRecording
public void stopComponentPathRecording()
_debugPushSemanticKeyPrefix
public void _debugPushSemanticKeyPrefix()
_debugPopSemanticKeyPrefix
public void _debugPopSemanticKeyPrefix()
_debugSetSemanticKeyPrefix
public void _debugSetSemanticKeyPrefix(String prefix)
_debugSemanticKeyPrefix
public String _debugSemanticKeyPrefix()
_debugResponseIdAsIs
public AWEncodedString _debugResponseIdAsIs()
_debugIsInPlaybackMode
public boolean _debugIsInPlaybackMode()
_debugIsInRecordingMode
public boolean _debugIsInRecordingMode()
setDebugIsInRecordingMode
public void setDebugIsInRecordingMode(boolean value)
_debugSkipRecordPlayback
public void _debugSkipRecordPlayback()
_debugShouldRecord
public boolean _debugShouldRecord()
cleanupThreadLocalState
public static void cleanupThreadLocalState()
cookieValueForKey
public String cookieValueForKey(String key)
formValueForKey
public String formValueForKey(String key)
formValues
public Map formValues()
isRequestSecure
public boolean isRequestSecure()
createPageWithName
public AWComponent createPageWithName(String name)
sessionTimeout
public int sessionTimeout()
requestUrl
public String requestUrl()
isPrintMode
public boolean isPrintMode()
setIsPrintMode
public void setIsPrintMode(boolean isPrintMode)
isExportMode
public boolean isExportMode()
setExportMode
public void setExportMode(boolean isExportMode)
setDataValuePushedInInvokeAction
public void setDataValuePushedInInvokeAction(boolean value)
dataValuePushedInInvokeAction
public boolean dataValuePushedInInvokeAction()
isIncrementalUpdateRequest
public boolean isIncrementalUpdateRequest()
isXMLHttpIncrementalRequest
public boolean isXMLHttpIncrementalRequest()
assertFileDownloadCompatibleRequestRequired
public void assertFileDownloadCompatibleRequestRequired()
allowFailedComponentRendezvous
public boolean allowFailedComponentRendezvous()
isContentGeneration
public boolean isContentGeneration()
isContentGeneration
public void isContentGeneration(boolean flag)
forceFullPageRefresh
public void forceFullPageRefresh()
fullPageRefreshRequired
public boolean fullPageRefreshRequired()
forceRerender
public void forceRerender()
forceRerenderRequired
public boolean forceRerenderRequired()
allowIncrementalUpdateApppend
public boolean allowIncrementalUpdateApppend()
allowIncrementalUpdateApppend
public void allowIncrementalUpdateApppend(boolean flag)
setHistoryRequest
public void setHistoryRequest(boolean historyRequest)
isHistoryRequest
public boolean isHistoryRequest()
setHistoryAction
public void setHistoryAction(int historyAction)
historyAction
public int historyAction()
dict
public Map dict()
- Deprecated. use put(key,value) and get(key) API's directly
setResponseCompleteCallback
public void setResponseCompleteCallback(AWBaseResponse.AWResponseCompleteCallback callback)
isAccessibilityEnabled
public boolean isAccessibilityEnabled()
isStaticGeneration
public boolean isStaticGeneration()
staticUrlForActionResults
public String staticUrlForActionResults(AWResponseGenerating responseGenerating)
AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.