[mapguide-commits] r7130 - in branches/maestro-4.0.x: . Maestro Maestro.Editors Maestro.Editors/FeatureSource/Providers/Wms MaestroAPITests OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/ObjectModels OSGeo.MapGuide.MaestroAPI/Schema OSGeo.MapGuide.MaestroAPI/SchemaOverrides 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
Thu Oct 18 12:59:02 PDT 2012


Author: jng
Date: 2012-10-18 12:59:02 -0700 (Thu, 18 Oct 2012)
New Revision: 7130

Added:
   branches/maestro-4.0.x/Maestro.Editors/Strings.Designer.cs
   branches/maestro-4.0.x/Maestro.Editors/Strings.resx
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/ObjectModels/LongTransaction.cs
Modified:
   branches/maestro-4.0.x/
   branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs
   branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs
   branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx
   branches/maestro-4.0.x/Maestro.Editors/Maestro.Editors.csproj
   branches/maestro-4.0.x/Maestro/changelog.txt
   branches/maestro-4.0.x/MaestroAPITests/ConfigurationTests.cs
   branches/maestro-4.0.x/MaestroAPITests/ObjectTests.cs
   branches/maestro-4.0.x/MaestroAPITests/ValidationTests.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
   branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Utility.cs
Log:
#2117, #2137: Backport to 4.0.x


Property changes on: branches/maestro-4.0.x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/Tools/Maestro:6490-6494,6923-6924,6926,6928,7026,7034,7056,7058,7060-7061,7073-7074
   + /trunk/Tools/Maestro:6490-6494,6923-6924,6926,6928,7026,7034,7056,7058,7060-7061,7073-7074,7125-7128

Modified: branches/maestro-4.0.x/Maestro/changelog.txt
===================================================================
--- branches/maestro-4.0.x/Maestro/changelog.txt	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/Maestro/changelog.txt	2012-10-18 19:59:02 UTC (rev 7130)
@@ -1,5 +1,13 @@
-4.0.3
+4.0.4
 -----
+ - Improved WMS Feature Source editor
+ - Fix: XSD data type case-sensitivity when parsing FDO Data properties
+ - Fix: Improve memory usage in SetResourceData (Local/LocalNative) for really large files
+ - Fix: FDO class name encoding/decoding
+ - Fix: Illegal drag/drop actions in Map Definition editor
+
+4.0.3
+-----
  - New specialized error dialog for displaying XML content errors when saving resources
  - Theme generation now considers active layer filter when generating rules
  - Use UNIQUE() for fetching distinct values in Expression Editor

Modified: branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.Designer.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -44,10 +44,18 @@
             this.grdSpatialContexts = new System.Windows.Forms.DataGridView();
             this.COL_NAME = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.COL_CS = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.grpLogicalClass = new System.Windows.Forms.GroupBox();
+            this.lnkSwap = new System.Windows.Forms.LinkLabel();
+            this.txtClassDescription = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.txtClassName = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.btnSwapAll = new System.Windows.Forms.Button();
             this.groupBox2.SuspendLayout();
             this.toolStrip1.SuspendLayout();
             this.groupBox1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.grdSpatialContexts)).BeginInit();
+            this.grpLogicalClass.SuspendLayout();
             this.SuspendLayout();
             // 
             // label1
@@ -162,12 +170,61 @@
             this.COL_CS.Name = "COL_CS";
             this.COL_CS.ReadOnly = true;
             // 
+            // grpLogicalClass
+            // 
+            resources.ApplyResources(this.grpLogicalClass, "grpLogicalClass");
+            this.grpLogicalClass.Controls.Add(this.lnkSwap);
+            this.grpLogicalClass.Controls.Add(this.txtClassDescription);
+            this.grpLogicalClass.Controls.Add(this.label3);
+            this.grpLogicalClass.Controls.Add(this.txtClassName);
+            this.grpLogicalClass.Controls.Add(this.label2);
+            this.grpLogicalClass.Name = "grpLogicalClass";
+            this.grpLogicalClass.TabStop = false;
+            // 
+            // lnkSwap
+            // 
+            resources.ApplyResources(this.lnkSwap, "lnkSwap");
+            this.lnkSwap.Name = "lnkSwap";
+            this.lnkSwap.TabStop = true;
+            this.lnkSwap.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lnkSwap_LinkClicked);
+            // 
+            // txtClassDescription
+            // 
+            resources.ApplyResources(this.txtClassDescription, "txtClassDescription");
+            this.txtClassDescription.Name = "txtClassDescription";
+            this.txtClassDescription.TextChanged += new System.EventHandler(this.txtClassDescription_TextChanged);
+            // 
+            // label3
+            // 
+            resources.ApplyResources(this.label3, "label3");
+            this.label3.Name = "label3";
+            // 
+            // txtClassName
+            // 
+            resources.ApplyResources(this.txtClassName, "txtClassName");
+            this.txtClassName.Name = "txtClassName";
+            this.txtClassName.TextChanged += new System.EventHandler(this.txtClassName_TextChanged);
+            // 
+            // label2
+            // 
+            resources.ApplyResources(this.label2, "label2");
+            this.label2.Name = "label2";
+            // 
+            // btnSwapAll
+            // 
+            resources.ApplyResources(this.btnSwapAll, "btnSwapAll");
+            this.btnSwapAll.Name = "btnSwapAll";
+            this.btnSwapAll.UseVisualStyleBackColor = true;
+            this.btnSwapAll.Click += new System.EventHandler(this.btnSwapAll_Click);
+            // 
             // WmsAdvancedConfigurationDialog
             // 
             this.AcceptButton = this.btnSave;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
             resources.ApplyResources(this, "$this");
             this.ControlBox = false;
+            this.Controls.Add(this.btnSwapAll);
+            this.Controls.Add(this.grpLogicalClass);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.btnReset);
             this.Controls.Add(this.groupBox2);
@@ -183,6 +240,8 @@
             this.toolStrip1.PerformLayout();
             this.groupBox1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.grdSpatialContexts)).EndInit();
+            this.grpLogicalClass.ResumeLayout(false);
+            this.grpLogicalClass.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -205,5 +264,12 @@
         private System.Windows.Forms.DataGridView grdSpatialContexts;
         private System.Windows.Forms.DataGridViewTextBoxColumn COL_NAME;
         private System.Windows.Forms.DataGridViewTextBoxColumn COL_CS;
+        private System.Windows.Forms.GroupBox grpLogicalClass;
+        private System.Windows.Forms.TextBox txtClassDescription;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox txtClassName;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.LinkLabel lnkSwap;
+        private System.Windows.Forms.Button btnSwapAll;
     }
 }
\ No newline at end of file

Modified: branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -29,6 +29,7 @@
 using OSGeo.MapGuide.MaestroAPI.Schema;
 using Maestro.Editors.Common;
 using OSGeo.MapGuide.ObjectModels.Common;
+using Maestro.Shared.UI;
 
 namespace Maestro.Editors.FeatureSource.Providers.Wms
 {
@@ -39,13 +40,11 @@
         private IFeatureSource _fs;
 
         public WmsConfigurationDocument Document { get { return _config; } }
-        private BindingList<RasterWmsItem> _items;
 
         public WmsAdvancedConfigurationDialog(IEditorService service)
         {
             InitializeComponent();
             grdSpatialContexts.AutoGenerateColumns = false;
-            _items = new BindingList<RasterWmsItem>();
             _service = service;
             _fs = (IFeatureSource)_service.GetEditedResource();
             txtFeatureServer.Text = _fs.GetConnectionProperty("FeatureServer");
@@ -59,16 +58,15 @@
                 catch (Exception ex)
                 {
                     MessageBox.Show(string.Format(Properties.Resources.ErrorLoadingWmsConfig, ex.Message), Properties.Resources.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Error);
-                    _config = BuildDefaultWmsDocument();
+                    MakeDefaultDocument();
                 }
             }
             else
             {
-                _config = BuildDefaultWmsDocument();
+                MakeDefaultDocument();
             }
 
-            _items = new BindingList<RasterWmsItem>(new List<RasterWmsItem>(_config.RasterOverrides));
-            lstFeatureClasses.DataSource = _items;
+            lstFeatureClasses.DataSource = _config.RasterOverrides;
             grdSpatialContexts.DataSource = _config.SpatialContexts;
         }
 
@@ -116,7 +114,7 @@
 
         private static RasterWmsItem CreateDefaultItem(string schemaName, string clsName, string rasName, IFdoSpatialContext defaultSc)
         {
-            var item = new RasterWmsItem(clsName, rasName);
+            var item = new RasterWmsItem(schemaName, clsName, rasName);
             item.ImageFormat = "PNG";
             item.IsTransparent = true;
             item.BackgroundColor = Color.White;
@@ -147,16 +145,61 @@
             this.DialogResult = DialogResult.Cancel;
         }
 
