Fusion.Lib.MGBroker

MGBroker is used to broker requests to the MapGuide Open Source mapagent interface.  It is a very simple class that is configured with a URL and credentials via the Fusion.Lib.MGBroker.setSiteURL method and can send requests to the server via the Fusion.Lib.MGBroker.dispatchRequest method.

Summary
Fusion.Lib.MGBrokerMGBroker is used to broker requests to the MapGuide Open Source mapagent interface.
Functions
dispatchRequestsend a request to the MapGuide Open Source server using XMLHttpRequest and return the result to the specified function.
setSiteURLset up a connection to a MapGuide Open Source site.
clearSiteURLremove all authentication information from the broker
Fusion.Lib.MGRequestMGRequest is the base class for all broker-compatible requests.
Functions
setParamsset the parameters associated with this request.
setOptionsset the options associated with this request
encodereturns a string containing all the request parameters in URL form suitable for appending to a URL.
Fusion.Lib.MGRequest.MGEnumerateResourcesencapsulate a request to the server to enumerate resources in the library.
Functions
Fusion.Lib.MGRequest.MGEnumerateResourcesinitialize a new instance of MGEnumerateResources
Fusion.Lib.MGRequest.MGGetResourceContentencapsulate a request to the server to get resource contents from the library.
Functions
Fusion.Lib.MGRequest.MGGetResourceContentinitialize a new instance of Fusion.Lib.MGRequest.MGGetResourceContent
Fusion.Lib.MGRequest.MGGetResourceHeaderencapsulate a request to the server to get resource header from the library.
Functions
Fusion.Lib.MGRequest.MGGetResourceHeaderinitialize a new instance of Fusion.Lib.MGRequest.MGGetResourceHeader
Fusion.Lib.MGRequest.MGCreateSessionencapsulate a request to the server to create a new session on the server.
Functions
Fusion.Lib.MGRequest.MGCreateSessioninitialize a new instance of Fusion.Lib.MGRequest.MGCreateSession
Fusion.Lib.MGRequest.MGCreateRuntimeMapencapsulate a request to the server to create a new runtime map (and session if required) on the server
Functions
Fusion.Lib.MGRequest.MGCreateRuntimeMapinitialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap
Fusion.Lib.MGRequest.MGDescribeRuntimeMapencapsulate a request to the server to create a new runtime map (and session if required) on the server
Functions
Fusion.Lib.MGRequest.MGCreateRuntimeMapinitialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap
Fusion.Lib.MGRequest.MGCopyResourceencapsulate a request to the server to copy a resource.
Functions
Fusion.Lib.MGRequest.MGCopyResourceinitialize a new instance of Fusion.Lib.MGRequest.MGCopyResource
Fusion.Lib.MGRequest.MGDeleteResourceencapsulate a request to the server to delete a resource.
Functions
Fusion.Lib.MGRequest.MGDeleteResourceinitialize a new instance of Fusion.Lib.MGRequest.MGDeleteResource
Fusion.Lib.MGRequest.MGMoveResourceencapsulate a request to the server to move a resource in the repository.
Functions
Fusion.Lib.MGRequest.MGMoveResourceinitialize a new instance of Fusion.Lib.MGRequest.MGMoveResource
Fusion.Lib.MGRequest.MGMoveResourceencapsulate a request to the server to set the content XML of a resource.
Functions
Fusion.Lib.MGRequest.MGMoveResourceinitialize a new instance of Fusion.Lib.MGRequest.MGMoveResource
Fusion.Lib.MGRequest.MGDescribeSchemaencapsulate a request to the server to describe the schema of a FeatureSource.
Functions
Fusion.Lib.MGRequest.MGDescribeSchemainitialize a new instance of Fusion.Lib.MGRequest.MGDescribeSchema
Fusion.Lib.MGRequest.MGGetSpatialContextsencapsulate a request to the server to retrieve the spatial context of a resource.
Functions
Fusion.Lib.MGRequest.MGGetSpatialContextsinitialize a new instance of Fusion.Lib.MGRequest.MGGetSpatialContexts
Fusion.Lib.MGRequest.MGEnumerateResourceReferencesencapsulate a request to the server to enumerate the references to a resource id.
Functions
Fusion.Lib.MGRequest.MGEnumerateResourceReferencesinitialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceReferences
Fusion.Lib.MGRequest.MGEnumerateResourceDataencapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.
Functions
Fusion.Lib.MGRequest.MGEnumerateResourceDatainitialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceData
Fusion.Lib.MGRequest.MGGetVisibleMapExtentEncapsulate a request to the server to get the visible map extent
Functions
Fusion.Lib.MGRequest.MGGetVisibleMapExtentinitialize a new instance of Fusion.Lib.MGRequest.MGGetVisibleMapExtent
Fusion.Lib.MGRequest.MGQueryMapFeaturesencapsulate a request to the server to query map features on selectable layers
Functions
Fusion.Lib.MGRequest.MGQueryMapFeaturesinitialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures
Fusion.Lib.MGRequest.MGQueryMapFeatures2encapsulate a request to the server to query map features on selectable layers
Functions
Fusion.Lib.MGRequest.MGQueryMapFeatures2initialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures2
Fusion.Lib.MGRequest.MGGetFeatureSetEnvelopeencapsulate a request to the server to query map features on selectable layers
Functions
Fusion.Lib.MGRequest.MGGetFeatureSetEnvelopeinitialize a new instance of Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope

