Fusion

The main global object for Fusion applications.

Summary
The main global object for Fusion applications.
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 mapping 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 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.
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
an internal class for managing generic events.

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 mapping 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 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.
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

Functions

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.

serverSet

serverSet : function(r)

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

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

Fusion. Lib. EventMgr

an internal class for managing generic events.  Classes that wish to publish and trigger events that other objects can listen for need to inherit from Fusion.Lib.EventMgr.

To publish an event, call registerEventID with some unique numeric or string value.  Other objects can then call registerForEvent with the eventID and a function to call when the event is triggered.

To trigger an event, call triggerEvent with the eventID and any additional arguments that should be passed to listeners.

Functions

destroy

destroy: function()
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.
serverSet : function(r)
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
destroy: function()
A set of classes that implement the functionlity required for applications