[mapguide-commits] r5604 - in sandbox/maestro-3.0: Maestro.Base
Maestro.Base/Commands Maestro.Base/Properties Maestro.Editors
Maestro.Editors/Diagnostics OSGeo.MapGuide.MaestroAPI
OSGeo.MapGuide.MaestroAPI/Commands OSGeo.MapGuide.MaestroAPI.Http
OSGeo.MapGuide.MaestroAPI.Http/Commands
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Mar 8 02:55:20 EST 2011
Author: jng
Date: 2011-03-07 23:55:20 -0800 (Mon, 07 Mar 2011)
New Revision: 5604
Added:
sandbox/maestro-3.0/Maestro.Base/Commands/CacheViewerCommand.cs
sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.Designer.cs
sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.cs
sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.resx
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/IGetFdoCacheInfo.cs
Modified:
sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin
sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj
sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs
sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx
sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/OSGeo.MapGuide.MaestroAPI.Http.csproj
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/CommandType.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
Log:
#1618: Implement FDO Connection cache viewer. Currently the output is the raw XML which is sufficient for now.
Added: sandbox/maestro-3.0/Maestro.Base/Commands/CacheViewerCommand.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Commands/CacheViewerCommand.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Base/Commands/CacheViewerCommand.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,49 @@
+#region Disclaimer / License
+// Copyright (C) 2011, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ICSharpCode.Core;
+using Maestro.Base.Services;
+using Maestro.Editors.Diagnostics;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+
+namespace Maestro.Base.Commands
+{
+ public class CacheViewerCommand : AbstractMenuCommand
+ {
+ public override void Run()
+ {
+ try
+ {
+ var wb = Workbench.Instance;
+ var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
+ var conn = mgr.GetConnection(wb.ActiveSiteExplorer.ConnectionName);
+
+ var diag = new FdoCacheViewer((IGetFdoCacheInfo)conn.CreateCommand((int)CommandType.GetFdoCacheInfo));
+ diag.Show();
+ }
+ catch (Exception ex)
+ {
+ MessageService.ShowError(ex.Message);
+ }
+ }
+ }
+}
Modified: sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/Maestro.Base/Maestro.Base.addin 2011-03-08 07:55:20 UTC (rev 5604)
@@ -190,6 +190,9 @@
<MenuItem id="ServerMonitor"
label="${res:ServerMonitor}"
class="Maestro.Base.Commands.ServerMonitorCommand"/>
+ <MenuItem id="CacheView"
+ label="${res:CacheView}"
+ class="Maestro.Base.Commands.CacheViewerCommand"/>
<MenuItem type="Separator" />
<MenuItem id="Menu_Tools_Options"
label="${res:Menu_Tools_Options}"
Modified: sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/Maestro.Base/Maestro.Base.csproj 2011-03-08 07:55:20 UTC (rev 5604)
@@ -67,6 +67,7 @@
<Link>GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Commands\AboutCommand.cs" />
+ <Compile Include="Commands\CacheViewerCommand.cs" />
<Compile Include="Commands\CloseActiveDocumentCommand.cs" />
<Compile Include="Commands\CloseAllDocumentsCommand.cs" />
<Compile Include="Commands\Conditions\ActiveEditorConditionEvaluator.cs" />
Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.Designer.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -259,6 +259,15 @@
}
}
+ /// <summary>
+ /// Looks up a localized string similar to View Feature Source Cache.
+ /// </summary>
+ internal static string CacheView {
+ get {
+ return ResourceManager.GetString("CacheView", resourceCulture);
+ }
+ }
+
internal static System.Drawing.Bitmap clipboard_paste {
get {
object obj = ResourceManager.GetObject("clipboard_paste", resourceCulture);
Modified: sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/Maestro.Base/Properties/Resources.resx 2011-03-08 07:55:20 UTC (rev 5604)
@@ -832,4 +832,7 @@
<data name="ConfirmBaseMapInvalidationLayerSave" xml:space="preserve">
<value>This layer is used as a tiled layer in the following maps: {0} Saving this layer may reset the cached tiles of these maps. Continue with save?</value>
</data>
+ <data name="CacheView" xml:space="preserve">
+ <value>View Feature Source Cache</value>
+ </data>
</root>
\ No newline at end of file
Added: sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.Designer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.Designer.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.Designer.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,85 @@
+namespace Maestro.Editors.Diagnostics
+{
+ partial class FdoCacheViewer
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FdoCacheViewer));
+ this.btnClose = new System.Windows.Forms.Button();
+ this.chkAutoRefresh = new System.Windows.Forms.CheckBox();
+ this.tmRefresh = new System.Windows.Forms.Timer(this.components);
+ this.txtXml = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // btnClose
+ //
+ resources.ApplyResources(this.btnClose, "btnClose");
+ this.btnClose.Name = "btnClose";
+ this.btnClose.UseVisualStyleBackColor = true;
+ this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
+ //
+ // chkAutoRefresh
+ //
+ resources.ApplyResources(this.chkAutoRefresh, "chkAutoRefresh");
+ this.chkAutoRefresh.Name = "chkAutoRefresh";
+ this.chkAutoRefresh.UseVisualStyleBackColor = true;
+ this.chkAutoRefresh.CheckedChanged += new System.EventHandler(this.chkAutoRefresh_CheckedChanged);
+ //
+ // tmRefresh
+ //
+ this.tmRefresh.Interval = 5000;
+ this.tmRefresh.Tick += new System.EventHandler(this.tmRefresh_Tick);
+ //
+ // txtXml
+ //
+ resources.ApplyResources(this.txtXml, "txtXml");
+ this.txtXml.Name = "txtXml";
+ this.txtXml.ReadOnly = true;
+ //
+ // FdoCacheViewer
+ //
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ resources.ApplyResources(this, "$this");
+ this.ControlBox = false;
+ this.Controls.Add(this.txtXml);
+ this.Controls.Add(this.chkAutoRefresh);
+ this.Controls.Add(this.btnClose);
+ this.Name = "FdoCacheViewer";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Button btnClose;
+ private System.Windows.Forms.CheckBox chkAutoRefresh;
+ private System.Windows.Forms.Timer tmRefresh;
+ private System.Windows.Forms.TextBox txtXml;
+ }
+}
\ No newline at end of file
Added: sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.cs (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,67 @@
+#region Disclaimer / License
+// Copyright (C) 2011, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+using System.IO;
+
+namespace Maestro.Editors.Diagnostics
+{
+ public partial class FdoCacheViewer : Form
+ {
+ private IGetFdoCacheInfo _cmd;
+
+ public FdoCacheViewer(IGetFdoCacheInfo cache)
+ {
+ InitializeComponent();
+ _cmd = cache;
+ txtXml.Text = ToXml(_cmd.Execute());
+ }
+
+ private string ToXml(FdoCacheInfo fdoCacheInfo)
+ {
+ using (var ms = new MemoryStream())
+ {
+ FdoCacheInfo.Serializer.Serialize(ms, fdoCacheInfo);
+ return Encoding.UTF8.GetString(ms.GetBuffer());
+ }
+ }
+
+ private void btnClose_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ private void chkAutoRefresh_CheckedChanged(object sender, EventArgs e)
+ {
+ tmRefresh.Enabled = chkAutoRefresh.Checked;
+ }
+
+ private void tmRefresh_Tick(object sender, EventArgs e)
+ {
+ txtXml.Text = ToXml(_cmd.Execute());
+ }
+ }
+}
Added: sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.resx
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.resx (rev 0)
+++ sandbox/maestro-3.0/Maestro.Editors/Diagnostics/FdoCacheViewer.resx 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnClose.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
+ <value>581, 449</value>
+ </data>
+ <data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="btnClose.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="btnClose.Text" xml:space="preserve">
+ <value>Close</value>
+ </data>
+ <data name=">>btnClose.Name" xml:space="preserve">
+ <value>btnClose</value>
+ </data>
+ <data name=">>btnClose.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnClose.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnClose.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
+ <data name="chkAutoRefresh.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Left</value>
+ </data>
+ <data name="chkAutoRefresh.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="chkAutoRefresh.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 453</value>
+ </data>
+ <data name="chkAutoRefresh.Size" type="System.Drawing.Size, System.Drawing">
+ <value>151, 17</value>
+ </data>
+ <data name="chkAutoRefresh.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name="chkAutoRefresh.Text" xml:space="preserve">
+ <value>Auto-Refresh every 5 secs</value>
+ </data>
+ <data name=">>chkAutoRefresh.Name" xml:space="preserve">
+ <value>chkAutoRefresh</value>
+ </data>
+ <data name=">>chkAutoRefresh.Type" xml:space="preserve">
+ <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>chkAutoRefresh.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>chkAutoRefresh.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <metadata name="tmRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+ <value>17, 17</value>
+ </metadata>
+ <data name="txtXml.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Bottom, Left, Right</value>
+ </data>
+ <data name="txtXml.Font" type="System.Drawing.Font, System.Drawing">
+ <value>Courier New, 9.75pt</value>
+ </data>
+ <data name="txtXml.Location" type="System.Drawing.Point, System.Drawing">
+ <value>13, 13</value>
+ </data>
+ <data name="txtXml.Multiline" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <data name="txtXml.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
+ <value>Vertical</value>
+ </data>
+ <data name="txtXml.Size" type="System.Drawing.Size, System.Drawing">
+ <value>643, 430</value>
+ </data>
+ <data name="txtXml.TabIndex" type="System.Int32, mscorlib">
+ <value>3</value>
+ </data>
+ <data name=">>txtXml.Name" xml:space="preserve">
+ <value>txtXml</value>
+ </data>
+ <data name=">>txtXml.Type" xml:space="preserve">
+ <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>txtXml.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>txtXml.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>668, 484</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>Feature Source Cache Information</value>
+ </data>
+ <data name=">>tmRefresh.Name" xml:space="preserve">
+ <value>tmRefresh</value>
+ </data>
+ <data name=">>tmRefresh.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Timer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>FdoCacheViewer</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/Maestro.Editors/Maestro.Editors.csproj 2011-03-08 07:55:20 UTC (rev 5604)
@@ -107,6 +107,12 @@
<Compile Include="Common\UnmanagedFileBrowser.Designer.cs">
<DependentUpon>UnmanagedFileBrowser.cs</DependentUpon>
</Compile>
+ <Compile Include="Diagnostics\FdoCacheViewer.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Diagnostics\FdoCacheViewer.Designer.cs">
+ <DependentUpon>FdoCacheViewer.cs</DependentUpon>
+ </Compile>
<Compile Include="Diagnostics\ServerStatusMonitor.cs">
<SubType>Form</SubType>
</Compile>
@@ -931,6 +937,9 @@
<DependentUpon>UnmanagedFileBrowser.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="Diagnostics\FdoCacheViewer.resx">
+ <DependentUpon>FdoCacheViewer.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="Diagnostics\ServerStatusMonitor.resx">
<DependentUpon>ServerStatusMonitor.cs</DependentUpon>
</EmbeddedResource>
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/CommandType.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/CommandType.cs 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/CommandType.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -52,5 +52,9 @@
/// Creates a data store on a feature source
/// </summary>
CreateDataStore,
+ /// <summary>
+ /// Retrieves information about cached FDO connections
+ /// </summary>
+ GetFdoCacheInfo
}
}
Added: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/IGetFdoCacheInfo.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/IGetFdoCacheInfo.cs (rev 0)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/IGetFdoCacheInfo.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,151 @@
+#region Disclaimer / License
+// Copyright (C) 2011, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml.Serialization;
+using System.ComponentModel;
+
+namespace OSGeo.MapGuide.MaestroAPI.Commands
+{
+ public interface IGetFdoCacheInfo : ICommand
+ {
+ FdoCacheInfo Execute();
+ }
+
+ [XmlRoot(ElementName = "FdoCacheInformation")]
+ public class FdoCacheInfo
+ {
+ private static XmlSerializer smSerializer;
+
+ public static XmlSerializer Serializer
+ {
+ get
+ {
+ if (null == smSerializer)
+ smSerializer = new XmlSerializer(typeof(FdoCacheInfo));
+
+ return smSerializer;
+ }
+ }
+
+ [XmlElement]
+ public DateTime TimeStamp { get; set; }
+
+
+ [XmlElement(ElementName = "ConfigurationSettings")]
+ [DisplayName("Configuration Settings")]
+ public ConfigurationSettings Configuration { get; set; }
+
+
+ [XmlElement(ElementName = "Provider")]
+ [DisplayName("Cached FDO Providers")]
+ public CachedProviderInfo[] Providers { get; set; }
+ }
+
+ [Serializable]
+ public class CachedFdoConnection
+ {
+
+ [XmlElement]
+ [DisplayName("Feature Source")]
+ public string Name { get; set; }
+
+
+ [XmlElement]
+ public string ConnectionState { get; set; }
+
+
+ [XmlElement]
+ public string InUse { get; set; }
+
+
+ [XmlElement]
+ public int UseCount { get; set; }
+
+
+ [XmlElement]
+ public string LongTransaction { get; set; }
+
+
+ [XmlElement]
+ public DateTime LastUsed { get; set; }
+
+
+ [XmlElement]
+ public string Valid { get; set; }
+ }
+
+ [Serializable]
+ public class CachedProviderInfo
+ {
+
+ [XmlElement(ElementName = "Name")]
+ public string FeatureSourceId { get; set; }
+
+
+ [XmlElement]
+ public int MaximumDataConnectionPoolSize { get; set; }
+
+
+ [XmlElement]
+ public int CurrentDataConnectionPoolSize { get; set; }
+
+
+ [XmlElement]
+ public int CurrentDataConnections { get; set; }
+
+
+ [XmlElement]
+ public string ThreadModel { get; set; }
+
+
+ [XmlElement]
+ public string KeepDataConnectionsCached { get; set; }
+
+ [XmlElement(ElementName = "CachedFdoConnection")]
+ [DisplayName("Cached Feature Sources")]
+ public CachedFdoConnection[] CachedFdoConnections { get; set; }
+ }
+
+ [Serializable]
+ public class ConfigurationSettings
+ {
+
+ [XmlElement]
+ public string DataConnectionPoolEnabled { get; set; }
+
+
+ [XmlElement]
+ public string DataConnectionPoolExcludedProviders { get; set; }
+
+
+ [XmlElement]
+ public int DataConnectionPoolSize { get; set; }
+
+
+ [XmlElement]
+ public string DataConnectionPoolSizeCustom { get; set; }
+
+
+ [XmlElement]
+ public int DataConnectionTimeout { get; set; }
+ }
+}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2011-03-08 07:55:20 UTC (rev 5604)
@@ -174,6 +174,7 @@
</Compile>
<Compile Include="ArgumentParser.cs" />
<Compile Include="BindingListExtensions.cs" />
+ <Compile Include="Commands\IGetFdoCacheInfo.cs" />
<Compile Include="Commands\IGetResourceContents.cs" />
<Compile Include="Capability\ConnectionCapabilities.cs" />
<Compile Include="Check.cs" />
Added: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs (rev 0)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/Commands/HttpGetFdoCacheInfo.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -0,0 +1,43 @@
+#region Disclaimer / License
+// Copyright (C) 2011, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+
+namespace OSGeo.MapGuide.MaestroAPI.Http.Commands
+{
+ public class HttpGetFdoCacheInfo : IGetFdoCacheInfo
+ {
+ private HttpServerConnection _conn;
+
+ internal HttpGetFdoCacheInfo(HttpServerConnection conn)
+ {
+ _conn = conn;
+ }
+
+ public IServerConnection Parent { get { return _conn; } }
+
+ public FdoCacheInfo Execute()
+ {
+ return _conn.GetFdoCacheInfo();
+ }
+ }
+}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpCapabilities.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -38,7 +38,8 @@
//TODO: Work out what this can/can't do
return new int[]
{
- (int)CommandType.GetResourceContents
+ (int)CommandType.GetResourceContents,
+ (int)CommandType.GetFdoCacheInfo
};
}
}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -1732,7 +1732,20 @@
CommandType ct = (CommandType)cmdType;
if (ct == CommandType.GetResourceContents)
return new HttpGetResourceContents(this);
+ else if (ct == CommandType.GetFdoCacheInfo)
+ return new HttpGetFdoCacheInfo(this);
return base.CreateCommand(cmdType);
}
+
+ internal FdoCacheInfo GetFdoCacheInfo()
+ {
+ var req = m_reqBuilder.GetFdoCacheInfo();
+ using (var s = this.OpenRead(req))
+ {
+ var info = this.DeserializeObject<FdoCacheInfo>(s);
+
+ return info;
+ }
+ }
}
}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/OSGeo.MapGuide.MaestroAPI.Http.csproj
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/OSGeo.MapGuide.MaestroAPI.Http.csproj 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/OSGeo.MapGuide.MaestroAPI.Http.csproj 2011-03-08 07:55:20 UTC (rev 5604)
@@ -51,6 +51,7 @@
<Compile Include="..\Properties\SignedAssemblyInfo.cs">
<Link>SignedAssemblyInfo.cs</Link>
</Compile>
+ <Compile Include="Commands\HttpGetFdoCacheInfo.cs" />
<Compile Include="HttpCapabilities.cs" />
<Compile Include="HttpCoordinateSystem.cs" />
<Compile Include="HttpCoordinateSystemCatalog.cs" />
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2011-03-07 13:47:28 UTC (rev 5603)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2011-03-08 07:55:20 UTC (rev 5604)
@@ -1539,5 +1539,17 @@
return req;
}
+
+ internal string GetFdoCacheInfo()
+ {
+ NameValueCollection param = new NameValueCollection();
+ param.Add("OPERATION", "GETFDOCACHEINFO");
+ param.Add("VERSION", "1.0.0");
+ param.Add("SESSION", m_sessionID);
+ param.Add("FORMAT", "text/xml");
+ param.Add("CLIENTAGENT", m_userAgent);
+
+ return m_hosturi + "?" + EncodeParameters(param);
+ }
}
}
More information about the mapguide-commits
mailing list