Functions

dispatchRequest

dispatchRequest : function(r,
f)

send a request to the MapGuide Open Source server using XMLHttpRequest and return the result to the specified function.

Parameters

r{Object} an Fusion.Lib.MGRequest-subclass instance that defines the operation to request.
f{Function} a function object to invoke when the XMLHttpRequest call completes

setSiteURL

setSiteURL : function(url,
user,
pass)

set up a connection to a MapGuide Open Source site.  This function expects that url is in the form http(s)://<address>/path-to-mapguide.  Path-to-mapguide is should be the base URL to a MapGuide Open Source install.  It is expected that the mapagent is in the expected place (mapagent/mapagent.fcgi) under that URL.  If (for some strange reason) its not, then you can include the full path to mapagent.fcgi in the URL and this function won’t try to guess its location.  The user name and password are passed on using basic HTML authentication (http://<user>:<pass>@<server>/path-to-mapguide).

Parameters

url{String} a properly formatted universal reverse locator to a MapGuide Open Source installation.
user{String} a valid user name
pass{String} the password for the given user.

clearSiteURL

clearSiteURL: function()

remove all authentication information from the broker

Fusion.Lib.MGRequest

MGRequest is the base class for all broker-compatible requests.  A request is a wrapper around an operation that is supported by the mapagent.

Summary
Functions
setParamsset the parameters associated with this request.
setOptionsset the options associated with this request
encodereturns a string containing all the request parameters in URL form suitable for appending to a URL.

Functions

setParams

setParams : function(o)

set the parameters associated with this request.  Parameters are dependent on the specific MGRequest subclass except for two mandatory parameters, version and locale, that are provided by this base class.

Parameters

o{Object} an object that contains named key : value pairs representing parameters to a request

setOptions

setOptions : function(o)

set the options associated with this request

Parameters

o{Object} an object that contains named key : value pairs representing for a request

encode

encode : function()

returns a string containing all the request parameters in URL form suitable for appending to a URL.

Return

{String} the parameters in URL form.

Fusion.Lib.MGRequest.MGEnumerateResources

encapsulate a request to the server to enumerate resources in the library.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGEnumerateResourcesinitialize a new instance of MGEnumerateResources

Functions

Fusion.Lib.MGRequest.MGEnumerateResources

initialize a new instance of MGEnumerateResources

Parameters

resourceID{String} optional parameter indicating the resource to enumerate.  If not set or null, it defaults to “Library://” which is the root of the library.
type{String} optional parameter indicating the type of resources to enumerate.  If not set, it will default to an empty string which indicates all types will be returned.
depth{Integer} optional parameter that controls the depth of the resource tree to enumerate.  If not set, it will default to -1 which means the tree will be fully enumerated.

Fusion.Lib.MGRequest.MGGetResourceContent

encapsulate a request to the server to get resource contents from the library.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGGetResourceContentinitialize a new instance of Fusion.Lib.MGRequest.MGGetResourceContent

Functions

Fusion.Lib.MGRequest.MGGetResourceContent

initialize a new instance of Fusion.Lib.MGRequest.MGGetResourceContent

Parameters

resourceID{String} optional parameter indicating the resource to enumerate.  If not set or null, it defaults to “Library://” which is the root of the library.

Fusion.Lib.MGRequest.MGGetResourceHeader

encapsulate a request to the server to get resource header from the library.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGGetResourceHeaderinitialize a new instance of Fusion.Lib.MGRequest.MGGetResourceHeader

Functions

Fusion.Lib.MGRequest.MGGetResourceHeader

initialize a new instance of Fusion.Lib.MGRequest.MGGetResourceHeader

Parameters

