[mapguide-commits] r6747 - in trunk/Tools/Maestro: Maestro.Editors Maestro.Editors/FeatureSource/Providers Maestro.Editors/FeatureSource/Providers/Common Maestro.Editors/FeatureSource/Providers/Odbc Maestro.Editors/Properties MaestroAPITests OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Services OSGeo.MapGuide.MaestroAPI.Http OSGeo.MapGuide.MaestroAPI.Local OSGeo.MapGuide.MaestroAPI.Native
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Jun 11 04:12:00 PDT 2012
Author: jng
Date: 2012-06-11 04:11:59 -0700 (Mon, 11 Jun 2012)
New Revision: 6747
Added:
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.resx
Modified:
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
Log:
#2002: Add support for constructing an ODBC configuration document with a filtered logical schema. This required a new API added to IFeatureService: DescribeFeatureSourcePartial(). Official API support for this already exists, so it's was a case of simply exposing it for use in Maestro.
Added: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.Designer.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.Designer.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -0,0 +1,117 @@
+namespace Maestro.Editors.FeatureSource.Providers.Common
+{
+ partial class FilteredLogicalSchemaDialog
+ {
+ /// <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()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FilteredLogicalSchemaDialog));
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.chkListClassNames = new System.Windows.Forms.CheckedListBox();
+ this.btnOK = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.btnCheckAll = new System.Windows.Forms.Button();
+ this.btnCheckNone = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ resources.ApplyResources(this.label1, "label1");
+ this.label1.Name = "label1";
+ //
+ // label2
+ //
+ resources.ApplyResources(this.label2, "label2");
+ this.label2.Name = "label2";
+ //
+ // chkListClassNames
+ //
+ resources.ApplyResources(this.chkListClassNames, "chkListClassNames");
+ this.chkListClassNames.CheckOnClick = true;
+ this.chkListClassNames.FormattingEnabled = true;
+ this.chkListClassNames.Name = "chkListClassNames";
+ //
+ // btnOK
+ //
+ resources.ApplyResources(this.btnOK, "btnOK");
+ this.btnOK.Name = "btnOK";
+ this.btnOK.UseVisualStyleBackColor = true;
+ this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
+ //
+ // btnCancel
+ //
+ resources.ApplyResources(this.btnCancel, "btnCancel");
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // btnCheckAll
+ //
+ resources.ApplyResources(this.btnCheckAll, "btnCheckAll");
+ this.btnCheckAll.Name = "btnCheckAll";
+ this.btnCheckAll.UseVisualStyleBackColor = true;
+ this.btnCheckAll.Click += new System.EventHandler(this.btnCheckAll_Click);
+ //
+ // btnCheckNone
+ //
+ resources.ApplyResources(this.btnCheckNone, "btnCheckNone");
+ this.btnCheckNone.Name = "btnCheckNone";
+ this.btnCheckNone.UseVisualStyleBackColor = true;
+ this.btnCheckNone.Click += new System.EventHandler(this.btnCheckNone_Click);
+ //
+ // FilteredLogicalSchemaDialog
+ //
+ this.AcceptButton = this.btnOK;
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
+ this.CancelButton = this.btnCancel;
+ resources.ApplyResources(this, "$this");
+ this.ControlBox = false;
+ this.Controls.Add(this.btnCheckNone);
+ this.Controls.Add(this.btnCheckAll);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnOK);
+ this.Controls.Add(this.chkListClassNames);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "FilteredLogicalSchemaDialog";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.CheckedListBox chkListClassNames;
+ private System.Windows.Forms.Button btnOK;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Button btnCheckAll;
+ private System.Windows.Forms.Button btnCheckNone;
+ }
+}
\ No newline at end of file
Added: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.cs (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -0,0 +1,87 @@
+#region Disclaimer / License
+// Copyright (C) 2012, 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.Linq;
+using System.Text;
+using System.Windows.Forms;
+
+namespace Maestro.Editors.FeatureSource.Providers.Common
+{
+ internal partial class FilteredLogicalSchemaDialog : Form
+ {
+ public FilteredLogicalSchemaDialog(string [] names)
+ {
+ InitializeComponent();
+ foreach (var n in names)
+ {
+ chkListClassNames.Items.Add(n, false);
+ }
+ }
+
+ public string[] ClassNames
+ {
+ get
+ {
+ var items = new List<string>();
+ foreach (var item in chkListClassNames.CheckedItems)
+ {
+ items.Add(item.ToString());
+ }
+ return items.ToArray();
+ }
+ }
+
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ }
+
+ private void btnOK_Click(object sender, EventArgs e)
+ {
+ if (chkListClassNames.CheckedItems.Count == 0)
+ {
+ MessageBox.Show(Properties.Resources.TextNoItemSelected);
+ return;
+ }
+
+ this.DialogResult = System.Windows.Forms.DialogResult.OK;
+ }
+
+ private void btnCheckAll_Click(object sender, EventArgs e)
+ {
+ for (int i = 0; i < chkListClassNames.Items.Count; i++)
+ {
+ chkListClassNames.SetItemChecked(i, true);
+ }
+ }
+
+ private void btnCheckNone_Click(object sender, EventArgs e)
+ {
+ for (int i = 0; i < chkListClassNames.Items.Count; i++)
+ {
+ chkListClassNames.SetItemChecked(i, false);
+ }
+ }
+ }
+}
Added: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.resx (rev 0)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Common/FilteredLogicalSchemaDialog.resx 2012-06-11 11:11:59 UTC (rev 6747)
@@ -0,0 +1,324 @@
+<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="label1.AutoSize" type="System.Boolean, mscorlib">
+ <value>True</value>
+ </data>
+ <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <data name="label1.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 19</value>
+ </data>
+ <data name="label1.Size" type="System.Drawing.Size, System.Drawing">
+ <value>315, 13</value>
+ </data>
+ <data name="label1.TabIndex" type="System.Int32, mscorlib">
+ <value>0</value>
+ </data>
+ <data name="label1.Text" xml:space="preserve">
+ <value>Select the FDO classes that will be in this configuration document</value>
+ </data>
+ <data name=">>label1.Name" xml:space="preserve">
+ <value>label1</value>
+ </data>
+ <data name=">>label1.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label1.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label1.ZOrder" xml:space="preserve">
+ <value>6</value>
+ </data>
+ <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+ <data name="label2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Left, Right</value>
+ </data>
+ <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 53</value>
+ </data>
+ <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+ <value>442, 39</value>
+ </data>
+ <data name="label2.TabIndex" type="System.Int32, mscorlib">
+ <value>1</value>
+ </data>
+ <data name="label2.Text" xml:space="preserve">
+ <value>Selecting only the required classes will reduce the attack surface of your Feature Source and improve schema walking performance for this Feature Source</value>
+ </data>
+ <data name=">>label2.Name" xml:space="preserve">
+ <value>label2</value>
+ </data>
+ <data name=">>label2.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>label2.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>label2.ZOrder" xml:space="preserve">
+ <value>5</value>
+ </data>
+ <data name="chkListClassNames.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Top, Bottom, Left, Right</value>
+ </data>
+ <data name="chkListClassNames.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 105</value>
+ </data>
+ <data name="chkListClassNames.Size" type="System.Drawing.Size, System.Drawing">
+ <value>442, 184</value>
+ </data>
+ <data name="chkListClassNames.TabIndex" type="System.Int32, mscorlib">
+ <value>2</value>
+ </data>
+ <data name=">>chkListClassNames.Name" xml:space="preserve">
+ <value>chkListClassNames</value>
+ </data>
+ <data name=">>chkListClassNames.Type" xml:space="preserve">
+ <value>System.Windows.Forms.CheckedListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>chkListClassNames.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>chkListClassNames.ZOrder" xml:space="preserve">
+ <value>4</value>
+ </data>
+ <data name="btnOK.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
+ <data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
+ <value>298, 306</value>
+ </data>
+ <data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <data name="btnOK.TabIndex" type="System.Int32, mscorlib">
+ <value>3</value>
+ </data>
+ <data name="btnOK.Text" xml:space="preserve">
+ <value>OK</value>
+ </data>
+ <data name=">>btnOK.Name" xml:space="preserve">
+ <value>btnOK</value>
+ </data>
+ <data name=">>btnOK.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnOK.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnOK.ZOrder" xml:space="preserve">
+ <value>3</value>
+ </data>
+ <data name="btnCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Right</value>
+ </data>
+ <data name="btnCancel.Location" type="System.Drawing.Point, System.Drawing">
+ <value>379, 306</value>
+ </data>
+ <data name="btnCancel.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <data name="btnCancel.TabIndex" type="System.Int32, mscorlib">
+ <value>4</value>
+ </data>
+ <data name="btnCancel.Text" xml:space="preserve">
+ <value>Cancel</value>
+ </data>
+ <data name=">>btnCancel.Name" xml:space="preserve">
+ <value>btnCancel</value>
+ </data>
+ <data name=">>btnCancel.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnCancel.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnCancel.ZOrder" xml:space="preserve">
+ <value>2</value>
+ </data>
+ <data name="btnCheckAll.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+ <value>Bottom, Left</value>
+ </data>
+ <data name="btnCheckAll.Location" type="System.Drawing.Point, System.Drawing">
+ <value>12, 306</value>
+ </data>
+ <data name="btnCheckAll.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <data name="btnCheckAll.TabIndex" type="System.Int32, mscorlib">
+ <value>5</value>
+ </data>
+ <data name="btnCheckAll.Text" xml:space="preserve">
+ <value>Check All</value>
+ </data>
+ <data name=">>btnCheckAll.Name" xml:space="preserve">
+ <value>btnCheckAll</value>
+ </data>
+ <data name=">>btnCheckAll.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnCheckAll.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnCheckAll.ZOrder" xml:space="preserve">
+ <value>1</value>
+ </data>
+ <data name="btnCheckNone.Location" type="System.Drawing.Point, System.Drawing">
+ <value>93, 306</value>
+ </data>
+ <data name="btnCheckNone.Size" type="System.Drawing.Size, System.Drawing">
+ <value>75, 23</value>
+ </data>
+ <data name="btnCheckNone.TabIndex" type="System.Int32, mscorlib">
+ <value>6</value>
+ </data>
+ <data name="btnCheckNone.Text" xml:space="preserve">
+ <value>Check None</value>
+ </data>
+ <data name=">>btnCheckNone.Name" xml:space="preserve">
+ <value>btnCheckNone</value>
+ </data>
+ <data name=">>btnCheckNone.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+ <data name=">>btnCheckNone.Parent" xml:space="preserve">
+ <value>$this</value>
+ </data>
+ <data name=">>btnCheckNone.ZOrder" xml:space="preserve">
+ <value>0</value>
+ </data>
+ <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+ <data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
+ <value>466, 341</value>
+ </data>
+ <data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
+ <value>CenterParent</value>
+ </data>
+ <data name="$this.Text" xml:space="preserve">
+ <value>Filter Logical Schema</value>
+ </data>
+ <data name=">>$this.Name" xml:space="preserve">
+ <value>FilteredLogicalSchemaDialog</value>
+ </data>
+ <data name=">>$this.Type" xml:space="preserve">
+ <value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </data>
+</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -23,6 +23,7 @@
using System.Drawing;
using System.Data;
using System.Text;
+using System.Linq;
using System.Windows.Forms;
using Maestro.Editors.Common;
using OSGeo.MapGuide.ObjectModels.FeatureSource;
@@ -33,6 +34,8 @@
using System.Xml;
using OSGeo.MapGuide.MaestroAPI.Schema;
using Maestro.Editors.FeatureSource.Providers.Odbc.OverrideEditor;
+using Maestro.Editors.FeatureSource.Providers.Common;
+using Maestro.Shared.UI;
namespace Maestro.Editors.FeatureSource.Providers.Odbc
{
@@ -308,18 +311,30 @@
try
{
- //#2002 TODO: Here is where we would present a list of classes in order to be able to create a filtered down
- //logical schema
- var desc = _fs.Describe(); //TODO: Describe only the selected class names
- if (desc.Schemas.Length == 0)
- throw new ApplicationException("Could not retrieve any schemas from this connection. If it is a DSN, ensure it is a valid DSN");
- _doc.AddSchema(desc.Schemas[0]); //Only one schema is supported by ODBC so this is ok
+ var schemaName = _fs.GetSchemaNames()[0];
+ var classNames = _fs.GetClassNames(schemaName);
+ var diag = new FilteredLogicalSchemaDialog(classNames);
+ if (diag.ShowDialog() == DialogResult.Cancel)
+ throw new ApplicationException(Properties.Resources.TextNoItemSelected);
- var scList = _fs.GetSpatialInfo(false);
- foreach (var sc in scList.SpatialContext)
+ var names = diag.ClassNames;
+
+ BusyWaitDelegate worker = () =>
{
- _doc.AddSpatialContext(sc);
- }
+ classNames = names.Select(x => x.Contains(":") ? x.Split(':')[1] : x).ToArray();
+ var schema = _fs.CurrentConnection.FeatureService.DescribeFeatureSourcePartial(_fs.ResourceID, schemaName, classNames);
+ _doc.AddSchema(schema); //Only one schema is supported by ODBC so this is ok
+ var scList = _fs.GetSpatialInfo(false);
+ foreach (var sc in scList.SpatialContext)
+ {
+ _doc.AddSpatialContext(sc);
+ }
+ return null;
+ };
+ BusyWaitDialog.Run(Properties.Resources.TextPreparingConfigurationDocument, worker, (obj) =>
+ {
+ //Done
+ });
}
catch (Exception ex)
{
Modified: trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/Maestro.Editors/Maestro.Editors.csproj 2012-06-11 11:11:59 UTC (rev 6747)
@@ -261,6 +261,12 @@
<Compile Include="FeatureSource\Preview\StandardQueryCtrl.Designer.cs">
<DependentUpon>StandardQueryCtrl.cs</DependentUpon>
</Compile>
+ <Compile Include="FeatureSource\Providers\Common\FilteredLogicalSchemaDialog.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="FeatureSource\Providers\Common\FilteredLogicalSchemaDialog.Designer.cs">
+ <DependentUpon>FilteredLogicalSchemaDialog.cs</DependentUpon>
+ </Compile>
<Compile Include="FeatureSource\Providers\FileBasedCtrl.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -1338,6 +1344,9 @@
<DependentUpon>StandardQueryCtrl.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
+ <EmbeddedResource Include="FeatureSource\Providers\Common\FilteredLogicalSchemaDialog.resx">
+ <DependentUpon>FilteredLogicalSchemaDialog.cs</DependentUpon>
+ </EmbeddedResource>
<EmbeddedResource Include="FeatureSource\Providers\FileBasedCtrl.resx">
<DependentUpon>FileBasedCtrl.cs</DependentUpon>
<SubType>Designer</SubType>
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -3235,6 +3235,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to No Items Selected.
+ /// </summary>
+ internal static string TextNoItemSelected {
+ get {
+ return ResourceManager.GetString("TextNoItemSelected", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to No Occurences Found.
/// </summary>
internal static string TextNoOccurrencesFound {
@@ -3271,6 +3280,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Preparing Configuration Document.
+ /// </summary>
+ internal static string TextPreparingConfigurationDocument {
+ get {
+ return ResourceManager.GetString("TextPreparingConfigurationDocument", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Search Text Not Found.
/// </summary>
internal static string TextSearchTextNotFound {
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2012-06-11 11:11:59 UTC (rev 6747)
@@ -5692,4 +5692,10 @@
<data name="TextSelectionOnly" xml:space="preserve">
<value>(Selection Only)</value>
</data>
+ <data name="TextNoItemSelected" xml:space="preserve">
+ <value>No Items Selected</value>
+ </data>
+ <data name="TextPreparingConfigurationDocument" xml:space="preserve">
+ <value>Preparing Configuration Document</value>
+ </data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -401,6 +401,11 @@
{
throw new NotImplementedException();
}
+
+ public FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string[] classNames)
+ {
+ throw new NotImplementedException();
+ }
}
#endregion
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -1449,6 +1449,15 @@
abstract public FeatureSchema DescribeFeatureSource(string resourceID, string schema);
/// <summary>
+ /// Describes the specified feature source restricted to only the specified schema and the specified class names
+ /// </summary>
+ /// <param name="resourceID"></param>
+ /// <param name="schema"></param>
+ /// <param name="classNames"></param>
+ /// <returns></returns>
+ public abstract FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string[] classNames);
+
+ /// <summary>
/// feature source description cache
/// </summary>
protected Dictionary<string, FeatureSourceDescription> m_featureSchemaCache = new Dictionary<string, FeatureSourceDescription>();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -218,6 +218,19 @@
FeatureSchema DescribeFeatureSource(string resourceID, string schema);
/// <summary>
+ /// Describes the specified feature source restricted to only the specified schema and the specified class names
+ /// </summary>
+ /// <param name="resourceID"></param>
+ /// <param name="schema"></param>
+ /// <remarks>
+ /// If you only need to list schemas and class names, use the respective <see cref="M:OSGeo.MapGuide.MaestroAPI.Services.IFeatureService.GetSchemas" /> and
+ /// <see cref="M:OSGeo.MapGuide.MaestroAPI.Services.IFeatureService.GetClassNames" /> methods. Using this API will have a noticeable performance impact on
+ /// really large datastores (whose size is in the 100s of classes).
+ /// </remarks>
+ /// <returns></returns>
+ FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string [] classNames);
+
+ /// <summary>
/// Gets the specified class definition
/// </summary>
/// <param name="resourceID"></param>
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -705,6 +705,37 @@
}
}
+ public override FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string[] classNames)
+ {
+ ResourceIdentifier.Validate(resourceID, ResourceTypes.FeatureSource);
+ string req = m_reqBuilder.DescribeSchemaPartial(resourceID, schema, classNames);
+ try
+ {
+ var fsd = new FeatureSourceDescription(this.OpenRead(req));
+ return fsd.Schemas[0];
+ }
+ catch (Exception ex)
+ {
+ if (typeof(WebException).IsAssignableFrom(ex.GetType()))
+ LogFailedRequest((WebException)ex);
+ try
+ {
+ if (this.IsSessionExpiredException(ex) && this.AutoRestartSession && this.RestartSession(false))
+ return this.DescribeFeatureSourcePartial(resourceID, schema, classNames);
+ }
+ catch
+ {
+ //Throw the original exception, not the secondary one
+ }
+
+ Exception ex2 = Utility.ThrowAsWebException(ex);
+ if (ex2 != ex)
+ throw ex2;
+ else
+ throw;
+ }
+ }
+
public override FeatureSchema DescribeFeatureSource(string resourceID, string schema)
{
ResourceIdentifier.Validate(resourceID, ResourceTypes.FeatureSource);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -1550,6 +1550,25 @@
return m_hosturi + "?" + EncodeParameters(param);
}
+ internal string DescribeSchemaPartial(string resourceID, string schemaName, string[] classNames)
+ {
+ NameValueCollection param = new NameValueCollection();
+ param.Add("OPERATION", "DESCRIBEFEATURESCHEMA");
+ param.Add("VERSION", "1.0.0");
+ param.Add("SESSION", m_sessionID);
+ param.Add("FORMAT", "text/xml");
+ param.Add("CLIENTAGENT", m_userAgent);
+
+ if (m_locale != null)
+ param.Add("LOCALE", m_locale);
+
+ param.Add("RESOURCEID", resourceID);
+ if (!string.IsNullOrEmpty(schemaName))
+ param.Add("SCHEMA", schemaName);
+ param.Add("CLASSNAMES", string.Join(".", classNames));
+ return m_hosturi + "?" + EncodeParameters(param);
+ }
+
public string GetClassDefinition(string resourceId, string schemaName, string className)
{
//BOGUS: GETCLASSDEFINITION is FUBAR (#2015)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -514,6 +514,20 @@
return new FeatureSourceDescription(ms);
}
+ public override FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string[] classNames)
+ {
+ var fes = GetFeatureService();
+ MgStringCollection names = new MgStringCollection();
+ foreach (var clsName in classNames)
+ {
+ names.Add(clsName);
+ }
+ string xml = fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema, names);
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+ LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, schema, "{" + string.Join(",", classNames) + "}");
+ return new FeatureSourceDescription(ms).Schemas[0];
+ }
+
public override FeatureSchema DescribeFeatureSource(string resourceID, string schema)
{
var fes = GetFeatureService();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2012-06-11 10:24:43 UTC (rev 6746)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs 2012-06-11 11:11:59 UTC (rev 6747)
@@ -382,6 +382,20 @@
return new FeatureSourceDescription(ms);
}
+ public override FeatureSchema DescribeFeatureSourcePartial(string resourceID, string schema, string[] classNames)
+ {
+ MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
+ MgStringCollection names = new MgStringCollection();
+ foreach (var clsName in classNames)
+ {
+ names.Add(clsName);
+ }
+ string xml = fes.DescribeSchemaAsXml(new MgResourceIdentifier(resourceID), schema, names);
+ MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
+ LogMethodCall("MgFeatureService::DescribeSchemaAsXml", true, resourceID, schema, "{" + string.Join(",", classNames) + "}");
+ return new FeatureSourceDescription(ms).Schemas[0];
+ }
+
public override FeatureSchema DescribeFeatureSource(string resourceID, string schema)
{
MgFeatureService fes = this.Connection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
More information about the mapguide-commits
mailing list