+        private ClassDefinition _logicalClass;
+        private bool _updatingLogicalClassUI = false;
+
         private void lstFeatureClasses_SelectedIndexChanged(object sender, EventArgs e)
         {
             var item = (RasterWmsItem)lstFeatureClasses.SelectedItem;
             grpRaster.Controls.Clear();
+            _updatingLogicalClassUI = true;
+            try
+            {
+                if (item != null)
+                {
+                    var ctrl = new RasterDefinitionCtrl(_config, item, _service);
+                    ctrl.Dock = DockStyle.Fill;
+                    grpRaster.Controls.Add(ctrl);
 
-            var ctrl = new RasterDefinitionCtrl(_config, item, _service);
-            ctrl.Dock = DockStyle.Fill;
-            grpRaster.Controls.Add(ctrl);
+                    btnRemove.Enabled = true;
 
-            btnRemove.Enabled = true;
+                    //Get logical class
+                    string schemaName = item.SchemaName;
+                    string className = item.FeatureClass;
+
+                    if (!string.IsNullOrEmpty(schemaName) && !string.IsNullOrEmpty(className))
+                    {
+                        _logicalClass = _config.GetClass(schemaName, className);
+                        if (_logicalClass != null)
+                        {
+                            txtClassName.Text = _logicalClass.Name;
+                            txtClassDescription.Text = _logicalClass.Description;
+                        }
+                        else
+                        {
+                            txtClassName.Text = string.Empty;
+                            txtClassDescription.Text = string.Empty;
+                        }
+                    }
+                    else
+                    {
+                        _logicalClass = null;
+                        txtClassName.Text = string.Empty;
+                        txtClassDescription.Text = string.Empty;
+                    }
+                }
+                else
+                {
+                    _logicalClass = null;
+                    txtClassName.Text = string.Empty;
+                    txtClassDescription.Text = string.Empty;
+                }
+            }
+            finally
+            {
+                _updatingLogicalClassUI = false;
+            }
+            grpLogicalClass.Enabled = (_logicalClass != null);
         }
 
         private void btnRemove_Click(object sender, EventArgs e)
@@ -206,15 +249,122 @@
 
         private void btnReset_Click(object sender, EventArgs e)
         {
-            _config = BuildDefaultWmsDocument();
-            _items.Clear();
-            foreach (var ov in _config.RasterOverrides)
+            MakeDefaultDocument();
+            lstFeatureClasses.DataSource = _config.RasterOverrides;
+            grdSpatialContexts.DataSource = _config.SpatialContexts;
+        }
+
+        private void MakeDefaultDocument()
+        {
+            try
             {
-                _items.Add(ov);
+                _config = (WmsConfigurationDocument)_service.FeatureService.GetSchemaMapping("OSGeo.WMS", _fs.ConnectionString); //NOXLATE
+                //BOGUS: This was not as sufficient as I originally thought, nevertheless this contains
+                //information that would not exist if we constructed the document the old fashioned way.
+                string defaultScName = string.Empty;
+                if (_config.SpatialContexts.Length > 0)
+                {
+                    defaultScName = _config.SpatialContexts[0].Name;
+                }
+                else
+                {
+                    var list = _fs.GetSpatialInfo(false);
+                    if (list.SpatialContext.Count > 0)
+                    {
+                        defaultScName = list.SpatialContext[0].Name;
+                    }
+                    else //Really? What kind of WMS service are you????
+                    {
+                        var sc = new FdoSpatialContextListSpatialContext()
+                        {
+                            Name = "EPSG:4326", //NOXLATE
+                            Description = "Maestro-generated spatialc context", //NOXLATE
+                            CoordinateSystemName = "EPSG:4326", //NOXLATE
+                            CoordinateSystemWkt = "GEOGCS[\"LL84\",DATUM[\"WGS84\",SPHEROID[\"WGS84\",6378137.000,298.25722293]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.01745329251994]]", //NOXLATE
+                            Extent = new FdoSpatialContextListSpatialContextExtent()
+                            {
+                                LowerLeftCoordinate = new FdoSpatialContextListSpatialContextExtentLowerLeftCoordinate()
+                                {
+                                    X = "-180.0", //NOXLATE
+                                    Y = "-90.0" //NOXLATE
+                                },
+                                UpperRightCoordinate = new FdoSpatialContextListSpatialContextExtentUpperRightCoordinate()
+                                {
+                                    X = "180.0", //NOXLATE
+                                    Y = "90.0" //NOXLATE
+                                }
+                            },
+                            ExtentType = FdoSpatialContextListSpatialContextExtentType.Static,
+                            IsActive = true,
+                            XYTolerance = 0.0001,
+                            ZTolerance = 0.0001,
+                        };
+                        _config.AddSpatialContext(sc);
+                        defaultScName = sc.Name;
+                    }
+                }
+
+                EnsureRasterProperties(defaultScName);
+                _config.EnsureConsistency();
             }
-            grdSpatialContexts.DataSource = _config.SpatialContexts;
+            catch
+            {
+                _config = BuildDefaultWmsDocument();
+            }
         }
 
+        private void EnsureRasterProperties(string defaultScName)
+        {
+            foreach (var schema in _config.Schemas)
+            {
+                foreach (var cls in schema.Classes)
+                {
+                    //Add identity property if none found
+                    if (cls.IdentityProperties.Count == 0)
+                    {
+                        cls.AddProperty(new DataPropertyDefinition("Id", string.Empty) //NOXLATE
+                        {
+                            DataType = DataPropertyType.String,
+                            Length = 256,
+                            IsNullable = false
+                        }, true);
+                    }
+                    //Add raster property if there's only one property (the identity property we either just added or found)
+                    if (cls.Properties.Count == 1)
+                    {
+                        cls.AddProperty(new RasterPropertyDefinition("Image", string.Empty) //NOXLATE
+                        {
+                            DefaultImageXSize = 1024,
+                            DefaultImageYSize = 1024,
+                            SpatialContextAssociation = defaultScName
+                        });
+                    }
+                    else
+                    {
+                        bool bFoundRaster = false;
+                        //Try to find this raster property
+                        foreach (var prop in cls.Properties)
+                        {
+                            if (prop.Type == OSGeo.MapGuide.MaestroAPI.Schema.PropertyDefinitionType.Raster)
+                            {
+                                bFoundRaster = true;
+                                break;
+                            }
+                        }
+                        if (!bFoundRaster)
+                        {
+                            cls.AddProperty(new RasterPropertyDefinition("Image", string.Empty) //NOXLATE
+                            {
+                                DefaultImageXSize = 1024,
+                                DefaultImageYSize = 1024,
+                                SpatialContextAssociation = defaultScName
+                            });
+                        }
+                    }
+                }
+            }
+        }
+
         private void grdSpatialContexts_CellContentClick(object sender, DataGridViewCellEventArgs e)
         {
             if (e.ColumnIndex == 1)
@@ -226,5 +376,78 @@
                 }
             }
         }
+
+        private void txtClassName_TextChanged(object sender, EventArgs e)
+        {
+            if (_updatingLogicalClassUI) return;
+            if (_logicalClass == null) return;
+            var item = lstFeatureClasses.SelectedItem  as RasterWmsItem;
+            if (item == null) return;
+
+            _logicalClass.Name = txtClassName.Text;
+            item.FeatureClass = _logicalClass.Name;
+            lstFeatureClasses.DataSource = _config.RasterOverrides; //rebind
+        }
+
+        private void txtClassDescription_TextChanged(object sender, EventArgs e)
+        {
+            if (_updatingLogicalClassUI) return;
+            if (_logicalClass == null) return;
+            var item = lstFeatureClasses.SelectedItem as RasterWmsItem;
+            if (item == null) return;
+
+            _logicalClass.Description = txtClassDescription.Text;
+            item.FeatureClass = _logicalClass.Name;
+            lstFeatureClasses.DataSource = _config.RasterOverrides; //rebind
+        }
+
+        private void lnkSwap_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+        {
+            if (_logicalClass == null) return;
+            var item = lstFeatureClasses.SelectedItem as RasterWmsItem;
+            if (item == null) return;
+
+            try
+            {
+                _updatingLogicalClassUI = true;
+                var tmp = txtClassName.Text;
+                txtClassName.Text = txtClassDescription.Text;
+                txtClassDescription.Text = tmp;
+
+                _logicalClass.Name = txtClassName.Text;
+                _logicalClass.Description = txtClassDescription.Text;
+                item.FeatureClass = _logicalClass.Name;
+                lstFeatureClasses.DataSource = _config.RasterOverrides; //rebind
+            }
+            finally
+            {
+                _updatingLogicalClassUI = false;
+            }
+        }
+
+        private void btnSwapAll_Click(object sender, EventArgs e)
+        {
+            if (MessageBox.Show(Strings.ConfirmWmsLogicalClassSwap, string.Empty, MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
+            {
+                using (new WaitCursor(this))
+                {
+                    _logicalClass = null;
+                    lstFeatureClasses.SelectedItem = null;
+                    foreach (var item in _config.RasterOverrides)
+                    {
+                        var cls = _config.GetClass(item.SchemaName, item.FeatureClass);
+                        if (cls == null)
+                            continue;
+
+                        var tmp = cls.Name;
+                        cls.Name = cls.Description;
+                        cls.Description = tmp;
+
+                        item.FeatureClass = cls.Name;
+                    }
+                    lstFeatureClasses.DataSource = _config.RasterOverrides; //rebind
+                }
+            }
+        }
     }
 }

