[mapguide-commits] r5096 - in trunk/MgDev: Common/MapGuideCommon/Services Common/PlatformBase/Services Server/src/Services/Feature Server/src/Wfs Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Aug 31 04:16:06 EDT 2010


Author: liuar
Date: 2010-08-31 08:16:06 +0000 (Tue, 31 Aug 2010)
New Revision: 5096

Modified:
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h
   trunk/MgDev/Common/PlatformBase/Services/FeatureService.h
   trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
   trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.h
   trunk/MgDev/Server/src/Wfs/1.1.0.xml.awd
   trunk/MgDev/Server/src/Wfs/OgcWfsService.config.awd
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
   trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
   trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.cpp
   trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.h
   trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp
   trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
Log:
Ticket #1421 OGC WFS 1.1.0 Support
1. Enhance the Feature Service interfaces !GetWfsFeature by adding a parameter to specify the WFS version.

2. Implement the !GetWfsFeature in !ServerFeatureService to support GML 3.1.1 format. 
   Update the default output format of !DescribeFeatureType and !GetFeature to GML3.

3. Update following items regard to the test suite of OGC CITE 

Update the DefaultSRS to urn:x-ogc:def:crs:EPSG:4326 Update the format element name from <ows:Format> to <Format> Update the namespaces in GetCapabilities response document Update the child element sequence of <ows:ServiceIdentification> Add GML 3 support for !DescribeFeatureType and GetFeature response. 


Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -1403,13 +1403,14 @@
                                                    CREFSTRING srs,
                                                    CREFSTRING filter,
                                                    INT32 maxFeatures,
+                                                   CREFSTRING wfsVersion,
                                                    CREFSTRING outputFormat)
 {
     MgCommand cmd;
     cmd.ExecuteCommand(m_connProp,                                  // Connection
                        MgCommand::knObject,                         // Return type expected
                        MgFeatureServiceOpId::GetWfsFeature_Id,      // Command Code
-                       7,                                           // No of arguments
+                       8,                                           // No of arguments
                        Feature_Service,                             // Service Id
                        BUILD_VERSION(2,3,0),                        // Operation version
                        MgCommand::knObject, featureSourceId,        // Argument#1
@@ -1418,7 +1419,8 @@
                        MgCommand::knString, &srs,                   // Argument#4
                        MgCommand::knString, &filter,                // Argument#5
                        MgCommand::knInt32,  maxFeatures,            // Argument#6
-                       MgCommand::knString, &outputFormat,          // Argument#7
+                       MgCommand::knString, &wfsVersion,            // Argument#7
+                       MgCommand::knString, &outputFormat,          // Argument#8
                        MgCommand::knNone);                          // End of argument
 
     SetWarning(cmd.GetWarningObject());

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -1055,8 +1055,8 @@
     /// A string identifying the output format of 
     /// the retrieved schema information.
     /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
-	/// http://portal.opengeospatial.org/files/?artifact_id=8339
-	/// 
+    /// http://portal.opengeospatial.org/files/?artifact_id=8339
+    /// 
     /// \return
     /// Returns an MgByteReader containing the XML schema.
     ///
@@ -1106,13 +1106,13 @@
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude JavaSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude PHPSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     ///
     /// \param featureSourceId (MgResourceIdentifier)
@@ -1131,6 +1131,8 @@
     /// \param maxFeatures (int)
     /// The maximum number of features to retrieve. If the value is less
     /// than or equal to zero, all features will be retrieved.
+    /// \param wfsVersion (String/string)
+    /// A string identifying the wfs version
     /// \param outputFormat (String/string)
     /// A string identifying the output format of 
     /// the retrieved feature information.
@@ -1140,8 +1142,11 @@
     /// \return
     /// Returns an MgByteReader containing the requested feature information.
     ///
+    ///
+    /// \exception MgInvalidArgumentException
+    ///
     MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
-        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING outputFormat);
+        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING wfsVersion, CREFSTRING outputFormat);
 
     ////////////////////////////////////////////////////////////////////////////////
     /// \brief

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureService.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureService.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureService.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -1610,13 +1610,13 @@
     ///
     /// <!-- Syntax in .Net, Java, and PHP -->
     /// \htmlinclude DotNetSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude JavaSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     /// \htmlinclude PHPSyntaxTop.html
