[mapguide-commits] r5707 - in trunk/Tools/Maestro: Maestro
Maestro.Editors/FeatureSource/Providers/Odbc
Maestro.Editors/Properties
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Apr 19 07:37:07 EDT 2011
Author: jng
Date: 2011-04-19 04:37:07 -0700 (Tue, 19 Apr 2011)
New Revision: 5707
Modified:
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
trunk/Tools/Maestro/Maestro/changelog.txt
Log:
ODBC Editor: Remove the stopgap measure of requiring a manual connection test before editing the schema or resetting it. This submission makes the connection test automatic, aborting the schema edit/reset if the connection does not check out
Also update the changelog
Modified: trunk/Tools/Maestro/Maestro/changelog.txt
===================================================================
--- trunk/Tools/Maestro/Maestro/changelog.txt 2011-04-19 06:28:35 UTC (rev 5706)
+++ trunk/Tools/Maestro/Maestro/changelog.txt 2011-04-19 11:37:07 UTC (rev 5707)
@@ -1,4 +1,19 @@
- - Add F2 keybinding to rename selected item in Site Explorer
+3.0 RC1
+-------
+
+ - Fix: Automatically test the connection first before editing or resetting an ODBC configuration document. Abort the process if connection test fails.
+ - Add an option to determine whether to validate resources on save
+ - Fix: Web Layout and Fusion editors didn't show the generated publish URL
+ - Fix: Layer Definition editor did not update the underlying XML content when deleting a vector scale range.
+ - Fix: Adding a new vector scale range in the Layer Definition editor did not create a default area/line/point rule
+ - Fix: When the "Show Area/Line/Point style checkbox is ticked, the Layer Definition editor would always create a new default rule
+ - Fix: Add missing coordinate system override functionality from 2.x
+ - Fix: Editors not re-initializing themselves properly after saving, when using Edit As XML command.
+ - Added more labels for main toolbar commands
+ - XML Editor: Add support for validating XML content against local XSD files
+ - Inactive document tabs are now colored differently to distinguish between active/inactive tabs
+ - Fix: Add missing find/replace in XML content functionality
+ - Add F2 keybinding to rename selected item in Site Explorer
- Fix: Added missing duplicate resource command from 2.x
- Fix: Added missing profiling feature from 2.x
- Fix: UI layout changes for Generic Feature Source Editor
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs 2011-04-19 06:28:35 UTC (rev 5706)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Odbc/OdbcProviderCtrl.cs 2011-04-19 11:37:07 UTC (rev 5707)
@@ -206,52 +206,73 @@
//This is ODBC, so there will only be one
private string _defaultSchemaName;
- private void btnEditSchema_Click(object sender, EventArgs e)
+ private bool CheckValidConnection()
{
if (string.IsNullOrEmpty(_fs.ConnectionString))
{
- MessageBox.Show(Properties.Resources.NoConnectionSet);
- return;
- }
-
- if (string.IsNullOrEmpty(_defaultSchemaName))
- {
- var names = _fs.GetSchemaNames();
- if (names.Length == 1)
+ if (this.ChildEditor != null)
{
- _defaultSchemaName = names[0];
+ var props = this.ChildEditor.ConnectionProperties;
+ _fs.ApplyConnectionProperties(props);
}
- else
- {
- MessageBox.Show(Properties.Resources.NoSchemasInFeatureSource);
- return;
- }
}
- string xml = _fs.GetConfigurationContent();
- if (!string.IsNullOrEmpty(xml))
+ //Flush back to session before testing
+ _service.SyncSessionCopy();
+
+ string result = _fs.TestConnection();
+ if (!result.ToLower().Equals("true"))
{
- _doc = (OdbcConfigurationDocument)ConfigurationDocument.LoadXml(xml);
+ MessageBox.Show(string.Format(Properties.Resources.InvalidConnection, result), Properties.Resources.TitleError);
+ return false;
}
- else
+
+ return true;
+ }
+
+ private void btnEditSchema_Click(object sender, EventArgs e)
+ {
+ if (CheckValidConnection())
{
- if (_doc == null)
+ if (string.IsNullOrEmpty(_defaultSchemaName))
{
- BuildDefaultDocument();
+ var names = _fs.GetSchemaNames();
+ if (names.Length == 1)
+ {
+ _defaultSchemaName = names[0];
+ }
+ else
+ {
+ MessageBox.Show(Properties.Resources.NoSchemasInFeatureSource);
+ return;
+ }
}
- }
- var diag = new TableConfigurationDialog(_doc, _defaultSchemaName);
- if (diag.ShowDialog() == DialogResult.OK)
- {
- _doc.ClearMappings();
- foreach (var table in diag.ConfiguredTables)
+ string xml = _fs.GetConfigurationContent();
+ if (!string.IsNullOrEmpty(xml))
{
- _doc.AddOverride(table);
+ _doc = (OdbcConfigurationDocument)ConfigurationDocument.LoadXml(xml);
}
- string updatedContent = _doc.ToXml();
- _fs.SetConfigurationContent(updatedContent);
- OnResourceChanged();
+ else
+ {
+ if (_doc == null)
+ {
+ BuildDefaultDocument();
+ }
+ }
+
+ var diag = new TableConfigurationDialog(_doc, _defaultSchemaName);
+ if (diag.ShowDialog() == DialogResult.OK)
+ {
+ _doc.ClearMappings();
+ foreach (var table in diag.ConfiguredTables)
+ {
+ _doc.AddOverride(table);
+ }
+ string updatedContent = _doc.ToXml();
+ _fs.SetConfigurationContent(updatedContent);
+ OnResourceChanged();
+ }
}
}
@@ -280,17 +301,14 @@
private void btnReset_Click(object sender, EventArgs e)
{
- if (string.IsNullOrEmpty(_fs.ConnectionString))
+ if (CheckValidConnection())
{
- MessageBox.Show(Properties.Resources.NoConnectionSet);
- return;
+ _fs.SetConfigurationContent(null);
+ _fs.ConfigurationDocument = null;
+ _service.SyncSessionCopy();
+ BuildDefaultDocument();
+ MessageBox.Show(Properties.Resources.ConfigurationDocumentReset);
}
-
- _fs.SetConfigurationContent(null);
- _fs.ConfigurationDocument = null;
- _service.SyncSessionCopy();
- BuildDefaultDocument();
- MessageBox.Show(Properties.Resources.ConfigurationDocumentReset);
}
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-04-19 06:28:35 UTC (rev 5706)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-04-19 11:37:07 UTC (rev 5707)
@@ -1568,6 +1568,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to This is not a valid connection: {0}.
+ /// </summary>
+ internal static string InvalidConnection {
+ get {
+ return ResourceManager.GetString("InvalidConnection", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Invalid field count in line {0}.
/// </summary>
internal static string InvalidFieldCountError {
@@ -1852,15 +1861,6 @@
}
/// <summary>
- /// Looks up a localized string similar to Could not determine the validity of this feature source. Please test the connection first to ensure a valid connection..
- /// </summary>
- internal static string NoConnectionSet {
- get {
- return ResourceManager.GetString("NoConnectionSet", resourceCulture);
- }
- }
-
- /// <summary>
/// Looks up a localized string similar to You have not selected a starting folder, do you want to back up the entire site?.
/// </summary>
internal static string NoFolderSelected {
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-04-19 06:28:35 UTC (rev 5706)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-04-19 11:37:07 UTC (rev 5707)
@@ -1154,9 +1154,6 @@
<data name="TitleNewFeatureClass" xml:space="preserve">
<value>New Feature Class</value>
</data>
- <data name="NoConnectionSet" xml:space="preserve">
- <value>Could not determine the validity of this feature source. Please test the connection first to ensure a valid connection.</value>
- </data>
<data name="PreviewUrlNotAvailable" xml:space="preserve">
<value>The Preview URL is not currently available</value>
</data>
@@ -1166,4 +1163,7 @@
<data name="TitleQuestion" xml:space="preserve">
<value>Question</value>
</data>
+ <data name="InvalidConnection" xml:space="preserve">
+ <value>This is not a valid connection: {0}</value>
+ </data>
</root>
\ No newline at end of file
More information about the mapguide-commits
mailing list