Modified: branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/Maestro.Editors/FeatureSource/Providers/Wms/WmsAdvancedConfigurationDialog.resx	2012-10-18 19:59:02 UTC (rev 7130)
@@ -144,7 +144,7 @@
     <value>$this</value>
   </data>
   <data name=">>label1.ZOrder" xml:space="preserve">
-    <value>7</value>
+    <value>9</value>
   </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="txtFeatureServer.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
@@ -169,16 +169,16 @@
     <value>$this</value>
   </data>
   <data name=">>txtFeatureServer.ZOrder" xml:space="preserve">
-    <value>6</value>
+    <value>8</value>
   </data>
   <data name="grpRaster.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Bottom, Left, Right</value>
   </data>
   <data name="grpRaster.Location" type="System.Drawing.Point, System.Drawing">
-    <value>294, 134</value>
+    <value>294, 224</value>
   </data>
   <data name="grpRaster.Size" type="System.Drawing.Size, System.Drawing">
-    <value>357, 352</value>
+    <value>357, 262</value>
   </data>
   <data name="grpRaster.TabIndex" type="System.Int32, mscorlib">
     <value>2</value>
@@ -196,7 +196,7 @@
     <value>$this</value>
   </data>
   <data name=">>grpRaster.ZOrder" xml:space="preserve">
-    <value>5</value>
+    <value>7</value>
   </data>
   <data name="btnSave.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Right</value>
@@ -223,7 +223,7 @@
     <value>$this</value>
   </data>
   <data name=">>btnSave.ZOrder" xml:space="preserve">
-    <value>4</value>
+    <value>6</value>
   </data>
   <data name="btnCancel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Bottom, Right</value>
@@ -250,11 +250,62 @@
     <value>$this</value>
   </data>
   <data name=">>btnCancel.ZOrder" xml:space="preserve">
-    <value>3</value>
+    <value>5</value>
   </data>
+  <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
   <data name="groupBox2.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Bottom, Left</value>
   </data>
+  <data name=">>lstFeatureClasses.Name" xml:space="preserve">
+    <value>lstFeatureClasses</value>
+  </data>
+  <data name=">>lstFeatureClasses.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>lstFeatureClasses.Parent" xml:space="preserve">
+    <value>groupBox2</value>
+  </data>
+  <data name=">>lstFeatureClasses.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name=">>toolStrip1.Name" xml:space="preserve">
+    <value>toolStrip1</value>
+  </data>
+  <data name=">>toolStrip1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>toolStrip1.Parent" xml:space="preserve">
+    <value>groupBox2</value>
+  </data>
+  <data name=">>toolStrip1.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 134</value>
+  </data>
+  <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>276, 352</value>
+  </data>
+  <data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
+    <value>5</value>
+  </data>
+  <data name="groupBox2.Text" xml:space="preserve">
+    <value>Feature Classes</value>
+  </data>
+  <data name=">>groupBox2.Name" xml:space="preserve">
+    <value>groupBox2</value>
+  </data>
+  <data name=">>groupBox2.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>groupBox2.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name=">>groupBox2.ZOrder" xml:space="preserve">
+    <value>4</value>
+  </data>
   <data name="lstFeatureClasses.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
@@ -309,30 +360,6 @@
   <data name=">>toolStrip1.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <data name="groupBox2.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 134</value>
-  </data>
-  <data name="groupBox2.Size" type="System.Drawing.Size, System.Drawing">
-    <value>276, 352</value>
-  </data>
-  <data name="groupBox2.TabIndex" type="System.Int32, mscorlib">
-    <value>5</value>
-  </data>
-  <data name="groupBox2.Text" xml:space="preserve">
-    <value>Feature Classes</value>
-  </data>
-  <data name=">>groupBox2.Name" xml:space="preserve">
-    <value>groupBox2</value>
-  </data>
-  <data name=">>groupBox2.Type" xml:space="preserve">
-    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </data>
-  <data name=">>groupBox2.Parent" xml:space="preserve">
-    <value>$this</value>
-  </data>
-  <data name=">>groupBox2.ZOrder" xml:space="preserve">
-    <value>2</value>
-  </data>
   <data name="btnAdd.ImageTransparentColor" type="System.Drawing.Color, System.Drawing">
     <value>Magenta</value>
   </data>
@@ -379,23 +406,53 @@
     <value>$this</value>
   </data>
   <data name=">>btnReset.ZOrder" xml:space="preserve">
-    <value>1</value>
+    <value>3</value>
   </data>
   <data name="groupBox1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
     <value>Top, Left, Right</value>
   </data>
+  <data name=">>grdSpatialContexts.Name" xml:space="preserve">
+    <value>grdSpatialContexts</value>
+  </data>
+  <data name=">>grdSpatialContexts.Type" xml:space="preserve">
+    <value>System.Windows.Forms.DataGridView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>grdSpatialContexts.Parent" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name=">>grdSpatialContexts.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
+    <value>12, 39</value>
+  </data>
+  <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
+    <value>639, 89</value>
+  </data>
+  <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
+    <value>7</value>
+  </data>
+  <data name="groupBox1.Text" xml:space="preserve">
+    <value>Spatial Contexts (click cell to edit coordinate system)</value>
+  </data>
+  <data name=">>groupBox1.Name" xml:space="preserve">
+    <value>groupBox1</value>
+  </data>
+  <data name=">>groupBox1.Type" xml:space="preserve">
+    <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>groupBox1.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name=">>groupBox1.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
   <metadata name="COL_NAME.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <data name="COL_NAME.HeaderText" xml:space="preserve">
-    <value>Name</value>
-  </data>
   <metadata name="COL_CS.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <data name="COL_CS.HeaderText" xml:space="preserve">
-    <value>Coordinate System</value>
-  </data>
   <data name="grdSpatialContexts.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
@@ -420,32 +477,269 @@
   <data name=">>grdSpatialContexts.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <data name="groupBox1.Location" type="System.Drawing.Point, System.Drawing">
-    <value>12, 39</value>
+  <metadata name="COL_NAME.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="COL_NAME.HeaderText" xml:space="preserve">
+    <value>Name</value>
   </data>
-  <data name="groupBox1.Size" type="System.Drawing.Size, System.Drawing">
-    <value>639, 89</value>
+  <metadata name="COL_CS.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="COL_CS.HeaderText" xml:space="preserve">
+    <value>Coordinate System</value>
   </data>
-  <data name="groupBox1.TabIndex" type="System.Int32, mscorlib">
-    <value>7</value>
+  <data name="grpLogicalClass.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
   </data>
-  <data name="groupBox1.Text" xml:space="preserve">
-    <value>Spatial Contexts (click cell to edit coordinate system)</value>
+  <data name=">>lnkSwap.Name" xml:space="preserve">
+    <value>lnkSwap</value>
   </data>