-    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
+    /// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string wfsVersion, string outputFormat);
     /// \htmlinclude SyntaxBottom.html
     ///
     /// \param featureSourceId (MgResourceIdentifier)
@@ -1635,6 +1635,8 @@
     /// \param maxFeatures (int)
     /// The maximum number of features to retrieve. If the value is less
     /// than or equal to zero, all features will be retrieved.
+    /// \param wfsVersion (String/string)
+    /// A string identifying the wfs version
     /// \param outputFormat (String/string)
     /// A string identifying the output format of 
     /// the retrieved feature information.
@@ -1644,8 +1646,10 @@
     /// \return
     /// Returns an MgByteReader containing the requested feature information.
     ///
+    /// \exception MgInvalidArgumentException
+    ///
     virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
-        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING outputFormat) = 0;
+        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING wfsVersion, CREFSTRING outputFormat) = 0;
 
     ////////////////////////////////////////////////////////////////////////////////
     /// \brief

Modified: trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -111,7 +111,7 @@
         // Write the response
         EndExecution(byteReader);
     }
-    else if (7 == m_packet.m_NumArguments)
+    else if (8 == m_packet.m_NumArguments)
     {
         // Get the feature source
         Ptr<MgResourceIdentifier> featureSourceId = (MgResourceIdentifier*)m_stream->GetObject();
@@ -135,6 +135,10 @@
         INT32 maxFeatures;
         m_stream->GetInt32(maxFeatures);
 
+        // Get the wfs version
+        STRING wfsVersion;
+        m_stream->GetString(wfsVersion);
+
         // Get the output format
         STRING outputFormat;
         m_stream->GetString(outputFormat);
@@ -154,6 +158,8 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(wfsVersion.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_STRING(outputFormat.c_str());
         MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
@@ -161,7 +167,7 @@
 
         // Execute the operation
         Ptr<MgByteReader> byteReader = m_service->GetWfsFeature(featureSourceId, featureClass,
-            requiredProperties, srs, filter, maxFeatures,outputFormat);
+            requiredProperties, srs, filter, maxFeatures, wfsVersion, outputFormat);
 
         // Write the response
         EndExecution(byteReader);

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -1693,20 +1693,20 @@
     return msds.GetIdentityProperties(resource, schemaName, classNames);
 }
 
-
-//////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////
 /// \brief
-/// Retrieves feature information based on the supplied criteria.
+/// Retrieves feature information based on the supplied criteria with specified format.
 ///
+///
 /// <!-- Syntax in .Net, Java, and PHP -->
 /// \htmlinclude DotNetSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
 /// \htmlinclude SyntaxBottom.html
 /// \htmlinclude JavaSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string outputFormat);
 /// \htmlinclude SyntaxBottom.html
 /// \htmlinclude PHPSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures);
+/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
 /// \htmlinclude SyntaxBottom.html
 ///
 /// \param featureSourceId (MgResourceIdentifier)
@@ -1722,19 +1722,30 @@
 /// The spatial reference system in which to return feature geometries
 /// \param filter (String/string)
 /// An XML string containing the definition for an OGC filter
-/// \param filter (int)
+/// \param maxFeatures (int)
 /// The maximum number of features to retrieve. If the value is less
 /// than or equal to zero, all features will be retrieved.
+/// \param wfsVersion (String/string)
+/// A string identifying the wfs version
+/// \param outputFormat (String/string)
+/// A string identifying the output format of 
+/// the retrieved feature information.
+/// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
+/// http://portal.opengeospatial.org/files/?artifact_id=8339
 ///
 /// \return
 /// Returns an MgByteReader containing the requested feature information.
 ///
