[mapguide-commits] r1366 - in trunk/MgDev: Common/Foundation/System Common/MapGuideCommon/MapLayer Common/PlatformBase/MapLayer Server/src/Common/Manager

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Mar 23 22:10:49 EDT 2007


Author: stevedang
Date: 2007-03-23 22:10:49 -0400 (Fri, 23 Mar 2007)
New Revision: 1366

Modified:
   trunk/MgDev/Common/Foundation/System/Util.cpp
   trunk/MgDev/Common/Foundation/System/Util.h
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.h
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
   trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.h
   trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.h
   trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.h
   trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
Log:
Implement MapGuide RFC 9 - Add Convenience Methods to MgLayerBase.

Modified: trunk/MgDev/Common/Foundation/System/Util.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/Util.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/Foundation/System/Util.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -620,7 +620,7 @@
     STRING tmp = Trim(str, L" \t\r\n");
     std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
 
-    return tmp.compare(L"true") == 0 ? true : false;
+    return (tmp.compare(L"true") == 0 ? true : false);
 }
 
 INT32 MgUtil::StringToInt32(CREFSTRING str)
@@ -645,6 +645,14 @@
     return ::wcstod(tmp.c_str(), NULL);
 }
 
+bool MgUtil::StringToBoolean(const string& str)
+{
+    string tmp = Trim(str, " \t\r\n");
+    std::transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
+
+    return (tmp.compare("true") == 0 ? true : false);
+}
+
 ///----------------------------------------------------------------------------
 /// <summary>
 /// Generates an Universal Unique IDentifier.

Modified: trunk/MgDev/Common/Foundation/System/Util.h
===================================================================
--- trunk/MgDev/Common/Foundation/System/Util.h	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/Foundation/System/Util.h	2007-03-24 02:10:49 UTC (rev 1366)
@@ -378,6 +378,15 @@
 
     ///////////////////////////////////////////////////////////////////////////
     /// \brief
+    /// Converts a string to a boolean.
+    ///
+    /// \return
+    /// returns boolean value.
+    ///
+    static bool StringToBoolean(const string& str);
+
+    ///////////////////////////////////////////////////////////////////////////
+    /// \brief
     /// Generates an Universal Unique IDentifier.
     ///
     /// \param uuid

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -16,6 +16,7 @@
 //
 
 #include "MapGuideCommon.h"
+#include "FSDSAX2Parser.h"
 
 IMPLEMENT_CREATE_OBJECT(MgLayer)
 
@@ -27,8 +28,6 @@
 {
 }
 
-
-
 //////////////////////////////////////////////////////////////
 // Creates a MgLayerBase object given a reference to a LayerDefinition
 //
