[mapguide-commits] r6409 - in trunk/Tools/Maestro: . Maestro Maestro.AddIn.ExtendedObjectModels Maestro.AddIn.FdoToolbox Maestro.AddIn.FdoToolbox/Commands Maestro.AddIn.FdoToolbox/Properties Maestro.AddIn.Local Maestro.Base/Events MaestroAPITestRunner MaestroAPITests OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Commands OSGeo.MapGuide.MaestroAPI/Feature OSGeo.MapGuide.MaestroAPI/Properties OSGeo.MapGuide.MaestroAPI/Schema OSGeo.MapGuide.MaestroAPI/Services OSGeo.MapGuide.MaestroAPI.Local OSGeo.MapGuide.MaestroAPI.Native OSGeo.MapGuide.MaestroAPI.Native/Commands

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Jan 6 12:26:02 EST 2012


Author: jng
Date: 2012-01-06 09:26:02 -0800 (Fri, 06 Jan 2012)
New Revision: 6409

Added:
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Commands/
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Commands/StartupCommand.cs
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Maestro.AddIn.FdoToolbox.csproj
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Manifest.addin
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/AssemblyInfo.cs
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.resx
   trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/UI/
   trunk/Tools/Maestro/MaestroAPITestRunner/Platform.ini
   trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableRecordBase.cs
Modified:
   trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Maestro.AddIn.ExtendedObjectModels.csproj
   trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.Desktop.dll
   trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
   trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs
   trunk/Tools/Maestro/Maestro/Maestro_All.sln
   trunk/Tools/Maestro/MaestroAPITestRunner/ConnectionProviders.xml
   trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj
   trunk/Tools/Maestro/MaestroAPITestRunner/Program.cs
   trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
   trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native32-2.2.0.csproj
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IFeatureReader.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
Log:
#1912: This submission adds interfaces to the Maestro API for feature manipulation (insert, update, delete, apply schema, create data store), with 2 implementations:
 - One wrapping the official MapGuide API
 - One wrapping the mg-desktop library
Now that we have the ability to manipulate features, it paves the way for one of my main post-4.0 goals. Making Maestro more like FDO Toolbox. This submission includes a skeleton addin, which will eventually provide FDO Toolbox functionality for any connection provider that implements these interfaces.