+/// EXCEPTIONS:
+/// MgInvalidArgumentException
 MgByteReader* MgServerFeatureService::GetWfsFeature(MgResourceIdentifier* fs,
                                                      CREFSTRING featureClass,
-                                                     MgStringCollection* propNames,
-                                                     CREFSTRING srs,
-                                                     CREFSTRING wfsFilter,
-                                                     INT32 maxFeatures)
+                                                     MgStringCollection* propNames, 
+                                                     CREFSTRING srs, 
+                                                     CREFSTRING wfsFilter, 
+                                                     INT32 maxFeatures,
+                                                     CREFSTRING wfsVersion,
+                                                     CREFSTRING outputFormat)
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetWfsFeature()");
 
@@ -1821,6 +1832,7 @@
     MgServerFdoFeatureReader maxFeatureReader(fdoReader);
     maxFeatureReader.SetMaxFeatures(maxFeatures);
 
+
     //generate a file name to serialize wfs data
     STRING fileName = MgFileUtil::GenerateTempFileName(false, L"wfs", L"xml");
 
@@ -1832,11 +1844,40 @@
     flags->SetMemberName(L"featureMember");
     flags->SetMemberUri(L"http://www.opengis.net/gml");
 
-    // set schemaLocations
-    // gml schema location
-    flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/2.1.2/feature.xsd");
+    // set schemaLocations 
+
+    // gml schema location and version
+    if(L"text/xml; subtype=gml/2.1.2" == outputFormat)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/2.1.2/feature.xsd");
+        flags->SetGmlVersion(FdoGmlVersion::FdoGmlVersion_212);
+    }
+    else if(L"text/xml; subtype=gml/3.1.1" == outputFormat)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/gml", L"http://schemas.opengis.net/gml/3.1.1/feature.xsd");
+        flags->SetGmlVersion(FdoGmlVersion::FdoGmlVersion_311);
+    }
+    else
+    {
+        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+    
     // wfs schema location
-    flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd");
+    if(L"1.0.0" == wfsVersion)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd");
+    }
+    else if(L"1.1.0" == wfsVersion)
+    {
+        flags->SetSchemaLocation(L"http://www.opengis.net/wfs", L"http://schemas.opengis.net/wfs/1.1.0/WFS-basic.xsd");
+    }
+    else
+    {
+        throw new MgInvalidArgumentException(L"MgServerFeatureService.GetWfsFeature",
+        __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+    
     // default namespace schema location
     flags->SetSchemaLocation(L"http://www.mynamespace.com/myns", L"http://www.mynamespace.com/myns/myns.xsd");
     // set the default namespace
@@ -1844,7 +1885,7 @@
 
     //create the FDO xml serializer stack and write out the features
     FdoPtr<FdoXmlWriter> xmlWriter = FdoXmlWriter::Create(fileName.c_str(), false);
-    FdoPtr<FdoXmlFeaturePropertyWriter> propWriter = FdoXmlFeaturePropertyWriter::Create(xmlWriter);
+    FdoPtr<FdoXmlFeaturePropertyWriter> propWriter = FdoXmlFeaturePropertyWriter::Create(xmlWriter,flags);
     FdoPtr<FdoXmlFeatureWriter> featWriter = FdoXmlFeatureWriter::Create(propWriter, flags);
 
     FdoXmlFeatureSerializer::XmlSerialize(&maxFeatureReader, featWriter, flags);
@@ -1868,61 +1909,21 @@
     return byteReader.Detach();
 }
 
-////////////////////////////////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Retrieves feature information based on the supplied criteria with specified format.
+
+///////////////////////////////////////////////////////////////////////////
+/// This method has been deprecated. Use the above method.
 ///
-///
-/// <!-- Syntax in .Net, Java, and PHP -->
-/// \htmlinclude DotNetSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
-/// \htmlinclude SyntaxBottom.html
-/// \htmlinclude JavaSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, String featureClass, MgStringCollection requiredProperties, String srs, String filter, int maxFeatures, string outputFormat);
-/// \htmlinclude SyntaxBottom.html
-/// \htmlinclude PHPSyntaxTop.html
-/// virtual MgByteReader GetWfsFeature(MgResourceIdentifier featureSourceId, string featureClass, MgStringCollection requiredProperties, string srs, string filter, int maxFeatures, string outputFormat);
-/// \htmlinclude SyntaxBottom.html
-///
-/// \param featureSourceId (MgResourceIdentifier)
-/// The resource identifier defining the
-/// location of the feature source in
-/// the repository.
-/// \param featureClass (String/string)
-/// The feature class containing the features to retrieve.
-/// \param requiredProperties (MgStringCollection)
-/// The collection of properties to retrieve for each feature. If the
-/// collection is null or empty, all properties will be retrieved.
-/// \param srs (String/string)
-/// The spatial reference system in which to return feature geometries
-/// \param filter (String/string)
-/// An XML string containing the definition for an OGC filter
-/// \param maxFeatures (int)
-/// The maximum number of features to retrieve. If the value is less
-/// than or equal to zero, all features will be retrieved.
-/// \param outputFormat (String/string)
-/// A string identifying the output format of 
-/// the retrieved feature information.
-/// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
-/// http://portal.opengeospatial.org/files/?artifact_id=8339
-///
-/// \return
-/// Returns an MgByteReader containing the requested feature information.
-///
 MgByteReader* MgServerFeatureService::GetWfsFeature(MgResourceIdentifier* fs,
                                                      CREFSTRING featureClass,
-                                                     MgStringCollection* propNames, 
-                                                     CREFSTRING srs, 
-                                                     CREFSTRING wfsFilter, 
-                                                     INT32 maxFeatures,
-                                                     CREFSTRING outputFormat)
+                                                     MgStringCollection* propNames,
+                                                     CREFSTRING srs,
+                                                     CREFSTRING wfsFilter,
+                                                     INT32 maxFeatures)
 {
-    throw new MgNotImplementedException(
-    L"MgServerFeatureService::GetWfsFeature",
-    __LINE__, __WFILE__, NULL, L"", NULL);
+    return GetWfsFeature(fs, featureClass, propNames, srs, wfsFilter, maxFeatures, L"1.0.0", L"2.1.2");
+}
 