-  <data name=">>groupBox1.Name" xml:space="preserve">
-    <value>groupBox1</value>
+  <data name=">>lnkSwap.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>groupBox1.Type" xml:space="preserve">
+  <data name=">>lnkSwap.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>lnkSwap.ZOrder" xml:space="preserve">
+    <value>0</value>
+  </data>
+  <data name=">>txtClassDescription.Name" xml:space="preserve">
+    <value>txtClassDescription</value>
+  </data>
+  <data name=">>txtClassDescription.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtClassDescription.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>txtClassDescription.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name=">>label3.Name" xml:space="preserve">
+    <value>label3</value>
+  </data>
+  <data name=">>label3.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=">>label3.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>label3.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name=">>txtClassName.Name" xml:space="preserve">
+    <value>txtClassName</value>
+  </data>
+  <data name=">>txtClassName.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtClassName.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>txtClassName.ZOrder" xml:space="preserve">
+    <value>3</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>grpLogicalClass</value>
+  </data>
+  <data name=">>label2.ZOrder" xml:space="preserve">
+    <value>4</value>
+  </data>
+  <data name="grpLogicalClass.Enabled" type="System.Boolean, mscorlib">
+    <value>False</value>
+  </data>
+  <data name="grpLogicalClass.Location" type="System.Drawing.Point, System.Drawing">
+    <value>294, 134</value>
+  </data>
+  <data name="grpLogicalClass.Size" type="System.Drawing.Size, System.Drawing">
+    <value>354, 84</value>
+  </data>
+  <data name="grpLogicalClass.TabIndex" type="System.Int32, mscorlib">
+    <value>8</value>
+  </data>
+  <data name="grpLogicalClass.Text" xml:space="preserve">
+    <value>Logical Class</value>
+  </data>
+  <data name=">>grpLogicalClass.Name" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>grpLogicalClass.Type" xml:space="preserve">
     <value>System.Windows.Forms.GroupBox, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name=">>groupBox1.Parent" xml:space="preserve">
+  <data name=">>grpLogicalClass.Parent" xml:space="preserve">
     <value>$this</value>
   </data>
-  <data name=">>groupBox1.ZOrder" xml:space="preserve">
+  <data name=">>grpLogicalClass.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="lnkSwap.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="lnkSwap.Location" type="System.Drawing.Point, System.Drawing">
+    <value>88, 0</value>
+  </data>
+  <data name="lnkSwap.Size" type="System.Drawing.Size, System.Drawing">
+    <value>40, 13</value>
+  </data>
+  <data name="lnkSwap.TabIndex" type="System.Int32, mscorlib">
+    <value>4</value>
+  </data>
+  <data name="lnkSwap.Text" xml:space="preserve">
+    <value>(Swap)</value>
+  </data>
+  <data name=">>lnkSwap.Name" xml:space="preserve">
+    <value>lnkSwap</value>
+  </data>
+  <data name=">>lnkSwap.Type" xml:space="preserve">
+    <value>System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>lnkSwap.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>lnkSwap.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <data name="txtClassDescription.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="txtClassDescription.Location" type="System.Drawing.Point, System.Drawing">
+    <value>91, 49</value>
+  </data>
+  <data name="txtClassDescription.Size" type="System.Drawing.Size, System.Drawing">
+    <value>234, 20</value>
+  </data>
+  <data name="txtClassDescription.TabIndex" type="System.Int32, mscorlib">
+    <value>3</value>
+  </data>
+  <data name=">>txtClassDescription.Name" xml:space="preserve">
+    <value>txtClassDescription</value>
+  </data>
+  <data name=">>txtClassDescription.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtClassDescription.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>txtClassDescription.ZOrder" xml:space="preserve">
+    <value>1</value>
+  </data>
+  <data name="label3.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
+  </data>
+  <data name="label3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+    <value>NoControl</value>
+  </data>
+  <data name="label3.Location" type="System.Drawing.Point, System.Drawing">
+    <value>16, 52</value>
+  </data>
+  <data name="label3.Size" type="System.Drawing.Size, System.Drawing">
+    <value>60, 13</value>
+  </data>
+  <data name="label3.TabIndex" type="System.Int32, mscorlib">
+    <value>2</value>
+  </data>
+  <data name="label3.Text" xml:space="preserve">
+    <value>Description</value>
+  </data>
+  <data name=">>label3.Name" xml:space="preserve">
+    <value>label3</value>
+  </data>
+  <data name=">>label3.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=">>label3.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>label3.ZOrder" xml:space="preserve">
+    <value>2</value>
+  </data>
+  <data name="txtClassName.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Top, Left, Right</value>
+  </data>
+  <data name="txtClassName.Location" type="System.Drawing.Point, System.Drawing">
+    <value>91, 23</value>
+  </data>
+  <data name="txtClassName.Size" type="System.Drawing.Size, System.Drawing">
+    <value>234, 20</value>
+  </data>
+  <data name="txtClassName.TabIndex" type="System.Int32, mscorlib">
+    <value>1</value>
+  </data>
+  <data name=">>txtClassName.Name" xml:space="preserve">
+    <value>txtClassName</value>
+  </data>
+  <data name=">>txtClassName.Type" xml:space="preserve">
+    <value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </data>
+  <data name=">>txtClassName.Parent" xml:space="preserve">
+    <value>grpLogicalClass</value>
+  </data>
+  <data name=">>txtClassName.ZOrder" xml:space="preserve">
+    <value>3</value>
+  </data>
+  <data name="label2.AutoSize" type="System.Boolean, mscorlib">
+    <value>True</value>
+  </data>
+  <data name="label2.Location" type="System.Drawing.Point, System.Drawing">
+    <value>16, 26</value>
+  </data>
+  <data name="label2.Size" type="System.Drawing.Size, System.Drawing">
+    <value>35, 13</value>
+  </data>
+  <data name="label2.TabIndex" type="System.Int32, mscorlib">
+    <value>0</value>
+  </data>
+  <data name="label2.Text" xml:space="preserve">
+    <value>Name</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>grpLogicalClass</value>
+  </data>
+  <data name=">>label2.ZOrder" xml:space="preserve">
+    <value>4</value>
+  </data>
+  <data name="btnSwapAll.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
+    <value>Bottom, Left</value>
+  </data>
+  <data name="btnSwapAll.Location" type="System.Drawing.Point, System.Drawing">
+    <value>125, 492</value>
+  </data>
+  <data name="btnSwapAll.Size" type="System.Drawing.Size, System.Drawing">
+    <value>160, 23</value>
+  </data>
+  <data name="btnSwapAll.TabIndex" type="System.Int32, mscorlib">
+    <value>9</value>
+  </data>
+  <data name="btnSwapAll.Text" xml:space="preserve">
+    <value>Swap Class Name/Description</value>
+  </data>
+  <data name=">>btnSwapAll.Name" xml:space="preserve">
+    <value>btnSwapAll</value>
+  </data>
+  <data name=">>btnSwapAll.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=">>btnSwapAll.Parent" xml:space="preserve">
+    <value>$this</value>
+  </data>
+  <data name=">>btnSwapAll.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>663, 527</value>

Modified: branches/maestro-4.0.x/Maestro.Editors/Maestro.Editors.csproj
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/Maestro.Editors.csproj	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/Maestro.Editors/Maestro.Editors.csproj	2012-10-18 19:59:02 UTC (rev 7130)
@@ -976,6 +976,11 @@
     <Compile Include="RepositoryHandle.cs" />
     <Compile Include="RepositoryIcons.cs" />
     <Compile Include="ResourceEditorServiceBase.cs" />
+    <Compile Include="Strings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Strings.resx</DependentUpon>
+    </Compile>
     <Compile Include="SymbolDefinition\AdvancedSettingsCtrl.cs">
       <SubType>UserControl</SubType>
     </Compile>
@@ -2496,6 +2501,10 @@
     <EmbeddedResource Include="Resources\points\star.png" />
     <EmbeddedResource Include="Resources\points\triangle.png" />
     <EmbeddedResource Include="Resources\points\x.png" />
+    <EmbeddedResource Include="Strings.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Strings.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
     <EmbeddedResource Include="WatermarkDefinition\WatermarkContentCtrl.resx">
       <DependentUpon>WatermarkContentCtrl.cs</DependentUpon>
     </EmbeddedResource>

Added: branches/maestro-4.0.x/Maestro.Editors/Strings.Designer.cs
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/Strings.Designer.cs	                        (rev 0)
+++ branches/maestro-4.0.x/Maestro.Editors/Strings.Designer.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.5420
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Maestro.Editors {
+    using System;
+    
+    
+    /// <summary>
+    ///   A strongly-typed resource class, for looking up localized strings, etc.
+    /// </summary>
+    // This class was auto-generated by the StronglyTypedResourceBuilder
+    // class via a tool like ResGen or Visual Studio.
+    // To add or remove a member, edit your .ResX file then rerun ResGen
+    // with the /str option, or rebuild your VS project.
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Strings {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Strings() {
+        }
+        
+        /// <summary>
+        ///   Returns the cached ResourceManager instance used by this class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Maestro.Editors.Strings", typeof(Strings).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   Overrides the current thread's CurrentUICulture property for all
+        ///   resource lookups using this strongly typed resource class.
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+        
+        /// <summary>
+        ///   Looks up a localized string similar to In some cases, the actual WMS layer name would be generated in the FDO class description. Swap FDO logical class names with their descriptions?.
+        /// </summary>
+        internal static string ConfirmWmsLogicalClassSwap {
+            get {
+                return ResourceManager.GetString("ConfirmWmsLogicalClassSwap", resourceCulture);
+            }
+        }
+    }
+}

