OracleJavaScript API Reference for Oracle ADF Faces

 

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

oracle.adfinternal.view.js.laf.dhtml.scriptLoading
Class AdfScriptLoadingService

Warning:

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adfinternal.view.js.laf.dhtml.scriptLoading.AdfScriptLoadingService

public class AdfScriptLoadingService
extends AdfObject
Service for dynamically loading scripts, typically scripts that are added in response to ppr activity. Clients may add library (external), inline or callback-based scripts. All scripts will be loaded sequentially in the order in which they were added, even if some scripts must be retreived asynchronously.



Field Summary

private Object
_asyncCallback
private Object
_domDocument
private Object
_domWindow
private Object
_initLoadedLibraries
private Object
_loadableScripts
private Object
_loading
private Object
_loadingScript
private Object
_loadListeners
public static Object
METHOD_ANY
Load method constant indicating that we don't care how the library script is loaded.
public static Object
METHOD_ASYNCHRONOUS
Load method constant indicating that the library script must loaded asynchronously.
public static Object
METHOD_BACKGROUND
Load method constant indicating that the library script must be loaded in the background.
public static Object
METHOD_SYNCHRONOUS
Load method constant indicating that the library script must be loaded immediately (synchronously), blocking execution until complete.
private Object
_policy
public static Object
POLICY_AUTO
Constant indicating that AdfScriptLoadingService should automatically pick the best script loading implementation to use for any library that it is asked to load.
public static Object
POLICY_CROSS_ORIGIN
Constant indicating that libraries should be loaded using a cross origin-friendly implementation.
public static Object
POLICY_SAME_ORIGIN
Constant indicating that libraries should be loaded using a same origin (ie.
private Object
_sameOriginRegexp
public static Object
STATUS_LOADED
Loading status change value indicating that scripts have completed loading.
public static Object
STATUS_LOADING
Loading status change value indicating that scripts are being loaded.
private Object
_syncCallback


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

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfScriptLoadingService(Object domWindow, Object domDocument, Object policy)
Service for dynamically loading scripts, typically scripts that are added in response to ppr activity.


Method Summary

public Object
addCallbackScript(Object context, Function callback, Object state)
Adds a function script to load.
public Object
addInlineScript(Object content)
Adds an inline script to load.
public Object
addLibraryScript(Object librarySource, Object loadMethod)
Adds a library script to load.
private Object
_addLoadableScript(Object loadableScript)
public Object
addLoadListener(Object listener)
Registers a listener that is notified of loading activity.
private Object
_asyncLoadComplete(Object librarySource)
protected Object
CreateLibraryLoadableScript(Object librarySource, Object loadMethod)
Creates an AdfLoadableScript instance for the specified library source and load method.
private Object
_createSameOriginRegexp()
protected Object
GetDomDocument()
Returns the DOM Document object.
protected Object
GetDomWindow()
Returns the DOM Window object.
protected Object
Init(Object domWindow, Object domDocument, Object policy)
Initializes the AdfScriptLoadingService.
protected static Object
InitClass()
private Object
_initLoadedLibraries(Object domDocument)
private Object
_isLibraryLoaded(Object librarySource)
private Object
_isSameOrigin(Object librarySource)
private Object
_loadNextScript()
private Object
_markLibraryLoaded(Object librarySource)
private Object
_notify(Object status)
private Object
_notifyLoaded()
private Object
_notifyLoading()
public Object
removeLoadListener(Object listener)
Removes a listener that was previously registered via a call to addLoadListener
private static String
_stripSessionId(String uri)
private Object
_syncLoadComplete(Object librarySource)


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


_asyncCallback

private Object _asyncCallback

_domDocument

private Object _domDocument

_domWindow

private Object _domWindow

_initLoadedLibraries

private Object _initLoadedLibraries

_loadableScripts

private Object _loadableScripts

_loading

private Object _loading

_loadingScript

private Object _loadingScript

_loadListeners

private Object _loadListeners

METHOD_ANY

public static Object METHOD_ANY

Load method constant indicating that we don't care how the library script is loaded.
See also:
addLibraryScript(Object, Object)

METHOD_ASYNCHRONOUS

public static Object METHOD_ASYNCHRONOUS

Load method constant indicating that the library script must loaded asynchronously. A potential problem with this method is that users may have access to a component's DOM content before required JavaScript code has finished loading. To avoid this, user interactions and other operations (eg. ppr) should be blocked until asynchronous loading completes. The addLoadListener() API provides a means to monitor asynchronous loading activity. Subsystems that need to block/suspend operation during asynchronous loading should use this API to track loading progress.
See also:
addLibraryScript(Object, Object)
addLoadListener(Object)

METHOD_BACKGROUND

public static Object METHOD_BACKGROUND

Load method constant indicating that the library script must be loaded in the background. Like METHOD_ASYNCHRONOUS, this means that the script is loaded asynchronously. However, unlikely METHOD_ASYNCHRONOUS, scripts that are loaded using METHOD_BACKGROUND should not block/interfere with user interaction or other processing.
See also:
addLibraryScript(Object, Object)

METHOD_SYNCHRONOUS

public static Object METHOD_SYNCHRONOUS

Load method constant indicating that the library script must be loaded immediately (synchronously), blocking execution until complete. is loaded.
See also:
addLibraryScript(Object, Object)

_policy

private Object _policy

POLICY_AUTO

public static Object POLICY_AUTO

Constant indicating that AdfScriptLoadingService should automatically pick the best script loading implementation to use for any library that it is asked to load.

POLICY_CROSS_ORIGIN

public static Object POLICY_CROSS_ORIGIN

Constant indicating that libraries should be loaded using a cross origin-friendly implementation.

POLICY_SAME_ORIGIN

public static Object POLICY_SAME_ORIGIN

Constant indicating that libraries should be loaded using a same origin (ie. XmlHttpRequest-based) implementation.

_sameOriginRegexp

private Object _sameOriginRegexp

STATUS_LOADED

public static Object STATUS_LOADED

Loading status change value indicating that scripts have completed loading.
See also:
addLoadListener(Object)

STATUS_LOADING

public static Object STATUS_LOADING

Loading status change value indicating that scripts are being loaded.
See also:
addLoadListener(Object)

_syncCallback

private Object _syncCallback

Constructor Detail


AdfScriptLoadingService

public AdfScriptLoadingService(Object domWindow,
                               Object domDocument,
                               Object policy)

Service for dynamically loading scripts, typically scripts that are added in response to ppr activity. Clients may add library (external), inline or callback-based scripts. All scripts will be loaded sequentially in the order in which they were added, even if some scripts must be retreived asynchronously.

Parameters:
domWindow    
domDocument    
policy    

Method Detail


addCallbackScript

public Object addCallbackScript(Object context,
                                Function callback,
                                Object state)

Adds a function script to load.

Parameters:
context  -  Object to pass as "this" to the callback
callback  -  the function to call
state  -  State parameter passed to the callback
Return:
Object

addInlineScript

public Object addInlineScript(Object content)

Adds an inline script to load.

Parameters:
content  -  the content of the script to load.
Return:
Object

addLibraryScript

public Object addLibraryScript(Object librarySource,
                               Object loadMethod)

Adds a library script to load.

Parameters:
librarySource  -  the source (uri) for the external library resource
loadMethod  -  hint indicating how the script should be loaded. One of METHOD_SYNCHRONOUS, METHOD_ASYNCHRONOUS, METHOD_BACKGROUND, METHOD_ANY.
Return:
Object

_addLoadableScript

private Object _addLoadableScript(Object loadableScript)

Parameters:
loadableScript    
Return:
Object

addLoadListener

public Object addLoadListener(Object listener)

Registers a listener that is notified of loading activity. The purpose of the load listener mechanism is to provide interested parties the ability to track asynchronous loading activity, as other subsystems may need to suspend operation (eg. block user input, suppress server communication) until all scripts are loaded. Listeners are called back with one of two argument values. The STATUS_LOADING value is passed into the listener just before asynchronous script loading begins. The value STATUS_LOADED is passed into the listener when all scripts have completed loading, thus allowing other subsystems to safely resume operation. Note that listeners are not notified of background script loading, as background loading should not interfere with normal operation (eg. user input should not be blocked).

Parameters:
listener  -  a single-argument method that is notified of loading/loaded activity.
Return:
Object

_asyncLoadComplete

private Object _asyncLoadComplete(Object librarySource)

Parameters:
librarySource    
Return:
Object

CreateLibraryLoadableScript

protected Object CreateLibraryLoadableScript(Object librarySource,
                                             Object loadMethod)

Creates an AdfLoadableScript instance for the specified library source and load method.

Parameters:
librarySource  -  the source (uri) for the external library resource
loadMethod  -  hint indicating how the script should be loaded. One of METHOD_SYNCHRONOUS, METHOD_ASYNCHRONOUS, METHOD_BACKGROUND, METHOD_ANY.
Return:
Object - an AdfLoadableScript that is capable of loading the specified library script.

_createSameOriginRegexp

private Object _createSameOriginRegexp()

Return:
Object

GetDomDocument

protected Object GetDomDocument()

Returns the DOM Document object.

Return:
Object

GetDomWindow

protected Object GetDomWindow()

Returns the DOM Window object.

Return:
Object

Init

protected Object Init(Object domWindow,
                      Object domDocument,
                      Object policy)

Initializes the AdfScriptLoadingService.

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

InitClass

protected static Object InitClass()

Return:
Object

_initLoadedLibraries

private Object _initLoadedLibraries(Object domDocument)

Parameters:
domDocument    
Return:
Object

_isLibraryLoaded

private Object _isLibraryLoaded(Object librarySource)

Parameters:
librarySource    
Return:
Object

_isSameOrigin

private Object _isSameOrigin(Object librarySource)

Parameters:
librarySource    
Return:
Object

_loadNextScript

private Object _loadNextScript()

Return:
Object

_markLibraryLoaded

private Object _markLibraryLoaded(Object librarySource)

Parameters:
librarySource    
Return:
Object

_notify

private Object _notify(Object status)

Parameters:
status    
Return:
Object

_notifyLoaded

private Object _notifyLoaded()

Return:
Object

_notifyLoading

private Object _notifyLoading()

Return:
Object

removeLoadListener

public Object removeLoadListener(Object listener)

Removes a listener that was previously registered via a call to addLoadListener

Parameters:
listener  -  the lister to remove
Return:
Object

_stripSessionId

private static String _stripSessionId(String uri)

Parameters:
uri  -  that might have a session Id encoded
Return:
String - uri stripped of the session id

_syncLoadComplete

private Object _syncLoadComplete(Object librarySource)

Parameters:
librarySource    
Return:
Object

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

 

Generated on 2014.03.27 12:59 UTC
Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.