-    return NULL; // to make some compiler happy
-}
+
 ////////////////////////////////////////////////////////////////////////////////
 /// \brief
 /// This method enumerates all the providers and if they are FDO enabled for

Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.h
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -869,8 +869,8 @@
     /// </param>
     /// <param name="outputFormat">Input
     /// A string identifying the output format of the retrieved schema information.
-	/// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
-	/// http://portal.opengeospatial.org/files/?artifact_id=8339
+    /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 8.2
+    /// http://portal.opengeospatial.org/files/?artifact_id=8339
     /// </param>
     /// <returns>
     /// Returns an MgByteReader containing the XML schema.
@@ -880,39 +880,6 @@
 
     //////////////////////////////////////////////////////////////////
     /// <summary>
-    /// Retrieves feature information based on the supplied criteria.
-    /// </summary>
-    /// <param name="featureSourceId">Input
-    /// The resource identifier defining the
-    /// location of the feature source in
-    /// the repository.
-    /// </param>
-    /// <param name="featureClass">Input
-    /// The feature class containing the features to retrieve.
-    /// </param>
-    /// <param name="requiredProperties">Input
-    /// The collection of properties to retrieve for each feature. If the
-    /// collection is null or empty, all properties will be retrieved.
-    /// </param>
-    /// <param name="srs">Input
-    /// The spatial reference system in which to return feature geometries.
-    /// </param>
-    /// <param name="filter">Input
-    /// An XML string containing the definition for an OGC filter.
-    /// </param>
-    /// <param name="maxFeatures">Input
-    /// The maximum number of features to retrieve. If the value is less
-    /// than or equal to zero, all features will be retrieved.
-    /// </param>
-    /// <returns>
-    /// Returns an MgByteReader containing the requested feature information.
-    /// </returns>
-    ///
-    MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
-        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures);
-
-    //////////////////////////////////////////////////////////////////
-    /// <summary>
     /// Retrieves feature information based on the supplied criteria with specified output format.
     /// </summary>
     /// <param name="featureSourceId">Input
@@ -937,6 +904,9 @@
     /// The maximum number of features to retrieve. If the value is less
     /// than or equal to zero, all features will be retrieved.
     /// </param>