Added: branches/maestro-4.0.x/Maestro.Editors/Strings.resx
===================================================================
--- branches/maestro-4.0.x/Maestro.Editors/Strings.resx	                        (rev 0)
+++ branches/maestro-4.0.x/Maestro.Editors/Strings.resx	2012-10-18 19:59:02 UTC (rev 7130)
@@ -0,0 +1,123 @@
+<?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>
+  <data name="ConfirmWmsLogicalClassSwap" xml:space="preserve">
+    <value>In some cases, the actual WMS layer name would be generated in the FDO class description. Swap FDO logical class names with their descriptions?</value>
+  </data>
+</root>
\ No newline at end of file

Modified: branches/maestro-4.0.x/MaestroAPITests/ConfigurationTests.cs
===================================================================
--- branches/maestro-4.0.x/MaestroAPITests/ConfigurationTests.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/MaestroAPITests/ConfigurationTests.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -165,15 +165,15 @@
         {
             var conf = new WmsConfigurationDocument();
 
-            var schema = new FeatureSchema("WMS", "");
-            var cls = new ClassDefinition("NASAWMSGlobalPan", "");
-            cls.AddProperty(new DataPropertyDefinition("Id", "")
+            var schema = new FeatureSchema("WMS", "WMS Test Schema");
+            var cls = new ClassDefinition("NASAWMSGlobalPan", "WMS Test Class");
+            cls.AddProperty(new DataPropertyDefinition("Id", "ID Property")
             {
                 DataType = DataPropertyType.String,
                 Length = 256,
                 IsNullable = false
             }, true);
-            cls.AddProperty(new RasterPropertyDefinition("Image", "")
+            cls.AddProperty(new RasterPropertyDefinition("Image", "Raster Property")
             {
                 DefaultImageXSize = 800,
                 DefaultImageYSize = 800
@@ -182,7 +182,7 @@
             schema.AddClass(cls);
             conf.AddSchema(schema);
 
-            var item = new RasterWmsItem(cls.Name, "Image");
+            var item = new RasterWmsItem(schema.Name, cls.Name, "Image");
             item.ImageFormat = RasterWmsItem.WmsImageFormat.PNG;
             item.IsTransparent = true;
             item.BackgroundColor = ColorTranslator.FromHtml("#FFFFFF");
@@ -208,7 +208,23 @@
             Assert.AreEqual(1, conf.RasterOverrides.Length);
 
             var ritem = conf.RasterOverrides[0];
+            cls = conf.GetClass("WMS", "NASAWMSGlobalPan");
 
+            Assert.NotNull(cls);
+            Assert.NotNull(cls.Parent);
+            Assert.AreEqual("WMS", cls.Parent.Name);
+            Assert.AreEqual("WMS Test Schema", cls.Parent.Description);
+            Assert.AreEqual("NASAWMSGlobalPan", cls.Name);
+            Assert.AreEqual("WMS Test Class", cls.Description);
+            var prop = cls.FindProperty("Id");
+            Assert.NotNull(prop);
+            Assert.AreEqual("Id", prop.Name);
+            Assert.AreEqual("ID Property", prop.Description);
+            prop = cls.FindProperty("Image");
+            Assert.NotNull(prop);
+            Assert.AreEqual("Image", prop.Name);
+            Assert.AreEqual("Raster Property", prop.Description);
+
             Assert.AreEqual(item.ImageFormat, ritem.ImageFormat);
             Assert.AreEqual(item.IsTransparent, ritem.IsTransparent);
             Assert.AreEqual(item.BackgroundColor, ritem.BackgroundColor);

Modified: branches/maestro-4.0.x/MaestroAPITests/ObjectTests.cs
===================================================================
--- branches/maestro-4.0.x/MaestroAPITests/ObjectTests.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/MaestroAPITests/ObjectTests.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -36,6 +36,24 @@
     public class ObjectTests
     {
         [Test]
+        public void TestConnectionString()
+        {
+            System.Data.Common.DbConnectionStringBuilder builder = new System.Data.Common.DbConnectionStringBuilder();
+            builder["Foo"] = "sdfjkg";
+            builder["Bar"] = "skgjuksdf";
+            builder["Snafu"] = "asjdgjh;sdgj"; //Note the ; in the value
+            builder["Whatever"] = "asjd=gjh;sdgj"; //Note the ; and = in the value
+
+            var values = ConnectionProviderRegistry.ParseConnectionString(builder.ToString());
+            Assert.AreEqual(values.Count, 4);
+
+            Assert.AreEqual(builder["Foo"].ToString(), values["Foo"]);
+            Assert.AreEqual(builder["Bar"].ToString(), values["Bar"]);
+            Assert.AreEqual(builder["Snafu"].ToString(), values["Snafu"]);
+            Assert.AreEqual(builder["Whatever"].ToString(), values["Whatever"]);
+        }
+
+        [Test]
         public void TestArgParser()
         {
             string[] args = new string[] { "-foo", "-bar:snafu", "-whatever:" };

Modified: branches/maestro-4.0.x/MaestroAPITests/ValidationTests.cs
===================================================================
--- branches/maestro-4.0.x/MaestroAPITests/ValidationTests.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/MaestroAPITests/ValidationTests.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -400,6 +400,17 @@
             {
                 throw new NotImplementedException();
             }
+
+
+            public OSGeo.MapGuide.ObjectModels.Common.ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly)
+            {
+                throw new NotImplementedException();
+            }
+
+            public OSGeo.MapGuide.MaestroAPI.SchemaOverrides.ConfigurationDocument GetSchemaMapping(string provider, string partialConnString)
+            {
+                throw new NotImplementedException();
+            }
         }
         #endregion
 

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2012-10-18 19:59:02 UTC (rev 7130)
@@ -223,6 +223,7 @@
     <Compile Include="NsDoc.cs" />
     <Compile Include="ObjectModels\CommonTypes.cs" />
     <Compile Include="ObjectModels\IFdoSpatialContext.cs" />
+    <Compile Include="ObjectModels\LongTransaction.cs" />
     <Compile Include="ObjectModels\NsDoc.cs" />
     <Compile Include="ObjectModels\SymbolDefFactory.cs" />
     <Compile Include="ObjectModels\WatermarkInterfaces.cs" />

Copied: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/ObjectModels/LongTransaction.cs (from rev 7128, trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/LongTransaction.cs)
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/ObjectModels/LongTransaction.cs	                        (rev 0)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/ObjectModels/LongTransaction.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -0,0 +1,71 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OSGeo.MapGuide.ObjectModels.Common
+{
+    /// <summary>
+    /// Represents a list of long transactions
+    /// </summary>
+    public interface ILongTransactionList
+    {
+        /// <summary>
+        /// Gets the long transactions in this list
+        /// </summary>
+        IEnumerable<ILongTransaction> Transactions { get; }
+    }
+
+    /// <summary>
+    /// Represents a long transaction
+    /// </summary>
+    public interface ILongTransaction
+    {
+        /// <summary>
+        /// Gets the name of the long transaction
+        /// </summary>
+        string Name { get; }
+
+        /// <summary>
+        /// Gets the description of the long transaction
+        /// </summary>
+        string Description { get; }
+
+        /// <summary>
+        /// Gets the owner of the long transaction
+        /// </summary>
+        string Owner { get; }
+
+        /// <summary>
+        /// Gets the creation date of the long transaction
+        /// </summary>
+        string CreationDate { get; }
+
+        /// <summary>
+        /// Gets whether the long transaction is active
+        /// </summary>
+        bool IsActive { get; }
+
+        /// <summary>
+        /// Gets whether the long transaction is frozen
+        /// </summary>
+        bool IsFrozen { get; }
+    }
+
+    partial class FdoLongTransactionList : ILongTransactionList
+    {
+        public IEnumerable<ILongTransaction> Transactions
+        {
+            get 
+            {
+                foreach (var tx in this.Transactions)
+                    yield return tx;
+            }
+        }
+    }
+
+    partial class FdoLongTransactionListLongTransaction : ILongTransaction
+    {
+
+    }
+}

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -39,6 +39,8 @@
 using GeoAPI.Geometries;
 using OSGeo.MapGuide.ObjectModels.LoadProcedure;
 using OSGeo.MapGuide.ObjectModels.LayerDefinition;
+using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
 
 namespace OSGeo.MapGuide.MaestroAPI
 {
@@ -1659,6 +1661,23 @@
         /// <returns></returns>
         public abstract string[] GetClassNames(string resourceId, string schemaName);
 
+        /// <summary>
+        /// Gets the long transactions for the specified feature source
+        /// </summary>
+        /// <param name="resourceId">The feature source id</param>
+        /// <param name="activeOnly">If true, will only return active long transactions</param>
+        /// <returns></returns>
+        public abstract ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly);
+
+        /// <summary>
+        /// Gets the schema mappings for the given FDO provider. These mappings form the basis for a custom configuration document
+        /// for a feature source that supports configuration
+        /// </summary>
+        /// <param name="provider">The FDO provider</param>
+        /// <param name="partialConnString">The connection string</param>
+        /// <returns></returns>
+        public abstract ConfigurationDocument GetSchemaMapping(string provider, string partialConnString);
+
         #endregion
 
         #region Feature/Capability Discovery

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -285,7 +285,14 @@
                 ctype.SetAttribute("hasGeometry", XmlNamespaces.FDO, "false");
             }
 
-            var cnt = doc.CreateElement("xs", "complexContent", XmlNamespaces.XS);
+            //Write description node
+            var anno = doc.CreateElement("xs", "annotation", XmlNamespaces.XS); //NOXLATE
+            var docN = doc.CreateElement("xs", "documentation", XmlNamespaces.XS); //NOXLATE
+            docN.InnerText = this.Description;
+            ctype.AppendChild(anno);
+            anno.AppendChild(docN);
+
+            var cnt = doc.CreateElement("xs", "complexContent", XmlNamespaces.XS); //NOXLATE
             ctype.AppendChild(cnt);
 
             var ext = doc.CreateElement("xs", "extension", XmlNamespaces.XS);
@@ -321,6 +328,11 @@
             if (abn != null)
                 this.IsAbstract = Convert.ToBoolean(abn.Value);
 
+            //Description
+            var docNode = node.SelectSingleNode("xs:annotation/xs:documentation", mgr); //NOXLATE
+            if (docNode != null)
+                this.Description = docNode.InnerText;
+
             //Process properties
             XmlNodeList propNodes = node.SelectNodes("xs:complexContent/xs:extension/xs:sequence/xs:element", mgr);
             if (propNodes.Count == 0)

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -202,7 +202,14 @@
             if (this.IsAutoGenerated)
                 prop.SetAttribute("autogenerated", XmlNamespaces.FDO, this.IsAutoGenerated.ToString().ToLower());
 
-            var simp = doc.CreateElement("xs", "simpleType", XmlNamespaces.XS);
+            //Write description node
+            var anno = doc.CreateElement("xs", "annotation", XmlNamespaces.XS); //NOXLATE
+            var docN = doc.CreateElement("xs", "documentation", XmlNamespaces.XS); //NOXLATE
+            docN.InnerText = this.Description;
+            prop.AppendChild(anno);
+            anno.AppendChild(docN);
+
+            var simp = doc.CreateElement("xs", "simpleType", XmlNamespaces.XS); //NOXLATE
             prop.AppendChild(simp);
 
             var rest = doc.CreateElement("xs", "restriction", XmlNamespaces.XS);

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -134,6 +134,13 @@
             schema.SetAttribute("elementFormDefault", "qualified");
             schema.SetAttribute("attributeFormDefault", "unqualified");
 
+            //Write description node
+            var anno = doc.CreateElement("xs", "annotation", XmlNamespaces.XS); //NOXLATE
+            var docN = doc.CreateElement("xs", "documentation", XmlNamespaces.XS); //NOXLATE
+            docN.InnerText = this.Description;
+            schema.AppendChild(anno);
+            anno.AppendChild(docN);
+
             foreach (var cls in this.Classes)
             {
                 cls.WriteXml(doc, schema);
@@ -152,6 +159,11 @@
             if (!node.Name.Equals("xs:schema"))
                 throw new Exception("Bad document. Expected element: xs:schema"); //LOCALIZEME
 
+            //Description
+            var docNode = node.SelectSingleNode("xs:annotation/xs:documentation", mgr); //NOXLATE
+            if (docNode != null)
+                this.Description = docNode.InnerText;
+
             var tns = node.Attributes["targetNamespace"];
             if (tns == null)
                 throw new Exception("Bad document. Expected attribute: targetNamespace"); //LOCALIZEME

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -271,16 +271,24 @@
         {
             var en = Utility.EncodeFDOName(this.Name);
 
-            var geom = doc.CreateElement("xs", "element", XmlNamespaces.XS);
-            geom.SetAttribute("name", en); //TODO: This may have been decoded. Should it be re-encoded?
-            geom.SetAttribute("type", "gml:AbstractGeometryType");
-            geom.SetAttribute("hasMeasure", XmlNamespaces.FDO, this.HasMeasure.ToString().ToLower());
-            geom.SetAttribute("hasElevation", XmlNamespaces.FDO, this.HasElevation.ToString().ToLower());
-            geom.SetAttribute("srsName", XmlNamespaces.FDO, this.SpatialContextAssociation);
-            geom.SetAttribute("geometricTypes", XmlNamespaces.FDO, GeometricTypesToString());
-            geom.SetAttribute("geometryTypes", XmlNamespaces.FDO, GeometryTypesToString());
-            geom.SetAttribute("geometryReadOnly", XmlNamespaces.FDO, this.IsReadOnly.ToString().ToLower());
+            var geom = doc.CreateElement("xs", "element", XmlNamespaces.XS); //NOXLATE
+            
+            geom.SetAttribute("name", en); //NOXLATE
+            geom.SetAttribute("type", "gml:AbstractGeometryType"); //NOXLATE
+            geom.SetAttribute("hasMeasure", XmlNamespaces.FDO, this.HasMeasure.ToString().ToLower()); //NOXLATE
+            geom.SetAttribute("hasElevation", XmlNamespaces.FDO, this.HasElevation.ToString().ToLower()); //NOXLATE
+            geom.SetAttribute("srsName", XmlNamespaces.FDO, this.SpatialContextAssociation); //NOXLATE
+            geom.SetAttribute("geometricTypes", XmlNamespaces.FDO, GeometricTypesToString()); //NOXLATE
+            geom.SetAttribute("geometryTypes", XmlNamespaces.FDO, GeometryTypesToString()); //NOXLATE
+            geom.SetAttribute("geometryReadOnly", XmlNamespaces.FDO, this.IsReadOnly.ToString().ToLower()); //NOXLATE
 
+            //Write description node
+            var anno = doc.CreateElement("xs", "annotation", XmlNamespaces.XS); //NOXLATE
+            var docN = doc.CreateElement("xs", "documentation", XmlNamespaces.XS); //NOXLATE
+            docN.InnerText = this.Description;
+            geom.AppendChild(anno);
+            anno.AppendChild(docN);
+
             currentNode.AppendChild(geom);
         }
 

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -214,7 +214,12 @@
             string name = Utility.DecodeFDOName(nn.Value);
             string desc = string.Empty;
 
-            if (node.Attributes["type"] != null && node.Attributes["type"].Value == "gml:AbstractGeometryType")
+            //Description
+            var docNode = node.SelectSingleNode("xs:annotation/xs:documentation", mgr); //NOXLATE
+            if (docNode != null)
+                desc = docNode.InnerText;
+
+            if (node.Attributes["type"] != null && node.Attributes["type"].Value == "gml:AbstractGeometryType") //NOXLATE
             {
                 prop = new GeometricPropertyDefinition(name, desc);
             }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -82,13 +82,21 @@
         {
             var en = Utility.EncodeFDOName(this.Name);
 
-            var geom = doc.CreateElement("xs", "element", XmlNamespaces.XS);
-            geom.SetAttribute("name", en); //TODO: This may have been decoded. Should it be re-encoded?
-            geom.SetAttribute("type", "fdo:RasterPropertyType");
-            geom.SetAttribute("defaultImageXSize", XmlNamespaces.FDO, this.DefaultImageXSize.ToString());
-            geom.SetAttribute("defaultImageYSize", XmlNamespaces.FDO, this.DefaultImageYSize.ToString());
-            geom.SetAttribute("srsName", XmlNamespaces.FDO, this.SpatialContextAssociation);
+            var geom = doc.CreateElement("xs", "element", XmlNamespaces.XS); //NOXLATE
+            
+            geom.SetAttribute("name", en); //NOXLATE
+            geom.SetAttribute("type", "fdo:RasterPropertyType"); //NOXLATE
+            geom.SetAttribute("defaultImageXSize", XmlNamespaces.FDO, this.DefaultImageXSize.ToString()); //NOXLATE
+            geom.SetAttribute("defaultImageYSize", XmlNamespaces.FDO, this.DefaultImageYSize.ToString()); //NOXLATE
+            geom.SetAttribute("srsName", XmlNamespaces.FDO, this.SpatialContextAssociation); //NOXLATE
 
+            //Write description node
+            var anno = doc.CreateElement("xs", "annotation", XmlNamespaces.XS); //NOXLATE
+            var docN = doc.CreateElement("xs", "documentation", XmlNamespaces.XS); //NOXLATE
+            docN.InnerText = this.Description;
+            geom.AppendChild(anno);
+            anno.AppendChild(docN);
+
             currentNode.AppendChild(geom);
         }
 

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/ConfigurationDocument.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -236,6 +236,11 @@
         {
             XmlDocument doc = new XmlDocument();
             doc.LoadXml(xml);
+            return LoadInternal(doc);
+        }
+
+        private static ConfigurationDocument LoadInternal(XmlDocument doc)
+        {
             var mgr = new XmlNamespaceManager(doc.NameTable);
             mgr.AddNamespace("xs", XmlNamespaces.XS);
             mgr.AddNamespace("xsi", XmlNamespaces.XSI);
@@ -279,5 +284,17 @@
 
             return null;
         }
+
+        /// <summary>
+        /// Creates a configuration document from the specified stream.
+        /// </summary>
+        /// <param name="stream">The stream.</param>
+        /// <returns>The configuration document</returns>
+        public static ConfigurationDocument Load(System.IO.Stream stream)
+        {
+            XmlDocument doc = new XmlDocument();
+            doc.Load(stream);
+            return LoadInternal(doc);
+        }
     }
 }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/RasterWmsItem.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -61,15 +61,22 @@
         /// <summary>
         /// Initializes a new instance of the <see cref="RasterWmsItem"/> class.
         /// </summary>
+        /// <param name="schemaName">Name of the schema</param>
         /// <param name="className">Name of the class.</param>
         /// <param name="rasterPropertyName">Name of the raster property.</param>
-        public RasterWmsItem(string className, string rasterPropertyName)
+        public RasterWmsItem(string schemaName, string className, string rasterPropertyName)
         {
+            this.SchemaName = schemaName;
             this.FeatureClass = className;
             this.RasterPropertyName = rasterPropertyName;
         }
 
         /// <summary>
+        /// Gets the name of the FDO logical schema this particular override applies to
+        /// </summary>
+        public string SchemaName { get; internal set; }
+
+        /// <summary>
         /// Gets or sets the feature class.
         /// </summary>
         /// <value>
@@ -241,9 +248,9 @@
             if (node.Name != "RasterDefinition")
                 throw new Exception("Bad document. Expected element: RasterDefinition");
 
-            var fc = node.ParentNode.Attributes["name"].Value;
-            this.FeatureClass = fc.Substring(0, fc.Length - "Type".Length);
-            this.RasterPropertyName = node.Attributes["name"].Value;
+            var fc = node.ParentNode.Attributes["name"].Value; //NOXLATE
+            this.FeatureClass = Utility.DecodeFDOName(fc.Substring(0, fc.Length - "Type".Length)); //NOXLATE
+            this.RasterPropertyName = node.Attributes["name"].Value; //NOXLATE
 
             var format = node["Format"];
             var transparent = node["Transparent"];

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/WmsConfigurationDocument.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -17,6 +17,7 @@
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 #endregion
+using OSGeo.MapGuide.MaestroAPI.Schema;
 using System;
 using System.Collections.Generic;
 using System.Text;
@@ -55,16 +56,20 @@
         /// <param name="currentNode"></param>
         protected override void WriteSchemaMappings(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
         {
-            var map = doc.CreateElement("SchemaMapping");
-            map.SetAttribute("provider", "OSGeo.WMS.3.2");
-            map.SetAttribute("xmlns", "http://fdowms.osgeo.org/schemas");
-            map.SetAttribute("name", base._schemas[0].Name);
+            var map = doc.CreateElement("SchemaMapping"); //NOXLATE
+            map.SetAttribute("provider", "OSGeo.WMS.3.2"); //NOXLATE
+            map.SetAttribute("xmlns", "http://fdowms.osgeo.org/schemas"); //NOXLATE
+            //TODO: Is WMS multi-schema? We should factor this in
+            map.SetAttribute("name", base._schemas[0].Name); //NOXLATE
             {
                 foreach(var ritem in _rasterItems)
                 {
-                    var ctype = doc.CreateElement("complexType");
-                    var ctypeName = doc.CreateAttribute("name");
-                    ctypeName.Value = ritem.FeatureClass + "Type";
+                    if (ritem.SchemaName != base._schemas[0].Name)
+                        continue;
+
+                    var ctype = doc.CreateElement("complexType"); //NOXLATE
+                    var ctypeName = doc.CreateAttribute("name"); //NOXLATE
+                    ctypeName.Value = Utility.EncodeFDOName(ritem.FeatureClass) + "Type"; //NOXLATE
                     ctype.Attributes.Append(ctypeName);
                     {
                         ritem.WriteXml(doc, ctype);
@@ -111,11 +116,65 @@
                         throw new Exception("Bad document. Expected element: RasterDefinition"); //LOCALIZEME
 
                     RasterWmsItem item = new RasterWmsItem();
+                    item.SchemaName = sn.Value;
                     item.ReadXml(rdf, mgr);
 
                     this.AddRasterItem(item);
                 }
             }
         }
+
+        /// <summary>
+        /// Removes any logical classes without physical mappings and vice versa, also ensures that the physical mapping refers
+        /// to the correct logical raster property
+        /// </summary>
+        public void EnsureConsistency()
+        {
+            var removeClasses = new List<ClassDefinition>();
+            var removeMappings = new List<RasterWmsItem>();
+            foreach (var mapping in this.RasterOverrides)
+            {
+                var cls = this.GetClass(mapping.SchemaName, mapping.FeatureClass);
+                if (cls == null)
+                    removeMappings.Add(mapping);
+            }
+            //Triple nested loop? You know what they say about Big-O. If n is usually small
+            //don't bother trying to optimize.
+            foreach (var schema in this.Schemas)
+            {
+                foreach (var cls in schema.Classes)
+                {
+                    bool bFound = false;
+                    foreach (var mapping in this.RasterOverrides)
+                    {
+                        if (mapping.SchemaName == schema.Name && mapping.FeatureClass == cls.Name)
+                        {
+                            bFound = true;
+                            //Since we're here. Fix up the raster logical property if there's a mismatch
+                            foreach (var prop in cls.Properties)
+                            {
+                                if (prop.Type == PropertyDefinitionType.Raster)
+                                {
+                                    if (prop.Name != mapping.RasterPropertyName)
+                                        mapping.RasterPropertyName = prop.Name;
+                                }
+                            }
+                            break;
+                        }
+                    }
+                    if (!bFound)
+                        removeClasses.Add(cls);
+                }
+            }
+            foreach (var mapping in removeMappings)
+            {
+                this.RemoveRasterItem(mapping);
+            }
+            foreach (var cls in removeClasses)
+            {
+                var schema = cls.Parent;
+                schema.RemoveClass(cls);
+            }
+        }
     }
 }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -24,6 +24,9 @@
 using ObjCommon = OSGeo.MapGuide.ObjectModels.Common;
 using OSGeo.MapGuide.MaestroAPI.Schema;
 using OSGeo.MapGuide.MaestroAPI.Feature;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
+using OSGeo.MapGuide.ObjectModels.Common;
 
 namespace OSGeo.MapGuide.MaestroAPI.Services
 {
@@ -265,5 +268,22 @@
         /// </param>
         /// <returns></returns>
         string[] GetClassNames(string resourceId, string schemaName);
+
+        /// <summary>
+        /// Gets the long transactions for the specified feature source
+        /// </summary>
+        /// <param name="resourceId">The feature source id</param>
+        /// <param name="activeOnly">If true, will only return active long transactions</param>
+        /// <returns></returns>
+        ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly);
+
+        /// <summary>
+        /// Gets the schema mappings for the given FDO provider. These mappings form the basis for a custom configuration document
+        /// for a feature source that supports configuration
+        /// </summary>
+        /// <param name="provider">The FDO provider</param>
+        /// <param name="partialConnString">The connection string</param>
+        /// <returns></returns>
+        ConfigurationDocument GetSchemaMapping(string provider, string partialConnString);
     }
 }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Utility.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Utility.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI/Utility.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -612,6 +612,14 @@
         /// FDO encodes a string
         /// </summary>
         /// <param name="name"></param>
+        /// <remarks>
+        /// <para>
+        /// FDO names must always be encoded when writing back to attributes in XML configuration documents as it may contain reserved characters that would render the final XML attribute content invalid.
+        /// </para>
+        /// <para>
+        /// Consequently, such names must always be decoded when reading from XML configuration documents otherwise these escape characters may still be present after reading
+        /// </para>
+        /// </remarks>
         /// <returns></returns>
         public static string EncodeFDOName(string name)
         {
@@ -731,6 +739,14 @@
         /// Converts FDO encoded characters into their original character.
         /// </summary>
         /// <param name="name">The FDO encoded string</param>
+        /// <remarks>
+        /// <para>
+        /// FDO names must always be encoded when writing back to attributes in XML configuration documents as it may contain reserved characters that would render the final XML attribute content invalid.
+        /// </para>
+        /// <para>
+        /// Consequently, such names must always be decoded when reading from XML configuration documents otherwise these escape characters may still be present after reading
+        /// </para>
+        /// </remarks>
         /// <returns>The unencoded version of the string</returns>
         public static string DecodeFDOName(string name)
         {

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -43,6 +43,8 @@
 using OSGeo.MapGuide.MaestroAPI.Schema;
 using OSGeo.MapGuide.MaestroAPI.Feature;
 using System.Drawing;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
 
 namespace OSGeo.MapGuide.MaestroAPI
 {
@@ -1661,6 +1663,18 @@
 			return o;
         }
 
+        public override ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly)
+        {
+            string req = m_reqBuilder.GetLongTransactions(resourceId, activeOnly);
+            return DeserializeObject<FdoLongTransactionList>(this.OpenRead(req));
+        }
+
+        public override ConfigurationDocument GetSchemaMapping(string provider, string partialConnString)
+        {
+            string req = m_reqBuilder.GetSchemaMapping(provider, partialConnString);
+            return ConfigurationDocument.Load(this.OpenRead(req));
+        }
+
         public override bool MoveFolderWithReferences(string oldpath, string newpath, LengthyOperationCallBack callback, LengthyOperationProgressCallBack progress)
         {
             if (this.SiteVersion >= new Version(2, 2)) //new way

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Http/RequestBuilder.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -1582,5 +1582,29 @@
 
             return m_hosturi + "?" + EncodeParameters(param);
         }
+
+        internal string GetLongTransactions(string resourceId, bool activeOnly)
+        {
+            NameValueCollection param = new NameValueCollection();
+            param.Add("OPERATION", "GETLONGTRANSACTIONS");
+            param.Add("VERSION", "1.0.0");
+            param.Add("SESSION", m_sessionID);
+            param.Add("RESOURCEID", resourceId);
+            param.Add("ACTIVEONLY", activeOnly ? "1" : "0");
+
+            return m_hosturi + "?" + EncodeParameters(param);
+        }
+
+        internal string GetSchemaMapping(string provider, string partialConnString)
+        {
+            NameValueCollection param = new NameValueCollection();
+            param.Add("OPERATION", "GETSCHEMAMAPPING");
+            param.Add("VERSION", "1.0.0");
+            param.Add("SESSION", m_sessionID);
+            param.Add("PROVIDER", provider);
+            param.Add("CONNECTIONSTRING", partialConnString);
+
+            return m_hosturi + "?" + EncodeParameters(param);
+        }
     }
 }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -32,6 +32,8 @@
 using System.IO;
 using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
 using System.Diagnostics;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
 
 namespace OSGeo.MapGuide.MaestroAPI.Local
 {
@@ -868,5 +870,100 @@
         {
             return true;
         }
+
+        public override ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly)
+        {
+            var featSvc = GetFeatureService();
+            var resId = new MgResourceIdentifier(resourceId);
+            var rdr = featSvc.GetLongTransactions(resId, activeOnly);
+            return new LocalLongTransactionList(rdr);
+        }
+
+        public override ConfigurationDocument GetSchemaMapping(string provider, string partialConnString)
+        {
+            var featSvc = GetFeatureService();
+            GetByteReaderMethod fetch = () =>
+            {
+                return featSvc.GetSchemaMapping(provider, partialConnString);
+            };
+            using (var stream = new MgReadOnlyStream(fetch))
+            {
+                return ConfigurationDocument.Load(stream);
+            }
+        }
     }
