[mapguide-commits] r4766 - in trunk/Tools/Maestro: Maestro/ResourceEditors Maestro/ResourceEditors/FeatureSourceEditors/ODBC MaestroAPI MaestroAPI/Generated

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Apr 8 05:10:31 EDT 2010


Author: jng
Date: 2010-04-08 05:10:30 -0400 (Thu, 08 Apr 2010)
New Revision: 4766

Added:
   trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.Designer.cs
   trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.cs
   trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.resx
   trunk/Tools/Maestro/MaestroAPI/Generated/StringCollection-1.0.0.cs
Modified:
   trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSN.cs
   trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceEditors.csproj
   trunk/Tools/Maestro/MaestroAPI/Generated/ResourceReferenceList-1.0.0.cs
   trunk/Tools/Maestro/MaestroAPI/Generated/WebLayout-1.0.0.cs
   trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs
   trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs
   trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
   trunk/Tools/Maestro/MaestroAPI/RequestBuilder.cs
   trunk/Tools/Maestro/MaestroAPI/ServerConnectionI.cs
Log:
Fix #1312: This adds DSN browsing support for the ODBC editor. This required the following changes:

- Add a new method GetConnectionPropertyValues() to ServerConnectionI, implemented in both HttpServerConnection and LocalNativeConnection
- Add a generated .net class for StringCollection (the return result of the GETCONNECTIONPROPERTYVALUES mapagent call), since this name clashes with System.Collections.Specialized.StringCollection, all existing references to StringCollection now use the fully qualified name. This file was generated from the built-in generic XsdGenerator project.
- Add a new DSNPicker dialog which houses the result of the GetConnectionPropertyValues call.

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSN.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSN.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSN.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -111,7 +111,13 @@
 
 		private void BrowseFileButton_Click(object sender, System.EventArgs e)
 		{
-			MessageBox.Show(this, OSGeo.MapGuide.Maestro.ResourceEditors.Strings.Common.MissingMethod, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
+            OSGeo.MapGuide.MaestroAPI.ServerConnectionI conn = m_editor.CurrentConnection;
+            string[] values = conn.GetConnectionPropertyValues("OSGeo.ODBC", "DataSourceName", "");
+            DSNPicker picker = new DSNPicker(values);
+            if (picker.ShowDialog() == DialogResult.OK)
+            {
+                FilepathText.Text = picker.SelectedDSN;
+            }
 		}
 
 		public void SetItem(ResourceEditors.EditorInterface editor, OSGeo.MapGuide.MaestroAPI.FeatureSource item)

Added: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.Designer.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -0,0 +1,91 @@
+namespace OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC
+{
+    partial class DSNPicker
+    {
+        /// <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.lstDSN = new System.Windows.Forms.ListBox();
+            this.btnOK = new System.Windows.Forms.Button();
+            this.btnCancel = new System.Windows.Forms.Button();
+            this.SuspendLayout();
+            // 
+            // lstDSN
+            // 
+            this.lstDSN.FormattingEnabled = true;
+            this.lstDSN.Location = new System.Drawing.Point(13, 13);
+            this.lstDSN.Name = "lstDSN";
+            this.lstDSN.Size = new System.Drawing.Size(196, 199);
+            this.lstDSN.TabIndex = 0;
+            // 
+            // btnOK
+            // 
+            this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnOK.Location = new System.Drawing.Point(52, 224);
+            this.btnOK.Name = "btnOK";
+            this.btnOK.Size = new System.Drawing.Size(75, 23);
+            this.btnOK.TabIndex = 1;
+            this.btnOK.Text = "OK";
+            this.btnOK.UseVisualStyleBackColor = true;
+            this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
+            // 
+            // btnCancel
+            // 
+            this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+            this.btnCancel.Location = new System.Drawing.Point(134, 224);
+            this.btnCancel.Name = "btnCancel";
+            this.btnCancel.Size = new System.Drawing.Size(75, 23);
+            this.btnCancel.TabIndex = 2;
+            this.btnCancel.Text = "Cancel";
+            this.btnCancel.UseVisualStyleBackColor = true;
+            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+            // 
+            // DSNPicker
+            // 
+            this.AcceptButton = this.btnOK;
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.CancelButton = this.btnCancel;
+            this.ClientSize = new System.Drawing.Size(221, 259);
+            this.ControlBox = false;
+            this.Controls.Add(this.btnCancel);
+            this.Controls.Add(this.btnOK);
+            this.Controls.Add(this.lstDSN);
+            this.Name = "DSNPicker";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "Select DSN";
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.ListBox lstDSN;
+        private System.Windows.Forms.Button btnOK;
+        private System.Windows.Forms.Button btnCancel;
+    }
+}
\ No newline at end of file

Added: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.cs
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -0,0 +1,58 @@
+#region Disclaimer / License
+// Copyright (C) 2010, 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;
+
+namespace OSGeo.MapGuide.Maestro.ResourceEditors.FeatureSourceEditors.ODBC
+{
+    public partial class DSNPicker : Form
+    {
+        public DSNPicker(string [] values)
+        {
+            InitializeComponent();
+            lstDSN.DataSource = values;
+        }
+
+        public string SelectedDSN
+        {
+            get
+            {
+                if (lstDSN.SelectedItem != null)
+                    return lstDSN.SelectedItem.ToString();
+                return string.Empty;
+            }
+        }
+
+        private void btnCancel_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.Cancel;
+        }
+
+        private void btnOK_Click(object sender, EventArgs e)
+        {
+            this.DialogResult = DialogResult.OK;
+        }
+    }
+}