+    /// <param name="wfsVersion">Input
+    ///  A string identifying the wfs version
+    /// </param>
     /// <param name="outputFormat">Input
     /// A string identifying the output format of the retrieved feature information.
     /// The supported values of output format are specified in OpenGIS Web Feature Service (WFS) Implementation Specification - section 9.2
@@ -946,9 +916,17 @@
     /// Returns an MgByteReader containing the requested feature information.
     /// </returns>
     ///
+    /// EXCEPTIONS:
+    /// MgInvalidArgumentException
     MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
-        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures, CREFSTRING outputFormat);
+        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures, CREFSTRING wfsVersion, CREFSTRING outputFormat);
 
+    ///////////////////////////////////////////////////////////////////////////
+    /// This method has been deprecated. Use the above method.
+    ///
+    MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
+        MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures);
+
     ////////////////////////////////////////////////////////////////////////////////
     /// <summary>
     /// This method enumerates all the providers and if they are FDO enabled for

Modified: trunk/MgDev/Server/src/Wfs/1.1.0.xml.awd
===================================================================
--- trunk/MgDev/Server/src/Wfs/1.1.0.xml.awd	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Server/src/Wfs/1.1.0.xml.awd	2010-08-31 08:16:06 UTC (rev 5096)
@@ -11,8 +11,8 @@
        Feature class #&Feature.iteration;
     -->
   <wfs:FeatureType
-     xmlns:ns="&Feature.namespace;">
-   <wfs:Name>&Feature.name;</wfs:Name>
+     xmlns:&Feature.Prefix;="&Feature.Resource;">
+   <wfs:Name>&Feature.FullName;</wfs:Name>
    <wfs:Title>&Feature.Title;</wfs:Title>
    <wfs:Abstract>&Feature.Abstract;</wfs:Abstract>
    <?Ifdef item="Feature.KeywordList"?>
@@ -59,7 +59,7 @@
  <Define item="ComparisonOperators.xml"><ogc:ComparisonOperator>&Enum.item;</ogc:ComparisonOperator></Define>
  <Define item="FunctionNames.xml"><ogc:FunctionName nArgs="&Enum.item.args;">&Enum.item;</ogc:FunctionName></Define>
  <Define item="OtherSRS.xml"><wfs:OtherSRS>&Enum.item;</wfs:OtherSRS></Define>
- <Define item="Format.xml"><ows:Format>&Enum.item;</ows:Format></Define>
+ <Define item="Format.xml"><Format>&Enum.item;</Format></Define>
  <Define item="BoundingBox.xml">
    <ows:LowerCorner>&Enum.item.west; &Enum.item.south;</ows:LowerCorner>
    <ows:UpperCorner>&Enum.item.east; &Enum.item.north;</ows:UpperCorner>
@@ -70,7 +70,7 @@
  <Define item="Feature.namespace">http://fdo.osgeo.org/schemas</Define>
  <Define item="Feature.Abstract">Abstract for this layer</Define>
  <Define item="Feature.KeywordList"></Define>
- <Define item="Feature.DefaultSRS">EPSG:4326</Define>
+ <Define item="Feature.DefaultSRS">urn:x-ogc:def:crs:EPSG:4326</Define>
  <!--Define item="Feature.OtherSRS"></Define-->
  <Define item="Feature.Bounds.north">90</Define>
  <Define item="Feature.Bounds.south">-90</Define>
@@ -109,24 +109,28 @@
 -->
 <Response request="GetCapabilities" content-type="text/xml">
 <wfs:WFS_Capabilities
+  xmlns:gml="http://www.opengis.net/gml"
+  xmlns:wfs="http://www.opengis.net/wfs"
   xmlns:ows="http://www.opengis.net/ows"
-  xmlns:ogc="http://www.opengis.net/ogc"
-  xmlns:wfs="http://www.opengis.net/wfs"
-  xmlns:gml="http://www.opengis.net/gml"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.opengis.net/wfs ../wfs.xsd" version="1.1.0" updateSequence="0">
+  xmlns:ogc="http://www.opengis.net/ogc"
+  xmlns="http://www.opengis.net/wfs"
+  version="1.1.0" 
+  updateSequence="0"
+  xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"
+ >
   <!-- ================================================================== -->
   <!-- SERVICE IDENTIFICATION SECTION                                     -->
   <!-- ================================================================== -->
   <ows:ServiceIdentification>
