wiki:MapGuideRfc70

Version 15 (modified by brucedechant, 15 years ago) ( diff )

--

MapGuide RFC 70 - Apply Schema

This page contains an change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.

Status

RFC Template Version(1.0)
Submission DateJune 26, 2009
Last ModifiedLeaf Li Timestamp
AuthorLeaf Li
RFC Statusready for vote
Implementation Statusunder development
Proposed Milestone2.2
Assigned PSC guide(s)Bruce Dechant
Voting History(vote date)
+1
+0
-0
-1
no vote

Overview

This proposal is to extend MapGuide Feature Service to support applying schema.

Motivation

Currently MapGuide Web API doesn’t support any functionality to create or modify schema of a feature source. The RFC is used to eliminate this limitation.

Proposed Solution

Changes to MgFeatureSchema, MgClassDefinition and MgPropertyDefinition

ApplySchema need not only support adding, modifying but also support deleting schema elements. So we need a method to mark the schema element for deletion. The method Delete() will be added to classes MgFeatureSchema, MgClassDefinition, MgPropertyDefinition for it.

/// \brief
/// Contains one or more feature class definitions, which specify the structure
/// of feature data in a datastore. 
class MgFeatureSchema: public MgNamedSerializable
{
PUBLISHED_API:
    ......
    /// \brief
    /// Marks the schema for deletion.
    ///
    /// \return
    /// Returns nothing.
    void Delete();
};

/// \brief
/// Defines a feature class belonging to a schema. 
class MgClassDefinition: public MgNamedSerializable
{
PUBLISHED_API:
    ......
    /// \brief
    /// Marks the class for deletion.
    ///
    /// \return
    /// Returns nothing.
    void Delete();
};

/// \brief
/// Defines the base class for the concreate property definition classes which
/// are used to create data, geometric, object, and raster property definitions. 
class MgPropertyDefinition: public MgProperty
{
PUBLISHED_API:
    ......
    /// \brief
    /// Marks the property for deletion.
    ///
    /// \return
    /// Returns nothing.
    void Delete();
};

Changes to Feature Service

Feature Service will be extended to add one method to apply a schema.

class MgFeatureService : public MgService 
{
PUBLISHED_API:
    /// \brief
    /// Creates or updates a feature schema within the DataStore. 
    ///
    /// \param resource (MgResourceIdentifier)
    /// A resource identifier referring to a feature source.
    /// \param schema
    /// Input schema to be created or updated.
    ///
    /// \return
    /// Returns nothing.
    ///
    virtual void ApplySchema(
                         MgResourceIdentifier* resource,
                         MgFeatureSchema* schema) = 0;
};

Changes to MgPropertyType

Many FDO data sources support decimal property type. Users can add a decimal property in a feature class in those datasources. However, class MgPropertyType doesn't define a decimal property type. So we will extend class MgPropertyType to add a new type name 'Decimal' so that method MgFeatureService::ApplySchema(...) can handle the decimal property.

class MgPropertyType
{
PUBLISHED_API:
    ......
    /////////////////////////////////////////////////// 
    /// \brief 
    /// Type name for a decimal property. 
    /// 
    /// \remarks 
    /// This property type name is currently used to 
    /// apply schema only. 
    static const int Decimal     =  15; 
};

Implications

This is new API only. There are no effects on existing applications. However, API documentation need to be updated.

Test Plan

Add unit tests for method MgFeatureService::ApplySchema(...) into the existing Feature Service unit tests.

Funding/Resources

Supplied by Autodesk.

Note: See TracWiki for help on using the wiki.