@@ -46,8 +45,28 @@
 {
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Return the map object.
+///
+MgMapBase* MgLayer::GetMap()
+{
+    MgMapBase* baseMap = NULL;
 
+    if (NULL != m_layers)
+    {
+        baseMap = m_layers->GetMap();
+    }
 
+    if (NULL == baseMap)
+    {
+        throw new MgNullReferenceException(L"MgLayerBase.GetMap",
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    return baseMap;
+}
+
 //////////////////////////////////////////////////////////////
 // Parse the layer definition XML and extracts scale ranges,
 // feature source and feature class from it
@@ -73,13 +92,12 @@
 
             // If the class name is fully qualified (prefixed with a schema name),
             // then use it to determine the schema name.
-            STRING schemaName;
             STRING className;
             size_t pfxSep = m_featureName.find_first_of(L':');
             if (pfxSep != STRING::npos)
             {
                 // fully qualified
-                schemaName = m_featureName.substr(0, pfxSep);
+                m_schemaName = m_featureName.substr(0, pfxSep);
                 className = m_featureName.substr(pfxSep + 1, m_featureName.length() - pfxSep - 1);
             }
             else
@@ -89,12 +107,12 @@
 
                 //TODO:  How do we deal with different schemas?  Just use first one for now...
                 Ptr<MgStringCollection> schemaNames = featureService->GetSchemas(resId);
-                schemaName = schemaNames->GetItem(0);
+                m_schemaName = schemaNames->GetItem(0);
             }
 
             // Get the identity properties
             Ptr<MgPropertyDefinitionCollection> idProps = featureService->GetIdentityProperties(resId,
-                                                                                                schemaName,
+                                                                                                m_schemaName,
                                                                                                 className);
             assert(idProps != NULL);
             for (int nIds=0; nIds<idProps->GetCount(); nIds++)
@@ -150,6 +168,7 @@
     }
     helper->WriteString(m_featureSourceId);
     helper->WriteString(m_featureName);
+    helper->WriteString(m_schemaName);
     helper->WriteString(m_geometry);
 
     helper->WriteUINT32((UINT32)m_idProps.size());
@@ -197,6 +216,7 @@
 
     helper->GetString(m_featureSourceId);
     helper->GetString(m_featureName);
+    helper->GetString(m_schemaName);
     helper->GetString(m_geometry);
 
     UINT32 idCount = 0;
@@ -212,3 +232,122 @@
     }
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Gets the class definition for the feature class of the layer.  If the
+/// feature class of the layer is extended with properties from other feature
+/// classes, then all those properties are also contained in the returned
+/// class definition.
+///
+MgClassDefinition* MgLayer::GetClassDefinition()
+{
+    Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(
+        GetMap()->GetService(MgServiceType::FeatureService));
+    Ptr<MgResourceIdentifier> resourceId = new MgResourceIdentifier(m_featureSourceId);
+
+    return featureService->GetClassDefinition(resourceId, m_schemaName, m_featureName);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Selects features from a feature source according to the
+/// criteria set in the MgFeatureQueryOptions argument The
+/// criteria are applied to all of the features in the feature
+/// source. If you want to apply the criteria to a subset of the
+/// features, use the MgFeatureService::SelectAggregate Method.
+///
+MgFeatureReader* MgLayer::SelectFeatures(MgFeatureQueryOptions* options)
+{
+    Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(
+        GetMap()->GetService(MgServiceType::FeatureService));
+    Ptr<MgResourceIdentifier> resourceId = new MgResourceIdentifier(m_featureSourceId);
+
+    return featureService->SelectFeatures(resourceId, m_featureName, options);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Selects groups of features from a feature source and applies
+/// filters to each of the groups according to the criteria set
+/// in the MgFeatureAggregateOptions argument. If you want to
+/// apply the criteria to all features without grouping them, use
+/// the MgFeatureService::SelectFeatures Method.
+///
+MgDataReader* MgLayer::SelectAggregate(MgFeatureAggregateOptions* options)
+{
+    Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(
+        GetMap()->GetService(MgServiceType::FeatureService));
+    Ptr<MgResourceIdentifier> resourceId = new MgResourceIdentifier(m_featureSourceId);
+
+    return featureService->SelectAggregate(resourceId, m_featureName, options);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Executes the MgDeleteFeatures, MgInsertFeatures,
+/// MgUpdateFeatures, MgLockFeatures or MgUnlockFeatures commands
+/// contained in the given MgFeatureCommandCollection object.
+///
+MgPropertyCollection* MgLayer::UpdateFeatures(MgFeatureCommandCollection* commands)
+{
+    Ptr<MgPropertyCollection> propCol;
+
+    MG_TRY()
+
+    // Get the content of the feature source.
+    Ptr<MgResourceService> resourceService = dynamic_cast<MgResourceService*>(
+        GetMap()->GetService(MgServiceType::ResourceService));
+    Ptr<MgResourceIdentifier> resourceId = new MgResourceIdentifier(m_featureSourceId);
+
+    Ptr<MgByteReader> byteReader = resourceService->GetResourceContent(resourceId);
+    string xmlContent;
+    byteReader->ToStringUtf8(xmlContent);
+
+    // Create the feature source object.
+    MdfParser::FSDSAX2Parser parser;
+    parser.ParseString(xmlContent.c_str(),
+        (unsigned int)(xmlContent.length() * sizeof(char)));
+    ACE_ASSERT(parser.GetSucceeded());
+
+    auto_ptr<MdfModel::FeatureSource> featureSource;
+    featureSource.reset(parser.DetachFeatureSource());
+
+    // Get the provider name.
+    STRING providerName = (STRING)featureSource->GetProvider();
+
+    // Determine if the provider supports transactions.
+    bool useTransaction = false;
+    Ptr<MgFeatureService> featureService = dynamic_cast<MgFeatureService*>(
+        GetMap()->GetService(MgServiceType::FeatureService));
+
+    byteReader = featureService->GetCapabilities(providerName);
+    xmlContent.clear();
+    byteReader->ToStringUtf8(xmlContent);
+
+    const string openTag = "<SupportsTransactions>"; //NOXLATE
+    const string closeTag = "</SupportsTransactions>"; //NOXLATE
+    size_t startIndex = xmlContent.find(openTag);
+
+    if (string::npos != startIndex)
+    {
+        size_t endIndex = xmlContent.find(closeTag, startIndex);
+
+        if (string::npos == endIndex)
+        {
+            throw new MgXmlParserException(L"MgLayer.UpdateFeatures",
+                __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+        else
+        {
+            string tagValue = xmlContent.substr(startIndex + openTag.length(), 
+                endIndex - startIndex - openTag.length());
+            useTransaction = MgUtil::StringToBoolean(tagValue);
+        }
+    }
+
+    propCol = featureService->UpdateFeatures(resourceId, commands, useTransaction);
+
+    MG_CATCH_AND_THROW(L"MgLayer.UpdateFeatures")
+
+    return propCol.Detach();
+}

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.h	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Layer.h	2007-03-24 02:10:49 UTC (rev 1366)
@@ -67,6 +67,158 @@
     ///
     MgLayer(MgResourceIdentifier* layerDefinition, MgResourceService* resourceService);
 
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Gets the class definition for the feature class of the layer.  If the
+    /// feature class of the layer is extended with properties from other feature
+    /// classes, then all those properties are also contained in the returned
+    /// class definition. See \link Feature_Schema_Module Feature Schema \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(string schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(String schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(string schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \return
+    /// Returns an MgClassDefinition instance for the feature class of the layer.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgClassDefinition* GetClassDefinition();
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Selects features from a feature source according to the
+    /// criteria set in the MgFeatureQueryOptions argument The
+    /// criteria are applied to all of the features in the feature
+    /// source. If you want to apply the criteria to a subset of the
+    /// features, use the \link MgFeatureService::SelectAggregate MgFeatureService::SelectAggregate Method \endlink.
+    /// See \link FiltersAndExpressions Filters and expressions \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param options (MgFeatureQueryOptions)
+    /// MgFeatureQueryOptions instance
+    /// containing all required filters for this
+    /// select operation.
+    ///
+    /// \return
+    /// Returns an MgFeatureReader containing the set of selected
+    /// features.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgFeatureReader* SelectFeatures(MgFeatureQueryOptions* options);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Selects groups of features from a feature source and applies
+    /// filters to each of the groups according to the criteria set
+    /// in the MgFeatureAggregateOptions argument. If you want to
+    /// apply the criteria to all features without grouping them, use
+    /// the \link MgFeatureService::SelectFeatures MgFeatureService::SelectFeatures Method \endlink.
+    /// See \link FiltersAndExpressions Filters and expressions \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param options (MgFeatureAggregateOptions)
+    /// An MgFeatureAggregateOptions instance
+    /// containing all the criteria and filters
+    /// required for this select operation.
+    ///
+    /// \return
+    /// Returns an MgDataReader containing the group values.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgDataReader* SelectAggregate(MgFeatureAggregateOptions* options);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Executes the MgDeleteFeatures, MgInsertFeatures,
+    /// MgUpdateFeatures, MgLockFeatures or MgUnlockFeatures commands
+    /// contained in the given MgFeatureCommandCollection object.
+    ///
+    /// \remarks
+    /// The XML returned by MgFeatureService::GetCapabilities says
+    /// whether a provider supports SQL commands. See \link ProviderCapabilities Provider Capabilities \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param commands (MgFeatureCommandCollection)
+    /// A collection of feature commands to be
+    /// executed.
+    ///
+    /// \return
+    /// Returns an MgPropertyCollection object. Each property in the
+    /// collection corresponds to a command in the
+    /// MgFeatureCommandCollection argument. The property name is the
+    /// index of the command in the feature command collection.
+    /// <ul>
+    ///   <li>If the command is of type MgDeleteFeatures, the property
+    ///     type is an MgPropertyType::Int32, and its value is the number
+    ///     of features deleted.</li>
+    ///   <li>If the command is of type MgInsertFeatures, the property
+    ///     type is an MgPropertyType::Feature, and its value is a
+    ///     MgFeatureReader object. The feature reader object contains
+    ///     the set of properties inserted into the datastore by the
+    ///     insert command.</li>
+    ///   <li>If the command is of type MgUpdateFeatures, the property
+    ///     type is MgPropertyType::Int32, and its value is the number of
+    ///     features updated.</li>
+    ///   <li>If the command is of type MgLockFeatures, the property
+    ///     type is MgPropertyType::Feature, and its value is the number
+    ///     of features locked.</li>
+    ///   <li>If the command is of type MgUnLockFeatures, the property
+    ///     type is MgPropertyType::Int32, and its value is the number of
+    ///     features unlocked.</li>
+    /// </ul>
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgInvalidOperationException
+    /// \exception MgFdoException
+    ///
+    virtual MgPropertyCollection* UpdateFeatures(MgFeatureCommandCollection* commands);
   
 INTERNAL_API:
 
@@ -131,6 +283,10 @@
         delete this;
     }
 
+private:
+
+    MgMapBase* GetMap();
+
 CLASS_ID:
     static const INT32 m_cls_id = MapGuide_MapLayer_Layer;
     

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -39,7 +39,71 @@
 {
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// Constructs an MgMap object that takes an MgSiteConnection instance.
+/// The object cannot be used until either the Create or Open method is called.
+///
+MgMap::MgMap(MgSiteConnection* siteConnection)
+    : MgMapBase(),
+    m_inSave(false),
+    m_unpackedLayersGroups(false)
+{
+    if (NULL == siteConnection)
+    {
+        throw new MgNullArgumentException(L"MgMap.MgMap",
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
 
+    m_siteConnection = SAFE_ADDREF(siteConnection);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// Initialize the resource service on demand only.
+///
+void MgMap::InitializeResourceService(MgResourceService* resourceService)
+{
+    if (NULL != resourceService)
+    {
+        m_resourceService = SAFE_ADDREF(resourceService);
+    }
+    else if (NULL == m_resourceService.p)
+    {
+        if (NULL == m_siteConnection.p)
+        {
+            throw new MgNullReferenceException(L"MgMap.InitializeResourceService",
+                __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+
+        m_resourceService = dynamic_cast<MgResourceService*>(
+            m_siteConnection->CreateService(MgServiceType::ResourceService));
+    }
+
+    ACE_ASSERT(NULL != m_resourceService.p);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Returns an instance of the specified service.
+///
+MgService* MgMap::GetService(INT32 serviceType)
+{
+    if (NULL == m_siteConnection.p)
+    {
+        throw new MgNullReferenceException(L"MgMap.GetSiteConnection",
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    if (MgServiceType::ResourceService == serviceType)
+    {
+        InitializeResourceService(NULL);
+        return SAFE_ADDREF((MgResourceService*)m_resourceService);
+    }
+    else
+    {
+        return m_siteConnection->CreateService(serviceType);
+    }
+}
+
 //////////////////////////////////////////////////////////////
 // Initializes a new Map object.
 // This method is used for Mg Viewers or for offline map production.
@@ -48,6 +112,7 @@
 {
     MG_TRY()
 
+    InitializeResourceService(resourceService);
     m_trackChangesDisabled = true;
 
     m_mapDefinitionId = mapDefinition;
@@ -58,7 +123,7 @@
     MgUtil::GenerateUuid(m_objectId);
 
     //get the map definition from the resource repository
-    Ptr<MgByteReader> content = resourceService->GetResourceContent(mapDefinition);
+    Ptr<MgByteReader> content = m_resourceService->GetResourceContent(mapDefinition);
 
     Ptr<MgByteSink> sink = new MgByteSink(content);
     Ptr<MgByte> bytes = sink->ToBuffer();
@@ -194,7 +259,7 @@
             MapLayer* layer = (MapLayer*)layers->GetAt(i);
             //create a runtime layer from this layer and add it to the layer collection
             Ptr<MgResourceIdentifier> layerDefId = new MgResourceIdentifier(layer->GetLayerResourceID());
-            Ptr<MgLayerBase> rtLayer = new MgLayer(layerDefId, resourceService);
+            Ptr<MgLayerBase> rtLayer = new MgLayer(layerDefId, m_resourceService);
             rtLayer->SetName(layer->GetName());
             rtLayer->SetVisible(layer->IsVisible());
             rtLayer->SetLayerType(MgLayerType::Dynamic);
@@ -263,7 +328,7 @@
                     {
                         //create a runtime layer from this base layer and add it to the layer collection
                         Ptr<MgResourceIdentifier> layerDefId = new MgResourceIdentifier(baseLayer->GetLayerResourceID());
-                        Ptr<MgLayerBase> rtLayer = new MgLayer(layerDefId, resourceService);
+                        Ptr<MgLayerBase> rtLayer = new MgLayer(layerDefId, m_resourceService);
                         rtLayer->SetName(baseLayer->GetName());
                         rtLayer->SetVisible(true);
                         rtLayer->SetLayerType(MgLayerType::BaseMap);
@@ -322,6 +387,14 @@
     MG_CATCH_AND_THROW(L"MgMap.Create")
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// Initializes a new MgMap object given a map definition and a name for the map.
+/// This method is used for MapGuide Viewers or for offline map production.
+///
+void MgMap::Create(MgResourceIdentifier* mapDefinition, CREFSTRING mapName)
+{
+    Create(NULL, mapDefinition, mapName);
+}
 
 //////////////////////////////////////////////////////////////
 // Call down to base class implementation.  Ptr<> seems to be
@@ -339,11 +412,13 @@
 //
 void MgMap::Open(MgResourceService* resourceService, CREFSTRING mapName)
 {
-    m_resourceService = SAFE_ADDREF(resourceService);
+    MG_TRY()
+
+    InitializeResourceService(resourceService);
     m_trackChangesDisabled = true;
 
     STRING sessionId;
-    Ptr<MgUserInformation> userInfo = resourceService->GetUserInfo();
+    Ptr<MgUserInformation> userInfo = m_resourceService->GetUserInfo();
 
     if (userInfo.p != NULL)
     {
@@ -361,13 +436,22 @@
     }
 
     Ptr<MgResourceIdentifier> resId = new MgResourceIdentifier(L"Session:" + sessionId + L"//" + mapName + L"." + MgResourceType::Map);
-    MgResource::Open(resourceService, resId);
+    MgResource::Open(m_resourceService, resId);
 
     //Note: Layers and Groups are loaded on demand by UnpackLayersAndGroups
 
     m_trackChangesDisabled = false;
+
+    MG_CATCH_AND_THROW(L"MgMap.Open")
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// Loads the map object from a session repository.
+///
+void MgMap::Open(CREFSTRING mapName)
+{
+    Open(NULL, mapName);
+}
 
 //////////////////////////////////////////////////////////////
 // Saves the resource using the specified resource service and resource identifier.
@@ -376,15 +460,17 @@
 //
 void MgMap::Save(MgResourceService* resourceService)
 {
+    MG_TRY()
+
+    InitializeResourceService(resourceService);
+
     if(m_resId == (MgResourceIdentifier*)NULL)
         throw new MgNullReferenceException(L"MgMap.Save", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_inSave = true;
 
-    MG_TRY()
+    SerializeToRepository(m_resourceService, false);
 
-    SerializeToRepository(resourceService, false);
-
     Ptr<MgMemoryStreamHelper> streamHelper = PackLayersAndGroups();
     if (NULL != (MgMemoryStreamHelper*) streamHelper)
     {
@@ -392,7 +478,7 @@
         Ptr<MgByteSource> bsource = new MgByteSource((BYTE_ARRAY_IN)streamHelper->GetBuffer(), streamHelper->GetLength());
         Ptr<MgByteReader> resourceData = bsource->GetReader();
 
-        resourceService->SetResourceData(m_resId, m_layerGroupTag, L"Stream", resourceData);
+        m_resourceService->SetResourceData(m_resId, m_layerGroupTag, L"Stream", resourceData);
     }
 
     MG_CATCH(L"MgMap.Save")
@@ -411,16 +497,18 @@
 //
 void MgMap::Save(MgResourceService* resourceService, MgResourceIdentifier* resourceId)
 {
+    MG_TRY()
+
+    InitializeResourceService(resourceService);
+
     m_resId = SAFE_ADDREF(resourceId);
     if(m_resId == (MgResourceIdentifier*)NULL)
         throw new MgNullReferenceException(L"MgMap.Save", __LINE__, __WFILE__, NULL, L"", NULL);
 
     m_inSave = true;
 
-    MG_TRY()
+    SerializeToRepository(m_resourceService, true);
 
-    SerializeToRepository(resourceService, true);
-
     Ptr<MgMemoryStreamHelper> streamHelper = PackLayersAndGroups();
     if (NULL != (MgMemoryStreamHelper*) streamHelper)
     {
@@ -428,7 +516,7 @@
         Ptr<MgByteSource> bsource = new MgByteSource((BYTE_ARRAY_IN)streamHelper->GetBuffer(), streamHelper->GetLength());
         Ptr<MgByteReader> resourceData = bsource->GetReader();
 
-        resourceService->SetResourceData(m_resId, m_layerGroupTag, L"Stream", resourceData);
+        m_resourceService->SetResourceData(m_resId, m_layerGroupTag, L"Stream", resourceData);
     }
 
     MG_CATCH(L"MgMap.Save")
@@ -441,6 +529,13 @@
     m_inSave = false;
 }
 
+///////////////////////////////////////////////////////////////////////////////
+/// Saves the Map.
+///
+void MgMap::Save()
+{
+    Save(NULL);
+}
 
 //////////////////////////////////////////////////////////////
 // Destruct a MgMap object
@@ -492,7 +587,7 @@
     if (NULL == (MgMemoryStreamHelper*) m_layerGroupHelper)
     {
         // Need to query from Resource Service
-        if (NULL != (MgResourceService*) m_resourceService)
+        if (NULL != m_resourceService.p)
         {
             Ptr<MgByteReader> breader = m_resourceService->GetResourceData(m_resId, m_layerGroupTag);
 
@@ -828,7 +923,13 @@
 /// \brief
 /// Sets internal resource service references.  Used for Lazy loading
 ///
-void MgMap::SetDelayedLoadResourceService(MgResourceService* service)
+void MgMap::SetDelayedLoadResourceService(MgResourceService* resourceService)
 {
-    m_resourceService = SAFE_ADDREF(service);
+    if (NULL == resourceService)
+    {
+        throw new MgNullArgumentException(L"MgMap.SetDelayedLoadResourceService",
+            __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
+    m_resourceService = SAFE_ADDREF(resourceService);
 }

Modified: trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.h	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/MapGuideCommon/MapLayer/Map.h	2007-03-24 02:10:49 UTC (rev 1366)
@@ -39,6 +39,7 @@
 */
 
 class MgMap;
+class MgSiteConnection;
 template class MG_MAPGUIDE_API Ptr<MgMap>;
 
 #ifdef WIN32
@@ -234,6 +235,8 @@
     /// Constructs an empty un-initialized MgMap object.
     ///
     /// \remarks
+    /// This method has been depreciated. Use the following method:
+    /// MgMap(MgSiteConnection siteConnection)
     /// The instance of MgMap cannot be used until either the \link MgMapBase::Create Create \endlink
     /// or \link MgMapBase::Open Open \endlink
     /// method is called.
@@ -258,10 +261,53 @@
 
     //////////////////////////////////////////////////////////////////
     /// \brief
+    /// Constructs an MgMap object that takes an MgSiteConnection instance.
+    ///
+    /// \remarks
+    /// The instance of MgMap cannot be used until either the \link MgMapBase::Create Create \endlink
+    /// or \link MgMapBase::Open Open \endlink
+    /// method is called.
+    /// Session ID is required for this MgMap constructor.
+    /// MgMap cannot exist in the Library repository.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// MgMap(MgSiteConnection siteConnection);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// MgMap(MgSiteConnection siteConnection);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// MgMap(MgSiteConnection siteConnection);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param siteConnection (MgSiteConnection)
+    /// An MgSiteConnection instance the MgMap object can use to
+    /// allocate service instances.
+    ///
+    /// <!-- Example (PHP) -->
+    /// \htmlinclude PHPExampleTop.html
+    /// See \link MgMapBase::Create Create \endlink.
+    /// \htmlinclude ExampleBottom.html
+    /// \code
+    /// $siteConn = new MgSiteConnection();
+    /// $userInfo = new MgUserInformation();
+    /// $userInfo->SetMgSessionId('abc123-xxx-yyy');
+    /// $siteConn->Open($userInfo);
+    /// $map = new MgMap($siteConn);
+    ///
+    MgMap(MgSiteConnection* siteConnection);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
     /// Initializes a new MgMap object given a resource service, map
     /// definition, and a name for the map. This method is used for
     /// MapGuide Viewers or for offline map production.
     ///
+    /// \remarks
+    /// This method has been depreciated. Use the following method:
+    /// void Create(MgResourceIdentifier mapDefinition, string mapName)
+    ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
     /// void Create(MgResourceService resourceService, MgResourceIdentifier mapDefinition, string mapName);
@@ -298,6 +344,45 @@
 
     //////////////////////////////////////////////////////////////////
     /// \brief
+    /// Initializes a new MgMap object given a map definition
+    /// and a name for the map. This method is used for
+    /// MapGuide Viewers or for offline map production.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// void Create(MgResourceIdentifier mapDefinition, string mapName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// void Create(MgResourceIdentifier mapDefinition, String mapName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// void Create(MgResourceIdentifier mapDefinition, string mapName);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param mapDefinition (MgResourceIdentifier)
+    /// An MgResourceIdentifier that specifies the
+    /// location of the map definition in a resource
+    /// repository.
+    /// \param mapName (String/string)
+    /// A string that specifies the name of the map.
+    ///
+    /// \return
+    /// Returns nothing.
+    ///
+    /// <!-- Example (PHP) -->
+    /// \htmlinclude PHPExampleTop.html
+    /// \code
+    /// // Assuming the site connection has already been intialized
+    /// $resourceID = new  MgResourceIdentifier('Library://Calgary/Maps/Calgary.MapDefinition');
+    /// $map = new MgMap($site);
+    /// $map->Create($resourceID, 'Calgary');
+    /// \endcode
+    /// \htmlinclude ExampleBottom.html
+    ///
+    virtual void Create(MgResourceIdentifier* mapDefinition, CREFSTRING mapName);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
     /// Initializes a new Map object given a spatial reference system,
     /// spatial extent of the map, and a name for the map. This method
     /// is used for the WMS service implementation and creates a map
@@ -329,6 +414,8 @@
     /// Loads the map object from a session repository.
     ///
     /// \remarks
+    /// This method has been depreciated. Use the following method:
+    /// void Open(string mapName)
     /// For more information, see \link Mapping_Service_Module Mapping Service \endlink.
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
@@ -368,11 +455,54 @@
     ///
     virtual void Open(MgResourceService* resourceService, CREFSTRING mapName);
 
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Loads the map object from a session repository.
+    ///
+    /// \remarks
+    /// For more information, see \link Mapping_Service_Module Mapping Service \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual void Open(string mapName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual void Open(String mapName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual void Open(string mapName);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param mapName (String/string)
+    /// A string that specifies the name of the map. This
+    /// is the name that was specified when \link MgMapBase::Create Create \endlink
+    /// was called to create the map object.
+    ///
+    /// \return
+    /// Returns nothing.
+    ///
+    /// <!-- Example (PHP) -->
+    /// \htmlinclude PHPExampleTop.html
+    /// \code
+    /// // Assuming the site connection has already been intialized
+    /// $map = new MgMap($site);
+    /// $map->Open('Calgary');
+    /// \endcode
+    /// \htmlinclude ExampleBottom.html
+    ///
+    /// \todo
+    ///   * [[Job for Philip: If I move that overview to the
+    ///     Developer's Guide, update the xref here.]]
+    ///
+    virtual void Open(CREFSTRING mapName);
+
     ///////////////////////////////////////////////////////////////
     /// \brief
     /// Saves the Map using the specified resource service.
     ///
     /// \remarks
+    /// This method has been depreciated. Use the following method:
+    /// void Open(string mapName)
     /// This method assumes a valid resource identifier has already
     /// been established via either Open or Save.
     ///
@@ -393,6 +523,15 @@
     ///
     void Save(MgResourceService* resourceService, MgResourceIdentifier* resourceId);
 
+    //////////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Saves the Map.
+    ///
+    /// \return
+    /// Returns nothing.
+    ///
+    void Save();
+
 INTERNAL_API:
 
     /// \brief
@@ -423,12 +562,18 @@
 
     //////////////////////////////////////////////////////////////////
     /// \brief
+    /// Returns an instance of the specified service.
+    ///
+    virtual MgService* GetService(INT32 serviceType);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
     /// Sets internal resource service references.  Used for Lazy loading
     ///
-    /// \param service
-    /// Resource Service
+    /// \param resourceService
+    /// Resource service.
     ///
-    void SetDelayedLoadResourceService(MgResourceService* service);
+    void SetDelayedLoadResourceService(MgResourceService* resourceService);
 
 protected:
 
@@ -464,15 +609,20 @@
     ///
     virtual void Dispose();
 
+private:
+
+    void InitializeResourceService(MgResourceService* resourceService);
+
 CLASS_ID:
     static const INT32 m_cls_id = MapGuide_MapLayer_Map;
 
 private:
 
     // Version for serialization
-    static const int m_serializeVersion = (3<<16) + 0;
+    static const int m_serializeVersion = (4<<16) + 0;
+    static STRING m_layerGroupTag;
 
-    static STRING m_layerGroupTag;
+    Ptr<MgSiteConnection> m_siteConnection;
     Ptr<MgMemoryStreamHelper> m_layerGroupHelper;
     Ptr<MgResourceService> m_resourceService;
     bool m_inSave;

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -489,6 +489,7 @@
     m_scaleRanges.clear();
     m_featureSourceId = L"";
     m_featureName = L"";
+    m_schemaName = L"";
 
     MG_TRY()
 
@@ -684,3 +685,56 @@
 {
     return m_geometry;
 }
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Gets the class definition for the feature class of the layer.  If the
+/// feature class of the layer is extended with properties from other feature
+/// classes, then all those properties are also contained in the returned
+/// class definition.
+///
+MgClassDefinition* MgLayerBase::GetClassDefinition()
+{
+    throw new MgNotImplementedException(L"MgLayerBase.GetClassDefinition",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Selects features from a feature source according to the
+/// criteria set in the MgFeatureQueryOptions argument The
+/// criteria are applied to all of the features in the feature
+/// source. If you want to apply the criteria to a subset of the
+/// features, use the MgFeatureService::SelectAggregate Method.
+///
+MgFeatureReader* MgLayerBase::SelectFeatures(MgFeatureQueryOptions* options)
+{
+    throw new MgNotImplementedException(L"MgLayerBase.SelectFeatures",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Selects groups of features from a feature source and applies
+/// filters to each of the groups according to the criteria set
+/// in the MgFeatureAggregateOptions argument. If you want to
+/// apply the criteria to all features without grouping them, use
+/// the MgFeatureService::SelectFeatures Method.
+///
+MgDataReader* MgLayerBase::SelectAggregate(MgFeatureAggregateOptions* options)
+{
+    throw new MgNotImplementedException(L"MgLayerBase.SelectAggregate",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Executes the MgDeleteFeatures, MgInsertFeatures,
+/// MgUpdateFeatures, MgLockFeatures or MgUnlockFeatures commands
+/// contained in the given MgFeatureCommandCollection object.
+///
+MgPropertyCollection* MgLayerBase::UpdateFeatures(MgFeatureCommandCollection* commands)
+{
+    throw new MgNotImplementedException(L"MgLayerBase.UpdateFeatures",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.h	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/LayerBase.h	2007-03-24 02:10:49 UTC (rev 1366)
@@ -685,6 +685,159 @@
     ///
     virtual STRING GetFeatureGeometryName();  /// _get
 
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Gets the class definition for the feature class of the layer.  If the
+    /// feature class of the layer is extended with properties from other feature
+    /// classes, then all those properties are also contained in the returned
+    /// class definition. See \link Feature_Schema_Module Feature Schema \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(string schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(String schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgClassDefinition GetClassDefinition(string schemaName);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \return
+    /// Returns an MgClassDefinition instance for the feature class of the layer.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgClassDefinition* GetClassDefinition();
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Selects features from a feature source according to the
+    /// criteria set in the MgFeatureQueryOptions argument The
+    /// criteria are applied to all of the features in the feature
+    /// source. If you want to apply the criteria to a subset of the
+    /// features, use the \link MgFeatureService::SelectAggregate MgFeatureService::SelectAggregate Method \endlink.
+    /// See \link FiltersAndExpressions Filters and expressions \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgFeatureReader SelectFeatures(MgFeatureQueryOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param options (MgFeatureQueryOptions)
+    /// MgFeatureQueryOptions instance
+    /// containing all required filters for this
+    /// select operation.
+    ///
+    /// \return
+    /// Returns an MgFeatureReader containing the set of selected
+    /// features.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgFeatureReader* SelectFeatures(MgFeatureQueryOptions* options);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Selects groups of features from a feature source and applies
+    /// filters to each of the groups according to the criteria set
+    /// in the MgFeatureAggregateOptions argument. If you want to
+    /// apply the criteria to all features without grouping them, use
+    /// the \link MgFeatureService::SelectFeatures MgFeatureService::SelectFeatures Method \endlink.
+    /// See \link FiltersAndExpressions Filters and expressions \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgDataReader SelectAggregate(MgFeatureAggregateOptions options);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param options (MgFeatureAggregateOptions)
+    /// An MgFeatureAggregateOptions instance
+    /// containing all the criteria and filters
+    /// required for this select operation.
+    ///
+    /// \return
+    /// Returns an MgDataReader containing the group values.
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgFdoException
+    ///
+    virtual MgDataReader* SelectAggregate(MgFeatureAggregateOptions* options);
+
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Executes the MgDeleteFeatures, MgInsertFeatures,
+    /// MgUpdateFeatures, MgLockFeatures or MgUnlockFeatures commands
+    /// contained in the given MgFeatureCommandCollection object.
+    ///
+    /// \remarks
+    /// The XML returned by MgFeatureService::GetCapabilities says
+    /// whether a provider supports SQL commands. See \link ProviderCapabilities Provider Capabilities \endlink.
+    ///
+    /// <!-- Syntax in .Net, Java, and PHP -->
+    /// \htmlinclude DotNetSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude JavaSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    /// \htmlinclude PHPSyntaxTop.html
+    /// virtual MgPropertyCollection UpdateFeatures(MgFeatureCommandCollection commands);
+    /// \htmlinclude SyntaxBottom.html
+    ///
+    /// \param commands (MgFeatureCommandCollection)
+    /// A collection of feature commands to be
+    /// executed.
+    ///
+    /// \return
+    /// Returns an MgPropertyCollection object. Each property in the
+    /// collection corresponds to a command in the
+    /// MgFeatureCommandCollection argument. The property name is the
+    /// index of the command in the feature command collection.
+    /// <ul>
+    ///   <li>If the command is of type MgDeleteFeatures, the property
+    ///     type is an MgPropertyType::Int32, and its value is the number
+    ///     of features deleted.</li>
+    ///   <li>If the command is of type MgInsertFeatures, the property
+    ///     type is an MgPropertyType::Feature, and its value is a
+    ///     MgFeatureReader object. The feature reader object contains
+    ///     the set of properties inserted into the datastore by the
+    ///     insert command.</li>
+    ///   <li>If the command is of type MgUpdateFeatures, the property
+    ///     type is MgPropertyType::Int32, and its value is the number of
+    ///     features updated.</li>
+    ///   <li>If the command is of type MgLockFeatures, the property
+    ///     type is MgPropertyType::Feature, and its value is the number
+    ///     of features locked.</li>
+    ///   <li>If the command is of type MgUnLockFeatures, the property
+    ///     type is MgPropertyType::Int32, and its value is the number of
+    ///     features unlocked.</li>
+    /// </ul>
+    ///
+    /// \exception MgFeatureServiceException
+    /// \exception MgInvalidArgumentException
+    /// \exception MgInvalidOperationException
+    /// \exception MgFdoException
+    ///
+    virtual MgPropertyCollection* UpdateFeatures(MgFeatureCommandCollection* commands);
+
 INTERNAL_API:
 
     //////////////////////////////////////////////////////////////////
@@ -847,6 +1000,7 @@
     SCALERANGES           m_scaleRanges;
     STRING                m_featureSourceId;
     STRING                m_featureName;
+    STRING                m_schemaName;
     STRING                m_geometry;
     IdPropertyList        m_idProps;
 };

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -770,3 +770,13 @@
 {
     return "Map";
 }
+
+///////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Returns an instance of the specified service.
+///
+MgService* MgMapBase::GetService(INT32 serviceType)
+{
+    throw new MgNotImplementedException(L"MgMapBase.GetService",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+}

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.h	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/MapBase.h	2007-03-24 02:10:49 UTC (rev 1366)
@@ -940,6 +940,12 @@
     ///
     virtual void ResetLayersRefresh();
 
+    //////////////////////////////////////////////////////////////////
+    /// \brief
+    /// Returns an instance of the specified service.
+    ///
+    virtual MgService* GetService(INT32 serviceType);
+
 protected:
 
     void TrackChange(CREFSTRING objectId, bool layer, MgObjectChange::ChangeType type, CREFSTRING param);

Modified: trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2007-03-24 00:37:34 UTC (rev 1365)
+++ trunk/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2007-03-24 02:10:49 UTC (rev 1366)
@@ -754,8 +754,7 @@
     // Get the feature source contents
     Ptr<MgByteReader> byteReader = resourceService->GetResourceContent(resource, MgResourcePreProcessingType::Substitution);
 
-    Ptr<MgByteSink> byteSink = new MgByteSink((MgByteReader*)byteReader);
-    byteSink->ToStringUtf8(resourceContent);
+    byteReader->ToStringUtf8(resourceContent);
 
     ValidateFeatureSource(resourceContent);
 



More information about the mapguide-commits mailing list