-    <ows:ServiceType>WFS</ows:ServiceType>
-    <?Enum list="&SupportedVersions;" using="&ServiceTypeVersion.xml;" item="Version"?>
-    <ows:Title>&Service.Title;</ows:Title>
-    <ows:Abstract>&Service.Abstract;</ows:Abstract>
+	<ows:Title>&Service.Title;</ows:Title>
+	<ows:Abstract>&Service.Abstract;</ows:Abstract>
     <ows:Keywords>
       <?Enum list="&Service.Keywords;" using="&Keywords.xml;"?>
     </ows:Keywords>
+	<ows:ServiceType>WFS</ows:ServiceType>
+	<?Enum list="&SupportedVersions;" using="&ServiceTypeVersion.xml;" item="Version"?>
     <ows:Fees>&Service.Fees;</ows:Fees>
     <ows:AccessConstraints>&Service.AccessConstraints;</ows:AccessConstraints>
   </ows:ServiceIdentification>
@@ -260,7 +264,7 @@
         <ogc:SimpleArithmetic/>
         <ogc:Functions>
           <ogc:FunctionNames>
-            <?Enum list="Query.FunctionNames" using="FunctionNames.xml"?>
+            <?Enum list="&Query.FunctionNames" using="&FunctionNames.xml"?>
           </ogc:FunctionNames>
         </ogc:Functions>
       </ogc:ArithmeticOperators>
@@ -274,17 +278,28 @@
  </wfs:WFS_Capabilities>
 </Response>
 
+<!--
 
+  WFS DescribeFeatureType - XML, GML 2.1.2
 
+-->
+<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/2.1.2">
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <?Ifdef item="Request.typename"?>
+ <?EnumDelim list="&Request.typename;" using="&DescribeFeature.EnumDelim.xml;"?>
+ <?Else?>
+ <?EnumFeatureTypes using="&DescribeFeature.EnumFeature.xml;" ?>
+ <?Endif?>
+ </xs:schema>
+</Response>
 
-
-
 <!--
 
-  WFS DescribeFeatureType - XML, GML 2.1.2
+  WFS DescribeFeatureType - XML, GML 3.1.1
 
 -->
-<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/2.1.2">
+<Response request="DescribeFeatureType" content-type="text/xml; subtype=gml/3.1.1">
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
             elementFormDefault="qualified" attributeFormDefault="unqualified">
  <?Ifdef item="Request.typename"?>
@@ -308,6 +323,17 @@
 
 <!--
 
+  WFS GetFeature - XML, GML 3.1.1
+
+-->
+<Response request="GetFeature" content-type="text/xml; subtype=gml/3.1.1">
+ <wfs:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xmlns:wfs="http://www.opengis.net/wfs">
+  <?EnumFeatures using="&GetFeature.xml;" ?>
+ </wfs:FeatureCollection>
+</Response>
+
+<!--
+
   Exception Format  - XML
 
 -->

Modified: trunk/MgDev/Server/src/Wfs/OgcWfsService.config.awd
===================================================================
--- trunk/MgDev/Server/src/Wfs/OgcWfsService.config.awd	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Server/src/Wfs/OgcWfsService.config.awd	2010-08-31 08:16:06 UTC (rev 5096)
@@ -135,27 +135,30 @@
       Specific version templates can override these -->
  <Define item="Formats.DescribeFeatureType">
    <item>text/xml; subtype=gml/2.1.2</item>
-   <!--item>text/xml; subtype=gml/3.1.1</item-->
+   <item>text/xml; subtype=gml/3.1.1</item>
  </Define>
 
