[mapguide-commits] r7934 - in trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI: . Commands Feature Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Nov 27 03:55:44 PST 2013


Author: jng
Date: 2013-11-27 03:55:44 -0800 (Wed, 27 Nov 2013)
New Revision: 7934

Modified:
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
Log:
Maestro API documentation updates

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs	2013-11-27 10:50:31 UTC (rev 7933)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Commands/FeatureManipulationCommands.cs	2013-11-27 11:55:44 UTC (rev 7934)
@@ -45,6 +45,60 @@
     /// <summary>
     /// Defines a command that creates a file-based data store on a given feature source
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
+    /// <example>
+    /// How to create a data store with a given schema
+    /// <code>
+    /// 
+    ///     IServerConnection conn = ...;
+    /// 
+    ///     FeatureSchema schema = new FeatureSchema("Default", "");
+    ///     ClassDefinition cls = new ClassDefinition("MyClass", "");
+    ///     
+    ///     cls.DefaultGeometryProperty = "GEOM";
+    ///     //Add identity property KEY
+    ///     cls.AddProperty(new DataPropertyDefinition("KEY", "")
+    ///     {
+    ///         DataType = DataPropertyType.Int32,
+    ///         IsAutoGenerated = true,
+    ///         IsReadOnly = true,
+    ///         IsNullable = false
+    ///     }, true);
+    ///     //Add string property NAME
+    ///     cls.AddProperty(new DataPropertyDefinition("NAME", "")
+    ///     {
+    ///         DataType = DataPropertyType.String,
+    ///         Length = 255,
+    ///         IsNullable = true,
+    ///         IsReadOnly = false
+    ///     });
+    ///     //Add geometry property GEOM
+    ///     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();
+    /// 
+    /// </code>
+    /// </example>
     public interface ICreateDataStore : ICommand, IFdoSpatialContext
     {
         /// <summary>
@@ -76,6 +130,27 @@
     /// <summary>
     /// Defines a command that inserts a feature into a Feature Source
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
+    /// <example>
+    /// How to insert a feature that contains a string and geometry value
+    /// <code>
+    /// 
+    ///     IServerConnection conn = ...;
+    ///     IInsertFeatures insertCmd = (IInsertFeatures)conn.CreateCommand((int)CommandType.InsertFeatures);
+    ///     insertCmd.FeatureSourceId = "Library://My.FeatureSource";
+    ///     insertCmd.ClassName = "MyFeatureClass";
+    ///     MutableRecord insertRec = new MutableRecord();
+    ///     FixedWKTReader wktReader = new FixedWKTReader();
+    ///     insertRec.PutValue("Geometry", new GeometryValue(wktReader.Read("POINT (10 10)")));
+    ///     insertRec.PutValue("Name", new StringValue("Foo"));
+    ///     insertCmd.RecordToInsert = insertRec;
+    ///     InsertResult res = insertCmd.Execute();
+    /// 
+    /// </code>
+    /// </example>
     public interface IInsertFeatures : IFeatureCommand
     {
         /// <summary>
@@ -84,7 +159,7 @@
         IMutableRecord RecordToInsert { get; set; }
         
         /// <summary>
-        /// Executes the command
+        /// Executes the command. Any error during execution will be caught and stored in the <see cref="P:OSGeo.MapGuide.MaestroAPI.Commands.InsertResult.Error"/> property
         /// </summary>
         /// <returns>The feature insert result</returns>
         InsertResult Execute();
@@ -104,6 +179,10 @@
     /// <summary>
     /// Defines a command that inserts a series of features into a Feature Source
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
     public interface IBatchInsertFeatures : IFeatureCommand
     {
         /// <summary>
@@ -125,6 +204,25 @@
     /// <summary>
     /// Defines a command that updates one or more features in a Feature Source based on some filtering criteria
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
+    /// <example>
+    /// How to update all features matching a given filter to the given value
+    /// <code>
+    /// 
+    ///     IServerConnection conn = ...;
+    ///     IUpdateFeatures updateCmd = (IUpdateFeatures)conn.CreateCommand((int)CommandType.UpdateFeatures);
+    ///     updateCmd.FeatureSourceId = "Library://My.FeatureSource";
+    ///     updateCmd.ClassName = "MyFeatureClass";
+    ///     updateCmd.Filter = "Name = 'Bar'";
+    ///     updateCmd.ValuesToUpdate = new MutableRecord();
+    ///     updateCmd.ValuesToUpdate.PutValue("Name", new StringValue("Foo"));
+    ///     int updated = updateCmd.Execute();
+    /// 
+    /// </code>
+    /// </example>
     public interface IUpdateFeatures : IFeatureCommand
     {
         /// <summary>
@@ -148,6 +246,23 @@
     /// <summary>
     /// Defines a command that deletes one or more features in a Feature Source based on some filtering criteria
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
+    /// <example>
+    /// How to update all features matching a given filter to the given value
+    /// <code>
+    /// 
+    ///     IServerConnection conn = ...;
+    ///     IDeleteFeatures deleteCmd = (IDeleteFeatures)conn.CreateCommand((int)CommandType.DeleteFeatures);
+    ///     deleteCmd.FeatureSourceId = "Library://My.FeatureSource";
+    ///     deleteCmd.ClassName = "MyFeatureClass";
+    ///     deleteCmd.Filter = "Name = 'Bar'";
+    ///     int deleted = deleteCmd.Execute();
+    /// 
+    /// </code>
+    /// </example>
     public interface IDeleteFeatures : IFeatureCommand
     {
         /// <summary>
@@ -165,6 +280,10 @@
     /// <summary>
     /// Defines a command that applies the given Feature Schema to a Feature Source
     /// </summary>
+    /// <remarks>
+    /// This command is only supported on certain implementations of <see cref="T:OSGeo.MapGuide.MaestroAPI.IServerConnection"/>
+    /// You can find out if the connection supports this command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+    /// </remarks>
     public interface IApplySchema : ICommand
     {
         /// <summary>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs	2013-11-27 10:50:31 UTC (rev 7933)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Feature/IReader.cs	2013-11-27 11:55:44 UTC (rev 7934)
@@ -355,6 +355,9 @@
     /// <summary>
     /// Defines a records whose properties can be modified
     /// </summary>
+    /// <remarks>
+    /// The default implementation of this interface is <see cref="T:OSGeo.MapGuide.MaestroAPI.Feature.MutableRecord"/>
+    /// </remarks>
     public interface IMutableRecord : IRecord, IRecordInitialize
     {
         /// <summary>

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs	2013-11-27 10:50:31 UTC (rev 7933)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/IServerConnection.cs	2013-11-27 11:55:44 UTC (rev 7934)
@@ -105,12 +105,16 @@
         /// <summary>
         /// Creates a command of the specified type
         /// </summary>
-        /// <param name="commandType"></param>
+        /// <remarks>
+        /// Some commands may not be supported by the connection. You can find out if the connection supports a particular command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+        /// </remarks>
+        /// <param name="commandType">The type of command to create. See <see cref="T:OSGeo.MapGuide.MaestroAPI.Commands.CommandType"/> for allowed values</param>
         /// <returns></returns>
         ICommand CreateCommand(int commandType);
 
         /// <summary>
-        /// Gets the capabilities for this connection
+        /// Gets the capabilities for this connection. The capabilities describes
+        /// what commands and services are supported by this connection
         /// </summary>
         IConnectionCapabilities Capabilities { get; }
 
@@ -132,7 +136,10 @@
         /// <summary>
         /// Gets the service based on the given type
         /// </summary>
-        /// <param name="serviceType"></param>
+        /// <remarks>
+        /// Some commands may not be supported by the connection. You can find out if the connection supports a particular command through the <see cref="P:OSGeo.MapGuide.MaestroAPI.IServerConnection.Capabilities"/>
+        /// </remarks>
+        /// <param name="serviceType">The type of service to create. See <see cref="T:OSGeo.MapGuide.MaestroAPI.Services.ServiceType"/> for allowed values</param>
         /// <returns></returns>
         IService GetService(int serviceType);
 

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2013-11-27 10:50:31 UTC (rev 7933)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Mapping/RuntimeMap.cs	2013-11-27 11:55:44 UTC (rev 7934)
@@ -112,10 +112,10 @@
     ///         {
     ///             int read = 0;
     ///             do
-    /// 		    {
-    /// 			    read = source.Read(buf, 0, buf.Length);
-    /// 			    target.Write(buf, 0, read);
-    /// 		    } while (read > 0);
+    ///             {
+    ///                 read = source.Read(buf, 0, buf.Length);
+    ///                 target.Write(buf, 0, read);
+    ///             } while (read > 0);
     ///         }
     ///     }
     /// 



More information about the mapguide-commits mailing list