Class MgServerConnectionBase
Base class of all MapGuide connection classes. Covers functionality encompassed by the MapGuide Geospatial Platform API and the MapGuide-specific services (Site, Rendering, Mapping, Tile, Drawing)
Inherited Members
Namespace: OSGeo.MapGuide.MaestroAPI
Assembly: OSGeo.MapGuide.MaestroAPI.dll
Syntax
public abstract class MgServerConnectionBase : PlatformConnectionBase
Constructors
| Improve this Doc View SourceMgServerConnectionBase()
Initializes a new instance of the MgServerConnectionBase class.
Declaration
protected MgServerConnectionBase()
Fields
| Improve this Doc View Source_canAutoRestartSession
Determines whether session auto-recover is possible
Declaration
protected bool _canAutoRestartSession
Field Value
Type | Description |
---|---|
System.Boolean |
m_autoRestartSession
A flag that indicates if a session will be automatically restarted
Declaration
protected bool m_autoRestartSession
Field Value
Type | Description |
---|---|
System.Boolean |
m_cachedGroupList
cached group list
Declaration
protected GroupList m_cachedGroupList
Field Value
Type | Description |
---|---|
GroupList |
m_cachedUserList
cached user list
Declaration
protected UserList m_cachedUserList
Field Value
Type | Description |
---|---|
UserList |
m_password
The password used to open this connection, if any
Declaration
protected string m_password
Field Value
Type | Description |
---|---|
System.String |
m_username
The username used to open this connection, if any
Declaration
protected string m_username
Field Value
Type | Description |
---|---|
System.String |
Properties
| Improve this Doc View SourceAutoRestartSession
Gets or sets a value indicating if the session should automatically be restarted if it expires
Declaration
public virtual bool AutoRestartSession { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCheckAndRaiseSessionChanged(String, String)
Raises the SessionIDChanged event if the old and new session ids do not match
Declaration
protected void CheckAndRaiseSessionChanged(string oldSessionId, string newSessionId)
Parameters
Type | Name | Description |
---|---|---|
System.String | oldSessionId | |
System.String | newSessionId |
DisableAutoSessionRecovery()
Indicates this connection cannot use session recovery, normally due to the fact the connection was initialized with just a session id.
Declaration
protected void DisableAutoSessionRecovery()
EnumerateGroups()
Gets a list of all groups on the server
Declaration
public abstract GroupList EnumerateGroups()
Returns
Type | Description |
---|---|
GroupList | The list of groups |
EnumerateUsers()
Gets a list of all users on the server
Declaration
public virtual UserList EnumerateUsers()
Returns
Type | Description |
---|---|
UserList | The list of users |
EnumerateUsers(String)
Gets a list of users in a group
Declaration
public abstract UserList EnumerateUsers(string group)
Parameters
Type | Name | Description |
---|---|---|
System.String | group | The group to retrieve the users from |
Returns
Type | Description |
---|---|
UserList | The list of users |
GetLegendImageStream(Double, String, Int32, Int32)
Renders a minature bitmap of the layers style
Declaration
public virtual Stream GetLegendImageStream(double scale, string layerdefinition, int themeIndex, int type)
Parameters
Type | Name | Description |
---|---|---|
System.Double | scale | The scale for the bitmap to match |
System.String | layerdefinition | The layer the image should represent |
System.Int32 | themeIndex | If the layer is themed, this gives the theme index, otherwise set to 0 |
System.Int32 | type | The geometry type, 1 for point, 2 for line, 3 for area, 4 for composite |
Returns
Type | Description |
---|---|
System.IO.Stream | The minature bitmap |
GetLegendImageStream(Double, String, Int32, Int32, Int32, Int32, String)
Gets the legend image.
Declaration
public abstract Stream GetLegendImageStream(double scale, string layerdefinition, int themeIndex, int type, int width, int height, string format)
Parameters
Type | Name | Description |
---|---|---|
System.Double | scale | The scale. |
System.String | layerdefinition | The layerdefinition. |
System.Int32 | themeIndex | Index of the theme. |
System.Int32 | type | The type. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.String | format | The format. |
Returns
Type | Description |
---|---|
System.IO.Stream |
GetSiteInfo()
Gets the site info.
Declaration
public abstract SiteInformation GetSiteInfo()
Returns
Type | Description |
---|---|
SiteInformation |
GetTile(String, String, Int32, Int32, Int32)
Gets the tile.
Declaration
public abstract Stream GetTile(string mapdefinition, string baselayergroup, int col, int row, int scaleindex)
Parameters
Type | Name | Description |
---|---|---|
System.String | mapdefinition | The mapdefinition. |
System.String | baselayergroup | The baselayergroup. |
System.Int32 | col | The col. |
System.Int32 | row | The row. |
System.Int32 | scaleindex | The scaleindex. |
Returns
Type | Description |
---|---|
System.IO.Stream |
IsSessionExpiredException(Exception)
Determines if an exception is a "Session Expired" exception.
Declaration
public abstract bool IsSessionExpiredException(Exception ex)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | ex | The exception to evaluate |
Returns
Type | Description |
---|---|
System.Boolean | True if the exception is a session expired exception |
QueryMapFeatures(RuntimeMap, Int32, String, Boolean, String, QueryMapOptions, Nullable<Int32>)
Identifies those features that meet the specified spatial selection criteria. This operation is used to implement server-side selection. In addition to a selection set, this operation returns attribute information in case only one feature is selected.
Declaration
public abstract string QueryMapFeatures(RuntimeMap rtMap, int maxFeatures, string wkt, bool persist, string selectionVariant, QueryMapOptions extraOptions, int? requestData)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | rtMap | The runtime map to identify features |
System.Int32 | maxFeatures | The maximum number of features to return |
System.String | wkt | The WKT of the filter geometry |
System.Boolean | persist | If true will update the selection set for the given map |
System.String | selectionVariant | The type of spatial operator to use for the spatial query |
QueryMapOptions | extraOptions | Extra querying options |
System.Nullable<System.Int32> | requestData | 1=Include attributes,2=Include Inline Selection,4=Tooltip Data,8=Include Hyperlink data |
Returns
Type | Description |
---|---|
System.String |
RenderDynamicOverlay(RuntimeMap, MapSelection, String)
Renders a dynamic overlay image of the map
Declaration
public Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | |
MapSelection | selection | |
System.String | format |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderDynamicOverlay(RuntimeMap, MapSelection, String, Boolean)
Renders a dynamic overlay image of the map
Declaration
public abstract Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, bool keepSelection)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | |
MapSelection | selection | |
System.String | format | |
System.Boolean | keepSelection |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderDynamicOverlay(RuntimeMap, MapSelection, String, Color, Int32)
Renders a dynamic overlay image of the map
Declaration
public abstract Stream RenderDynamicOverlay(RuntimeMap map, MapSelection selection, string format, Color selectionColor, int behaviour)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | |
MapSelection | selection | |
System.String | format | |
System.Drawing.Color | selectionColor | |
System.Int32 | behaviour |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Double, Int32, Int32, Int32)
Renders the runtime map.
Declaration
public virtual Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x1 | The x1. |
System.Double | y1 | The y1. |
System.Double | x2 | The x2. |
System.Double | y2 | The y2. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Double, Int32, Int32, Int32, String)
Renders the runtime map.
Declaration
public virtual Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x1 | The x1. |
System.Double | y1 | The y1. |
System.Double | x2 | The x2. |
System.Double | y2 | The y2. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
System.String | format | The format. |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Double, Int32, Int32, Int32, String, Boolean)
Renders the runtime map.
Declaration
public abstract Stream RenderRuntimeMap(RuntimeMap map, double x1, double y1, double x2, double y2, int width, int height, int dpi, string format, bool clip)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x1 | The x1. |
System.Double | y1 | The y1. |
System.Double | x2 | The x2. |
System.Double | y2 | The y2. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
System.String | format | The format. |
System.Boolean | clip | if set to |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Int32, Int32, Int32)
Renders the runtime map.
Declaration
public virtual Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x | The x. |
System.Double | y | The y. |
System.Double | scale | The scale. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Int32, Int32, Int32, String)
Renders the runtime map.
Declaration
public virtual Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x | The x. |
System.Double | y | The y. |
System.Double | scale | The scale. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
System.String | format | The format. |
Returns
Type | Description |
---|---|
System.IO.Stream |
RenderRuntimeMap(RuntimeMap, Double, Double, Double, Int32, Int32, Int32, String, Boolean)
Renders the runtime map.
Declaration
public abstract Stream RenderRuntimeMap(RuntimeMap map, double x, double y, double scale, int width, int height, int dpi, string format, bool clip)
Parameters
Type | Name | Description |
---|---|---|
RuntimeMap | map | The runtime map instance. |
System.Double | x | The x. |
System.Double | y | The y. |
System.Double | scale | The scale. |
System.Int32 | width | The width. |
System.Int32 | height | The height. |
System.Int32 | dpi | The dpi. |
System.String | format | The format. |
System.Boolean | clip | if set to |
Returns
Type | Description |
---|---|
System.IO.Stream |
RestartSession()
Restarts the server session, and creates a new session ID
Declaration
public void RestartSession()
RestartSession(Boolean)
Restarts the server session, and creates a new session ID
Declaration
public bool RestartSession(bool throwException)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | throwException | If set to true, the call throws an exception if the call failed |
Returns
Type | Description |
---|---|
System.Boolean | True if the creation succeed, false otherwise |
RestartSessionInternal(Boolean)
Attempts to create a new session
Declaration
protected abstract bool RestartSessionInternal(bool throwException)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | throwException |
Returns
Type | Description |
---|---|
System.Boolean |
Events
| Improve this Doc View SourceSessionIDChanged
Raised when the associated session id has changed. This would happen if the connection detected an expired session and built a new session
Declaration
public event EventHandler SessionIDChanged
Event Type
Type | Description |
---|---|
System.EventHandler |