#region Disclaimer / License // Copyright (C) 2012, Jackie Ng // http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@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 { /// /// Defines a command that works against a Feature Class of a Feature Source /// public interface IFeatureCommand : ICommand { /// /// Gets or sets the Feature Source ID /// string FeatureSourceId { get; set; } /// /// Gets or sets the Feature Class name /// string ClassName { get; set; } } /// /// Defines a command that creates a file-based data store on a given feature source /// public interface ICreateDataStore : ICommand, IFdoSpatialContext { /// /// Gets or sets the Feature Schema that models the structure of the data store /// FeatureSchema Schema { get; set; } /// /// Gets or sets the FDO provider name /// string Provider { get; set; } /// /// Gets or sets the file name for the data store /// string FileName { get; set; } /// /// Gets or sets the Feature Source ID /// string FeatureSourceId { get; set; } /// /// Executes the command /// void Execute(); } /// /// Defines a command that inserts a feature into a Feature Source /// public interface IInsertFeatures : IFeatureCommand { /// /// The feature to insert /// IMutableRecord RecordToInsert { get; set; } /// /// Executes the command /// /// The feature insert result InsertResult Execute(); } /// /// The result of a operation /// public class InsertResult { /// /// Gets the object. If there is no exception, the insert operation succeeded. /// public Exception Error { get; set; } } /// /// Defines a command that inserts a series of features into a Feature Source /// public interface IBatchInsertFeatures : IFeatureCommand { /// /// Gets or sets the list of features to insert /// ICollection RecordsToInsert { get; set; } /// /// Executes the command. /// /// /// A collection of instances. /// Inspect the individual properties to /// determine which features failed to be inserted. /// ICollection Execute(); } /// /// Defines a command that updates one or more features in a Feature Source based on some filtering criteria /// public interface IUpdateFeatures : IFeatureCommand { /// /// Gets or sets the filter that determines which features will be updated. If empty, will cause all /// features to be updated /// string Filter { get; set; } /// /// Gets or sets the collection of values to apply /// IMutableRecord ValuesToUpdate { get; set; } /// /// Executes the command /// /// The number of features updated by this command int Execute(); } /// /// Defines a command that deletes one or more features in a Feature Source based on some filtering criteria /// public interface IDeleteFeatures : IFeatureCommand { /// /// Gets or sets the filter that determines what features will be deleted. If empty, this will delete all features /// string Filter { get; set; } /// /// Executes the command. /// /// The number of features deleted int Execute(); } /// /// Defines a command that applies the given Feature Schema to a Feature Source /// public interface IApplySchema : ICommand { /// /// Gets or sets the Feature Source ID /// string FeatureSourceId { get; set; } /// /// Gets or sets the Feature Schema /// FeatureSchema Schema { get; set; } /// /// Executes the command /// void Execute(); } }