- <Define item="Formats.DescribeFeatureType.default">text/xml; subtype=gml/2.1.2</Define>
-
+ <Define item="Formats.DescribeFeatureType.default.1.0.0">text/xml; subtype=gml/2.1.2</Define>
+ <Define item="Formats.DescribeFeatureType.default.1.1.0">text/xml; subtype=gml/3.1.1</Define>
+ 
  <!-- For historic reasons, we need to accept these output formats, -->
  <!-- which we convert into the indicated notations                 -->
  <Define item="Parameter.OutputFormat.ValueMap">
   <translate from="GML2">text/xml; subtype=gml/2.1.2</translate>
   <translate from="XMLSCHEMA">text/xml; subtype=gml/2.1.2</translate>
+  <translate from="GML3">text/xml; subtype=gml/3.1.1</translate>
  </Define>
 
  <!-- These are the supported GetFeature formats
       Specific version templates can override these    -->
  <Define item="Formats.GetFeature">
    <item>text/xml; subtype=gml/2.1.2</item>
-   <!--item>text/xml; subtype=gml/3.1.1</item-->
+   <item>text/xml; subtype=gml/3.1.1</item>
  </Define>
 
- <Define item="Formats.GetFeature.default">text/xml; subtype=gml/2.1.2</Define>
-
+ <Define item="Formats.GetFeature.default.1.0.0">text/xml; subtype=gml/2.1.2</Define>
+ <Define item="Formats.GetFeature.default.1.1.0">text/xml; subtype=gml/3.1.1</Define>
+ 
  <!-- These are the supported Exception formats
       Specific version templates can override these -->
  <Define item="Formats.Exception">

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -302,6 +302,7 @@
 const STRING MgHttpResourceStrings::opWmsGetFeatureInfo = L"WMS.GETFEATUREINFO";
 
 // Predefined Web Feature Service Request Parameters
+const STRING MgHttpResourceStrings::reqWfsVersion = L"VERSION";
 const STRING MgHttpResourceStrings::reqWfsPropertyName = L"PROPERTYNAME";
 const STRING MgHttpResourceStrings::reqWfsMaxFeatures = L"MAXFEATURES";
 const STRING MgHttpResourceStrings::reqWfsSrsName = L"SRSNAME";

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -214,6 +214,7 @@
     static const STRING reqWmsFeatureCount;
 
     // PREDEFINED WEB FEATURE SERVICE REQUEST PARAMETERS
+    static const STRING reqWfsVersion;
     static const STRING reqWfsPropertyName;
     static const STRING reqWfsMaxFeatures;
     static const STRING reqWfsSrsName;

Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -149,7 +149,13 @@
                 int numFeaturesRetrieved = 0;
                 int maxFeatures = m_getFeatureParams->GetMaxFeatures();
 
+                STRING sVersion = m_getFeatureParams->GetVersion();
                 STRING sOutputFormat = m_getFeatureParams->GetOutputFormat();