+
+    class LocalLongTransaction : ILongTransaction
+    {
+        public LocalLongTransaction(MgLongTransactionReader rdr)
+        {
+            this.Name = rdr.Name;
+            this.Description = rdr.Description;
+            this.Owner = rdr.Owner;
+            this.CreationDate = rdr.CreationDate.ToString();
+            this.IsActive = rdr.IsActive();
+            this.IsFrozen = rdr.IsFrozen();
+        }
+
+        public string Name
+        {
+            get;
+            private set;
+        }
+
+        public string Description
+        {
+            get;
+            private set;
+        }
+
+        public string Owner
+        {
+            get;
+            private set;
+        }
+
+        public string CreationDate
+        {
+            get;
+            private set;
+        }
+
+        public bool IsActive
+        {
+            get;
+            private set;
+        }
+
+        public bool IsFrozen
+        {
+            get;
+            private set;
+        }
+    }
+
+    class LocalLongTransactionList : ILongTransactionList
+    {
+        private List<LocalLongTransaction> _transactions;
+
+        public LocalLongTransactionList(MgLongTransactionReader rdr)
+        {
+            _transactions = new List<LocalLongTransaction>();
+            while (rdr.ReadNext())
+            {
+                _transactions.Add(new LocalLongTransaction(rdr));
+            }
+            rdr.Close();
+        }
+
+        public IEnumerable<ILongTransaction> Transactions
+        {
+            get 
+            {
+                foreach (var tx in _transactions)
+                    yield return tx;
+            }
+        }
+    }
+
 }