resourceID{String} optional parameter indicating the resource to enumerate.  If not set or null, it defaults to “Library://” which is the root of the library.

Fusion.Lib.MGRequest.MGCreateSession

encapsulate a request to the server to create a new session on the server.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGCreateSessioninitialize a new instance of Fusion.Lib.MGRequest.MGCreateSession

Functions

Fusion.Lib.MGRequest.MGCreateSession

initialize a new instance of Fusion.Lib.MGRequest.MGCreateSession

Fusion.Lib.MGRequest.MGCreateRuntimeMap

encapsulate a request to the server to create a new runtime map (and session if required) on the server

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGCreateRuntimeMapinitialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap

Functions

Fusion.Lib.MGRequest.MGCreateRuntimeMap

initialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap

Fusion.Lib.MGRequest.MGDescribeRuntimeMap

encapsulate a request to the server to create a new runtime map (and session if required) on the server

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGCreateRuntimeMapinitialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap

Functions

Fusion.Lib.MGRequest.MGCreateRuntimeMap

initialize a new instance of Fusion.Lib.MGRequest.MGCreateRuntimeMap

Fusion.Lib.MGRequest.MGCopyResource

encapsulate a request to the server to copy a resource.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGCopyResourceinitialize a new instance of Fusion.Lib.MGRequest.MGCopyResource

Functions

Fusion.Lib.MGRequest.MGCopyResource

initialize a new instance of Fusion.Lib.MGRequest.MGCopyResource

Parameters

sourceID{String} the Resource ID of the source
destinationID{String} the Resource ID of the destination
overwrite{Boolean} overwrite the destination if it exists

Fusion.Lib.MGRequest.MGDeleteResource

encapsulate a request to the server to delete a resource.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGDeleteResourceinitialize a new instance of Fusion.Lib.MGRequest.MGDeleteResource

Functions

Fusion.Lib.MGRequest.MGDeleteResource

initialize a new instance of Fusion.Lib.MGRequest.MGDeleteResource

Parameters

resourceID{String} the id of the resource to delete

Fusion.Lib.MGRequest.MGMoveResource

encapsulate a request to the server to move a resource in the repository.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGMoveResourceinitialize a new instance of Fusion.Lib.MGRequest.MGMoveResource

Functions

Fusion.Lib.MGRequest.MGMoveResource

initialize a new instance of Fusion.Lib.MGRequest.MGMoveResource

Parameters

sourceID{String} the Resource ID of the source
destinationID{String} the Resource ID of the destination
overwrite{Boolean} overwrite the destination if it exists

Fusion.Lib.MGRequest.MGMoveResource

encapsulate a request to the server to set the content XML of a resource.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGMoveResourceinitialize a new instance of Fusion.Lib.MGRequest.MGMoveResource

Functions

Fusion.Lib.MGRequest.MGMoveResource

initialize a new instance of Fusion.Lib.MGRequest.MGMoveResource

Fusion.Lib.MGRequest.MGDescribeSchema

encapsulate a request to the server to describe the schema of a FeatureSource.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGDescribeSchemainitialize a new instance of Fusion.Lib.MGRequest.MGDescribeSchema

Functions

Fusion.Lib.MGRequest.MGDescribeSchema

initialize a new instance of Fusion.Lib.MGRequest.MGDescribeSchema

Parameters

resourceID{String} the id of the resource to describe the schema for
schema{String} what does this do?

Fusion.Lib.MGRequest.MGGetSpatialContexts

encapsulate a request to the server to retrieve the spatial context of a resource.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGGetSpatialContextsinitialize a new instance of Fusion.Lib.MGRequest.MGGetSpatialContexts

Functions

Fusion.Lib.MGRequest.MGGetSpatialContexts

initialize a new instance of Fusion.Lib.MGRequest.MGGetSpatialContexts

Parameters

resourceID{String} the id of the resource to retrieve the spatial context for
activeonly{Boolean} what does this do?

Fusion.Lib.MGRequest.MGEnumerateResourceReferences

encapsulate a request to the server to enumerate the references to a resource id.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGEnumerateResourceReferencesinitialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceReferences

Functions

Fusion.Lib.MGRequest.MGEnumerateResourceReferences

initialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceReferences

Parameters

resourceID{String} the id of the resource to retrieve the spatial context for

Fusion.Lib.MGRequest.MGEnumerateResourceData

encapsulate a request to the server to enumerate the data associated with a FeatureSource N.B.  This does not enumerate resource data for ‘unmanaged’ FeatureSources (those referencing files or directories outside the respository) Fusion.Lib.MGRequest.MGDescribeSchema should be used for those sources.

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGEnumerateResourceDatainitialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceData

