Fusion

declare global namespace object for Fusion library to use

Summary
declare global namespace object for Fusion library to use
A set of utility classes that provide common tools for applications
A set of classes that implement the functionlity required for applications
A class to provide for event handling at application runtime
A set of classes to provide core funtionality
A set of classes that implement layer functionality for various server technologies.
Application scope constants
Initialize the Fusion application.
set the current initialization state of the application.
load any scripts that have been queued for loading.
Insert a new script into the loading queue.
Called when a script fails to load for some reason.
a script has loaded.
check if scripts have loaded.
asynchronously load the application definition through the broker and config manager.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the application failed to load the application configuration file.
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
trap exceptions produced in handling an ajax response.
Optionally convert XML to JSON using a server-side script for requests that aren’t available in JSON.
return a map widget with the given name
return a map widget that is associated with the given dom element by id.
return the map widget at the given index
return a reference to a widget by the id of the DOM Element that it was created in.
returns the applicaiton’s absolute URL minus the filename.html part
{String} Relative path of this script.
Return the path to this script.

Fusion. Tools

A set of utility classes that provide common tools for applications

Fusion. Widget

A set of classes that implement the functionlity required for applications

Fusion. Event

A class to provide for event handling at application runtime

Fusion.Lib

A set of classes to provide core funtionality

Fusion.Maps

A set of classes that implement layer functionality for various server technologies.

Fusion. Constant

Application scope constants

Summary
Initialize the Fusion application.
set the current initialization state of the application.
load any scripts that have been queued for loading.
Insert a new script into the loading queue.
Called when a script fails to load for some reason.
a script has loaded.
check if scripts have loaded.
asynchronously load the application definition through the broker and config manager.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the server has returned the application configuration file that contains enough information to bootstrap the application.
the application failed to load the application configuration file.
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
trap exceptions produced in handling an ajax response.
Optionally convert XML to JSON using a server-side script for requests that aren’t available in JSON.
return a map widget with the given name
return a map widget that is associated with the given dom element by id.
return the map widget at the given index
return a reference to a widget by the id of the DOM Element that it was created in.
returns the applicaiton’s absolute URL minus the filename.html part
{String} Relative path of this script.
Return the path to this script.

Functions and Properties

initialize

initialize : function(options)

Initialize the Fusion application.

@param {Object} options

Optional paramters that can be passed to initialize are

{String} applicationDefinitiona URL or resource ID for an ApplicationDefinition file
{String} sessionIda session id to start the application with.  Normally, applications are started without a session id and create one.  However, sometimes it is desirable to use an existing session.

setLoadState

setLoadState: function(state)

set the current initialization state of the application.  Depending on the state, this will cause various scripts to be loaded.

Parameter {Integer} state

the new loading state

loadQueuedScripts

loadQueuedScripts: function()

load any scripts that have been queued for loading.  As the scripts load, they are removed.  When all queued scripts have been loaded, the load state is advanced.  If any of the loaded scripts require other scripts (for inheritance), they will be queued and loaded before the load state is advanced.

queueScript

queueScript : function(url)

Insert a new script into the loading queue.  The URL should be relative to the Fusion base url.  The script will not actually be loaded until loadQueuedScripts is called.

Parameter: {String} url

The url of the script.

scriptFailed

scriptFailed: function(url)

Called when a script fails to load for some reason.

Parameter: url

{String} the url that failed to load

TODO: the application probably won’t work if a script fails to load so we need to decide how to inform the user and fail gracefully.

scriptLoaded

scriptLoaded: function(url)

a script has loaded.  It is removed from the various tracking arrays.  When all requested scripts have been loaded, we check to see if any scripts where required by the ones just loaded.  If yes, then we loadQueuedScripts again, otherwise we advance the load state.

Parameter: url

{String} the url of the script that was loaded.

checkLoadingScripts

checkLoadingScripts: function()