Modified: branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-10-18 19:29:27 UTC (rev 7129)
+++ branches/maestro-4.0.x/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-10-18 19:59:02 UTC (rev 7130)
@@ -39,6 +39,8 @@
 using OSGeo.MapGuide.MaestroAPI.Feature;
 using System.Drawing;
 using System.Globalization;
+using OSGeo.MapGuide.ObjectModels.FeatureSource;
+using OSGeo.MapGuide.MaestroAPI.SchemaOverrides;
 
 namespace OSGeo.MapGuide.MaestroAPI.Native
 {
@@ -1262,5 +1264,99 @@
                 }
             }
         }
+
+        public override ILongTransactionList GetLongTransactions(string resourceId, bool activeOnly)
+        {
+            var featSvc = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+            var resId = new MgResourceIdentifier(resourceId);
+            var rdr = featSvc.GetLongTransactions(resId, activeOnly);
+            return new LocalLongTransactionList(rdr);
+        }
+
+        public override ConfigurationDocument GetSchemaMapping(string provider, string partialConnString)
+        {
+            var featSvc = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+            GetByteReaderMethod fetch = () =>
+            {
+                return featSvc.GetSchemaMapping(provider, partialConnString);
+            };
+            using (var stream = new MgReadOnlyStream(fetch))
+            {
+                return ConfigurationDocument.Load(stream);
+            }
+        }
     }
