# Fusion.Lib.ApplicationDefinition

Utility class to parse an application definition

Summary

Fusion.Lib.ApplicationDefinition | Utility class to parse an application definition
Properties |
mapGroups | array of map groups, parsed from ApplicationDefinition.
widgetSets | array of widget sets (each one corresponding to a map) parsed from the ApplicationDefinition.
{Object} oBroker | A Broker object that can communicate with a MapGuide instance in the case we are running against a MapGuide server
{Array} searchDefinitions | An array of search definitions
{Array} searchCategories | An array of search categories
Functions |
ApplicationDefinition | construct a new instance of the ApplicationDefinition object.
parse | start parsing the ApplicationDefinition file.
parseAppDef | parse the ApplicationDefinition file into the appropriate Fusion objects
create | Create the application definition.
getMapByName | return a map widget with the given name
getMapById | return a map widget with the given id
getMapByIndice | return the map widget at the given index
getMapGroup | return the specified map group from the application definition
Fusion.Lib.ApplicationDefinition.MapGroup | Holds an internal representation of MapGroup objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.Map | Holds an internal representation of Map objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.WidgetSet | Holds an internal representation of WidgetSet objects as defined in the AppDef
Functions |
addWidgetInstance | keep track of live widgets created in this widgetSet
getMapWidget | return the map widget for this widget set
create | create all the things required by this widgetSet, including containers and widgets.
getMapByName | return the map widget from this widget set if the map’s name matches the requested name, or null.
Fusion.Lib.ApplicationDefinition.Container | Holds an internal representation of Container objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.Widget | Holds an internal representation of Widget objects as defined in the AppDef
Functions |
create | creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers
Fusion.Lib.ApplicationDefinition.Item | Holds an internal representation of Menu Item objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.Flyout | Holds an internal representation of Flyout objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.Multi | Holds an internal representation of Multi objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.SearchDefinition | Holds an internal representation of SearchDefinition objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.SearchJoin | Holds an internal representation of SearchJoin objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.SearchRule | Holds an internal representation of SearchRule objects as defined in the AppDef
Fusion.Lib.ApplicationDefinition.SearchCondition | Holds an internal representation of SearchCondition objects as defined in the AppDef

### Properties

### mapGroups

array of map groups, parsed from ApplicationDefinition. A MapGroup consists of one or more Maps that can be combined into the same OpenLayers Map object

### widgetSets

array of widget sets (each one corresponding to a map) parsed from the ApplicationDefinition.

### {Object} oBroker

A Broker object that can communicate with a MapGuide instance in the case we are running against a MapGuide server

### {Array} searchDefinitions

An array of search definitions

### {Array} searchCategories

An array of search categories

### Functions

### ApplicationDefinition

construct a new instance of the ApplicationDefinition object. While not enforced, this is intended to be a singleton.

Parameter: sessionId

an optional session id to initialize the application with, passed to the map widgets when they are created.

### parse

> parse : function()

start parsing the ApplicationDefinition file. This happens asynchronously since the ApplicationDefinition has to be retrieved from the server or the MapGuide repository. When parsing is complete, an APPLICATIONDEFINITION_PARSED event will be emitted. This function returns true if parsing will start, false if it will not (due to a missing application definition for instance).

### parseAppDef

> parseAppDef: function( | json | )

parse the ApplicationDefinition file into the appropriate Fusion objects

Parameter: {XmlHttpRequest} xhr

the XmlHttpRequest object

### create

> create: function()

Create the application definition. This actually triggers initializing every widget and container.

### 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 with the given id

Parameter: {String} id

The map id to return. ID is distinct from map.name in that id is the id of the HTML tag where the map widget is inserted.

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.

### getMapGroup

> getMapGroup : function( | mapGroupId | )

return the specified map group from the application definition

Parameter: {String} mapgroup

The id of the MapGroup to return

Returns: {Object} a MapGroup appdef or null if not found.

## Fusion.Lib.ApplicationDefinition.MapGroup

Holds an internal representation of MapGroup objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.Map

Holds an internal representation of Map objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.WidgetSet

Holds an internal representation of WidgetSet objects as defined in the AppDef

Summary

Functions |
addWidgetInstance | keep track of live widgets created in this widgetSet
getMapWidget | return the map widget for this widget set
create | create all the things required by this widgetSet, including containers and widgets.
getMapByName | return the map widget from this widget set if the map’s name matches the requested name, or null.

### Functions

### addWidgetInstance

> addWidgetInstance: function( | widget | )

keep track of live widgets created in this widgetSet

Parameter: {Fusion.Widget} widget

the widget to add

### getMapWidget

> getMapWidget: function()

return the map widget for this widget set

Returns: {<Fusion.Lib.Map>} a map widget or null

### create

> create: function( | appDef | )

create all the things required by this widgetSet, including containers and widgets.

Parameter: {Fusion.Lib.ApplicationDefinition}

the application definition that this widgetSet is part of

### getMapByName

> getMapByName : function( | name | )

return the map widget from this widget set if the map’s name matches the requested name, or null.

Parameter: {String} name

The map name to check

Returns: {Object} a map object or null.

## Fusion.Lib.ApplicationDefinition.Container

Holds an internal representation of Container objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.Widget

Holds an internal representation of Widget objects as defined in the AppDef

Summary

Functions |
create | creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers

### Functions

### create

> create: function( | widgetSet,
> | widgetName | )

creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers

Parameter: name

An optional name to use for the widget, overrides the original name temporarily if passed.

Returns: an instance of the widget represented by this object.

## Fusion.Lib.ApplicationDefinition.Item

Holds an internal representation of Menu Item objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.Flyout

Holds an internal representation of Flyout objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.Multi

Holds an internal representation of Multi objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.SearchDefinition

Holds an internal representation of SearchDefinition objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.SearchJoin

Holds an internal representation of SearchJoin objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.SearchRule

Holds an internal representation of SearchRule objects as defined in the AppDef

## Fusion.Lib.ApplicationDefinition.SearchCondition

Holds an internal representation of SearchCondition objects as defined in the AppDef

> parse : function()

start parsing the ApplicationDefinition file.

> parseAppDef: function( | json | )

parse the ApplicationDefinition file into the appropriate Fusion objects

> create: function()

Create the application definition.

> getMapByName : function( | name | )

return a map widget with the given name

> getMapById : function( | id | )

return a map widget with the given id

> getMapByIndice : function( | indice | )

return the map widget at the given index

> getMapGroup : function( | mapGroupId | )

return the specified map group from the application definition

> addWidgetInstance: function( | widget | )

keep track of live widgets created in this widgetSet

> getMapWidget: function()

return the map widget for this widget set

> create: function( | appDef | )

create all the things required by this widgetSet, including containers and widgets.

> getMapByName : function( | name | )

return the map widget from this widget set if the map’s name matches the requested name, or null.

> create: function( | widgetSet,
> | widgetName | )

creates a new instance of the widget, optionally using a different name during instantiation to accomodate containers
This is the base class for all widgets.
Utility class to parse an application definition
Close