Functions

Fusion.Lib.MGRequest.MGEnumerateResourceData

initialize a new instance of Fusion.Lib.MGRequest.MGEnumerateResourceData

Parameters

resourceID{String} the id of the FeatureSource to retrieve data for

Fusion.Lib.MGRequest.MGGetVisibleMapExtent

Encapsulate a request to the server to get the visible map extent

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGGetVisibleMapExtentinitialize a new instance of Fusion.Lib.MGRequest.MGGetVisibleMapExtent

Functions

Fusion.Lib.MGRequest.MGGetVisibleMapExtent

initialize a new instance of Fusion.Lib.MGRequest.MGGetVisibleMapExtent

Parameters

sessionId{String} the id of the session to restore
mapName{String} the name of the map
viewCenterX{String} the horizontal center of the view
viewCenterY{String} the vertical center of the view
viewScale{String} the scale of the map
dataExtent{String} the extent of the data
displayDpi{String} the DPI of the display
displayWidth{String} the width of the map
displayHeight{String} the height of the map
showLayers{String} a list of layer names to show
hideLayers{String} a list of layer names to hide
showGroups{String} a list of group names to show
hideGroups{String} a list of groupnames to hide
refreshLayers{String} a list of layers that need to be refreshed

Fusion.Lib.MGRequest.MGQueryMapFeatures

encapsulate a request to the server to query map features on selectable layers

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGQueryMapFeaturesinitialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures

Functions

Fusion.Lib.MGRequest.MGQueryMapFeatures

initialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures

Parameters

sessionId{String} the id of the session to restore
mapName{String} the id of the session to restore geometry (sting wkt} gemetry to use for selection.  Example : POLYGON(x1 y1, x2,y2)
maxFeatures{integer} number of maximum results (-1 to indicate no maximum)
selectionPersist{boolean} save the selection (valid values are 0 and 1)
selectionVariant{String} indicates the spatial operation.  Valid values are ‘INTERSECTS’, ...
featureFilter{String} filter crieteria to be applied for selection.
layerNames{String} comma separated list of layer names to include in the query
layerAttributeFilter{integer} bitmask determining layer selection behaviour (1=visible layers, 2=selectable layers, 4=layers with tooltips)

Fusion.Lib.MGRequest.MGQueryMapFeatures2

encapsulate a request to the server to query map features on selectable layers

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGQueryMapFeatures2initialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures2

Functions

Fusion.Lib.MGRequest.MGQueryMapFeatures2

initialize a new instance of Fusion.Lib.MGRequest.MGQueryMapFeatures2

Parameters

sessionId{String} the id of the session to restore
mapName{String} the id of the session to restore geometry (sting wkt} gemetry to use for selection.  Example : POLYGON(x1 y1, x2,y2)
maxFeatures{integer} number of maximum results (-1 to indicate no maximum)
selectionPersist{boolean} save the selection (valid values are 0 and 1)
selectionVariant{String} indicates the spatial operation.  Valid values are ‘INTERSECTS’, ...
featureFilter{String} filter crieteria to be applied for selection.
layerNames{String} comma separated list of layer names to include in the query
layerAttributeFilter{integer} bitmask determining layer selection behaviour (1=visible layers, 2=selectable layers, 4=layers with tooltips)
requestData{integer} a bitmask of the desired information to return (Attributes = 1 InlineSelection?  = 2 Tooltip = 4 Hyperlink = 8)
selectionColor{String} the html color for the inline selection image (if requested)
selectionFormat{String} the format of the inline selection image (if requested)

Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope

encapsulate a request to the server to query map features on selectable layers

Inherits from

Summary
Functions
Fusion.Lib.MGRequest.MGGetFeatureSetEnvelopeinitialize a new instance of Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope

Functions

Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope

initialize a new instance of Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope

Parameters

sessionId{String} the id of the session to restore
mapName{String} the id of the session to restore
features(String XML} a feature set selection XML
dispatchRequest : function(r,
f)
send a request to the MapGuide Open Source server using XMLHttpRequest and return the result to the specified function.
setSiteURL : function(url,
user,
pass)
set up a connection to a MapGuide Open Source site.
clearSiteURL: function()
remove all authentication information from the broker
setParams : function(o)
set the parameters associated with this request.
setOptions : function(o)
set the options associated with this request
encode : function()
returns a string containing all the request parameters in URL form suitable for appending to a URL.
MGRequest is the base class for all broker-compatible requests.
encapsulate a request to the server to describe the schema of a FeatureSource.
Close