Added: trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.resx
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.resx	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/FeatureSourceEditors/ODBC/DSNPicker.resx	2010-04-08 09:10:30 UTC (rev 4766)
@@ -0,0 +1,120 @@
+<?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>
+</root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceEditors.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceEditors.csproj	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/Maestro/ResourceEditors/ResourceEditors.csproj	2010-04-08 09:10:30 UTC (rev 4766)
@@ -1,7 +1,7 @@
 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
   <PropertyGroup>
     <ProjectType>Local</ProjectType>
-    <ProductVersion>9.0.30729</ProductVersion>
+    <ProductVersion>9.0.21022</ProductVersion>
     <SchemaVersion>2.0</SchemaVersion>
     <ProjectGuid>{E324888B-4A05-46A7-8FB4-54452145128F}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -232,6 +232,12 @@
     <Compile Include="FeatureSourceEditors\ODBC\DSN.cs">
       <SubType>UserControl</SubType>
     </Compile>
+    <Compile Include="FeatureSourceEditors\ODBC\DSNPicker.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FeatureSourceEditors\ODBC\DSNPicker.Designer.cs">
+      <DependentUpon>DSNPicker.cs</DependentUpon>
+    </Compile>
     <Compile Include="FeatureSourceEditors\ODBC\FeatureSourceEditorODBC.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -1111,6 +1117,9 @@
       <DependentUpon>Unmanaged.cs</DependentUpon>
       <SubType>Designer</SubType>
     </EmbeddedResource>
+    <EmbeddedResource Include="FeatureSourceEditors\ODBC\DSNPicker.resx">
+      <DependentUpon>DSNPicker.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FeatureSourceEditors\ODBC\Strings\FeatureSourceEditorODBC.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>FeatureSourceEditorODBC.Designer.cs</LastGenOutput>