+                if(sOutputFormat.empty())
+                {
+                    // get the default output format
+                    sOutputFormat = wfsServer->GetDefaultOutputFormat(sVersion);
+                }
 
                 for(int i = 0; i < featureTypeList->GetCount(); i++)
                 {
@@ -222,9 +228,7 @@
 
                             // Call the C++ API
                             Ptr<MgByteReader> resultReader = featureService->GetWfsFeature(featureSourceId, ((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass),
-                                requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve);
-                            //Ptr<MgByteReader> resultReader = featureService->GetWfsFeature(featureSourceId, ((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass),
-                            //    requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve, sOutputFormat);
+                                requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve, sVersion, sOutputFormat);
 
                             // TODO How to determine number of features retrieved...?
                             // Note: for now, maxFeatures is managed by the MgWfsFeatures object. - TMT 2006-3-20

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -35,7 +35,8 @@
 CPSZ kpszPiDefinitionFeatureIteration      = _("Feature.iteration");
 
 CPSZ kpszQueryValueGetFeature                = _("GetFeature");
-CPSZ kpszQueryStringGetFeatureOutputFormatDefault    = _("Formats.GetFeature.default");
+CPSZ kpszQueryStringGetFeatureOutputFormatDefault_1_0_0    = _("Formats.GetFeature.default.1.0.0");
+CPSZ kpszQueryStringGetFeatureOutputFormatDefault_1_1_0    = _("Formats.GetFeature.default.1.1.0");
 CPSZ kpszPiGetFeatureCollection              = _("GetFeatureCollection");
 CPSZ kpszPiGetFeatureCollectionDefaultFormat = _("&GetFeatureCollection.xml;");
 
@@ -240,9 +241,14 @@
     {
         // See what format they requested the GetFeature response in...
         CPSZ pszFormat = RequestParameter(kpszQueryStringOutputFormat);
+        STRING sOutputFormat;
+
         if(pszFormat == NULL)
-          pszFormat = this->Definition(kpszQueryStringGetFeatureOutputFormatDefault);
-
+        {
+            CPSZ pszVersion = RequestParameter(MgHttpResourceStrings::reqWfsVersion.c_str());
+            sOutputFormat = this->GetDefaultOutputFormat(pszVersion);
+            pszFormat = sOutputFormat.c_str();
+        }
         // Generate a response to the GetFeature request
         if(GenerateResponse(kpszQueryValueGetFeature,pszFormat))
         {
@@ -416,5 +422,20 @@
     m_pFeatures = pFeatureDefs;
 }
 
+// Help method to get the default output format
+STRING MgOgcWfsServer::GetDefaultOutputFormat(CREFSTRING sVersion)
+{
+    if(_("1.0.0") == sVersion)
+    {
+        CPSZ psz = this->Definition(kpszQueryStringGetFeatureOutputFormatDefault_1_0_0);
+        return STRING(psz? psz : _(""));
+    }
+    else
+    {
+        CPSZ psz = this->Definition(kpszQueryStringGetFeatureOutputFormatDefault_1_1_0);
+        return STRING(psz? psz : _(""));
+    }
+}
 
 
+

Modified: trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/OgcWfsServer.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -32,6 +32,7 @@
     void SetFeatures(MgWfsFeatures* pFeatures);
     void SetGetFeatureRequestParams(WfsGetFeatureParams* pGetFeatureParams);
     void SetFeatureDefinitions(MgWfsFeatureDefinitions* pFeatureDefs);
+	STRING GetDefaultOutputFormat(CREFSTRING sVersion);
 
 protected:
     virtual void RespondToRequest();

Modified: trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp	2010-08-31 08:16:06 UTC (rev 5096)
@@ -95,6 +95,9 @@
     // Get the requested output format
     m_outputFormat = GetRequestParameter(oServer,MgHttpResourceStrings::reqWfsOutputFormat);
 
+    // Get the wfs version 
+    m_version = GetRequestParameter(oServer,MgHttpResourceStrings::reqWfsVersion);
+
 }
 
 WfsGetFeatureParams::~WfsGetFeatureParams()
@@ -332,6 +335,7 @@
 {
     return m_srs;
 }
+
 /// <summary>
 /// Retrieves the output format of the feautre information
 /// </summary>
@@ -344,6 +348,17 @@
 }
 
 /// <summary>
+/// Retrieves the wfs request version
+/// </summary>
+/// <returns>
+/// A STRING defining the wfs version
+/// </returns>
+STRING WfsGetFeatureParams::GetVersion()
+{
+    return m_version;
+}
+
+/// <summary>
 /// Performs a minimum amount of request parsing in order to determine
 /// whether this class can handle the specified XML request
 /// </summary>

Modified: trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h	2010-08-30 01:14:44 UTC (rev 5095)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h	2010-08-31 08:16:06 UTC (rev 5096)
@@ -110,6 +110,14 @@
     STRING GetOutputFormat();
 
     /// <summary>
+    /// Retrieves the wfs request version
+    /// </summary>
+    /// <returns>
+    /// A STRING defining the wfs version
+    /// </returns>
+    STRING GetVersion();
+
+    /// <summary>
     /// Performs a minimum amount of request parsing in order to determine
     /// whether this class can handle the specified XML request
     /// </summary>
@@ -161,6 +169,7 @@
     INT32 m_maxFeatures;
     STRING m_srs;
     STRING m_outputFormat;
+    STRING m_version;
 };
 
 #endif  // _FS_WFS_GET_FEATURE_PARAMS_H



More information about the mapguide-commits mailing list