Modified: trunk/Tools/Maestro/Maestro/Maestro_All.sln
===================================================================
--- trunk/Tools/Maestro/Maestro/Maestro_All.sln	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/Maestro/Maestro_All.sln	2012-01-06 17:26:02 UTC (rev 6409)
@@ -122,6 +122,8 @@
 		{222CB020-5336-47D7-9BB9-A22D18953C80} = {222CB020-5336-47D7-9BB9-A22D18953C80}
 	EndProjectSection
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Maestro.AddIn.FdoToolbox", "..\Maestro.AddIn.FdoToolbox\Maestro.AddIn.FdoToolbox.csproj", "{8787FF3F-552F-46BE-B9D7-548B6162B079}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -280,6 +282,10 @@
 		{E367FE8E-E46F-4DA0-86CE-E6F37E78DEE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{E367FE8E-E46F-4DA0-86CE-E6F37E78DEE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{E367FE8E-E46F-4DA0-86CE-E6F37E78DEE0}.Release|Any CPU.Build.0 = Release|Any CPU
+		{8787FF3F-552F-46BE-B9D7-548B6162B079}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{8787FF3F-552F-46BE-B9D7-548B6162B079}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{8787FF3F-552F-46BE-B9D7-548B6162B079}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{8787FF3F-552F-46BE-B9D7-548B6162B079}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Maestro.AddIn.ExtendedObjectModels.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Maestro.AddIn.ExtendedObjectModels.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Maestro.AddIn.ExtendedObjectModels.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -35,26 +35,6 @@
     </DocumentationFile>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Maestro.Editors, Version=3.0.0.5475, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\SDK\bin\Maestro.Editors.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="Maestro.Shared.UI, Version=3.0.0.5475, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\SDK\bin\Maestro.Shared.UI.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.ExtendedObjectModels, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\SDK\bin\OSGeo.MapGuide.ExtendedObjectModels.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
-    <Reference Include="OSGeo.MapGuide.MaestroAPI, Version=3.0.0.5475, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\SDK\bin\OSGeo.MapGuide.MaestroAPI.dll</HintPath>
-      <Private>False</Private>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Drawing" />
@@ -107,6 +87,26 @@
       <Name>Maestro.Base</Name>
       <Private>False</Private>
     </ProjectReference>
+    <ProjectReference Include="..\Maestro.Editors\Maestro.Editors.csproj">
+      <Project>{5AD2CDBA-952E-4148-98A1-31D2E0D540D5}</Project>
+      <Name>Maestro.Editors</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\Maestro.Shared.UI\Maestro.Shared.UI.csproj">
+      <Project>{CFD19053-2172-41D3-8460-0FD2123A1E88}</Project>
+      <Name>Maestro.Shared.UI</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.ExtendedObjectModels\OSGeo.MapGuide.ExtendedObjectModels.csproj">
+      <Project>{B3A2B816-9F41-4857-A111-09D2DF2550D6}</Project>
+      <Name>OSGeo.MapGuide.ExtendedObjectModels</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
+      <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
+      <Name>OSGeo.MapGuide.MaestroAPI</Name>
+      <Private>False</Private>
+    </ProjectReference>
     <ProjectReference Include="..\Thirdparty\SharpDevelop\ICSharpCode.Core\ICSharpCode.Core.csproj">
       <Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
       <Name>ICSharpCode.Core</Name>


Property changes on: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox
___________________________________________________________________
Added: svn:ignore
   + obj
bin


Added: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Commands/StartupCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Commands/StartupCommand.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Commands/StartupCommand.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,37 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using ICSharpCode.Core;
+using Maestro.Base;
+using Maestro.Base.Services;
+using Maestro.Shared.UI;
+
+namespace Maestro.AddIn.FdoToolbox.Commands
+{
+    public class StartupCommand : AbstractCommand
+    {
+        public override void Run()
+        {
+
+        }
+    }
+}

Added: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Maestro.AddIn.FdoToolbox.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Maestro.AddIn.FdoToolbox.csproj	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Maestro.AddIn.FdoToolbox.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{8787FF3F-552F-46BE-B9D7-548B6162B079}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Maestro.AddIn.FdoToolbox</RootNamespace>
+    <AssemblyName>Maestro.AddIn.FdoToolbox</AssemblyName>
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\out\Debug\AddIns\FdoToolbox\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\out\Release\AddIns\FdoToolbox\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Commands\StartupCommand.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DesignTime>True</DesignTime>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Maestro.Base\Maestro.Base.csproj">
+      <Project>{F1E2F468-5030-4DBA-968C-9620284AFAA1}</Project>
+      <Name>Maestro.Base</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\Maestro.Shared.UI\Maestro.Shared.UI.csproj">
+      <Project>{CFD19053-2172-41D3-8460-0FD2123A1E88}</Project>
+      <Name>Maestro.Shared.UI</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
+      <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
+      <Name>OSGeo.MapGuide.MaestroAPI</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\Thirdparty\SharpDevelop\ICSharpCode.Core.WinForms\ICSharpCode.Core.WinForms.csproj">
+      <Project>{857CA1A3-FC88-4BE0-AB6A-D1EE772AB288}</Project>
+      <Name>ICSharpCode.Core.WinForms</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\Thirdparty\SharpDevelop\ICSharpCode.Core\ICSharpCode.Core.csproj">
+      <Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project>
+      <Name>ICSharpCode.Core</Name>
+      <Private>False</Private>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Manifest.addin">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+    </EmbeddedResource>
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="UI\" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

Copied: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Manifest.addin (from rev 6404, trunk/Tools/Maestro/Maestro.AddIn.ExtendedObjectModels/Manifest.addin)
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Manifest.addin	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Manifest.addin	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,20 @@
+<AddIn name="Maestro.AddIn.FdoToolbox"
+       author="Jackie Ng"
+       url="http://trac.osgeo.org/mapguide/wiki/maestro"
+       description="FDO Toolbox AddIn for MapGuide Maestro"
+       addInManagerHidden="preinstalled">
+
+    <Manifest>
+        <Identity name="Maestro.AddIn.FdoToolbox" />
+    </Manifest>
+
+    <Runtime>
+        <Import assembly="../../Maestro.Base.dll" />
+        <Import assembly="Maestro.AddIn.FdoToolbox.dll" />
+    </Runtime>
+
+    <!-- Auto-start commands -->
+    <Path name="/Workspace/Autostart">
+        <Class id="Startup" class="Maestro.AddIn.FdoToolbox.Commands.StartupCommand" />
+    </Path>
+</AddIn>

Added: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/AssemblyInfo.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/AssemblyInfo.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/AssemblyInfo.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Maestro.AddIn.FdoToolbox")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Maestro.AddIn.FdoToolbox")]
+[assembly: AssemblyCopyright("Copyright ©  2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1d41a9ea-b61e-45f4-8e17-9ac4571062fa")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

Added: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.Designer.cs	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.Designer.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,72 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.5448
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Maestro.AddIn.FdoToolbox.Properties {
+    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 Resources {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources() {
+        }
+        
+        /// <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.AddIn.FdoToolbox.Properties.Resources", typeof(Resources).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 FDO Toolbox.
+        /// </summary>
+        internal static string Content_FdoToolbox {
+            get {
+                return ResourceManager.GetString("Content_FdoToolbox", resourceCulture);
+            }
+        }
+    }
+}

Added: trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.resx	                        (rev 0)
+++ trunk/Tools/Maestro/Maestro.AddIn.FdoToolbox/Properties/Resources.resx	2012-01-06 17:26:02 UTC (rev 6409)
@@ -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="Content_FdoToolbox" xml:space="preserve">
+    <value>FDO Toolbox</value>
+  </data>
+</root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj
===================================================================
--- trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/Maestro.AddIn.Local/Maestro.AddIn.Local.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -37,14 +37,17 @@
     <Reference Include="OSGeo.MapGuide.Foundation, Version=1.0.0.1, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\OSGeo.MapGuide.Foundation.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="OSGeo.MapGuide.Geometry, Version=1.0.0.1, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\OSGeo.MapGuide.Geometry.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="OSGeo.MapGuide.PlatformBase, Version=1.0.0.1, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=x86">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\OSGeo.MapGuide.PlatformBase.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="OSGeo.MapGuide.Viewer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -54,6 +57,7 @@
     <Reference Include="OSGeo.MapGuide.Viewer.Desktop, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\OSGeo.MapGuide.Viewer.Desktop.dll</HintPath>
+      <Private>False</Private>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
@@ -114,6 +118,7 @@
     <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Local\OSGeo.MapGuide.MaestroAPI.Local.csproj">
       <Project>{3DDF6501-0148-474C-8674-7C7DA49C7F02}</Project>
       <Name>OSGeo.MapGuide.MaestroAPI.Local</Name>
+      <Private>False</Private>
     </ProjectReference>
     <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
       <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.Desktop.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.AddIn.Local/OSGeo.MapGuide.Viewer.dll
===================================================================
(Binary files differ)

Modified: trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -108,7 +108,6 @@
             var wb = Workbench.Instance;
             if (wb.ActiveSiteExplorer == null)
             {
-                var siteExp = new SiteExplorer();
                 var viewMgr = ServiceRegistry.GetService<ViewContentManager>();
 
                 viewMgr.OpenContent(Properties.Resources.Content_SiteExplorer, 

Modified: trunk/Tools/Maestro/MaestroAPITestRunner/ConnectionProviders.xml
===================================================================
--- trunk/Tools/Maestro/MaestroAPITestRunner/ConnectionProviders.xml	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/MaestroAPITestRunner/ConnectionProviders.xml	2012-01-06 17:26:02 UTC (rev 6409)
@@ -21,4 +21,11 @@
         <Assembly>OSGeo.MapGuide.MaestroAPI.Native.dll</Assembly>
         <Type>OSGeo.MapGuide.MaestroAPI.LocalNativeConnection</Type>
     </ConnectionProvider>
+
+    <ConnectionProvider>
+        <Name>Maestro.Local</Name>
+        <Description>Connection wrapping the mg-desktop library</Description>
+        <Assembly>OSGeo.MapGuide.MaestroAPI.Local.dll</Assembly>
+        <Type>OSGeo.MapGuide.MaestroAPI.LocalConnection</Type>
+    </ConnectionProvider>
 </ConnectionProviderRegistry>

Modified: trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/MaestroAPITestRunner/MaestroAPITestRunner.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -32,10 +32,6 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="MapGuideDotNetApi, Version=2.0.0.2308, Culture=neutral, PublicKeyToken=f526c48929fda856, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\Thirdparty\MapGuideDotNetApi\MapGuideDotNetApi.dll</HintPath>
-    </Reference>
     <Reference Include="nunit-console-runner, Version=2.5.5.10112, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\Thirdparty\NUnit\bin\net-2.0\lib\nunit-console-runner.dll</HintPath>
@@ -62,6 +58,10 @@
       <Project>{351D49A3-2E4A-4EC3-AFC2-D56598F44F51}</Project>
       <Name>MaestroAPITests</Name>
     </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Local\OSGeo.MapGuide.MaestroAPI.Local.csproj">
+      <Project>{3DDF6501-0148-474C-8674-7C7DA49C7F02}</Project>
+      <Name>OSGeo.MapGuide.MaestroAPI.Local</Name>
+    </ProjectReference>
     <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
       <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
       <Name>OSGeo.MapGuide.MaestroAPI</Name>
@@ -69,7 +69,15 @@
   </ItemGroup>
   <ItemGroup>
     <None Include="App.config" />
+    <None Include="Platform.ini">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
+  <ItemGroup>
+    <Content Include="ConnectionProviders.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.
@@ -79,6 +87,10 @@
   </Target>
   -->
   <PropertyGroup>
-    <PostBuildEvent>IF EXIST "$(ProjectDir)Setup" XCOPY /Y /I "$(ProjectDir)Setup\*.*" "$(ProjectDir)$(OutDir)"</PostBuildEvent>
+    <PostBuildEvent>IF EXIST "$(ProjectDir)Setup" XCOPY /Y /I "$(ProjectDir)Setup\*.*" "$(ProjectDir)$(OutDir)"
+IF NOT EXIST "$(OutDir)Dictionaries" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\Dictionaries\*.*" "$(ProjectDir)$(OutDir)Dictionaries"
+IF NOT EXIST "$(OutDir)FDO" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\FDO\*.*" "$(ProjectDir)$(OutDir)FDO"
+IF NOT EXIST "$(OutDir)Resources" XCOPY /S /Y /I "$(SolutionDir)..\Maestro.AddIn.Local\Resources\*.res" "$(ProjectDir)$(OutDir)Resources"
+COPY /Y "$(SolutionDir)..\Maestro.AddIn.Local\*.dll" "$(ProjectDir)$(OutDir)"</PostBuildEvent>
   </PropertyGroup>
 </Project>
\ No newline at end of file

Added: trunk/Tools/Maestro/MaestroAPITestRunner/Platform.ini
===================================================================
--- trunk/Tools/Maestro/MaestroAPITestRunner/Platform.ini	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITestRunner/Platform.ini	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,270 @@
+# *****************************************************************************
+# MapGuide Server Configuration File
+#
+# The following configuration is based on a single CPU with a single core.
+#
+# WARNING: BE VERY CAREFUL WHEN MODIFYING THIS FILE AS IT COULD
+#          ADVERSLY IMPACT SERVER PERFORMANCE
+#
+# When saving this file use a UTF-8 encoding.
+#
+# *****************************************************************************
+# COMMON VALIDATION INFORMATION
+#
+# (Unless otherwise noted under the property description)
+# -----------------------------------------------------------------------------
+# String Property                  Range of String Length   Reserved Characters
+# -----------------------------------------------------------------------------
+# File Name                        0 <  Length <= 128       //:*?"<>|
+# Folder Name                      0 <  Length <= 128       //:*?"<>|
+# Log Parameters                   0 <= Length <= 1024
+# Password                         0 <= Length <= 64        /t/r/n/v/f
+# Path                             0 <  Length <= 255       *?"<>|
+# -----------------------------------------------------------------------------
+# Numeric Property                 Range of Numeric Value
+# -----------------------------------------------------------------------------
+# Port Number                      0 <= Value <= 65535
+# *****************************************************************************
+
+[GeneralProperties]
+# *****************************************************************************
+# G E N E R A L
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# DefaultMessageLocale             ISO 639-1 name for the message locale
+#                                       Length = 2
+#                                       Example: en
+# FdoPath                          Path where FDO is installed
+# MentorDictionaryPath             Path where the CS-Map cooridnate system dictionaries is installed
+# Locale                           The server's locale. If left blank it will default to the operating system locale
+#                                       0 <= Length <= 255
+#                                       Format           : lang[_country_region.code_page]
+#                                       Example (Windows): English_United States.1252
+#                                       Example Linux)   : en_US.iso88591
+# Renderer                         Image renderer to use (GD or AGG)
+# ResourcesPath                    Path where the localization resource files are stored
+# TempPath                         Path where the temporary files are stored
+# WfsDocumentPath                  Document path location for WFS documents
+# WmsDocumentPath                  Document path location for WMS documents
+# *****************************************************************************
+DefaultMessageLocale               = en
+FdoPath                            = FDO/
+MentorDictionaryPath			   = Dictionaries/
+Locale                             =
+Renderer                           = AGG
+ResourcesPath                      = Resources/
+TempPath                           = Temp/
+WfsDocumentPath                    = Wfs/
+WmsDocumentPath                    = Wms/
+
+[DrawingServiceProperties]
+# *****************************************************************************
+# D R A W I N G  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# *****************************************************************************
+
+[FeatureServiceProperties]
+# *****************************************************************************
+# F E A T U R E  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# CacheSize                        Max # of internal data objects to cache
+#                                  (schemas, classes, etc...)
+#                                       0 < Value <= 5000
+# CacheTimeLimit                   Time duration in seconds for how long to
+#                                  cache the internal data objects
+#                                       0 < Value <= 2147483647
+# CacheTimerInterval               Time interval in seconds for when the server
+#                                  checks for expired cache entries
+#                                       0 < Value <= 2147483647
+# DataCacheSize                    Max # of features to fetch
+#                                       0 < Value <= 2147483647
+# DataConnectionPoolEnabled        FDO connection pooling
+#                                       0 = disabled, 1 = enabled
+# DataConnectionPoolExcludedProviders  The list of providers to exclude from connection pooling.
+#                                       0 <= Length <= 1024
+#                                       Value = provider name(s) separated by ","
+#                                       Example: OSGeo.SDF,OSGeo.SHP
+# DataConnectionPoolSize           Default # of FDO connections to cache per provider
+#                                       1 < Value <= 1024
+# DataConnectionPoolSizeCustom     Custom # of FDO connections to cache for specified provider
+#                                       0 <= Length <= 1024
+#                                       Example: OSGeo.SDF:10,OSGeo.SHP:10
+# DataConnectionTimeout            Time duration in seconds for when an idle FDO
+#                                  connection is dropped
+#                                       0 < Value <= 2147483647
+# DataConnectionTimerInterval      Time interval in seconds for when the server
+#                                  checks for idle FDO connections
+#                                       0 < Value <= 2147483647
+# JoinQueryBatchSize               Join query batch size
+#                                       1 < Value <= 10000
+# DataTransactionTimeout          Time duration in seconds for when an idle FDO
+#                                  transaction is dropped
+#                                       0 < Value <= 1800
+# DataTransactionTimerInterval  Time interval in seconds for when the server
+#                                  checks for idle FDO transactions
+#                                       0 < Value <= 1800
+# *****************************************************************************
+CacheSize                          = 100
+CacheTimeLimit                     = 86400
+CacheTimerInterval                 = 3600
+DataCacheSize                      = 100
+DataConnectionPoolEnabled          = 1
+DataConnectionPoolExcludedProviders= OSGeo.SDF,OSGeo.SHP
+DataConnectionPoolSize             = 200
+DataConnectionPoolSizeCustom       = OSGeo.Gdal:1
+DataConnectionTimeout              = 28800
+DataConnectionTimerInterval        = 3600
+JoinQueryBatchSize                 = 1000
+DataTransactionTimeout             = 360
+DataTransactionTimerInterval       = 60
+
+[MappingServiceProperties]
+# *****************************************************************************
+# M A P P I N G  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# LegendFont                       Font to use when rendering legend elements
+#                                       0 < Length <= 255
+# *****************************************************************************
+LegendFont                         = Arial
+
+[RenderingServiceProperties]
+# *****************************************************************************
+# R E N D E R I N G  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# TileExtentOffset                 Max request extent offset to use when
+#                                  requesting features for a tile, specified as
+#                                  a factor of the tile size
+#                                       0.0 <= Value <= 1.0
+# RasterGridSize                   Size of raster re-projection grid in pixels
+#                                       0 < Value <= 2147483647
+# MinRasterGridSize                Minimum size of raster re-projection grid in
+#                                  pixels. This should be less than RasterGridSize.
+#                                       0 < Value <= 2147483647
+# RasterGridSizeOverrideRatio      If the RasterGridSize is larger than the
+#                                  image's height or width multiplied by the
+#                                  RasterGridSizeOverrideRatio, then the
+#                                  RasterGridSize is overridden with this value.
+#                                  Set to 0 or 1 to disable the override.
+#                                       0.0 <= Value <= 1.0
+# RasterGridSizeForPlot            Size of raster re-projection grid in pixels
+#                                  for plot
+# MinRasterGridSizeForPlot         Minimum size of raster re-projection grid in
+#                                  pixels for plot. This must be less than
+#                                  RasterGridSizeForPlot.
+# RasterGridSizeOverrideRatioForPlot If the RasterGridSizeForPlot is larger than the
+#                                  image's height or width multiplied by the
+#                                  RasterGridSizeOverrideRatioForPlot, then the
+#                                  RasterGridSizeForPlot is overridden with this
+#                                  value.
+#                                  Change this setting to 1 to disable the
+#                                  override.
+# RenderSelectionBatchSize         The batch size to use when rendering a selection
+# ClampPoints                      Specifies whether point coordinates are clamped
+#                                  to integer values before passing them to the
+#                                  AGG renderer (experimental)
+#                                       0 = false and 1 = true
+# GeneralizeData                   Specifies whether feature geometry is generalized
+#                                  before being rendered (experimental)
+#                                       0 = false and 1 = true
+# *****************************************************************************
+TileExtentOffset                   = 0.35
+RasterGridSize                     = 100
+MinRasterGridSize                  = 10
+RasterGridSizeOverrideRatio        = 0.25
+RasterGridSizeForPlot              = 50
+MinRasterGridSizeForPlot           = 5
+RasterGridSizeOverrideRatioForPlot = 0.10
+RenderSelectionBatchSize           = 50000
+ClampPoints                        = 0
+GeneralizeData                     = 0
+
+[ResourceServiceProperties]
+# *****************************************************************************
+# R E S O U R C E  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# LibraryRepositoryPath            Path where the Library repository is stored
+# LibraryResourceDataFilePath      Path where the Library resource data files
+#                                  are stored
+# PackagesPath                     Path where the resource packages can be found
+# ResourceDataFileTrashFolderName  Folder where the repository trash files are
+#                                  stored
+# ResourceSchemaFilePath           Path where the resource schema files are
+#                                  stored
+# SessionRepositoryPath            Path where the Session repository is stored
+# SessionResourceDataFilePath      Path where the Session resource data files
+#                                  are stored
+# SiteRepositoryPath               Path where the Site repository is stored
+# *****************************************************************************
+LibraryRepositoryPath              = Repositories/Library/Content/
+LibraryResourceDataFilePath        = Repositories/Library/DataFiles/
+PackagesPath                       = Packages/
+ResourceDataFileTrashFolderName    = Trash
+ResourceSchemaFilePath             = Schemas/
+SessionRepositoryPath              = Repositories/Session/Content/
+SessionResourceDataFilePath        = Repositories/Session/DataFiles/
+SiteRepositoryPath                 = Repositories/Site/
+
+[TileServiceProperties]
+# *****************************************************************************
+# T I L E  S E R V I C E
+#
+# Property Name                    Description
+# -----------------------------------------------------------------------------
+# RenderOnly                       Renders the tile only
+#                                       0 = false and 1 = true
+# TileCachePath                    Root path of the image tile cache
+# TileColumnsPerFolder             Number of columns of tiles per folder
+#                                       0 < Value <= 1000
+# TileRowsPerFolder                Number of rows of tiles per folder
+#                                       0 < Value <= 1000
+# DefaultTileSizeX                 Width of generated tiles in pixels
+#                                       50 < value <= 10000
+# DefaultTileSizeY                 Height of generated tiles in pixels
+#                                       50 < value <= 10000
+# ImageFormat                      Image format for generated tiles
+#                                       PNG, PNG8, GIF or JPG
+# *****************************************************************************
+RenderOnly                         = 0
+TileCachePath                      = Repositories/TileCache/
+TileColumnsPerFolder               = 30
+TileRowsPerFolder                  = 30
+DefaultTileSizeX                   = 300
+DefaultTileSizeY                   = 300
+ImageFormat                        = PNG
+
+[FontAliases]
+# *****************************************************************************
+# F O N T  A L I A S E S
+# This section is used to map a font family name to another.  The left side
+# is a name that might be specified by the user and the right side is what
+# font to actually use.
+# *****************************************************************************
+MS ゴシック = MS Gothic
+MS Pゴシック = MS PGothic
+MS 明朝 = MS Mincho
+MS P明朝 = MS PMincho
+굴림 = Gulim
+굴림체 = GulimChe
+돋움 = Dotum
+돋움체 = DotumChe
+바탕 = Batang
+바탕체 = BatangChe
+궁서 = Gungsuh
+궁서체 = GungsuhChe
+
+[UnmanagedDataMappings]
+# *****************************************************************************
+# U N M A N A G E D  D A T A  M A P P I N G S
+# This section is used to map a mapping name to an unmanaged data folder.
+# *****************************************************************************
\ No newline at end of file

Modified: trunk/Tools/Maestro/MaestroAPITestRunner/Program.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITestRunner/Program.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/MaestroAPITestRunner/Program.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -21,6 +21,7 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using System.Diagnostics;
 
 namespace MaestroAPITestRunner
 {

Added: trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITests/LocalNativeFeatureTests.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,336 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using NUnit.Framework;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.MaestroAPI;
+using OSGeo.MapGuide.MaestroAPI.Feature;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
+using GisSharpBlog.NetTopologySuite.IO;
+
+namespace MaestroAPITests
+{
+    public abstract class LocalNativeFeatureTestsBase
+    {
+        protected abstract IServerConnection CreateTestConnection();
+
+        protected void CreateTestDataStore(IServerConnection conn, string fsId, ref FeatureSchema schema, ref ClassDefinition cls)
+        {
+            schema = new FeatureSchema("Default", "");
+            cls = new ClassDefinition("Class1", "");
+
+            try
+            {
+                if (conn.ResourceService.ResourceExists(fsId))
+                    conn.ResourceService.DeleteResource(fsId);
+
+                cls.DefaultGeometryPropertyName = "GEOM";
+                cls.AddProperty(new DataPropertyDefinition("KEY", "")
+                {
+                    DataType = DataPropertyType.Int32,
+                    IsAutoGenerated = true,
+                    IsReadOnly = true,
+                    IsNullable = false
+                }, true);
+
+                cls.AddProperty(new DataPropertyDefinition("NAME", "")
+                {
+                    DataType = DataPropertyType.String,
+                    Length = 255,
+                    IsNullable = true,
+                    IsReadOnly = false
+                });
+
+                cls.AddProperty(new GeometricPropertyDefinition("GEOM", "")
+                {
+                    GeometricTypes = FeatureGeometricType.Point,
+                    SpatialContextAssociation = "Default"
+                });
+
+                schema.AddClass(cls);
+
+                ICreateDataStore create = (ICreateDataStore)conn.CreateCommand((int)CommandType.CreateDataStore);
+                CoordinateSystemDefinitionBase coordSys = conn.CoordinateSystemCatalog.FindCoordSys("LL84");
+                create.FeatureSourceId = fsId;
+                create.CoordinateSystemWkt = coordSys.WKT;
+                create.Name = "Default";
+                create.ExtentType = OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType.Dynamic;
+                create.FileName = "Test.sdf";
+                create.Provider = "OSGeo.SDF";
+                create.Schema = schema;
+                create.XYTolerance = 0.001;
+                create.ZTolerance = 0.001;
+
+                create.Execute();
+            }
+            catch
+            {
+                schema = null;
+                cls = null;
+                throw;
+            }
+        }
+
+        protected void PopulateTestDataStore(IServerConnection conn, string fsId, ref FeatureSchema schema, ref ClassDefinition cls)
+        {
+            CreateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            IInsertFeatures insert = (IInsertFeatures)conn.CreateCommand((int)CommandType.InsertFeature);
+            insert.ClassName = cls.Name;
+            insert.FeatureSourceId = fsId;
+            var feat = new MutableRecord();
+
+            var reader = new WKTReader();
+
+            //Initialize this record
+            feat.PutValue("GEOM", new GeometryValue(reader.Read("POINT (0 0)")));
+            feat.PutValue("NAME", new StringValue("Test1"));
+
+            //Attach to command.
+            insert.RecordToInsert = feat;
+
+            var res = insert.Execute();
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (0 1)"));
+            feat.SetString("NAME", "Test2");
+
+            res = insert.Execute();
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (1 1)"));
+            feat.SetString("NAME", "Test3");
+
+            res = insert.Execute();
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (1 0)"));
+            feat.SetString("NAME", "Test4");
+
+            res = insert.Execute();
+        }
+
+        public virtual void TestInsertFeatures()
+        {
+            var conn = CreateTestConnection();
+            var fsId = "Library://UnitTests/Data/TestInsertFeatures.FeatureSource";
+            ClassDefinition cls = null;
+            FeatureSchema schema = null;
+            CreateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            IInsertFeatures insert = (IInsertFeatures)conn.CreateCommand((int)CommandType.InsertFeature);
+            insert.ClassName = cls.Name;
+            insert.FeatureSourceId = fsId;
+            var feat = new MutableRecord();
+
+            var reader = new WKTReader();
+
+            //Initialize this record
+            feat.PutValue("GEOM", new GeometryValue(reader.Read("POINT (0 0)")));
+            feat.PutValue("NAME", new StringValue("Test1"));
+
+            Assert.True(feat.PropertyExists("GEOM"));
+            Assert.True(feat.PropertyExists("NAME"));
+
+            //Attach to command.
+            insert.RecordToInsert = feat;
+
+            var res = insert.Execute();
+            Assert.Null(res.Error);
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (0 1)"));
+            feat.SetString("NAME", "Test2");
+
+            res = insert.Execute();
+            Assert.Null(res.Error);
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (1 1)"));
+            feat.SetString("NAME", "Test3");
+
+            res = insert.Execute();
+            Assert.Null(res.Error);
+
+            feat.SetGeometry("GEOM", reader.Read("POINT (1 0)"));
+            feat.SetString("NAME", "Test4");
+
+            res = insert.Execute();
+            Assert.Null(res.Error);
+
+            int count = 0;
+            using (var rdr = conn.FeatureService.QueryFeatureSource(fsId, cls.Name))
+            {
+                while (rdr.ReadNext())
+                {
+                    count++;
+                }
+                rdr.Close();
+            }
+
+            Assert.AreEqual(4, count);
+        }
+        
+        public virtual void TestUpdateFeatures()
+        {
+            var conn = CreateTestConnection();
+            var fsId = "Library://UnitTests/Data/TestUpdateFeatures.FeatureSource";
+            ClassDefinition cls = null;
+            FeatureSchema schema = null;
+            PopulateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            IUpdateFeatures update = (IUpdateFeatures)conn.CreateCommand((int)CommandType.UpdateFeatures);
+            update.ClassName = cls.Name;
+            update.FeatureSourceId = fsId;
+            update.Filter = "NAME = 'Test4'";
+
+            update.ValuesToUpdate = new MutableRecord();
+            update.ValuesToUpdate.PutValue("NAME", new StringValue("Test4Modified"));
+
+            Assert.AreEqual(1, update.Execute());
+        }
+
+        public virtual void TestDeleteFeatures()
+        {
+            var conn = CreateTestConnection();
+            var fsId = "Library://UnitTests/Data/TestDeleteFeatures.FeatureSource";
+            ClassDefinition cls = null;
+            FeatureSchema schema = null;
+            PopulateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            IDeleteFeatures delete = (IDeleteFeatures)conn.CreateCommand((int)CommandType.DeleteFeatures);
+            delete.ClassName = cls.Name;
+            delete.FeatureSourceId = fsId;
+            delete.Filter = "NAME = 'Test4'";
+
+            Assert.AreEqual(1, delete.Execute());
+
+            int count = 0;
+            using (var rdr = conn.FeatureService.QueryFeatureSource(fsId, cls.Name))
+            {
+                while (rdr.ReadNext()) { count++; }
+            }
+
+            Assert.AreEqual(3, count);
+        }
+
+        public virtual void TestCreateDataStore()
+        {
+            var conn = CreateTestConnection();
+            var fsId = "Library://UnitTests/Data/TestCreateDataStore.FeatureSource";
+            ClassDefinition cls = null;
+            FeatureSchema schema = null;
+            CreateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            ClassDefinition cls2 = conn.FeatureService.GetClassDefinition(fsId, "Class1");
+            Assert.NotNull(cls2);
+            Assert.False(ClassDefinition.ReferenceEquals(cls, cls2));
+
+            Assert.AreEqual(cls.Name, cls2.Name);
+            Assert.AreEqual(cls.DefaultGeometryPropertyName, cls2.DefaultGeometryPropertyName);
+            Assert.AreEqual(cls.Properties.Count, cls2.Properties.Count);
+            Assert.AreEqual(cls.IdentityProperties.Count, cls2.IdentityProperties.Count);
+            foreach (var prop in cls.Properties)
+            {
+                var prop2 = cls2.FindProperty(prop.Name);
+                Assert.AreEqual(prop.Name, prop2.Name);
+                Assert.AreEqual(prop.Type, prop2.Type);
+            }
+        }
+
+        public virtual void TestApplySchema()
+        {
+            var fsId = "Library://UnitTests/Data/TestMaestroLocalApplySchema.FeatureSource";
+            var conn = CreateTestConnection();
+            if (conn.ResourceService.ResourceExists(fsId))
+                conn.ResourceService.DeleteResource(fsId);
+
+            ClassDefinition cls = null;
+            FeatureSchema schema = null;
+            CreateTestDataStore(conn, fsId, ref schema, ref cls);
+
+            cls.AddProperty(new DataPropertyDefinition("ExtraProp", "")
+            {
+                DataType = DataPropertyType.String,
+                IsNullable = false,
+                Length = 255
+            });
+
+            //Apply changes
+            IApplySchema cmd = (IApplySchema)conn.CreateCommand((int)CommandType.ApplySchema);
+            cmd.Schema = schema;
+            cmd.FeatureSourceId = fsId;
+            cmd.Execute();
+
+            ClassDefinition cls2 = conn.FeatureService.GetClassDefinition(cmd.FeatureSourceId, "Class1");
+            Assert.NotNull(cls2);
+            Assert.False(ClassDefinition.ReferenceEquals(cls, cls2));
+
+            Assert.AreEqual(cls.Name, cls2.Name);
+            Assert.AreEqual(cls.DefaultGeometryPropertyName, cls2.DefaultGeometryPropertyName);
+            Assert.AreEqual(cls.Properties.Count, cls2.Properties.Count);
+            Assert.AreEqual(cls.IdentityProperties.Count, cls2.IdentityProperties.Count);
+            foreach (var prop in cls.Properties)
+            {
+                var prop2 = cls2.FindProperty(prop.Name);
+                Assert.AreEqual(prop.Name, prop2.Name);
+                Assert.AreEqual(prop.Type, prop2.Type);
+            }
+        }
+    }
+
+    [TestFixture(Ignore = TestControl.IgnoreLocalFeatureTests)]
+    public class LocalFeatureTests : LocalNativeFeatureTestsBase
+    {
+        protected override IServerConnection CreateTestConnection()
+        {
+            return ConnectionProviderRegistry.CreateConnection("Maestro.Local", "ConfigFile", "Platform.ini");
+        }
+
+        [Test]
+        public override void TestApplySchema()
+        {
+            base.TestApplySchema();
+        }
+
+        [Test]
+        public override void TestCreateDataStore()
+        {
+            base.TestCreateDataStore();
+        }
+
+        [Test]
+        public override void TestDeleteFeatures()
+        {
+            base.TestDeleteFeatures();
+        }
+
+        [Test]
+        public override void TestInsertFeatures()
+        {
+            base.TestInsertFeatures();
+        }
+
+        [Test]
+        public override void TestUpdateFeatures()
+        {
+            base.TestUpdateFeatures();
+        }
+    }
+
+}

Modified: trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -76,6 +76,7 @@
     <Compile Include="FeatureReaderTests.cs" />
     <Compile Include="HttpConnectionTests.cs" />
     <Compile Include="HttpSiteTests.cs" />
+    <Compile Include="LocalNativeFeatureTests.cs" />
     <Compile Include="ObjectTests.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\Resources.Designer.cs">
@@ -290,20 +291,6 @@
     </None>
   </ItemGroup>
   <ItemGroup>
-    <ProjectReference Include="..\OSGeo.MapGuide.ExtendedObjectModels\OSGeo.MapGuide.ExtendedObjectModels.csproj">
-      <Project>{B3A2B816-9F41-4857-A111-09D2DF2550D6}</Project>
-      <Name>OSGeo.MapGuide.ExtendedObjectModels</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Http\OSGeo.MapGuide.MaestroAPI.Http.csproj">
-      <Project>{6EF1E775-444B-4E5F-87FB-D687C43A68D7}</Project>
-      <Name>OSGeo.MapGuide.MaestroAPI.Http</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
-      <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
-      <Name>OSGeo.MapGuide.MaestroAPI</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <ItemGroup>
     <Content Include="..\TestData\gen_default1_MySql_master.xml">
       <Link>UserTestData\gen_default1_MySql_master.xml</Link>
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -621,6 +608,20 @@
       <Install>true</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\OSGeo.MapGuide.ExtendedObjectModels\OSGeo.MapGuide.ExtendedObjectModels.csproj">
+      <Project>{B3A2B816-9F41-4857-A111-09D2DF2550D6}</Project>
+      <Name>OSGeo.MapGuide.ExtendedObjectModels</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI.Http\OSGeo.MapGuide.MaestroAPI.Http.csproj">
+      <Project>{6EF1E775-444B-4E5F-87FB-D687C43A68D7}</Project>
+      <Name>OSGeo.MapGuide.MaestroAPI.Http</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\OSGeo.MapGuide.MaestroAPI\OSGeo.MapGuide.MaestroAPI.csproj">
+      <Project>{80FA3158-8B5F-48D1-A393-0378AFE48A7E}</Project>
+      <Name>OSGeo.MapGuide.MaestroAPI</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

Modified: trunk/Tools/Maestro/MaestroAPITests/TestControl.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/MaestroAPITests/TestControl.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -38,6 +38,8 @@
         public const bool IgnoreResourceTests = false;
         public const bool IgnoreHttpRuntimeMapTests = false;
         public const bool IgnoreLocalRuntimeMapTests = true;
+        public const bool IgnoreLocalFeatureTests = false;
+        public const bool IgnoreLocalNativeFeatureTests = false;
         public const bool IgnoreSchemaTests = false;
         public const bool IgnoreSerializationTests = false;
         public const bool IgnoreValidationTests = false;
@@ -45,7 +47,7 @@
 
     public class ConnectionUtil
     {
-        public static string Port { get { return ""; } }
+        public static string Port { get { return "8008"; } }
 
         public static IServerConnection CreateTestHttpConnection()
         {

Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommandImpl.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,517 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Feature;
+
+namespace OSGeo.MapGuide.MaestroAPI.Commands
+{
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.ICommand"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultCommand<TConn> : ICommand where TConn : IServerConnection 
+    {
+        /// <summary>
+        /// Gets the connection implementation.
+        /// </summary>
+        public TConn ConnImpl { get { return (TConn)this.Parent; } }
+
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultCommand(TConn conn)
+        {
+            this.Parent = conn;
+        }
+
+        /// <summary>
+        /// Gets the parent connection.
+        /// </summary>
+        /// <value>
+        /// The parent connection.
+        /// </value>
+        public IServerConnection Parent
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Validates the core commnad parameters.
+        /// </summary>
+        protected void ValidateCoreParams()
+        {
+            if (this.Parent == null)
+                throw new InvalidOperationException("Null parent connection"); //LOCALIZEME
+        }
+    }
+
+    /// <summary>
+    /// A default implementation of the <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IFeatureCommand"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultFeatureCommand<TConn> : DefaultCommand<TConn>, IFeatureCommand where TConn : IServerConnection
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultFeatureCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultFeatureCommand(TConn conn) : base(conn) { }
+
+        /// <summary>
+        /// Gets or sets the feature source id.
+        /// </summary>
+        /// <value>
+        /// The feature source id.
+        /// </value>
+        public string FeatureSourceId
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the name of the class.
+        /// </summary>
+        /// <value>
+        /// The name of the class.
+        /// </value>
+        public string ClassName
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Performs basic validation of core command parameters
+        /// </summary>
+        protected void ValidateParams()
+        {
+            base.ValidateCoreParams();
+            if (string.IsNullOrEmpty(this.FeatureSourceId))
+                throw new InvalidOperationException("No feature source id specified"); //LOCALIZEME
+            if (string.IsNullOrEmpty(this.ClassName))
+                throw new InvalidOperationException("No class name specified"); //LOCALIZEME
+        }
+    }
+
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IInsertFeatures"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultInsertCommand<TConn> : DefaultFeatureCommand<TConn>, IInsertFeatures where TConn : IServerConnection
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultInsertCommand"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultInsertCommand(TConn conn) : base(conn) { }
+
+        /// <summary>
+        /// Gets or sets the record to insert.
+        /// </summary>
+        /// <value>
+        /// The record to insert.
+        /// </value>
+        public IMutableRecord RecordToInsert
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Performs the actual command execution
+        /// </summary>
+        protected abstract void ExecuteInternal();
+
+        /// <summary>
+        /// Executes this instance.
+        /// </summary>
+        /// <returns></returns>
+        public InsertResult Execute()
+        {
+            var res = new InsertResult();
+            try
+            {
+                base.ValidateParams();
+                if (this.RecordToInsert == null)
+                    throw new InvalidOperationException("Nothing to insert"); //LOCALIZEME
+
+                this.ExecuteInternal(); 
+            }
+            catch (Exception ex)
+            {
+                res.Error = ex;
+            }
+            return res;
+        }
+    }
+
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IUpdateFeatures"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultUpdateCommand<TConn> : DefaultFeatureCommand<TConn>, IUpdateFeatures where TConn : IServerConnection
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultUpdateCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="parent">The parent.</param>
+        public DefaultUpdateCommand(TConn parent) : base(parent) { }
+
+        /// <summary>
+        /// Gets or sets the filter.
+        /// </summary>
+        /// <value>
+        /// The filter.
+        /// </value>
+        public string Filter
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the values to update.
+        /// </summary>
+        /// <value>
+        /// The values to update.
+        /// </value>
+        public IMutableRecord ValuesToUpdate
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Performs the actual execution of the command
+        /// </summary>
+        /// <returns></returns>
+        public abstract int ExecuteInternal();
+
+        /// <summary>
+        /// Executes this instance.
+        /// </summary>
+        /// <returns></returns>
+        public int Execute()
+        {
+            base.ValidateParams();
+            if (this.ValuesToUpdate == null)
+                throw new InvalidOperationException("No values specified for updating"); //LOCALIZEME
+
+            return ExecuteInternal();
+        }
+    }
+
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IDeleteFeatures"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultDeleteCommand<TConn> : DefaultFeatureCommand<TConn>, IDeleteFeatures where TConn : IServerConnection 
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultDeleteCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultDeleteCommand(TConn conn) : base(conn) { }
+
+        /// <summary>
+        /// Gets or sets the filter.
+        /// </summary>
+        /// <value>
+        /// The filter.
+        /// </value>
+        public string Filter
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Executes this instance.
+        /// </summary>
+        /// <returns></returns>
+        public int Execute()
+        {
+            this.ValidateParams();
+            return this.ExecuteInternal();
+        }
+
+        /// <summary>
+        /// Performs actual execution of the command
+        /// </summary>
+        /// <returns></returns>
+        protected abstract int ExecuteInternal();
+    }
+
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IApplySchema"/>. This class is reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultApplySchemaCommand<TConn> : DefaultFeatureCommand<TConn>, IApplySchema where TConn : IServerConnection
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultApplySchemaCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultApplySchemaCommand(TConn conn) : base(conn) { }
+
+        /// <summary>
+        /// Gets or sets the schema.
+        /// </summary>
+        /// <value>
+        /// The schema.
+        /// </value>
+        public OSGeo.MapGuide.MaestroAPI.Schema.FeatureSchema Schema
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the feature source id.
+        /// </summary>
+        /// <value>
+        /// The feature source id.
+        /// </value>
+        public string FeatureSourceId
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Executes this instance.
+        /// </summary>
+        public void Execute()
+        {
+            base.ValidateCoreParams();
+            if (string.IsNullOrEmpty(this.FeatureSourceId))
+                throw new InvalidOperationException("Empty feature source id"); //LOCALIZEME
+            if (this.Schema == null)
+                throw new InvalidOperationException("No schema specified to apply"); //LOCALIZEME
+
+            this.ExecuteInternal();
+        }
+
+        /// <summary>
+        /// Performs the actual command execution
+        /// </summary>
+        protected abstract void ExecuteInternal();
+    }
+
+    /// <summary>
+    /// A default implementation of <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.IApplySchema"/>. Reserved for connection provider use
+    /// </summary>
+    /// <typeparam name="TConn">The type of the conn.</typeparam>
+    public abstract class DefaultCreateDataStoreCommand<TConn> : DefaultCommand<TConn>, ICreateDataStore where TConn : IServerConnection
+    {
+        /// <summary>
+        /// Initializes a new instance of the <see cref="DefaultCreateDataStoreCommand&lt;TConn&gt;"/> class.
+        /// </summary>
+        /// <param name="conn">The conn.</param>
+        protected DefaultCreateDataStoreCommand(TConn conn) : base(conn) { }
+
+        /// <summary>
+        /// Gets or sets the schema.
+        /// </summary>
+        /// <value>
+        /// The schema.
+        /// </value>
+        public OSGeo.MapGuide.MaestroAPI.Schema.FeatureSchema Schema
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the feature source id.
+        /// </summary>
+        /// <value>
+        /// The feature source id.
+        /// </value>
+        public string FeatureSourceId
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the provider.
+        /// </summary>
+        /// <value>
+        /// The provider.
+        /// </value>
+        public string Provider
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the name of the file.
+        /// </summary>
+        /// <value>
+        /// The name of the file.
+        /// </value>
+        public string FileName
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Executes this instance.
+        /// </summary>
+        public void Execute()
+        {
+            this.ValidateCoreParams();
+            if (string.IsNullOrEmpty(this.FeatureSourceId))
+                throw new InvalidOperationException("No feature source id specified"); //LOCALIZEME
+            if (string.IsNullOrEmpty(this.CoordinateSystemWkt))
+                throw new InvalidOperationException("No coordinate system WKT specified"); //LOCALIZEME
+            if (this.Extent == null && this.ExtentType != OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType.Dynamic)
+                throw new InvalidOperationException("No extent specified for static extent type"); //LOCALIZEME
+            if (string.IsNullOrEmpty(this.FileName))
+                throw new InvalidOperationException("No file name specified"); //LOCALIZEME
+            if (string.IsNullOrEmpty(this.Name))
+                throw new InvalidOperationException("No spatial context name specified. This is the name that should be referred to by any spatial context associations in your feature schema");
+            if (string.IsNullOrEmpty(this.Provider))
+                throw new InvalidOperationException("No provider specified"); //LOCALIZEME
+            if (this.Schema == null)
+                throw new InvalidOperationException("No schema specified"); //LOCALIZEME
+            this.ExecuteInternal();
+        }
+
+        /// <summary>
+        /// Performs actual execution of the command.
+        /// </summary>
+        protected abstract void ExecuteInternal();
+
+        /// <summary>
+        /// Gets or sets the name of the coordinate system.
+        /// </summary>
+        /// <value>
+        /// The name of the coordinate system.
+        /// </value>
+        public string CoordinateSystemName
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the coordinate system WKT.
+        /// </summary>
+        /// <value>
+        /// The coordinate system WKT.
+        /// </value>
+        public string CoordinateSystemWkt
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the description.
+        /// </summary>
+        /// <value>
+        /// The description.
+        /// </value>
+        public string Description
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the extent.
+        /// </summary>
+        /// <value>
+        /// The extent.
+        /// </value>
+        public OSGeo.MapGuide.ObjectModels.Common.IEnvelope Extent
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the type of the extent.
+        /// </summary>
+        /// <value>
+        /// The type of the extent.
+        /// </value>
+        public OSGeo.MapGuide.ObjectModels.Common.FdoSpatialContextListSpatialContextExtentType ExtentType
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the name of the spatial context to create.
+        /// </summary>
+        /// <value>
+        /// The name.
+        /// </value>
+        public string Name
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the XY tolerance.
+        /// </summary>
+        /// <value>
+        /// The XY tolerance.
+        /// </value>
+        public double XYTolerance
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// Gets or sets the Z tolerance.
+        /// </summary>
+        /// <value>
+        /// The Z tolerance.
+        /// </value>
+        public double ZTolerance
+        {
+            get;
+            set;
+        }
+
+        public void WriteXml(System.Xml.XmlDocument doc, System.Xml.XmlNode currentNode)
+        {
+            throw new NotImplementedException();
+        }
+
+        public void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,92 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.MaestroAPI.Feature;
+using OSGeo.MapGuide.ObjectModels.Common;
+
+namespace OSGeo.MapGuide.MaestroAPI.Commands
+{
+    public interface IFeatureCommand : ICommand 
+    {
+        string FeatureSourceId { get; set; }
+
+        string ClassName { get; set; }
+    }
+
+    public interface ICreateDataStore : ICommand, IFdoSpatialContext
+    {
+        FeatureSchema Schema { get; set; }
+
+        string Provider { get; set; }
+
+        string FileName { get; set; }
+
+        string FeatureSourceId { get; set; }
+
+        void Execute();
+    }
+
+    public interface IInsertFeatures : IFeatureCommand
+    {
+        IMutableRecord RecordToInsert { get; set; }
+
+        InsertResult Execute();
+    }
+
+    public class InsertResult
+    {
+        public Exception Error { get; set; }
+    }
+
+    public interface IBatchInsertFeatures : IFeatureCommand
+    {
+        ICollection<IRecord> RecordsToInsert { get; set; }
+
+        ICollection<InsertResult> Execute();
+    }
+
+    public interface IUpdateFeatures : IFeatureCommand
+    {
+        string Filter { get; set; }
+
+        IMutableRecord ValuesToUpdate { get; set; }
+
+        int Execute();
+    }
+
+    public interface IDeleteFeatures : IFeatureCommand
+    {
+        string Filter { get; set; }
+
+        int Execute();
+    }
+
+    public interface IApplySchema : ICommand
+    {
+        string FeatureSourceId { get; set; }
+
+        FeatureSchema Schema { get; set; }
+
+        void Execute();
+    }
+}

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IFeatureReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IFeatureReader.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IFeatureReader.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -74,4 +74,30 @@
         /// <returns></returns>
         IFeatureReader GetFeatureObject(int index);
     }
+
+    public interface IMutableFeature : IMutableRecord
+    {
+        /// <summary>
+        /// Gets the class definition of the object currently being read. If the user has requested 
+        /// only a subset of the class properties (as specified in the filter text), the class 
+        /// definition reflects what the user has requested, rather than the full class definition. 
+        /// </summary>
+        ClassDefinition ClassDefinition { get; }
+
+        /// <summary>
+        /// Gets a <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing
+        /// all the nested features of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        IFeatureReader GetFeatureObject(string name);
+
+        /// <summary>
+        /// Gets a <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.IFeatureReader"/> containing
+        /// all the nested features at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        IFeatureReader GetFeatureObject(int index);
+    }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -21,6 +21,7 @@
 using System.Collections.Generic;
 using System.Text;
 using GeoAPI.Geometries;
+using OSGeo.MapGuide.MaestroAPI.Schema;
 
 namespace OSGeo.MapGuide.MaestroAPI.Feature
 {
@@ -88,6 +89,11 @@
     public interface IRecordInitialize
     {
         /// <summary>
+        /// Gets the property names.
+        /// </summary>
+        IEnumerable<string> PropertyNames { get; }
+
+        /// <summary>
         /// Gets the specified property value by name
         /// </summary>
         /// <param name="name"></param>
@@ -331,5 +337,217 @@
         /// <param name="name"></param>
         /// <returns></returns>
         object this[string name] { get; }
+
+        /// <summary>
+        /// Gets the type of the property.
+        /// </summary>
+        /// <param name="name">The name.</param>
+        /// <returns></returns>
+        PropertyValueType GetPropertyType(string name);
+        /// <summary>
+        /// Gets the type of the property at the specified index.
+        /// </summary>
+        /// <param name="index">The index.</param>
+        /// <returns></returns>
+        PropertyValueType GetPropertyType(int index);
     }
+
+    public interface IMutableRecord : IRecord, IRecordInitialize
+    {
+        /// <summary>
+        /// Gets or sets the object at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        object this[int index] { set; get; }
+
+        /// <summary>
+        /// Gets or sets the object value for the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        object this[string name] { set; get; }
+
+        /// <summary>
+        /// Sets whether the specified property name has a null property value
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetNull(string name);
+
+        /// <summary>
+        /// Sets whether the property value at the specified index has a null property value.
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetNull(int index);
+
+        /// <summary>
+        /// Sets the boolean value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetBoolean(string name, bool value);
+
+        /// <summary>
+        /// Sets the byte value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetByte(string name, byte value);
+
+        /// <summary>
+        /// Sets the blob value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetBlob(string name, byte[] value);
+
+        /// <summary>
+        /// Sets the clob value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetClob(string name, char[] value);
+
+        /// <summary>
+        /// Sets the double value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetDouble(string name, double value);
+
+        /// <summary>
+        /// Sets the datetime value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetDateTime(string name, DateTime value);
+
+        /// <summary>
+        /// Sets the int16 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetInt16(string name, short value);
+
+        /// <summary>
+        /// Sets the int32 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetInt32(string name, int value);
+
+        /// <summary>
+        /// Sets the int64 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetInt64(string name, long value);
+
+        /// <summary>
+        /// Sets the single value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetSingle(string name, float value);
+
+        /// <summary>
+        /// Sets the string value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetString(string name, string value);
+
+        /// <summary>
+        /// Sets the geometry value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        void SetGeometry(string name, IGeometry value);
+
+        /// <summary>
+        /// Sets the boolean value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetBoolean(int index, bool value);
+
+        /// <summary>
+        /// Sets the byte value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetByte(int index, byte value);
+
+        /// <summary>
+        /// Sets the blob value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetBlob(int index, byte[] value);
+
+        /// <summary>
+        /// Sets the clob value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetClob(int index, char[] value);
+
+        /// <summary>
+        /// Sets the double value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetDouble(int index, double value);
+
+        /// <summary>
+        /// Sets the datetime value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetDateTime(int index, DateTime value);
+
+        /// <summary>
+        /// Sets the int16 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetInt16(int index, short value);
+
+        /// <summary>
+        /// Sets the int32 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetInt32(int index, int value);
+
+        /// <summary>
+        /// Sets the int64 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetInt64(int index, long value);
+
+        /// <summary>
+        /// Sets the single value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetSingle(int index, float value);
+
+        /// <summary>
+        /// Sets the string value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetString(int index, string value);
+
+        /// <summary>
+        /// Sets the geometry value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        void SetGeometry(int index, IGeometry value);
+    }
 }

Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableFeatureBase.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,48 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+
+namespace OSGeo.MapGuide.MaestroAPI.Feature
+{
+    public class MutableFeatureBase : MutableRecordBase, IMutableFeature
+    {
+        protected ClassDefinition _clsDef;
+
+        protected MutableFeatureBase(IRecordInitialize feature, ClassDefinition source)
+            : base(feature)
+        {
+            _clsDef = ClassDefinition.Clone(source);
+        }
+
+        protected MutableFeatureBase(MutableFeatureBase feat)
+            : this(feat, feat.ClassDefinition)
+        {
+
+        }
+
+        public ClassDefinition ClassDefinition
+        {
+            get { return _clsDef; }
+        }
+    }
+}

Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableRecordBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableRecordBase.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/MutableRecordBase.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,505 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+
+namespace OSGeo.MapGuide.MaestroAPI.Feature
+{
+    /// <summary>
+    /// A mutable record
+    /// </summary>
+    public class MutableRecordBase : RecordBase, IMutableRecord
+    {
+        protected MutableRecordBase(IRecordInitialize prototype)
+        {
+            _values.Clear();
+            if (prototype != null)
+            {
+                foreach (string name in prototype.PropertyNames)
+                {
+                    var src = prototype.GetValue(name);
+                    _values[name] = ClonePropertyValue(src);
+                }
+            }
+        }
+
+        protected PropertyValue ClonePropertyValue(PropertyValue propertyValue)
+        {
+            if (propertyValue.IsNull)
+            {
+                switch (propertyValue.Type)
+                {
+                    case PropertyValueType.Blob:
+                        return new BlobValue();
+                    case PropertyValueType.Boolean:
+                        return new BooleanValue();
+                    case PropertyValueType.Byte:
+                        return new ByteValue();
+                    case PropertyValueType.Clob:
+                        return new ClobValue();
+                    case PropertyValueType.DateTime:
+                        return new DateTimeValue();
+                    case PropertyValueType.Double:
+                        return new DoubleValue();
+                    case PropertyValueType.Feature:
+                        return new FeatureValue();
+                    case PropertyValueType.Geometry:
+                        return new GeometryValue();
+                    case PropertyValueType.Int16:
+                        return new Int16Value();
+                    case PropertyValueType.Int32:
+                        return new Int32Value();
+                    case PropertyValueType.Int64:
+                        return new Int64Value();
+                    case PropertyValueType.Raster:
+                        return new RasterValue();
+                    case PropertyValueType.Single:
+                        return new SingleValue();
+                    case PropertyValueType.String:
+                        return new StringValue();
+                }
+            }
+            else
+            {
+                switch (propertyValue.Type)
+                {
+                    case PropertyValueType.Blob:
+                        return new BlobValue(((BlobValue)propertyValue).Value);
+                    case PropertyValueType.Boolean:
+                        return new BooleanValue(((BooleanValue)propertyValue).Value);
+                    case PropertyValueType.Byte:
+                        return new ByteValue(((ByteValue)propertyValue).Value);
+                    case PropertyValueType.Clob:
+                        return new ClobValue(((ClobValue)propertyValue).Value);
+                    case PropertyValueType.DateTime:
+                        return new DateTimeValue(((DateTimeValue)propertyValue).Value);
+                    case PropertyValueType.Double:
+                        return new DoubleValue(((DoubleValue)propertyValue).Value);
+                    case PropertyValueType.Feature:
+                        return new FeatureValue(((FeatureValue)propertyValue).Value);
+                    case PropertyValueType.Geometry:
+                        return new GeometryValue(((GeometryValue)propertyValue).Value);
+                    case PropertyValueType.Int16:
+                        return new Int16Value(((Int16Value)propertyValue).Value);
+                    case PropertyValueType.Int32:
+                        return new Int32Value(((Int32Value)propertyValue).Value);
+                    case PropertyValueType.Int64:
+                        return new Int64Value(((Int64Value)propertyValue).Value);
+                    case PropertyValueType.Raster:
+                        return new RasterValue(((RasterValue)propertyValue).Value);
+                    case PropertyValueType.Single:
+                        return new SingleValue(((SingleValue)propertyValue).Value);
+                    case PropertyValueType.String:
+                        return new StringValue(((StringValue)propertyValue).Value);
+                }
+            }
+            throw new ArgumentException();
+        }
+
+        /// <summary>
+        /// Gets or sets the <see cref="System.Object"/> at the specified index.
+        /// </summary>
+        public object this[int index]
+        {
+            get
+            {
+                return base[index];
+            }
+            set
+            {
+                this[_ordinalMap[index]] = value;
+            }
+        }
+
+        /// <summary>
+        /// Gets or sets the <see cref="System.Object"/> with the specified name.
+        /// </summary>
+        public object this[string name]
+        {
+            get
+            {
+                return this[name];
+            }
+            set
+            {
+                if (value == null)
+                    throw new InvalidOperationException("null values are not permitted. Use SetNull() if you need to specify null values"); //LOCALIZEME
+
+                switch (_values[name].Type)
+                {
+                    case PropertyValueType.Blob:
+                        SetBlob(name, (byte[])value);
+                        break;
+                    case PropertyValueType.Boolean:
+                        SetBoolean(name, (bool)value);
+                        break;
+                    case PropertyValueType.Byte:
+                        SetByte(name, (byte)value);
+                        break;
+                    case PropertyValueType.Clob:
+                        SetClob(name, (char[])value);
+                        break;
+                    case PropertyValueType.DateTime:
+                        SetDateTime(name, (DateTime)value);
+                        break;
+                    case PropertyValueType.Double:
+                        SetDouble(name, (double)value);
+                        break;
+                    case PropertyValueType.Geometry:
+                        SetGeometry(name, (GeoAPI.Geometries.IGeometry)value);
+                        break;
+                    case PropertyValueType.Int16:
+                        SetInt16(name, (short)value);
+                        break;
+                    case PropertyValueType.Int32:
+                        SetInt32(name, (int)value);
+                        break;
+                    case PropertyValueType.Int64:
+                        SetInt64(name, (long)value);
+                        break;
+                    case PropertyValueType.Single:
+                        SetSingle(name, (float)value);
+                        break;
+                    case PropertyValueType.String:
+                        SetString(name, (string)value);
+                        break;
+                }
+                throw new ArgumentException();
+            }
+        }
+
+        /// <summary>
+        /// Sets whether the specified property name has a null property value
+        /// </summary>
+        /// <param name="name"></param>
+        public void SetNull(string name)
+        {
+            _values[name].SetNull();
+        }
+
+        /// <summary>
+        /// Sets whether the property value at the specified index has a null property value.
+        /// </summary>
+        /// <param name="index"></param>
+        public void SetNull(int index)
+        {
+            SetNull(_ordinalMap[index]);
+        }
+
+        /// <summary>
+        /// Sets the boolean value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetBoolean(string name, bool value)
+        {
+            var propVal = _values[name] as BooleanValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Boolean.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the byte value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetByte(string name, byte value)
+        {
+            var propVal = _values[name] as ByteValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Byte.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the blob value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetBlob(string name, byte[] value)
+        {
+            var propVal = _values[name] as BlobValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Blob.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the clob value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetClob(string name, char[] value)
+        {
+            var propVal = _values[name] as ClobValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Clob.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the double value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetDouble(string name, double value)
+        {
+            var propVal = _values[name] as DoubleValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Double.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the datetime value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetDateTime(string name, DateTime value)
+        {
+            var propVal = _values[name] as DateTimeValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.DateTime.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the int16 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetInt16(string name, short value)
+        {
+            var propVal = _values[name] as Int16Value;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Int16.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the int32 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetInt32(string name, int value)
+        {
+            var propVal = _values[name] as Int32Value;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Int32.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the int64 value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetInt64(string name, long value)
+        {
+            var propVal = _values[name] as Int64Value;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Int64.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the single value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetSingle(string name, float value)
+        {
+            var propVal = _values[name] as SingleValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Single.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the string value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetString(string name, string value)
+        {
+            var propVal = _values[name] as StringValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.String.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the geometry value of the specified property
+        /// </summary>
+        /// <param name="name"></param>
+        /// <param name="value"></param>
+        public void SetGeometry(string name, GeoAPI.Geometries.IGeometry value)
+        {
+            var propVal = _values[name] as GeometryValue;
+            if (propVal == null)
+                throw new InvalidOperationException(string.Format(Properties.Resources.ERR_PROPERTY_VALUE_NOT_OF_TYPE, name, PropertyValueType.Geometry.ToString()));
+
+            propVal.Value = value;
+        }
+
+        /// <summary>
+        /// Sets the boolean value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetBoolean(int index, bool value)
+        {
+            SetBoolean(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the byte value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetByte(int index, byte value)
+        {
+            SetByte(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the blob value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetBlob(int index, byte[] value)
+        {
+            SetBlob(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the clob value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetClob(int index, char[] value)
+        {
+            SetClob(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the double value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetDouble(int index, double value)
+        {
+            SetDouble(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the datetime value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetDateTime(int index, DateTime value)
+        {
+            SetDateTime(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the int16 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetInt16(int index, short value)
+        {
+            SetInt16(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the int32 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetInt32(int index, int value)
+        {
+            SetInt32(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the int64 value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetInt64(int index, long value)
+        {
+            SetInt64(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the single value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetSingle(int index, float value)
+        {
+            SetSingle(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the string value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetString(int index, string value)
+        {
+            SetString(_ordinalMap[index], value);
+        }
+
+        /// <summary>
+        /// Sets the geometry value at the specified index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <param name="value"></param>
+        public void SetGeometry(int index, GeoAPI.Geometries.IGeometry value)
+        {
+            SetGeometry(_ordinalMap[index], value);
+        }
+    }
+
+    /// <summary>
+    /// A record whose properties can be modified and allows for adding of new 
+    /// <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.PropertyValue"/> instances
+    /// </summary>
+    public class MutableRecord : MutableRecordBase
+    {
+        public MutableRecord() : base(null) { }
+    }
+}
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/PropertyValue.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -53,6 +53,14 @@
         /// Gets the type.
         /// </summary>
         public abstract PropertyValueType Type { get; }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public abstract PropertyDefinitionType PropertyDefType { get; }
     }
 
     /// <summary>
@@ -120,6 +128,17 @@
         {
             _value = null;
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Data; }
+        }
     }
 
     /// <summary>
@@ -140,8 +159,7 @@
         protected ReferenceTypePropertyValue(T value)
             : base()
         {
-            _value = value;
-            this.IsNull = false;
+            this.Value = value;
         }
 
         private T _value;
@@ -174,6 +192,10 @@
     /// </summary>
     public class ByteValue : ValueTypePropertyValue<byte>
     {
+        public ByteValue() : base() { }
+
+        public ByteValue(byte value) : base() { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -188,6 +210,10 @@
     /// </summary>
     public class BooleanValue : ValueTypePropertyValue<bool>
     {
+        public BooleanValue() : base() { }
+
+        public BooleanValue(bool value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -202,6 +228,10 @@
     /// </summary>
     public class BlobValue : ReferenceTypePropertyValue<byte[]>
     {
+        public BlobValue() : base() { }
+
+        public BlobValue(byte[] value) : base(value) { } 
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -209,6 +239,17 @@
         {
             get { return PropertyValueType.Blob; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Data; }
+        }
     }
 
     /// <summary>
@@ -216,6 +257,10 @@
     /// </summary>
     public class ClobValue : ReferenceTypePropertyValue<char[]>
     {
+        public ClobValue() : base() { }
+
+        public ClobValue(char[] value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -223,6 +268,17 @@
         {
             get { return PropertyValueType.Clob; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Data; }
+        }
     }
 
     /// <summary>
@@ -230,6 +286,10 @@
     /// </summary>
     public class DateTimeValue : ValueTypePropertyValue<DateTime>
     {
+        public DateTimeValue() : base() { }
+
+        public DateTimeValue(DateTime value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -244,6 +304,10 @@
     /// </summary>
     public class DoubleValue : ValueTypePropertyValue<double>
     {
+        public DoubleValue() : base() { }
+
+        public DoubleValue(double value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -258,6 +322,10 @@
     /// </summary>
     public class FeatureValue : ReferenceTypePropertyValue<IFeature[]>
     {
+        public FeatureValue() : base() { }
+
+        public FeatureValue(IFeature[] values) : base(values) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -265,6 +333,17 @@
         {
             get { return PropertyValueType.Feature; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Object; }
+        }
     }
 
     /// <summary>
@@ -272,6 +351,10 @@
     /// </summary>
     public class GeometryValue : ReferenceTypePropertyValue<IGeometry>
     {
+        public GeometryValue() : base() { }
+
+        public GeometryValue(IGeometry value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -279,6 +362,17 @@
         {
             get { return PropertyValueType.Geometry; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Geometry; }
+        }
     }
 
     /// <summary>
@@ -286,6 +380,10 @@
     /// </summary>
     public class Int16Value : ValueTypePropertyValue<short>
     {
+        public Int16Value() : base() { }
+
+        public Int16Value(short value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -300,6 +398,10 @@
     /// </summary>
     public class Int32Value : ValueTypePropertyValue<int>
     {
+        public Int32Value() : base() { }
+
+        public Int32Value(int value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -314,6 +416,10 @@
     /// </summary>
     public class Int64Value : ValueTypePropertyValue<long>
     {
+        public Int64Value() : base() { }
+
+        public Int64Value(long value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -328,6 +434,10 @@
     /// </summary>
     public class RasterValue : ReferenceTypePropertyValue<byte[]>
     {
+        public RasterValue() : base() { }
+
+        public RasterValue(byte[] value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -335,6 +445,17 @@
         {
             get { return PropertyValueType.Raster; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Raster; }
+        }
     }
 
     /// <summary>
@@ -342,6 +463,10 @@
     /// </summary>
     public class SingleValue : ValueTypePropertyValue<float>
     {
+        public SingleValue() : base() { }
+
+        public SingleValue(float value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -356,6 +481,10 @@
     /// </summary>
     public class StringValue : ReferenceTypePropertyValue<string>
     {
+        public StringValue() : base() { }
+
+        public StringValue(string value) : base(value) { }
+
         /// <summary>
         /// Gets the type.
         /// </summary>
@@ -363,6 +492,17 @@
         {
             get { return PropertyValueType.String; }
         }
+
+        /// <summary>
+        /// Gets the suggsted property definition type for this value
+        /// </summary>
+        /// <value>
+        /// The suggsted property definition type.
+        /// </value>
+        public override PropertyDefinitionType PropertyDefType
+        {
+            get { return PropertyDefinitionType.Data; }
+        }
     }
 
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/ReaderBase.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -368,5 +368,26 @@
         {
             get { return this.Current[name]; }
         }
+
+
+        /// <summary>
+        /// Gets the type of the property.
+        /// </summary>
+        /// <param name="name">The name.</param>
+        /// <returns></returns>
+        public OSGeo.MapGuide.MaestroAPI.Schema.PropertyValueType GetPropertyType(string name)
+        {
+            return this.Current.GetPropertyType(name);
+        }
+
+        /// <summary>
+        /// Gets the type of the property at the specified index.
+        /// </summary>
+        /// <param name="index">The index.</param>
+        /// <returns></returns>
+        public OSGeo.MapGuide.MaestroAPI.Schema.PropertyValueType GetPropertyType(int index)
+        {
+            return this.Current.GetPropertyType(index);
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/RecordBase.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -60,6 +60,16 @@
         }
 
         /// <summary>
+        /// Gets whether the specified named property exists
+        /// </summary>
+        /// <param name="name">The property name.</param>
+        /// <returns></returns>
+        public bool PropertyExists(string name)
+        {
+            return _values.ContainsKey(name);
+        }
+
+        /// <summary>
         /// Adds the specified property value
         /// </summary>
         /// <param name="name"></param>
@@ -69,6 +79,7 @@
             if (_values.ContainsKey(name))
                 throw new ArgumentException("Key " + name + " already exists"); //LOCALIZEME
 
+            _ordinalMap[this.FieldCount] = name;
             _values[name] = value;
         }
 
@@ -506,5 +517,33 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Gets the property names.
+        /// </summary>
+        public IEnumerable<string> PropertyNames
+        {
+            get { return _ordinalMap.Values; }
+        }
+
+        /// <summary>
+        /// Gets the type of the property.
+        /// </summary>
+        /// <param name="name">The name.</param>
+        /// <returns></returns>
+        public PropertyValueType GetPropertyType(string name)
+        {
+            return _values[name].Type;
+        }
+
+        /// <summary>
+        /// Gets the type of the property at the specified index.
+        /// </summary>
+        /// <param name="index">The index.</param>
+        /// <returns></returns>
+        public PropertyValueType GetPropertyType(int index)
+        {
+            return GetPropertyType(_ordinalMap[index]);
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -175,6 +175,8 @@
     <Compile Include="ArgumentParser.cs" />
     <Compile Include="BindingListExtensions.cs" />
     <Compile Include="Capability\NsDoc.cs" />
+    <Compile Include="Commands\FeatureManipulationCommandImpl.cs" />
+    <Compile Include="Commands\FeatureManipulationCommands.cs" />
     <Compile Include="Commands\IGetFdoCacheInfo.cs" />
     <Compile Include="Commands\IGetResourceContents.cs" />
     <Compile Include="Capability\ConnectionCapabilities.cs" />
@@ -212,6 +214,8 @@
     <Compile Include="Feature\FeatureReaderBase.cs" />
     <Compile Include="Feature\IFeatureReader.cs" />
     <Compile Include="Feature\IReader.cs" />
+    <Compile Include="Feature\MutableFeatureBase.cs" />
+    <Compile Include="Feature\MutableRecordBase.cs" />
     <Compile Include="Feature\NsDoc.cs" />
     <Compile Include="Feature\PropertyValue.cs" />
     <Compile Include="Feature\ReaderBase.cs" />

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/PlatformConnectionBase.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -1419,7 +1419,7 @@
         /// <summary>
         /// a class definition cache
         /// </summary>
-        protected Dictionary<string, ClassDefinition> m_featureSchemaNameCache = new Dictionary<string, ClassDefinition>();
+        protected Dictionary<string, ClassDefinition> m_classDefinitionCache = new Dictionary<string, ClassDefinition>();
 
         /// <summary>
         /// Gets the feature source description.
@@ -1434,7 +1434,7 @@
                 {
                     m_featureSchemaCache[resourceID] = this.DescribeFeatureSource(resourceID);
                     foreach (ClassDefinition scm in m_featureSchemaCache[resourceID].AllClasses)
-                        m_featureSchemaNameCache[resourceID + "!" + scm.QualifiedName] = scm;
+                        m_classDefinitionCache[resourceID + "!" + scm.QualifiedName] = scm;
                 }
                 catch
                 {
@@ -1451,21 +1451,44 @@
         /// Gets the class definition.
         /// </summary>
         /// <param name="resourceID">The resource ID.</param>
-        /// <param name="schema">The schema.</param>
+        /// <param name="className">The class name to look for.</param>
         /// <returns></returns>
-        public virtual ClassDefinition GetClassDefinition(string resourceID, string schema)
+        public virtual ClassDefinition GetClassDefinition(string resourceID, string className)
         {
             /*if (schema != null && schema.IndexOf(":") > 0)
                 schema = schema.Substring(0, schema.IndexOf(":"));*/
 
+            FeatureSourceDescription desc = null;
             //If it is missing, just get the entire schema, and hope that we will need the others
             //Some providers actually return the entire list even when asked for a particular schema
-            if (!m_featureSchemaCache.ContainsKey(resourceID + "!" + schema))
-                GetFeatureSourceDescription(resourceID);
-            if (!m_featureSchemaNameCache.ContainsKey(resourceID + "!" + schema))
-                m_featureSchemaNameCache[resourceID + "!" + schema] = null;
+            if (!m_featureSchemaCache.ContainsKey(resourceID + "!" + className))
+                desc = GetFeatureSourceDescription(resourceID);
+            if (!m_classDefinitionCache.ContainsKey(resourceID + "!" + className))
+                m_classDefinitionCache[resourceID + "!" + className] = null;
 
-            return m_featureSchemaNameCache[resourceID + "!" + schema];
+            var cls = m_classDefinitionCache[resourceID + "!" + className];
+            if (cls == null)
+            {
+                //Try non qualified
+                if (desc != null)
+                {
+                    if (desc.Schemas.Length == 1)
+                    {
+                        return desc.GetClass(desc.SchemaNames[0], className);
+                    }
+                    else
+                    {
+                        //Since this is not qualified, just find the first matching
+                        //class by its name, regardless of its parent
+                        foreach (var klass in desc.AllClasses)
+                        {
+                            if (klass.Name == className)
+                                return klass;
+                        }
+                    }
+                }
+            }
+            return cls;
         }
 
         /// <summary>
@@ -1474,7 +1497,7 @@
         public virtual void ResetFeatureSourceSchemaCache()
         {
             m_featureSchemaCache = new Dictionary<string, FeatureSourceDescription>();
-            m_featureSchemaNameCache = new Dictionary<string, ClassDefinition>();
+            m_classDefinitionCache = new Dictionary<string, ClassDefinition>();
         }
 
         /// <summary>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -441,6 +441,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to The specified property {0} is not of type: {1}.
+        /// </summary>
+        internal static string ERR_PROPERTY_VALUE_NOT_OF_TYPE {
+            get {
+                return ResourceManager.GetString("ERR_PROPERTY_VALUE_NOT_OF_TYPE", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to No connection attached to this resource.
         /// </summary>
         internal static string ERR_RESOURCE_NOT_ATTACHED {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx	2012-01-06 17:26:02 UTC (rev 6409)
@@ -557,4 +557,7 @@
   <data name="LDF_IrrelevantUsageContext" xml:space="preserve">
     <value>Referenced Symbol Definition {0} has an irrelevant usage context for this layer because this layer does not have features of type: {1}</value>
   </data>
+  <data name="ERR_PROPERTY_VALUE_NOT_OF_TYPE" xml:space="preserve">
+    <value>The specified property {0} is not of type: {1}</value>
+  </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -357,5 +357,30 @@
                 }
             }
         }
+
+        /// <summary>
+        /// Creates a clone of the specified instance
+        /// </summary>
+        /// <param name="source">The instance to clone.</param>
+        /// <returns></returns>
+        public static ClassDefinition Clone(ClassDefinition source)
+        {
+            var clone = new ClassDefinition(source.Name, source.Description);
+            foreach (var prop in source.Properties)
+            {
+                var clonedProp = PropertyDefinition.Clone(prop);
+                if (clonedProp.Type == PropertyDefinitionType.Data &&
+                    source.IdentityProperties.Contains((DataPropertyDefinition)prop))
+                {
+                    clone.AddProperty((DataPropertyDefinition)clonedProp, true);
+                }
+                else
+                {
+                    clone.AddProperty(clonedProp);
+                }
+            }
+            //TODO: Base Class
+            return clone;
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -243,5 +243,60 @@
         {
             get;
         }
+
+        /// <summary>
+        /// Creates a clone of the specified instance
+        /// </summary>
+        /// <param name="prop">The instance to clone.</param>
+        /// <returns></returns>
+        public static PropertyDefinition Clone(PropertyDefinition prop)
+        {
+            switch (prop.Type)
+            {
+                case PropertyDefinitionType.Data:
+                    {
+                        var source = (DataPropertyDefinition)prop;
+                        var dp = new DataPropertyDefinition(prop.Name, prop.Description);
+
+                        dp.DataType = source.DataType;
+                        dp.DefaultValue = source.DefaultValue;
+                        dp.IsAutoGenerated = source.IsAutoGenerated;
+                        dp.IsNullable = source.IsNullable;
+                        dp.IsReadOnly = source.IsReadOnly;
+                        dp.Length = source.Length;
+                        dp.Precision = source.Precision;
+                        dp.Scale = source.Scale;
+
+                        return dp;
+                    }
+                case PropertyDefinitionType.Geometry:
+                    {
+                        var source = (GeometricPropertyDefinition)prop;
+                        var gp = new GeometricPropertyDefinition(prop.Name, prop.Description);
+
+                        gp.SpecificGeometryTypes = source.SpecificGeometryTypes;
+                        gp.HasElevation = source.HasElevation;
+                        gp.HasMeasure = source.HasMeasure;
+                        gp.IsReadOnly = source.IsReadOnly;
+                        gp.SpatialContextAssociation = source.SpatialContextAssociation;
+
+                        return gp;
+                    }
+                case PropertyDefinitionType.Raster:
+                    {
+                        var source = (RasterPropertyDefinition)prop;
+                        var rp = new RasterPropertyDefinition(prop.Name, prop.Description);
+
+                        rp.DefaultImageXSize = source.DefaultImageXSize;
+                        rp.DefaultImageYSize = source.DefaultImageYSize;
+                        rp.IsNullable = source.IsNullable;
+                        rp.IsReadOnly = source.IsReadOnly;
+                        rp.SpatialContextAssociation = source.SpatialContextAssociation;
+
+                        return rp;
+                    }
+            }
+            throw new ArgumentException();
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -99,28 +99,28 @@
         /// Executes a feature query on the specified feature source
         /// </summary>
         /// <param name="resourceID"></param>
-        /// <param name="schema"></param>
-        /// <param name="query"></param>
+        /// <param name="className"></param>
+        /// <param name="filter"></param>
         /// <returns></returns>
-        IFeatureReader QueryFeatureSource(string resourceID, string schema, string query);
+        IFeatureReader QueryFeatureSource(string resourceID, string className, string filter);
 
         /// <summary>
         /// Executes a feature query on the specified feature source
         /// </summary>
         /// <param name="resourceID"></param>
-        /// <param name="schema"></param>
+        /// <param name="className"></param>
         /// <returns></returns>
-        IFeatureReader QueryFeatureSource(string resourceID, string schema);
+        IFeatureReader QueryFeatureSource(string resourceID, string className);
 
         /// <summary>
         /// Executes a feature query on the specified feature source
         /// </summary>
         /// <param name="resourceID"></param>
-        /// <param name="schema"></param>
-        /// <param name="query"></param>
-        /// <param name="columns"></param>
+        /// <param name="className"></param>
+        /// <param name="filter"></param>
+        /// <param name="propertyNames"></param>
         /// <returns></returns>
-        IFeatureReader QueryFeatureSource(string resourceID, string schema, string query, string[] columns);
+        IFeatureReader QueryFeatureSource(string resourceID, string className, string filter, string[] propertyNames);
 
         /// <summary>
         /// Executes a feature query on the specified feature source
@@ -212,7 +212,7 @@
         /// <param name="resourceID"></param>
         /// <param name="schema"></param>
         /// <returns></returns>
-        ClassDefinition GetClassDefinition(string resourceID, string schema);
+        ClassDefinition GetClassDefinition(string resourceID, string className);
 
         /// <summary>
         /// Get the spatial context information for the specified feature source

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/LocalConnection.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -32,6 +32,8 @@
 using System.IO;
 using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
 using System.Diagnostics;
+using OSGeo.MapGuide.MaestroAPI.Local.Commands;
+using OSGeo.MapGuide.MaestroAPI.Commands;
 
 namespace OSGeo.MapGuide.MaestroAPI.Local
 {
@@ -66,6 +68,25 @@
             Trace.TraceInformation("MapGuide Platform initialized in {0}ms", sw.ElapsedMilliseconds);
         }
 
+        public override OSGeo.MapGuide.MaestroAPI.Commands.ICommand CreateCommand(int cmdType)
+        {
+            CommandType ct = (CommandType)cmdType;
+            switch (ct)
+            {
+                case CommandType.ApplySchema:
+                    return new LocalNativeApplySchema(this);
+                case CommandType.CreateDataStore:
+                    return new LocalNativeCreateDataStore(this);
+                case CommandType.DeleteFeatures:
+                    return new LocalNativeDelete(this);
+                case CommandType.InsertFeature:
+                    return new LocalNativeInsert(this);
+                case CommandType.UpdateFeatures:
+                    return new LocalNativeUpdate(this);
+            }
+            return base.CreateCommand(cmdType);
+        }
+
         public const string PROVIDER_NAME = "Maestro.Local";
 
         public override string ProviderName
@@ -113,8 +134,8 @@
         private string _configFile;
         const string PARAM_CONFIG = "ConfigFile";
 
-        private MgResourceService _resSvc;
-        private MgFeatureService _featSvc;
+        private MgdResourceService _resSvc;
+        private MgdFeatureService _featSvc;
         private MgDrawingService _drawSvc;
         private MgRenderingService _renderSvc;
         private MgTileService _tileSvc;
@@ -152,18 +173,18 @@
             }
         }
 
-        private MgResourceService GetResourceService()
+        private MgdResourceService GetResourceService()
         {
             if (_resSvc == null)
-                _resSvc = (MgResourceService)_fact.CreateService(MgServiceType.ResourceService);
+                _resSvc = (MgdResourceService)_fact.CreateService(MgServiceType.ResourceService);
 
             return _resSvc;
         }
 
-        private MgFeatureService GetFeatureService()
+        private MgdFeatureService GetFeatureService()
         {
             if (_featSvc == null)
-                _featSvc = (MgFeatureService)_fact.CreateService(MgServiceType.FeatureService);
+                _featSvc = (MgdFeatureService)_fact.CreateService(MgServiceType.FeatureService);
 
             return _featSvc;
         }
@@ -836,5 +857,99 @@
         {
             return true;
         }
+
+        internal void InsertFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props)
+        {
+            try
+            {
+                MgdFeatureService fs = GetFeatureService();
+                MgFeatureReader fr = null;
+                try
+                {
+                    fr = fs.InsertFeatures(fsId, className, props);
+                }
+                finally
+                {
+                    if (fr != null)
+                        fr.Close();
+                }
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal int UpdateFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props, string filter)
+        {
+            try
+            {
+                MgdFeatureService fs = GetFeatureService();
+                return fs.UpdateFeatures(fsId, className, props, filter);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal int DeleteFeatures(MgResourceIdentifier fsId, string className, string filter)
+        {
+            try
+            {
+                MgdFeatureService fs = GetFeatureService();
+                return fs.DeleteFeatures(fsId, className, filter);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal void ApplySchema(MgResourceIdentifier fsId, MgFeatureSchema schemaToApply)
+        {
+            try
+            {
+                MgdFeatureService fs = GetFeatureService();
+                fs.ApplySchema(fsId, schemaToApply);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal void CreateDataStore(MgResourceIdentifier fsId, MgFeatureSourceParams fp)
+        {
+            try
+            {
+                MgdFeatureService fs = GetFeatureService();
+                fs.CreateFeatureSource(fsId, fp);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Local/OSGeo.MapGuide.MaestroAPI.Local.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -57,6 +57,12 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\Commands\FeatureCommandsImpl.cs">
+      <Link>FeatureCommandsImpl.cs</Link>
+    </Compile>
+    <Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\Commands\LocalGetResourceContents.cs">
+      <Link>LocalGetResourceContents.cs</Link>
+    </Compile>
     <Compile Include="..\OSGeo.MapGuide.MaestroAPI.Native\LocalNativeCoordinateSystem.cs">
       <Link>LocalNativeCoordinateSystem.cs</Link>
     </Compile>

Added: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs	                        (rev 0)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/FeatureCommandsImpl.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -0,0 +1,548 @@
+#region Disclaimer / License
+// Copyright (C) 2012, Jackie Ng
+// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie at gmail.com
+// 
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// 
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+// 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+// 
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OSGeo.MapGuide.MaestroAPI.Commands;
+using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.MaestroAPI.Feature;
+
+#if LOCAL_API
+namespace OSGeo.MapGuide.MaestroAPI.Local.Commands
+#else
+namespace OSGeo.MapGuide.MaestroAPI.Native.Commands
+#endif
+{
+    [global::System.Serializable]
+    public class FeatureServiceException : ApplicationException
+    {
+        //
+        // For guidelines regarding the creation of new exception types, see
+        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
+        // and
+        //    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
+        //
+
+        public FeatureServiceException() { }
+        public FeatureServiceException(string message) : base(message) { }
+        public FeatureServiceException(string message, Exception inner) : base(message, inner) { }
+        protected FeatureServiceException(
+          System.Runtime.Serialization.SerializationInfo info,
+          System.Runtime.Serialization.StreamingContext context)
+            : base(info, context) { }
+
+        public string MgErrorDetails { get; set; }
+
+        public string MgStackTrace { get; set; }
+    }
+
+    internal static class GeomConverter
+    {
+        static MgAgfReaderWriter _agfRw;
+        static MgWktReaderWriter _wktRw;
+        static GisSharpBlog.NetTopologySuite.IO.WKTReader _reader;
+
+        static GeomConverter()
+        {
+            _agfRw = new MgAgfReaderWriter();
+            _wktRw = new MgWktReaderWriter();
+            _reader = new GisSharpBlog.NetTopologySuite.IO.WKTReader();
+        }
+
+        public static MgByteReader GetAgf(GeoAPI.Geometries.IGeometry geom)
+        {
+            MgGeometry mgeom = _wktRw.Read(geom.AsText());
+            return _agfRw.Write(mgeom);
+        }
+
+        public static string GetWkt(MgGeometry geom)
+        {
+            return _wktRw.Write(geom);
+        }
+
+        public static GeoAPI.Geometries.IGeometry GetGeometry(MgByteReader agf)
+        {
+            MgGeometry mgeom = _agfRw.Read(agf);
+            return _reader.Read(GetWkt(mgeom));   
+        }
+    }
+
+    internal static class MgFeatureCommandUtility
+    {
+        internal static void Update(MgPropertyCollection props, IRecord record)
+        {
+            if (props.Count != record.FieldCount)
+                throw new InvalidOperationException("Number of values to update does not match. Ensure the MgPropertyCollection was initialized first with PropertyUtil.Populate() first and that the input IRecord comes from the same source used to initialize this MgPropertyCollection"); //LOCALIZEME
+
+            //Flip the null bit first
+            for (int i = 0; i < props.Count; i++)
+            {
+                var p = props.GetItem(i);
+                var np = p as MgNullableProperty;
+                if (np != null)
+                    np.SetNull(true);
+
+                string name = p.Name;
+                if (!record.IsNull(name))
+                {
+                    switch (p.PropertyType)
+                    {
+                        case MgPropertyType.Blob:
+                            {
+                                var bytes = record.GetBlob(name);
+                                var bs = new MgByteSource(bytes, bytes.Length);
+                                ((MgBlobProperty)p).SetValue(bs.GetReader());
+                            }
+                            break;
+                        case MgPropertyType.Boolean:
+                            {
+                                ((MgBooleanProperty)p).SetValue(record.GetBoolean(name));
+                            }
+                            break;
+                        case MgPropertyType.Byte:
+                            {
+                                ((MgByteProperty)p).SetValue(record.GetByte(name));
+                            }
+                            break;
+                        case MgPropertyType.Clob:
+                            {
+                                var bytes = record.GetBlob(name);
+                                var bs = new MgByteSource(bytes, bytes.Length);
+                                ((MgClobProperty)p).SetValue(bs.GetReader()); 
+                            }
+                            break;
+                        case MgPropertyType.DateTime:
+                            {
+                                var dt = record.GetDateTime(i);
+                                var mdt = new MgDateTime((short)dt.Year, (short)dt.Month, (short)dt.Day, (short)dt.Hour, (short)dt.Minute, (short)dt.Second, dt.Millisecond * 1000);
+                                ((MgDateTimeProperty)p).SetValue(mdt);
+                            }
+                            break;
+                        case MgPropertyType.Decimal:
+                        case MgPropertyType.Double:
+                            {
+                                ((MgDoubleProperty)p).SetValue(record.GetDouble(name));
+                            }
+                            break;
+                        case MgPropertyType.Feature:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case MgPropertyType.Geometry:
+                            {
+                                var agf = GeomConverter.GetAgf(record.GetGeometry(name));
+                                ((MgGeometryProperty)p).SetValue(agf);
+                            }
+                            break;
+                        case MgPropertyType.Int16:
+                            {
+                                ((MgInt16Property)p).SetValue(record.GetInt16(name));
+                            }
+                            break;
+                        case MgPropertyType.Int32:
+                            {
+                                ((MgInt32Property)p).SetValue(record.GetInt32(name));
+                            }
+                            break;
+                        case MgPropertyType.Int64:
+                            {
+                                ((MgInt64Property)p).SetValue(record.GetInt64(name));
+                            }
+                            break;
+                        case MgPropertyType.Raster:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case MgPropertyType.Single:
+                            {
+                                ((MgSingleProperty)p).SetValue(record.GetSingle(name));
+                            }
+                            break;
+                        case MgPropertyType.String:
+                            {
+                                ((MgStringProperty)p).SetValue(record.GetString(name));
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+        internal static void Populate(MgPropertyCollection props, IMutableRecord record)
+        {
+            for (int i = 0; i < record.FieldCount; i++)
+            {
+                var pt = record.GetPropertyType(i);
+                string name = record.GetName(i);
+                if (record.IsNull(i))
+                {
+                    switch (pt)
+                    {
+                        case PropertyValueType.Blob:
+                            {
+                                var propVal = new MgBlobProperty(name, null);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Boolean:
+                            {
+                                var propVal = new MgBooleanProperty(name, false);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Byte:
+                            {
+                                var propVal = new MgByteProperty(name, 0);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Clob:
+                            {
+                                var propVal = new MgClobProperty(name, null);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.DateTime:
+                            {
+                                var propVal = new MgDateTimeProperty(name, null);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Double:
+                            {
+                                var propVal = new MgDoubleProperty(name, 0.0);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Feature:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case PropertyValueType.Geometry:
+                            {
+                                var propVal = new MgGeometryProperty(name, null);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Int16:
+                            {
+                                var propVal = new MgInt16Property(name, 0);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Int32:
+                            {
+                                var propVal = new MgInt32Property(name, 0);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Int64:
+                            {
+                                var propVal = new MgInt64Property(name, 0L);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.Raster:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case PropertyValueType.Single:
+                            {
+                                var propVal = new MgSingleProperty(name, 0.0f);
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                        case PropertyValueType.String:
+                            {
+                                var propVal = new MgStringProperty(name, "");
+                                propVal.SetNull(true);
+                                props.Add(propVal);
+                            }
+                            break;
+                    }
+                }
+                else
+                {
+                    switch (pt)
+                    {
+                        case PropertyValueType.Blob:
+                            {
+                                var bytes = record.GetBlob(i);
+                                var br = new MgByteSource(bytes, bytes.Length);
+                                var bv = new MgBlobProperty(name, br.GetReader());
+                                props.Add(bv);
+                            }
+                            break;
+                        case PropertyValueType.Boolean:
+                            {
+                                props.Add(new MgBooleanProperty(name, record.GetBoolean(i)));
+                            }
+                            break;
+                        case PropertyValueType.Byte:
+                            {
+                                props.Add(new MgByteProperty(name, record.GetByte(i)));
+                            }
+                            break;
+                        case PropertyValueType.Clob:
+                            {
+                                var bytes = record.GetBlob(i);
+                                var br = new MgByteSource(bytes, bytes.Length);
+                                var bv = new MgClobProperty(name, br.GetReader());
+                                props.Add(bv);
+                            }
+                            break;
+                        case PropertyValueType.DateTime:
+                            {
+                                var dt = record.GetDateTime(i);
+                                var mdt = new MgDateTime((short)dt.Year, (short)dt.Month, (short)dt.Day, (short)dt.Hour, (short)dt.Minute, (short)dt.Second, dt.Millisecond * 1000);
+                                props.Add(new MgDateTimeProperty(name, mdt));
+                            }
+                            break;
+                        case PropertyValueType.Double:
+                            {
+                                props.Add(new MgDoubleProperty(name, record.GetDouble(i)));
+                            }
+                            break;
+                        case PropertyValueType.Feature:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case PropertyValueType.Geometry:
+                            {
+                                MgByteReader agf = GeomConverter.GetAgf(record.GetGeometry(i));
+                                props.Add(new MgGeometryProperty(name, agf));
+                            }
+                            break;
+                        case PropertyValueType.Int16:
+                            {
+                                props.Add(new MgInt16Property(name, record.GetInt16(i)));
+                            }
+                            break;
+                        case PropertyValueType.Int32:
+                            {
+                                props.Add(new MgInt32Property(name, record.GetInt32(i)));
+                            }
+                            break;
+                        case PropertyValueType.Int64:
+                            {
+                                props.Add(new MgInt64Property(name, record.GetInt64(i)));
+                            }
+                            break;
+                        case PropertyValueType.Raster:
+                            {
+                                throw new NotSupportedException();
+                            }
+                            break;
+                        case PropertyValueType.Single:
+                            {
+                                props.Add(new MgSingleProperty(name, record.GetSingle(i)));
+                            }
+                            break;
+                        case PropertyValueType.String:
+                            {
+                                props.Add(new MgStringProperty(name, record.GetString(i)));
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+        internal static MgFeatureSchema ConvertSchema(FeatureSchema source)
+        {
+            MgFeatureSchema fs = new MgFeatureSchema(source.Name, source.Description);
+            MgClassDefinitionCollection classes = fs.GetClasses();
+            foreach (ClassDefinition cls in source.Classes)
+            {
+                MgClassDefinition clsDef = new MgClassDefinition();
+                clsDef.SetName(cls.Name);
+                clsDef.SetDescription(cls.Description);
+                clsDef.SetDefaultGeometryPropertyName(cls.DefaultGeometryPropertyName);
+                var clsProps = clsDef.GetProperties();
+                var idProps = clsDef.GetIdentityProperties();
+
+                foreach (PropertyDefinition prop in cls.Properties)
+                {
+                    switch (prop.Type)
+                    {
+                        case PropertyDefinitionType.Data:
+                            {
+                                var dp = new MgDataPropertyDefinition(prop.Name);
+                                var srcDp = (DataPropertyDefinition)prop;
+                                dp.SetAutoGeneration(srcDp.IsAutoGenerated);
+                                dp.SetDataType((int)srcDp.DataType);
+                                if (srcDp.DefaultValue != null) dp.SetDefaultValue(srcDp.DefaultValue);
+                                if (srcDp.Description != null) dp.SetDescription(srcDp.Description);
+                                dp.SetLength(srcDp.Length);
+                                dp.SetNullable(srcDp.IsNullable);
+                                dp.SetPrecision(srcDp.Precision);
+                                dp.SetReadOnly(srcDp.IsReadOnly);
+                                dp.SetScale(srcDp.Scale);
+
+                                clsProps.Add(dp);
+
+                                if (cls.IdentityProperties.Contains(srcDp))
+                                    idProps.Add(dp);
+                            }
+                            break;
+                        case PropertyDefinitionType.Geometry:
+                            {
+                                var gp = new MgGeometricPropertyDefinition(prop.Name);
+                                var srcGp = (GeometricPropertyDefinition)prop;
+                                if (srcGp.Description != null) gp.SetDescription(srcGp.Description);
+                                gp.SetGeometryTypes((int)srcGp.GeometricTypes);
+                                gp.SetHasElevation(srcGp.HasElevation);
+                                gp.SetHasMeasure(srcGp.HasMeasure);
+                                gp.SetReadOnly(srcGp.IsReadOnly);
+                                if (srcGp.SpatialContextAssociation != null) gp.SetSpatialContextAssociation(srcGp.SpatialContextAssociation);
+
+                                clsProps.Add(gp);
+                            }
+                            break;
+                        case PropertyDefinitionType.Raster:
+                            {
+                                var rp = new MgRasterPropertyDefinition(prop.Name);
+                                var srcRp = (RasterPropertyDefinition)prop;
+                                rp.SetDefaultImageXSize(srcRp.DefaultImageYSize);
+                                rp.SetDefaultImageYSize(srcRp.DefaultImageYSize);
+                                if (srcRp.Description != null) rp.SetDescription(srcRp.Description);
+                                rp.SetNullable(srcRp.IsNullable);
+                                rp.SetReadOnly(srcRp.IsReadOnly);
+                                if (srcRp.SpatialContextAssociation != null) rp.SetSpatialContextAssociation(srcRp.SpatialContextAssociation);
+
+                                clsProps.Add(rp);
+                            }
+                            break;
+                        default:
+                            throw new NotSupportedException();
+                    }
+                }
+
+                classes.Add(clsDef);
+            }
+
+            return fs;
+        }
+    }
+
+#if LOCAL_API
+    public class LocalNativeInsert : DefaultInsertCommand<LocalConnection>
+    {
+        internal LocalNativeInsert(LocalConnection conn) : base(conn) { }
+#else
+    public class LocalNativeInsert : DefaultInsertCommand<LocalNativeConnection>
+    {
+        internal LocalNativeInsert(LocalNativeConnection conn) : base(conn) { }
+#endif
+        protected override void ExecuteInternal()
+        {
+            MgPropertyCollection props = new MgPropertyCollection();
+            MgFeatureCommandUtility.Populate(props, this.RecordToInsert);
+            this.ConnImpl.InsertFeatures(new MgResourceIdentifier(this.FeatureSourceId), this.ClassName, props);
+        }
+    }
+
+#if LOCAL_API
+    public class LocalNativeUpdate : DefaultUpdateCommand<LocalConnection>
+    {
+        internal LocalNativeUpdate(LocalConnection conn) : base(conn) { }
+#else
+    public class LocalNativeUpdate : DefaultUpdateCommand<LocalNativeConnection>
+    {
+        internal LocalNativeUpdate(LocalNativeConnection conn) : base(conn) { }
+#endif
+
+        public override int ExecuteInternal()
+        {
+            MgPropertyCollection props = new MgPropertyCollection();
+            MgFeatureCommandUtility.Populate(props, this.ValuesToUpdate);
+            return this.ConnImpl.UpdateFeatures(new MgResourceIdentifier(this.FeatureSourceId), this.ClassName, props, this.Filter);
+        }
+    }
+
+#if LOCAL_API
+    public class LocalNativeDelete : DefaultDeleteCommand<LocalConnection>
+    {
+        internal LocalNativeDelete(LocalConnection conn) : base(conn) { }
+#else
+    public class LocalNativeDelete : DefaultDeleteCommand<LocalNativeConnection>
+    {
+        internal LocalNativeDelete(LocalNativeConnection conn) : base(conn) { }
+#endif
+
+        protected override int ExecuteInternal()
+        {
+            return this.ConnImpl.DeleteFeatures(new MgResourceIdentifier(this.FeatureSourceId), this.ClassName, this.Filter);
+        }
+    }
+
+#if LOCAL_API
+    public class LocalNativeApplySchema : DefaultApplySchemaCommand<LocalConnection>
+    {
+        internal LocalNativeApplySchema(LocalConnection conn) : base(conn) { }
+#else
+    public class LocalNativeApplySchema : DefaultApplySchemaCommand<LocalNativeConnection>
+    {
+        internal LocalNativeApplySchema(LocalNativeConnection conn) : base(conn) { }
+#endif
+
+        protected override void ExecuteInternal()
+        {
+            MgFeatureSchema schema = MgFeatureCommandUtility.ConvertSchema(this.Schema);
+            this.ConnImpl.ApplySchema(new MgResourceIdentifier(this.FeatureSourceId), schema);
+        }
+    }
+
+#if LOCAL_API
+    public class LocalNativeCreateDataStore : DefaultCreateDataStoreCommand<LocalConnection>
+    {
+        internal LocalNativeCreateDataStore(LocalConnection conn) : base(conn) { }
+#else
+    public class LocalNativeCreateDataStore : DefaultCreateDataStoreCommand<LocalNativeConnection>
+    {
+        internal LocalNativeCreateDataStore(LocalNativeConnection conn) : base(conn) { }
+#endif
+        protected override void ExecuteInternal()
+        {
+            MgFileFeatureSourceParams fp = new MgFileFeatureSourceParams(this.Provider, this.Name, this.CoordinateSystemWkt, MgFeatureCommandUtility.ConvertSchema(this.Schema));
+            fp.FileName = this.FileName;
+            if (this.Description != null) fp.SpatialContextDescription = this.Description;
+            fp.XYTolerance = this.XYTolerance;
+            fp.ZTolerance = this.ZTolerance;
+            this.ConnImpl.CreateDataStore(new MgResourceIdentifier(this.FeatureSourceId), fp);
+        }
+    }
+}

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/Commands/LocalGetResourceContents.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -25,17 +25,30 @@
 using System.Diagnostics;
 using System.IO;
 
+#if LOCAL_API
+namespace OSGeo.MapGuide.MaestroAPI.Local.Commands
+#else
 namespace OSGeo.MapGuide.MaestroAPI.Native.Commands
+#endif
 {
     public class LocalGetResourceContents : IGetResourceContents
     {
         private MgResourceService _resSvc;
 
+#if LOCAL_API
+        public LocalGetResourceContents(LocalConnection conn)
+        {
+            this.Parent = conn;
+            var fact = new MgServiceFactory();
+            _resSvc = (MgResourceService)fact.CreateService(MgServiceType.ResourceService);
+        }
+#else 
         public LocalGetResourceContents(LocalNativeConnection conn)
         {
             this.Parent = conn;
             _resSvc = (MgResourceService)conn.Connection.CreateService(MgServiceType.ResourceService);
         }
+#endif
 
         Dictionary<string, IResource> IGetResourceContents.Execute(IEnumerable<string> resourceIds)
         {

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeCapabilities.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -39,7 +39,11 @@
                     //TODO: Work out what this can/can't do
                     return new int[] 
                     {
-                        (int)CommandType.GetResourceContents
+                        (int)CommandType.GetResourceContents,
+                        (int)CommandType.ApplySchema,
+                        (int)CommandType.InsertFeature,
+                        (int)CommandType.UpdateFeatures,
+                        (int)CommandType.DeleteFeatures
                     };
                 }
                 else
@@ -47,6 +51,10 @@
                     //TODO: Work out what this can/can't do
                     return new int[] 
                     {
+                        (int)CommandType.ApplySchema,
+                        (int)CommandType.InsertFeature,
+                        (int)CommandType.UpdateFeatures,
+                        (int)CommandType.DeleteFeatures
                     };
                 }
             }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/LocalNativeConnection.cs	2012-01-06 17:26:02 UTC (rev 6409)
@@ -909,8 +909,19 @@
         public override OSGeo.MapGuide.MaestroAPI.Commands.ICommand CreateCommand(int cmdType)
         {
             CommandType ct = (CommandType)cmdType;
-            if (ct == CommandType.GetResourceContents)
-                return new LocalGetResourceContents(this);
+            switch (ct)
+            {
+                case CommandType.GetResourceContents:
+                    return new LocalGetResourceContents(this);
+                case CommandType.ApplySchema:
+                    return new LocalNativeApplySchema(this);
+                case CommandType.DeleteFeatures:
+                    return new LocalNativeDelete(this);
+                case CommandType.InsertFeature:
+                    return new LocalNativeDelete(this);
+                case CommandType.UpdateFeatures:
+                    return new LocalNativeDelete(this);
+            }
             return base.CreateCommand(cmdType);
         }
 
@@ -1238,5 +1249,114 @@
                 }
             }
         }
+
+        internal void InsertFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props)
+        {
+            try
+            {
+                MgFeatureCommandCollection cmds = new MgFeatureCommandCollection();
+                MgInsertFeatures insert = new MgInsertFeatures(className, props);
+                cmds.Add(insert);
+
+                MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+                MgPropertyCollection result = fs.UpdateFeatures(fsId, cmds, false);
+
+                ((MgFeatureProperty)result.GetItem(0)).GetValue().Close();
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal int UpdateFeatures(MgResourceIdentifier fsId, string className, MgPropertyCollection props, string filter)
+        {
+            try
+            {
+                MgFeatureCommandCollection cmds = new MgFeatureCommandCollection();
+                MgUpdateFeatures update = new MgUpdateFeatures(className, props, filter);
+                cmds.Add(update);
+
+                MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+                MgPropertyCollection result = fs.UpdateFeatures(fsId, cmds, false);
+
+                var ip = result.GetItem(0) as MgInt32Property;
+                if (ip != null)
+                    return ip.GetValue();
+                return -1;
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal int DeleteFeatures(MgResourceIdentifier fsId, string className, string filter)
+        {
+            try
+            {
+                MgFeatureCommandCollection cmds = new MgFeatureCommandCollection();
+                MgDeleteFeatures delete = new MgDeleteFeatures(className, filter);
+                cmds.Add(delete);
+
+                MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+                MgPropertyCollection result = fs.UpdateFeatures(fsId, cmds, false);
+
+                var ip = result.GetItem(0) as MgInt32Property;
+                if (ip != null)
+                    return ip.GetValue();
+                return -1;
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal void ApplySchema(MgResourceIdentifier fsId, MgFeatureSchema schemaToApply)
+        {
+            try
+            {
+                MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+                fs.ApplySchema(fsId, schemaToApply);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
+
+        internal void CreateDataStore(MgResourceIdentifier fsId, MgFeatureSourceParams fp)
+        {
+            try
+            {
+                MgFeatureService fs = (MgFeatureService)this.Connection.CreateService(MgServiceType.FeatureService);
+                fs.CreateFeatureSource(fsId, fp);
+            }
+            catch (MgException ex)
+            {
+                var exMgd = new FeatureServiceException(ex.Message);
+                exMgd.MgErrorDetails = ex.GetDetails();
+                exMgd.MgStackTrace = ex.GetStackTrace();
+                ex.Dispose();
+                throw exMgd;
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native32-2.2.0.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native32-2.2.0.csproj	2012-01-05 09:38:17 UTC (rev 6408)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Native/OSGeo.MapGuide.MaestroAPI.Native32-2.2.0.csproj	2012-01-06 17:26:02 UTC (rev 6409)
@@ -76,6 +76,7 @@
     <Compile Include="..\Properties\SignedAssemblyInfo.cs">
       <Link>SignedAssemblyInfo.cs</Link>
     </Compile>
+    <Compile Include="Commands\FeatureCommandsImpl.cs" />
     <Compile Include="Commands\LocalGetResourceContents.cs" />
     <Compile Include="LocalNativeDataReader.cs" />
     <Compile Include="LocalNativeFeature.cs" />



More information about the mapguide-commits mailing list