check if scripts have loaded.  In IE, scripts don’t seem to fire the onload event.  Safari also seems to have some problems.

loadConfig

loadConfig : function()

asynchronously load the application definition through the broker and config manager.

getConfigCB

getConfigCB : function(r)

the server has returned the application configuration file that contains enough information to bootstrap the application.

Parameter {Object} r an XMLHttpRequest object

serverSet

serverSet : function()

the server has returned the application configuration file that contains enough information to bootstrap the application.

Parameter {Object} r an XMLHttpRequest object

serverFailed

serverFailed: function(r)

the application failed to load the application configuration file.  Not much point in continuing, but we can inform the user why this happened.

Parameter: {Object} r

the XMLHttpRequest object

TODO: do something more useful in here?

ajaxRequest

ajaxRequest: function(scriptURL,
options)

convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.

Parameter: {String} scriptURL

the URL (relative to Fusion) to request

Parameter: {Object} options

optional parameters to send with the request, passed directly to Prototype’s Ajax.Request function

ajaxException

ajaxException: function(r,
e)

trap exceptions produced in handling an ajax response.

Parameter: {XmlHttpRequest} r

Parameter: {Exception} e

convertXML

Optionally convert XML to JSON using a server-side script for requests that aren’t available in JSON.

Parameter: {XmlHttpRequest} r

the XmlHttpRequest object

Parameter: json

boolean indicator if the content is JSON or not.

Parameter: callback

callback method to be executed on success and will be passed a parsed json object

getMapByName

getMapByName : function(name)

return a map widget with the given name

Parameter: {String} name

The map name to return

Returns: {Object} a map object or null if not found.

getMapById

getMapById : function(id)

return a map widget that is associated with the given dom element by id.

Parameter: {String} id

The map id to return

Returns: {Object} a map object or null if not found.

getMapByIndice

getMapByIndice : function(indice)

return the map widget at the given index

Parameter: {String} indice

The map indice to return

Returns: {Object} a map object or null if not found.

getWidgetById

getWidgetById: function(id)

return a reference to a widget by the id of the DOM Element that it was created in.

Parameter: {String} id

the DOM id to get the widget for

Returns: {Fusion.Widget} the widget or null

getApplicationURL

getApplicationURL: function()

returns the applicaiton’s absolute URL minus the filename.html part

_scriptName

{String} Relative path of this script.

_getScriptLocation

_getScriptLocation: function ()

Return the path to this script.

Returns

{String} Path to this script

initialize : function(options)
Initialize the Fusion application.
setLoadState: function(state)
set the current initialization state of the application.
loadQueuedScripts: function()
load any scripts that have been queued for loading.
queueScript : function(url)
Insert a new script into the loading queue.
scriptFailed: function(url)
Called when a script fails to load for some reason.
scriptLoaded: function(url)
a script has loaded.
checkLoadingScripts: function()
check if scripts have loaded.
loadConfig : function()
asynchronously load the application definition through the broker and config manager.
getConfigCB : function(r)
the server has returned the application configuration file that contains enough information to bootstrap the application.
serverSet : function()
the server has returned the application configuration file that contains enough information to bootstrap the application.
serverFailed: function(r)
the application failed to load the application configuration file.
ajaxRequest: function(scriptURL,
options)
convenience function to issue an XmlHttpRequest to the server relative to the Fusion installation.
ajaxException: function(r,
e)
trap exceptions produced in handling an ajax response.
getMapByName : function(name)
return a map widget with the given name
getMapById : function(id)
return a map widget that is associated with the given dom element by id.
getMapByIndice : function(indice)
return the map widget at the given index
getWidgetById: function(id)
return a reference to a widget by the id of the DOM Element that it was created in.
getApplicationURL: function()
returns the applicaiton’s absolute URL minus the filename.html part
_getScriptLocation: function ()
Return the path to this script.
A set of classes that implement the functionlity required for applications