OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adfinternal.view.js.comm
Class AdfXmlHttpDataTransferService

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.comm.AdfDataTransferService
               |
               +--oracle.adfinternal.view.js.comm.AdfXmlHttpDataTransferService

public class AdfXmlHttpDataTransferService
extends AdfDataTransferService
Implementation of DataTransferService using XmlHttp


Field Summary

private static Object
_ADF_STREAMING_IFRAME_ID
private static Object
_MULTIPART_FRAME
private static Object
_MULTIPART_TYPE
private Object
_pageUnloading
private static Object
_POLLING_TYPE
private Object
_reqCount
private Object
_requestQueue
private Object
_state
private Object
_stateChangeListeners
private static Object
_STREAMING_TYPE
private Object
_streamingCount
private Object
_suspendCount
private Object
_window
private static Object
_WINDOW_PARAM
private static Object
_XMLHTTP_TYPE

Fields inherited from oracle.adfinternal.view.js.comm.AdfDataTransferService

STATE_BUSY, STATE_READY, TRANSFER_COMPLETE

Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass

Fields inherited from org.ecmascript.object.Object

prototype

Constructor Summary

public
AdfXmlHttpDataTransferService(Object domWindow)
Implementation of DataTransferService using XmlHttp

Method Summary

private Object
_addRequestToQueue(Object type, Object context, Object actionURL, Object headerParams, Object content, Object listeners, Object eventListeners, Object minBusyState)
This function adds a new request to the request queue of the DataTransferService.
public Object
addStateChangeListener(Function listener, Object instance)
Adds a listener to the data transfer service that is interested in its state change.
private static Object
_alertError(Object statusCode)
private Object
_appendParamNode(Object domDocument, Object form, Object name, Object value)
static Object
__broadcastRequestStatusChanged(Object listeners, Object event)
private Object
_broadcastStateChangeEvent(Object state)
broadcast the state change of the data transfer service to its listeners
private Object
_clearParamNodes()
public Object
dispose()
private Object
_doNextRequest()
private Object
_doStreamingTransfer(Object requestItem)
Initiate a data streaming request as a GET on an IFRAME
private Object
_doTransfer()
private Object
_doTransferThroughIframe(Object requestItem)
Perform a PPR Post through a document in an iframe
private Object
_doXmlHttpTransfer(Object requestItem, Object callback)
Sends a request to the server over by using XHR
static String
__encodePageIdOnUrl(String url, Object pageId)
static String
__encodeWindowIdOnUrl(String url, Object windowId)
private Object
_getDomDocument()
public Object
getDTSState()
Return the current DTS state.
private Object
_handleIFrameLoad()
private Object
_handleRequestCallback(Object xmlHttp)
protected Object
Init(Object domWindow)
Initializes the instance.
protected static Object
InitClass()
private Object
_isSuspended()
public Object
notifyStreamingRequestComplete()
Notifies Data Transfer Service that the streaming request is done
private Object
_onIFrameLoadComplete(Object iframeDoc, Object context, Object requestListeners)
public Object
pageUnloading()
private Object
_processQueuedStreamingMessages()
public Object
processStreamingResponse(Object script)
Called by the script from within the streaming IFRAME
private static void
_removeFrame(HtmlNode hiddenFrame)
Removes the hidden iframe from the document.
public Object
removeStateChangeListener(Function listener, Object instance)
Removes a listener from the data transfer service that is interested in its state change.
private static Object
_requestCallback(Object xmlRequest)
private Object
_requestDone()
public Object
resume()
Resumes the data transfer service, allowing normally processing to continue.
public AdfXmlHttpDataTransferRequest
sendMultiPartRequest(Object context, Object actionURL, Object headerParams, Object htmlForm, Object params, Object listeners, Object eventListeners)
Performs Asynchronous HTTP Request with the Server for multipart data
public AdfXmlHttpDataTransferRequest
sendPollingRequest(Object actionURL, Object listeners)
This function is only used for long-polling requests and interval polling requests.
public AdfXmlHttpDataTransferRequest
sendRequest(Object context, Object actionURL, Object headerParams, Object content, Object listeners)
Performs Asynchronous XML HTTP Request with the Server
public AdfXmlHttpDataTransferRequest
sendStreamingRequest(Object actionURL, Object params)
Sends a streaming request to the server over an IFRAME
private Object
_setResponseIdentifierFromResponseHeader(Object request)
Extract response identifier from response header and set it on the page object.
public Boolean
streamingResponsesOutstanding()
public Object
suspend()
Suspends the data transfer service until a matching call to resume() is made.

Methods inherited from oracle.adfinternal.view.js.comm.AdfDataTransferService

getInstance

Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, exportPrototypeSymbol, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toDebugString, toString

Field Detail


_ADF_STREAMING_IFRAME_ID

private static Object _ADF_STREAMING_IFRAME_ID

_MULTIPART_FRAME

private static Object _MULTIPART_FRAME

_MULTIPART_TYPE

private static Object _MULTIPART_TYPE

_pageUnloading

private Object _pageUnloading

_POLLING_TYPE

private static Object _POLLING_TYPE

_reqCount