Modified: trunk/Tools/Maestro/MaestroAPI/Generated/ResourceReferenceList-1.0.0.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/Generated/ResourceReferenceList-1.0.0.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/Generated/ResourceReferenceList-1.0.0.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -17,11 +17,9 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 #endregion
-using System.Collections.Specialized;
+
 namespace OSGeo.MapGuide.MaestroAPI 
 {
-    
-    
     /// <remarks/>
     [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
     public class ResourceReferenceList {
@@ -34,12 +32,13 @@
 			get { return SchemaName; }
 			set { if (value != SchemaName) throw new System.Exception("Cannot set the schema name"); }
 		}
-		
-		private StringCollection m_resourceId;
+
+        private System.Collections.Specialized.StringCollection m_resourceId;
         
         /// <remarks/>
         [System.Xml.Serialization.XmlElementAttribute("ResourceId")]
-        public StringCollection ResourceId {
+        public System.Collections.Specialized.StringCollection ResourceId
+        {
             get {
                 return this.m_resourceId;
             }

Added: trunk/Tools/Maestro/MaestroAPI/Generated/StringCollection-1.0.0.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/Generated/StringCollection-1.0.0.cs	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPI/Generated/StringCollection-1.0.0.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -0,0 +1,59 @@
+#region Disclaimer / License
+// Copyright (C) 2010, 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
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.3053
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+// 
+// This source code was auto-generated by xsd, Version=2.0.50727.1432.
+// 
+namespace OSGeo.MapGuide.MaestroAPI {
+    using System.Xml.Serialization;
+    
+    
+    /// <remarks/>
+    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
+    [System.SerializableAttribute()]
+    [System.Diagnostics.DebuggerStepThroughAttribute()]
+    [System.ComponentModel.DesignerCategoryAttribute("code")]
+    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
+    [System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
+    public partial class StringCollection {
+        
+        private System.Collections.Generic.List<string> itemField;
+        
+        /// <remarks/>
+        [System.Xml.Serialization.XmlElementAttribute("Item")]
+        public System.Collections.Generic.List<string> Item {
+            get {
+                return this.itemField;
+            }
+            set {
+                this.itemField = value;
+            }
+        }
+    }
+}

Modified: trunk/Tools/Maestro/MaestroAPI/Generated/WebLayout-1.0.0.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/Generated/WebLayout-1.0.0.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/Generated/WebLayout-1.0.0.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 #endregion
-using System.Collections.Specialized;
+
 namespace OSGeo.MapGuide.MaestroAPI 
 {
     
@@ -582,9 +582,9 @@
     public class InvokeURLCommandType : TargetedCommandType {
         
         private string m_uRL;
+
+        private System.Collections.Specialized.StringCollection m_layerSet;
         
-        private StringCollection m_layerSet;
-        
         private ParameterPairTypeCollection m_additionalParameter;
         
         private bool m_disableIfSelectionEmpty;
@@ -601,7 +601,7 @@
         
         /// <remarks/>
         [System.Xml.Serialization.XmlArrayItemAttribute("Layer", IsNullable=false)]
-        public StringCollection LayerSet {
+        public System.Collections.Specialized.StringCollection LayerSet {
             get {
                 return this.m_layerSet;
             }

Modified: trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/HttpServerConnection.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -1397,7 +1397,17 @@
             }
         }
 
+        public string[] GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString)
+        {
+            string req = m_reqBuilder.GetConnectionPropertyValues(providerName, propertyName, partialConnectionString);
+            using (System.IO.Stream s = this.OpenRead(req))
+            {
+                StringCollection strc = this.DeserializeObject<StringCollection>(s);
+                return strc.Item.ToArray();
+            }
+        }
 
+
         #region IDisposable Members
 
         public override void Dispose()
@@ -1434,6 +1444,5 @@
             get { return m_reqBuilder.UserAgent; }
             set { m_reqBuilder.UserAgent = value; }
         }
-
     }
 }

Modified: trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/LocalNativeConnection.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -864,6 +864,18 @@
             
         }
 
+        public string[] GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString)
+        {
+            MgFeatureService featSvc = this.Con.CreateService(MgServiceType.FeatureService) as MgFeatureService;
+            MgStringCollection result = featSvc.GetConnectionPropertyValues(providerName, propertyName, partialConnectionString);
+            string[] values = new string[result.GetCount()];
+            for (int i = 0; i < result.GetCount(); i++)
+            {
+                values[i] = result.GetItem(i);
+            }
+            return values;
+        }
+
 		#endregion
 
         #region IDisposable Members
@@ -894,6 +906,5 @@
         }
 
         #endregion
-
     }
 }

Modified: trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2010-04-08 09:10:30 UTC (rev 4766)
@@ -134,6 +134,7 @@
     </Compile>
     <Compile Include="ConnectionFactory.cs" />
     <Compile Include="ConnectionProviderRegistry.cs" />
+    <Compile Include="Generated\StringCollection-1.0.0.cs" />
     <Compile Include="HttpCoordinateSystem.cs">
       <SubType>Code</SubType>
     </Compile>

Modified: trunk/Tools/Maestro/MaestroAPI/RequestBuilder.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/RequestBuilder.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/RequestBuilder.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -1216,11 +1216,28 @@
             return m_hosturi + "?" + EncodeParameters(param);
         }
 
+        public string GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString)
+        {
+            NameValueCollection param = new NameValueCollection();
+            param.Add("OPERATION", "GETCONNECTIONPROPERTYVALUES");
+            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("PROVIDER", providerName);
+            param.Add("PROPERTY", propertyName);
+            param.Add("CONNECTIONSTRING", partialConnectionString);
+
+            return m_hosturi + "?" + EncodeParameters(param);
+        }
+
         public string UserAgent
         {
             get { return m_userAgent; }
             set { m_userAgent = value; }
         }
-    
     }
 }

Modified: trunk/Tools/Maestro/MaestroAPI/ServerConnectionI.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPI/ServerConnectionI.cs	2010-04-08 03:24:16 UTC (rev 4765)
+++ trunk/Tools/Maestro/MaestroAPI/ServerConnectionI.cs	2010-04-08 09:10:30 UTC (rev 4766)
@@ -75,6 +75,15 @@
 		/// <returns>The provider name without version numbers</returns>
 		string RemoveVersionFromProviderName(string providername);
 
+        /// <summary>
+        /// Gets the possible values for a given connection property
+        /// </summary>
+        /// <param name="providerName">The FDO provider name</param>
+        /// <param name="propertyName">The property name</param>
+        /// <param name="partialConnectionString">A partial connection string if certain providers require such information</param>
+        /// <returns>A list of possible values for the given property</returns>
+        string[] GetConnectionPropertyValues(string providerName, string propertyName, string partialConnectionString);
+
 		/// <summary>
 		/// Returns an installed provider, given the name of the provider
 		/// </summary>



More information about the mapguide-commits mailing list