[mapguide-commits] r6255 - in trunk/Tools/Maestro: Maestro Maestro.Base/Commands Maestro.Editors/FeatureSource/Providers/Odbc Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors OSGeo.MapGuide.MaestroAPI/Properties OSGeo.MapGuide.MaestroAPI/Resource/Validation OSGeo.MapGuide.MaestroAPI/Schema

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 28 22:58:06 EST 2011


Author: jng
Date: 2011-11-28 19:58:05 -0800 (Mon, 28 Nov 2011)
New Revision: 6255

Modified:
   trunk/Tools/Maestro/Maestro.Base/Commands/SaveResourceAsCommand.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.Designer.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.resx
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ConnectionStringCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/DSNCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/IOdbcSubEditor.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/KnownDriversCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ManagedCtrl.cs
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/UnmanagedCtrl.cs
   trunk/Tools/Maestro/Maestro/changelog.txt
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
Log:
#1477: Fix bad xsd data types being specified when serializing a class definition.
Also includes other changes:
 - Improve the "Connection Test failed" validation error message
 - Make it easy to specify a 64-bit driver option for certain ODBC drivers.
 - Fix a defect in SaveResourceAs command when multiple site connections are open

Modified: trunk/Tools/Maestro/Maestro/changelog.txt
===================================================================
--- trunk/Tools/Maestro/Maestro/changelog.txt	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro/changelog.txt	2011-11-29 03:58:05 UTC (rev 6255)
@@ -1,4 +1,7 @@
-4.0 RC1
+4.0
+---
+
+4.0 RC1
 -------
 
  - A warning will now be displayed when attempting to preview a map definition with tiled layers in Local Connection Mode (because the mg-desktop viewer has not implemented support for this yet)