private Object _reqCount

_requestQueue

private Object _requestQueue

_state

private Object _state

_stateChangeListeners

private Object _stateChangeListeners

_STREAMING_TYPE

private static Object _STREAMING_TYPE

_streamingCount

private Object _streamingCount

_suspendCount

private Object _suspendCount

_window

private Object _window

_WINDOW_PARAM

private static Object _WINDOW_PARAM

_XMLHTTP_TYPE

private static Object _XMLHTTP_TYPE

Constructor Detail


AdfXmlHttpDataTransferService

public AdfXmlHttpDataTransferService(Object domWindow)

Implementation of DataTransferService using XmlHttp

Parameters:
domWindow  

Method Detail


_addRequestToQueue

private Object _addRequestToQueue(Object type,
                                  Object context,
                                  Object actionURL,
                                  Object headerParams,
                                  Object content,
                                  Object listeners,
                                  Object eventListeners,
                                  Object minBusyState)

This function adds a new request to the request queue of the DataTransferService. Once the request has been pushed to the queue it also triggers the _doTransfer() do start the real request processing.

Parameters:
type - the type of the request
context - any object that is sent back to the callback when the request is complete. This object can be null.
actionURL - the url to send the request to
headerParams - Option HTTP header parameters to attach to the request
content - the content of the Asynchronous XML HTTP Post
listeners - Objects that implements DataTransferRequestListener interface
eventListeners  
minBusyState - the minimum value of the busy state required for request to be sent to the server. Most requests will use STATE_READY (0), but streaming will be allowed to proceed with TRANSFER_COMPLETE(1) (see bug #7257216)
Return:
Object

addStateChangeListener

public Object addStateChangeListener(Function listener,
                                     Object instance)

Adds a listener to the data transfer service that is interested in its state change. The listners are notified in the order that they are added. A listener can cancel notification to other listeners in the chain by returning false.

Parameters:
listener - listener function to remove
instance - to pass as this when calling function
Return:
Object
Overrides:
AdfDataTransferService.addStateChangeListener(Function, Object)

_alertError

private static Object _alertError(Object statusCode)

Parameters:
statusCode  
Return:
Object

_appendParamNode

private Object _appendParamNode(Object domDocument,
                                Object form,
                                Object name,
                                Object value)

Parameters:
domDocument  
form  
name  
value  
Return:
Object

__broadcastRequestStatusChanged

static Object __broadcastRequestStatusChanged(Object listeners,
                                               Object event)

Parameters:
listeners  
event  
Return:
Object

_broadcastStateChangeEvent

private Object _broadcastStateChangeEvent(Object state)

broadcast the state change of the data transfer service to its listeners

Parameters:
state  
Return:
Object

_clearParamNodes

private Object _clearParamNodes()

Return:
Object

dispose

public Object dispose()

Return:
Object
Overrides:
AdfDataTransferService.dispose()

_doNextRequest

private Object _doNextRequest()

Return:
Object

_doStreamingTransfer

private Object _doStreamingTransfer(Object requestItem)

Initiate a data streaming request as a GET on an IFRAME

Parameters:
requestItem  
Return:
Object

_doTransfer

private Object _doTransfer()

Return:
Object

_doTransferThroughIframe

private Object _doTransferThroughIframe(Object requestItem)

Perform a PPR Post through a document in an iframe

Parameters:
requestItem  
Return:
Object

_doXmlHttpTransfer

private Object _doXmlHttpTransfer(Object requestItem,
                                  Object callback)

Sends a request to the server over by using XHR

Parameters:
requestItem - the current request item object from the underlying queue
callback - custom callback to be executed once the request is done
Return:
Object

__encodePageIdOnUrl

static String __encodePageIdOnUrl(String url,
                                   Object pageId)

Parameters:
url - target action url
pageId  
Return:
String - url with the pageId added as a query parameter

__encodeWindowIdOnUrl

static String __encodeWindowIdOnUrl(String url,
                                     Object windowId)

Parameters:
url - target action url
windowId  
Return:
String - url with the windowId added as a query parameter

_getDomDocument

private Object _getDomDocument()

Return:
Object

getDTSState

public Object getDTSState()

Return the current DTS state. return (int) _state

Return:
Object
Overrides:
AdfDataTransferService.getDTSState()

_handleIFrameLoad

private Object _handleIFrameLoad()

Return:
Object

_handleRequestCallback

private Object _handleRequestCallback(Object xmlHttp)

Parameters:
xmlHttp  
Return:
Object

Init

protected Object Init(Object domWindow)

Initializes the instance. Subclasses of AdfObject must call their superclass' Init

Parameters:
domWindow  
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Return:
Object
Overrides:
AdfDataTransferService.InitClass()

_isSuspended

private Object _isSuspended()

Return:
Object

notifyStreamingRequestComplete

public Object notifyStreamingRequestComplete()

Notifies Data Transfer Service that the streaming request is done

Return:
Object
Overrides:
AdfDataTransferService.notifyStreamingRequestComplete()

_onIFrameLoadComplete

private Object _onIFrameLoadComplete(Object iframeDoc,
                                     Object context,
                                     Object requestListeners)

Parameters:
iframeDoc  
context  
requestListeners  
Return:
Object

pageUnloading

public Object pageUnloading()

Return:
Object
Overrides:
AdfDataTransferService.pageUnloading()

_processQueuedStreamingMessages

private Object _processQueuedStreamingMessages()

Return:
Object

processStreamingResponse

public Object processStreamingResponse(Object script)

Called by the script from within the streaming IFRAME

Parameters:
script - script to be executed in the context of the streaming IFRAME
Return:
Object
Overrides:
AdfDataTransferService.processStreamingResponse(Object)

_removeFrame

private static void _removeFrame(HtmlNode hiddenFrame)

Removes the hidden iframe from the document. This task is done from another callstack (window.setTimeout) to prevent FF from getting hung in a browser busy state - in another "thread" to prevent the iframe from being removed from its own onload event handler.

Parameters:
hiddenFrame - data transfer iframe that should be removed from the document
Return:
void - null

removeStateChangeListener

public Object removeStateChangeListener(Function listener,
                                        Object instance)

Removes a listener from the data transfer service that is interested in its state change.

Parameters:
listener - listener function to remove
instance - to pass as this when calling function
Return:
Object
Overrides:
AdfDataTransferService.removeStateChangeListener(Function, Object)

_requestCallback

private static Object _requestCallback(Object xmlRequest)

Parameters:
xmlRequest  
Return:
Object

_requestDone

private Object _requestDone()

Return:
Object

resume

public Object resume()

Resumes the data transfer service, allowing normally processing to continue.

Return:
Object
Overrides:
AdfDataTransferService.resume()

sendMultiPartRequest

public AdfXmlHttpDataTransferRequest sendMultiPartRequest(Object context,
                                                          Object actionURL,
                                                          Object headerParams,
                                                          Object htmlForm,
                                                          Object params,
                                                          Object listeners,
                                                          Object eventListeners)

Performs Asynchronous HTTP Request with the Server for multipart data

Parameters:
context - any object that is sent back to the callback when the request is complete. This object can be null.
actionURL - This is the appropriate action url
headerParams - Additional header parameters that need to be sent to the server
htmlForm - The form containing multi-part data or an object. If object then XMLHttpRequest is used for transfer and transfer is unordered.
params - Additional parameters that need to be sent to the server
listeners - Objects that implements DataTransferRequestListener interface
eventListeners - Objects that implements EventListener interface
Return:
AdfXmlHttpDataTransferRequest - request object of current data transfer request
Overrides:
AdfDataTransferService.sendMultiPartRequest(Object, Object, Object, Object, Object, Object, Object)

sendPollingRequest

public AdfXmlHttpDataTransferRequest sendPollingRequest(Object actionURL,
                                                        Object listeners)

This function is only used for long-polling requests and interval polling requests. This method triggers a HTTP GET request to the server.

Parameters:
actionURL - the url to send the request to
listeners - Objects that implements DataTransferRequestListener interface
Return:
AdfXmlHttpDataTransferRequest - request object of current data transfer request
Overrides:
AdfDataTransferService.sendPollingRequest(Object, Object)

sendRequest

public AdfXmlHttpDataTransferRequest sendRequest(Object context,
                                                 Object actionURL,
                                                 Object headerParams,
                                                 Object content,
                                                 Object listeners)

Performs Asynchronous XML HTTP Request with the Server

Parameters:
context - any object that is sent back to the callback when the request is complete. This object can be null.
actionURL - the url to send the request to
headerParams - Option HTTP header parameters to attach to the request
content - the content of the Asynchronous XML HTTP Post
listeners - Objects that implements DataTransferRequestListener interface
Return:
AdfXmlHttpDataTransferRequest - request object of current data transfer request
Overrides:
AdfDataTransferService.sendRequest(Object, Object, Object, Object, Object)

sendStreamingRequest

public AdfXmlHttpDataTransferRequest sendStreamingRequest(Object actionURL,
                                                          Object params)

Sends a streaming request to the server over an IFRAME

Parameters:
actionURL - the url to send the request to
params - additional request parameters
Return:
AdfXmlHttpDataTransferRequest - request object of current data transfer request
Overrides:
AdfDataTransferService.sendStreamingRequest(Object, Object)

_setResponseIdentifierFromResponseHeader

private Object _setResponseIdentifierFromResponseHeader(Object request)

Extract response identifier from response header and set it on the page object. Normally, response identifier would be sent from server via Java script. This function is to serve the case where the request never reaches ADF lifecycle, thus response identifier can only be available on response header if it exists.

Parameters:
request - request object to retrieve response header from
Return:
Object

streamingResponsesOutstanding

public Boolean streamingResponsesOutstanding()

Return:
Boolean - Returns true if there are still outstanding streaming requests
Overrides:
AdfDataTransferService.streamingResponsesOutstanding()

suspend

public Object suspend()

Suspends the data transfer service until a matching call to resume() is made. While suspended, the data transfer service does not: - Send any new requests to the server - Transition between ready states. - Deliver state change events.

Return:
Object
Overrides:
AdfDataTransferService.suspend()

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.