+
+    class LocalLongTransaction : ILongTransaction
+    {
+        public LocalLongTransaction(MgLongTransactionReader rdr)
+        {
+            this.Name = rdr.Name;
+            this.Description = rdr.Description;
+            this.Owner = rdr.Owner;
+            this.CreationDate = rdr.CreationDate.ToString();
+            this.IsActive = rdr.IsActive();
+            this.IsFrozen = rdr.IsFrozen();
+        }
+
+        public string Name
+        {
+            get;
+            private set;
+        }
+
+        public string Description
+        {
+            get;
+            private set;
+        }
+
+        public string Owner
+        {
+            get;
+            private set;
+        }
+
+        public string CreationDate
+        {
+            get;
+            private set;
+        }
+
+        public bool IsActive
+        {
+            get;
+            private set;
+        }
+
+        public bool IsFrozen
+        {
+            get;
+            private set;
+        }
+    }
+
+    class LocalLongTransactionList : ILongTransactionList
+    {
+        private List<LocalLongTransaction> _transactions;
+
+        public LocalLongTransactionList(MgLongTransactionReader rdr)
+        {
+            _transactions = new List<LocalLongTransaction>();
+            while (rdr.ReadNext())
+            {
+                _transactions.Add(new LocalLongTransaction(rdr));
+            }
+            rdr.Close();
+        }
+
+        public IEnumerable<ILongTransaction> Transactions
+        {
+            get 
+            {
+                foreach (var tx in _transactions)
+                    yield return tx;
+            }
+        }
+    }
 }



More information about the mapguide-commits mailing list