Modified: trunk/Tools/Maestro/Maestro.Base/Commands/SaveResourceAsCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/SaveResourceAsCommand.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/SaveResourceAsCommand.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -35,10 +35,9 @@
         {
             var wb = Workbench.Instance;
             var exp = wb.ActiveSiteExplorer;
-            var connMgr = ServiceRegistry.GetService<ServerConnectionManager>();
             var omgr = ServiceRegistry.GetService<OpenResourceManager>();
-            var conn = connMgr.GetConnection(exp.ConnectionName);
             var ed = wb.ActiveDocumentView as IEditorViewContent;
+            var conn = ed.EditorService.GetEditedResource().CurrentConnection;
             
             if (ed != null)
             {

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.Designer.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.Designer.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -39,6 +39,7 @@
             this.groupBox3 = new System.Windows.Forms.GroupBox();
             this.txtConnectionStatus = new System.Windows.Forms.TextBox();
             this.pnlMethod = new System.Windows.Forms.Panel();
+            this.chkUse64Bit = new System.Windows.Forms.CheckBox();
             this.contentPanel.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -46,6 +47,7 @@
             // 
             // contentPanel
             // 
+            this.contentPanel.Controls.Add(this.chkUse64Bit);
             this.contentPanel.Controls.Add(this.pnlMethod);
             this.contentPanel.Controls.Add(this.groupBox3);
             this.contentPanel.Controls.Add(this.groupBox2);
@@ -121,12 +123,18 @@
             resources.ApplyResources(this.pnlMethod, "pnlMethod");
             this.pnlMethod.Name = "pnlMethod";
             // 
+            // chkUse64Bit
+            // 
+            resources.ApplyResources(this.chkUse64Bit, "chkUse64Bit");
+            this.chkUse64Bit.Name = "chkUse64Bit";
+            this.chkUse64Bit.UseVisualStyleBackColor = true;
+            this.chkUse64Bit.CheckedChanged += new System.EventHandler(this.chkUse64Bit_CheckedChanged);
+            // 
             // OdbcProviderCtrl
             // 
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
-            this.HeaderText = "ODBC Feature Source";
+            resources.ApplyResources(this, "$this");
             this.Name = "OdbcProviderCtrl";
-            resources.ApplyResources(this, "$this");
             this.contentPanel.ResumeLayout(false);
             this.contentPanel.PerformLayout();
             this.groupBox2.ResumeLayout(false);
@@ -149,5 +157,6 @@
         private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.TextBox txtConnStr;
         private System.Windows.Forms.Panel pnlMethod;
+        private System.Windows.Forms.CheckBox chkUse64Bit;
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -56,11 +56,14 @@
         private IEditorService _service;
         private IFeatureSource _fs;
 
+        bool Use64BitDriver { get { return chkUse64Bit.Visible && chkUse64Bit.Checked; } }
+
         void InternalConnectionChanged(object sender, EventArgs e)
         {
             btnTest.Enabled = true;
+            var props = (Use64BitDriver) ? this.ChildEditor.Get64BitConnectionProperties() : this.ChildEditor.ConnectionProperties;
             if (this.ChildEditor != null)
-                txtConnStr.Text = Utility.ToConnectionString(this.ChildEditor.ConnectionProperties);
+                txtConnStr.Text = Utility.ToConnectionString(props);
             else
                 txtConnStr.Text = string.Empty;
 
@@ -191,7 +194,7 @@
             txtConnectionStatus.Text = string.Empty;
             if (this.ChildEditor != null)
             {
-                var props = this.ChildEditor.ConnectionProperties;
+                var props = Use64BitDriver ? this.ChildEditor.Get64BitConnectionProperties() : this.ChildEditor.ConnectionProperties;
                 _fs.ApplyConnectionProperties(props);
                 //Flush back to session before testing
                 _service.SyncSessionCopy();
@@ -310,5 +313,14 @@
                 MessageBox.Show(Properties.Resources.ConfigurationDocumentReset);
             }
         }
+
+        private void chkUse64Bit_CheckedChanged(object sender, EventArgs e)
+        {
+            OdbcConnectionMethod method = (OdbcConnectionMethod)cmbMethod.SelectedItem;
+            if (method == OdbcConnectionMethod.ManagedFile || method == OdbcConnectionMethod.Unmanaged)
+            {
+                InternalConnectionChanged(this, EventArgs.Empty);
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.resx	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.resx	2011-11-29 03:58:05 UTC (rev 6255)
@@ -118,14 +118,44 @@
     <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="chkUse64Bit.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Right</value>
+  </data>
+  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="chkUse64Bit.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="chkUse64Bit.Location" type="System.Drawing.Point, System.Drawing">
+    <value>308, 8</value>
+  </data>
+  <data name="chkUse64Bit.Size" type="System.Drawing.Size, System.Drawing">
+    <value>219, 17</value>
+  </data>
+  <data name="chkUse64Bit.TabIndex" type="System.Int32, mscorlib">
+    <value>10</value>
+  </data>
+  <data name="chkUse64Bit.Text" xml:space="preserve">
+    <value>Use 64-bit ODBC driver where applicable</value>
+  </data>
+  <data name="&gt;&gt;chkUse64Bit.Name" xml:space="preserve">
+    <value>chkUse64Bit</value>
+  </data>
+  <data name="&gt;&gt;chkUse64Bit.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="&gt;&gt;chkUse64Bit.Parent" xml:space="preserve">
+    <value>contentPanel</value>
+  </data>
+  <data name="&gt;&gt;chkUse64Bit.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
   <data name="pnlMethod.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Bottom, Left, Right</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="pnlMethod.AutoScroll" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="pnlMethod.Location" type="System.Drawing.Point, System.Drawing">
     <value>23, 33</value>
   </data>
@@ -145,7 +175,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;pnlMethod.ZOrder" xml:space="preserve">
-    <value>0</value>
+    <value>1</value>
   </data>
   <data name="groupBox3.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left, Right</value>
@@ -202,7 +232,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;groupBox3.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>2</value>
   </data>
   <data name="groupBox2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left, Right</value>
@@ -256,13 +286,13 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;groupBox2.ZOrder" xml:space="preserve">
-    <value>2</value>
+    <value>3</value>
   </data>
   <data name="btnReset.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left</value>
   </data>
   <data name="btnReset.Location" type="System.Drawing.Point, System.Drawing">
-    <value>23, 282</value>
+    <value>23, 286</value>
   </data>
   <data name="btnReset.Size" type="System.Drawing.Size, System.Drawing">
     <value>122, 23</value>
@@ -283,13 +313,13 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;btnReset.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>4</value>
   </data>
   <data name="btnEditSchema.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left</value>
   </data>
   <data name="btnEditSchema.Location" type="System.Drawing.Point, System.Drawing">
-    <value>23, 253</value>
+    <value>23, 257</value>
   </data>
   <data name="btnEditSchema.Size" type="System.Drawing.Size, System.Drawing">
     <value>122, 23</value>
@@ -310,7 +340,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;btnEditSchema.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>5</value>
   </data>
   <data name="btnTest.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Left</value>
@@ -319,7 +349,7 @@
     <value>False</value>
   </data>
   <data name="btnTest.Location" type="System.Drawing.Point, System.Drawing">
-    <value>23, 205</value>
+    <value>23, 207</value>
   </data>
   <data name="btnTest.Size" type="System.Drawing.Size, System.Drawing">
     <value>122, 23</value>
@@ -340,7 +370,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;btnTest.ZOrder" xml:space="preserve">
-    <value>5</value>
+    <value>6</value>
   </data>
   <data name="cmbMethod.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
@@ -349,7 +379,7 @@
     <value>138, 6</value>
   </data>
   <data name="cmbMethod.Size" type="System.Drawing.Size, System.Drawing">
-    <value>389, 21</value>
+    <value>149, 21</value>
   </data>
   <data name="cmbMethod.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
@@ -364,7 +394,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;cmbMethod.ZOrder" xml:space="preserve">
-    <value>6</value>
+    <value>7</value>
   </data>
   <data name="label1.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
@@ -391,7 +421,7 @@
     <value>contentPanel</value>
   </data>
   <data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
-    <value>7</value>
+    <value>8</value>
   </data>
   <data name="contentPanel.Size" type="System.Drawing.Size, System.Drawing">
     <value>552, 325</value>
@@ -411,6 +441,9 @@
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <data name="$this.HeaderText" xml:space="preserve">
+    <value>ODBC Feature Source</value>
+  </data>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
     <value>552, 352</value>
   </data>
@@ -418,6 +451,6 @@
     <value>OdbcProviderCtrl</value>
   </data>
   <data name="&gt;&gt;$this.Type" xml:space="preserve">
-    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=3.0.0.5654, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Editors.Common.EditorBindableCollapsiblePanel, Maestro.Editors, Version=4.0.0.6216, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ConnectionStringCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ConnectionStringCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ConnectionStringCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -68,5 +68,10 @@
         {
             get { return this; }
         }
+
+        public NameValueCollection Get64BitConnectionProperties()
+        {
+            return this.ConnectionProperties;
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/DSNCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/DSNCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/DSNCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -81,5 +81,10 @@
             if (lstDSN.SelectedItem != null)
                 OnConnectionChanged();
         }
+
+        public NameValueCollection Get64BitConnectionProperties()
+        {
+            return this.ConnectionProperties;
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/IOdbcSubEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/IOdbcSubEditor.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/IOdbcSubEditor.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -32,5 +32,7 @@
         event EventHandler ConnectionChanged;
 
         Control Content { get; }
+
+        NameValueCollection Get64BitConnectionProperties();
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/KnownDriversCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/KnownDriversCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/KnownDriversCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -65,6 +65,11 @@
             }
         }
 
+        public NameValueCollection Get64BitConnectionProperties()
+        {
+            return this.ConnectionProperties;
+        }
+
         public event EventHandler ConnectionChanged;
 
         public Control Content

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ManagedCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ManagedCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/ManagedCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -66,23 +66,7 @@
         {
             get
             {
-                var values = new NameValueCollection();
-
-                if (string.IsNullOrEmpty(resDataCtrl.MarkedFile))
-                    return values;
-                    //throw new InvalidOperationException(Properties.Resources.OdbcNoMarkedFile);
-
-                string drv = InferDriver(resDataCtrl.MarkedFile);
-                if (drv == null)
-                    return values;
-                    //throw new InvalidOperationException(string.Format(Properties.Resources.OdbcCannotInferDriver, resDataCtrl.MarkedFile));
-
-                var inner = new System.Data.Odbc.OdbcConnectionStringBuilder();
-                inner["Driver"] = drv;
-                inner["Dbq"] = "%MG_DATA_FILE_PATH%" + resDataCtrl.MarkedFile;
-                values["ConnectionString"] = inner.ToString();
-
-                return values;
+                return GetConnectionPropertiesInternal(false);
             }
             set
             {
@@ -100,9 +84,35 @@
             }
         }
 
+        public NameValueCollection Get64BitConnectionProperties()
+        {
+            return GetConnectionPropertiesInternal(true);
+        }
+
+        private NameValueCollection GetConnectionPropertiesInternal(bool use64Bit)
+        {
+            var values = new NameValueCollection();
+
+            if (string.IsNullOrEmpty(resDataCtrl.MarkedFile))
+                return values;
+            //throw new InvalidOperationException(Properties.Resources.OdbcNoMarkedFile);
+
+            string drv = InferDriver(resDataCtrl.MarkedFile, use64Bit);
+            if (drv == null)
+                return values;
+            //throw new InvalidOperationException(string.Format(Properties.Resources.OdbcCannotInferDriver, resDataCtrl.MarkedFile));
+
+            var inner = new System.Data.Odbc.OdbcConnectionStringBuilder();
+            inner["Driver"] = drv;
+            inner["Dbq"] = "%MG_DATA_FILE_PATH%" + resDataCtrl.MarkedFile;
+            values["ConnectionString"] = inner.ToString();
+
+            return values;
+        }
+
         public event EventHandler ConnectionChanged;
 
-        private static string InferDriver(string fileName)
+        private static string InferDriver(string fileName, bool use64Bit)
         {
             string ext = System.IO.Path.GetExtension(fileName).ToUpper();
             switch (ext)
@@ -110,9 +120,9 @@
                 case ".ACCDB":
                     return Properties.Resources.OdbcDriverAccess64;
                 case ".MDB":
-                    return Properties.Resources.OdbcDriverAccess;
+                    return use64Bit ? Properties.Resources.OdbcDriverAccess64 : Properties.Resources.OdbcDriverAccess;
                 case ".XLS":
-                    return Properties.Resources.OdbcDriverExcel;
+                    return use64Bit ? Properties.Resources.OdbcDriverExcel64 : Properties.Resources.OdbcDriverExcel;
                 case ".XLSX":
                 case ".XLSM":
                 case ".XLSB":

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/UnmanagedCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/UnmanagedCtrl.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/SubEditors/UnmanagedCtrl.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -58,7 +58,7 @@
                 handler(this, EventArgs.Empty);
         }
 
-        private static string InferDriver(string fileName)
+        private static string InferDriver(string fileName, bool use64Bit)
         {
             string ext = System.IO.Path.GetExtension(fileName).ToUpper();
             switch (ext)
@@ -66,15 +66,9 @@
                 case ".ACCDB":
                     return Properties.Resources.OdbcDriverAccess64;
                 case ".MDB":
-                    if (MessageBox.Show(Properties.Resources.PromptUseOffice2010Drivers, Properties.Resources.TitleQuestion, MessageBoxButtons.YesNo) == DialogResult.Yes)
-                        return Properties.Resources.OdbcDriverAccess64;
-                    else
-                        return Properties.Resources.OdbcDriverAccess;
+                    return use64Bit ? Properties.Resources.OdbcDriverAccess64 : Properties.Resources.OdbcDriverAccess;
                 case ".XLS":
-                    if (MessageBox.Show(Properties.Resources.PromptUseOffice2010Drivers, Properties.Resources.TitleQuestion, MessageBoxButtons.YesNo) == DialogResult.Yes)
-                        return Properties.Resources.OdbcDriverExcel64;
-                    else
-                        return Properties.Resources.OdbcDriverExcel;
+                    return use64Bit ? Properties.Resources.OdbcDriverExcel64 : Properties.Resources.OdbcDriverExcel;
                 case ".XLSX":
                 case ".XLSM":
                 case ".XLSB":
@@ -87,23 +81,7 @@
         {
             get
             {
-                var values = new NameValueCollection();
-                string path = txtFilePath.Text;
-                if (string.IsNullOrEmpty(path))
-                    return values;
-                    //throw new InvalidOperationException(Properties.Resources.OdbcNoMarkedFile);
-
-                string drv = InferDriver(path);
-                if (drv == null)
-                    return values;
-                    //throw new InvalidOperationException(string.Format(Properties.Resources.OdbcCannotInferDriver, path));
-
-                var inner = new System.Data.Odbc.OdbcConnectionStringBuilder();
-                inner["Driver"] = drv;
-                inner["Dbq"] = path;
-                values["ConnectionString"] = inner.ToString();
-
-                return values;
+                return GetConnectionPropertiesInternal(false);
             }
             set
             {
@@ -115,6 +93,32 @@
             }
         }
 
+        private NameValueCollection GetConnectionPropertiesInternal(bool use64Bit)
+        {
+            var values = new NameValueCollection();
+            string path = txtFilePath.Text;
+            if (string.IsNullOrEmpty(path))
+                return values;
+            //throw new InvalidOperationException(Properties.Resources.OdbcNoMarkedFile);
+
+            string drv = InferDriver(path, use64Bit);
+            if (drv == null)
+                return values;
+            //throw new InvalidOperationException(string.Format(Properties.Resources.OdbcCannotInferDriver, path));
+
+            var inner = new System.Data.Odbc.OdbcConnectionStringBuilder();
+            inner["Driver"] = drv;
+            inner["Dbq"] = path;
+            values["ConnectionString"] = inner.ToString();
+
+            return values;
+        }
+
+        public NameValueCollection Get64BitConnectionProperties()
+        {
+            return GetConnectionPropertiesInternal(true);
+        }
+
         public event EventHandler ConnectionChanged;
 
         private void btnBrowse_Click(object sender, EventArgs e)

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     This code was generated by a tool.
-//     Runtime Version:2.0.50727.5448
+//     Runtime Version:2.0.50727.4963
 //
 //     Changes to this file may cause incorrect behavior and will be lost if
 //     the code is regenerated.
@@ -458,7 +458,7 @@
         }
         
         /// <summary>
-        ///   Looks up a localized string similar to Connection test failed.
+        ///   Looks up a localized string similar to Connection test failed: {0}.
         /// </summary>
         internal static string FS_ConnectionTestFailed {
             get {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2011-11-29 03:58:05 UTC (rev 6255)
@@ -186,7 +186,7 @@
     <value>Factory method already registered for version: </value>
   </data>
   <data name="FS_ConnectionTestFailed" xml:space="preserve">
-    <value>Connection test failed</value>
+    <value>Connection test failed: {0}</value>
     <comment>An error message that is displayed if a connection test on the feature source failed</comment>
   </data>
   <data name="FS_DefaultSpatialContextWarning" xml:space="preserve">

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -58,7 +58,7 @@
             //Note: Must be saved!
             string s = feature.CurrentConnection.FeatureService.TestConnection(feature.ResourceID);
             if (s.Trim().ToUpper() != true.ToString().ToUpper())
-                return new ValidationIssue[] { new ValidationIssue(feature, ValidationStatus.Error, ValidationStatusCode.Error_FeatureSource_ConnectionTestFailed, Properties.Resources.FS_ConnectionTestFailed) };
+                return new ValidationIssue[] { new ValidationIssue(feature, ValidationStatus.Error, ValidationStatusCode.Error_FeatureSource_ConnectionTestFailed, string.Format(Properties.Resources.FS_ConnectionTestFailed, s)) };
 
             try
             {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs	2011-11-29 02:39:09 UTC (rev 6254)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs	2011-11-29 03:58:05 UTC (rev 6255)
@@ -110,13 +110,13 @@
                 case DataPropertyType.Double:
                     return "xs:double";
                 case DataPropertyType.Int16:
-                    return "xs:int16";
+                    return "xs:short";
                 case DataPropertyType.Int32:
-                    return "fdo:int32";
+                    return "xs:int";
                 case DataPropertyType.Int64:
                     return "xs:int64";
                 case DataPropertyType.Single:
-                    return "xs:single";
+                    return "xs:float";
                 case DataPropertyType.String:
                     return "xs:string";
                 case DataPropertyType.Clob:



More information about the mapguide-commits mailing list