[mapguide-commits] r5090 - in trunk/MgDev:
Common/MapGuideCommon/Services Common/PlatformBase/Services
Server/src/Services/Feature Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sun Aug 15 21:52:44 EDT 2010
Author: liuar
Date: 2010-08-16 01:52:44 +0000 (Mon, 16 Aug 2010)
New Revision: 5090
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/FeatureOperationFactory.cpp
trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
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/Web/src/HttpHandler/HttpResourceStrings.cpp
trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
trunk/MgDev/Web/src/HttpHandler/HttpWfsDescribeFeatureType.cpp
trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp
trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
Log:
Ticket #1421 OGC WFS 1.1.0 Support
Enhance the Feature Service interfaces DescribeWfsFeatureType and GetWfsFeature by adding a parameter to specify the output format.
The most significant update from WFS 1.0.0 to WFS 1.1.0 is the supported output GML format. WFS 1.0.0 only support GML 2.1.1 while WFS 1.3.0 suport both GML 2.1.1 and GML 3.1.2. So, it's necessary for MapGuide feature service to allow user to specify GML format.
Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -1343,7 +1343,29 @@
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
+//////////////////////////////////////////////////////////////////
+// Retrieves WFS schema information for the specified feature classes with specified format
+MgByteReader* MgProxyFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId,
+ MgStringCollection* featureClasses,
+ CREFSTRING outputFormat)
+{
+ MgCommand cmd;
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgFeatureServiceOpId::DescribeWfsFeatureType_Id, // Command Code
+ 3, // No of arguments
+ Feature_Service, // Service Id
+ BUILD_VERSION(2,3,0), // Operation version
+ MgCommand::knObject, featureSourceId, // Argument#1
+ MgCommand::knObject, featureClasses, // Argument#2
+ MgCommand::knString, &outputFormat, // Argument#3
+ MgCommand::knNone); // End of argument
+ SetWarning(cmd.GetWarningObject());
+
+ return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
//////////////////////////////////////////////////////////////////
// Retrieves feature information in WFS format, based on the specified criteria
MgByteReader* MgProxyFeatureService::GetWfsFeature(MgResourceIdentifier* featureSourceId,
@@ -1373,7 +1395,37 @@
return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
+//////////////////////////////////////////////////////////////////
+// Retrieves feature information in with specified WFS format, based on the specified criteria
+MgByteReader* MgProxyFeatureService::GetWfsFeature(MgResourceIdentifier* featureSourceId,
+ CREFSTRING featureClass,
+ MgStringCollection* requiredProperties,
+ CREFSTRING srs,
+ CREFSTRING filter,
+ INT32 maxFeatures,
+ CREFSTRING outputFormat)
+{
+ MgCommand cmd;
+ cmd.ExecuteCommand(m_connProp, // Connection
+ MgCommand::knObject, // Return type expected
+ MgFeatureServiceOpId::GetWfsFeature_Id, // Command Code
+ 7, // No of arguments
+ Feature_Service, // Service Id
+ BUILD_VERSION(2,3,0), // Operation version
+ MgCommand::knObject, featureSourceId, // Argument#1
+ MgCommand::knString, &featureClass, // Argument#2
+ MgCommand::knObject, requiredProperties, // Argument#3
+ MgCommand::knString, &srs, // Argument#4
+ MgCommand::knString, &filter, // Argument#5
+ MgCommand::knInt32, maxFeatures, // Argument#6
+ MgCommand::knString, &outputFormat, // Argument#7
+ MgCommand::knNone); // End of argument
+ SetWarning(cmd.GetWarningObject());
+
+ return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
+}
+
//////////////////////////////////////////////////////////////////
MgBatchPropertyCollection* MgProxyFeatureService::GetFeatures(CREFSTRING featureReader)
{
Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyFeatureService.h 2010-08-16 01:52:44 UTC (rev 5090)
@@ -1005,13 +1005,13 @@
///
/// <!-- Syntax in .Net, Java, and PHP -->
/// \htmlinclude DotNetSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
/// \htmlinclude JavaSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
/// \htmlinclude PHPSyntaxTop.html
- /// virtual MgByteReader CreateFeatureSource(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses);
/// \htmlinclude SyntaxBottom.html
///
/// \param featureSourceId (MgResourceIdentifier)
@@ -1030,6 +1030,40 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Retrieves schema informationabout a set of feature classes for a given feature source with specified format.
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClasses (MgStringCollection)
+ /// A collection of strings identifying the feature classes for which to
+ /// retrieve schema information. If this collection is null or empty, information
+ /// is returned for all feature classes.
+ /// \param outputFormat (String/string)
+ /// 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
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the XML schema.
+ ///
+ virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses,CREFSTRING outputFormat);
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Retrieves feature information based on the supplied criteria.
///
/// <!-- Syntax in .Net, Java, and PHP -->
@@ -1066,6 +1100,49 @@
MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures);
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// 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, 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* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
+ MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING outputFormat);
+
////////////////////////////////////////////////////////////////////////////////
/// \brief
/// This method enumerates all the providers and if they are FDO enabled for
Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureService.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureService.h 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureService.h 2010-08-16 01:52:44 UTC (rev 5090)
@@ -1528,6 +1528,42 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief
+ /// Retrieves schema informationabout a set of feature classes for a given feature source with specified format.
+ ///
+ /// \note1
+ ///
+ /// <!-- Syntax in .Net, Java, and PHP -->
+ /// \htmlinclude DotNetSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude JavaSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+ /// \htmlinclude SyntaxBottom.html
+ /// \htmlinclude PHPSyntaxTop.html
+ /// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+ /// \htmlinclude SyntaxBottom.html
+ ///
+ /// \param featureSourceId (MgResourceIdentifier)
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// \param featureClasses (MgStringCollection)
+ /// A collection of strings identifying the feature classes for which to
+ /// retrieve schema information. If this collection is null or empty, information
+ /// is returned for all feature classes.
+ /// \param outputFormat (String/string)
+ /// 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
+ ///
+ /// \return
+ /// Returns an MgByteReader containing the XML schema.
+ ///
+ virtual MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses,CREFSTRING outputFormat) = 0;
+
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
/// Retrieves feature information based on the supplied criteria.
///
/// \note1
@@ -1566,6 +1602,51 @@
virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures) = 0;
+ ////////////////////////////////////////////////////////////////////////////////////////////////////////
+ /// \brief
+ /// Retrieves feature information based on the supplied criteria with specified format.
+ ///
+ /// \note1
+ ///
+ /// <!-- 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.
+ ///
+ virtual MgByteReader* GetWfsFeature(MgResourceIdentifier* featureSourceId, CREFSTRING featureClass,
+ MgStringCollection* requiredProperties, CREFSTRING srs, CREFSTRING filter, INT32 maxFeatures,CREFSTRING outputFormat) = 0;
+
////////////////////////////////////////////////////////////////////////////////
/// \brief
/// This method enumerates all the providers and if they are FDO enabled for
Modified: trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Server/src/Services/Feature/FeatureOperationFactory.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -489,6 +489,7 @@
switch (VERSION_NO_PHASE(operationVersion))
{
case VERSION_SUPPORTED(1,0):
+ case VERSION_SUPPORTED(2,3):
handler.reset(new MgOpDescribeWfsFeatureType());
break;
default:
@@ -501,6 +502,7 @@
switch (VERSION_NO_PHASE(operationVersion))
{
case VERSION_SUPPORTED(1,0):
+ case VERSION_SUPPORTED(2,3):
handler.reset(new MgOpGetWfsFeature());
break;
default:
Modified: trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Server/src/Services/Feature/OpDescribeWfsFeatureType.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -86,6 +86,36 @@
// Write the response
EndExecution(byteReader);
}
+ else if (3 == m_packet.m_NumArguments)
+ {
+ // Get the feature source
+ Ptr<MgResourceIdentifier> featureSourceId = (MgResourceIdentifier*)m_stream->GetObject();
+
+ // Get the feature class collection
+ Ptr<MgStringCollection> featureClasses = (MgStringCollection*)m_stream->GetObject();
+
+ // Get the output format
+ STRING outputFormat;
+ m_stream->GetString(outputFormat);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureSourceId->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(outputFormat.c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ // Execute the operation
+ Ptr<MgByteReader> byteReader = m_service->DescribeWfsFeatureType(featureSourceId, featureClasses,outputFormat);
+
+ // Write the response
+ EndExecution(byteReader);
+ }
else
{
MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
Modified: trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Server/src/Services/Feature/OpGetWfsFeature.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -111,6 +111,61 @@
// Write the response
EndExecution(byteReader);
}
+ else if (7 == m_packet.m_NumArguments)
+ {
+ // Get the feature source
+ Ptr<MgResourceIdentifier> featureSourceId = (MgResourceIdentifier*)m_stream->GetObject();
+
+ // Get the schema name
+ STRING featureClass;
+ m_stream->GetString(featureClass);
+
+ // Get the required properties
+ Ptr<MgStringCollection> requiredProperties = (MgStringCollection*)m_stream->GetObject();
+
+ // Get the srs
+ STRING srs;
+ m_stream->GetString(srs);
+
+ // Get the filter
+ STRING filter;
+ m_stream->GetString(filter);
+
+ // Get the max features to return
+ INT32 maxFeatures;
+ m_stream->GetInt32(maxFeatures);
+
+ // Get the output format
+ STRING outputFormat;
+ m_stream->GetString(outputFormat);
+
+ BeginExecution();
+
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureSourceId->ToString().c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureClass.c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(L"MgStringCollection");
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(srs.c_str());
+ MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+ MG_LOG_OPERATION_MESSAGE_ADD_STRING(filter.c_str());
+ 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(outputFormat.c_str());
+ MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
+
+ Validate();
+
+ // Execute the operation
+ Ptr<MgByteReader> byteReader = m_service->GetWfsFeature(featureSourceId, featureClass,
+ requiredProperties, srs, filter, maxFeatures,outputFormat);
+
+ // Write the response
+ EndExecution(byteReader);
+ }
else
{
MG_LOG_OPERATION_MESSAGE_PARAMETERS_START();
Modified: trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -1261,6 +1261,49 @@
}
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// Retrieves schema informationabout a set of feature classes for a given feature source with specified format.
+///
+///
+/// <!-- Syntax in .Net, Java, and PHP -->
+/// \htmlinclude DotNetSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+/// \htmlinclude SyntaxBottom.html
+/// \htmlinclude JavaSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasses, string outputFormat);
+/// \htmlinclude SyntaxBottom.html
+/// \htmlinclude PHPSyntaxTop.html
+/// virtual MgByteReader DescribeWfsFeatureType(MgResourceIdentifier featureSourceId, MgStringCollection featureClasse, string outputFormats);
+/// \htmlinclude SyntaxBottom.html
+///
+/// \param featureSourceId (MgResourceIdentifier)
+/// The resource identifier defining the
+/// location of the feature source in
+/// the repository.
+/// \param featureClasses (MgStringCollection)
+/// A collection of strings identifying the feature classes for which to
+/// retrieve schema information. If this collection is null or empty, information
+/// is returned for all feature classes.
+/// \param outputFormat (String/string)
+/// 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
+///
+/// \return
+/// Returns an MgByteReader containing the XML schema.
+///
+MgByteReader* MgServerFeatureService::DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses,CREFSTRING outputFormat)
+{
+ throw new MgNotImplementedException(
+ L"MgServerFeatureService::DescribeWfsFeatureType",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+
+ return NULL; // to make some compiler happy
+}
+
+
//////////////////////////////////////////////////////////////////
// Helper private method
void MgServerFeatureService::FeatureSourceToString(MgResourceIdentifier* resource, string& resourceContent)
@@ -1825,6 +1868,61 @@
return byteReader.Detach();
}
+////////////////////////////////////////////////////////////////////////////////////////////////////////
+/// \brief
+/// 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, 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)
+{
+ throw new MgNotImplementedException(
+ L"MgServerFeatureService::GetWfsFeature",
+ __LINE__, __WFILE__, NULL, L"", NULL);
+
+ 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-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Server/src/Services/Feature/ServerFeatureService.h 2010-08-16 01:52:44 UTC (rev 5090)
@@ -855,6 +855,31 @@
//////////////////////////////////////////////////////////////////
/// <summary>
+ /// Retrieves schema information about a set of feature classes for a given feature source with specified output format.
+ /// </summary>
+ /// <param name="featureSourceId">Input
+ /// The resource identifier defining the
+ /// location of the feature source in
+ /// the repository.
+ /// </param>
+ /// <param name="featureClasses">Input
+ /// A collection of strings identifying the feature classes for which to
+ /// retrieve schema information. If this collection is null or empty, information
+ /// is returned for all feature classes.
+ /// </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
+ /// </param>
+ /// <returns>
+ /// Returns an MgByteReader containing the XML schema.
+ /// </returns>
+ ///
+ MgByteReader* DescribeWfsFeatureType(MgResourceIdentifier* featureSourceId, MgStringCollection* featureClasses, CREFSTRING outputFormat);
+
+ //////////////////////////////////////////////////////////////////
+ /// <summary>
/// Retrieves feature information based on the supplied criteria.
/// </summary>
/// <param name="featureSourceId">Input
@@ -886,6 +911,44 @@
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
+ /// 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>
+ /// <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
+ /// http://portal.opengeospatial.org/files/?artifact_id=8339
+ /// </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, CREFSTRING outputFormat);
+
////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// This method enumerates all the providers and if they are FDO enabled for
Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -309,6 +309,7 @@
const STRING MgHttpResourceStrings::reqWfsFeatureId = L"FEATUREID";
const STRING MgHttpResourceStrings::reqWfsFilter = L"FILTER";
const STRING MgHttpResourceStrings::reqWfsBbox = L"BBOX";
+const STRING MgHttpResourceStrings::reqWfsOutputFormat = L"OUTPUTFORMAT";
// Web Application Parameters
const STRING MgHttpResourceStrings::reqFormat = L"FORMAT";
Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h 2010-08-16 01:52:44 UTC (rev 5090)
@@ -221,6 +221,7 @@
static const STRING reqWfsFeatureId;
static const STRING reqWfsFilter;
static const STRING reqWfsBbox;
+ static const STRING reqWfsOutputFormat;
// PREDEFINED WEB APPLICATION REQUEST PARAMETERS
static const STRING reqFormat;
Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsDescribeFeatureType.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsDescribeFeatureType.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsDescribeFeatureType.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -83,6 +83,10 @@
{
featureTypeList = MgStringCollection::ParseCollection(sFeatureTypes, L",");
}
+
+ // Determine required output format
+ CPSZ pszOutputFormat = Wfs.RequestParameter(MgHttpResourceStrings::reqWfsOutputFormat.c_str());
+ STRING sOutputFormat = pszOutputFormat? pszOutputFormat : _("");
Ptr<MgResourceService> pResourceService = (MgResourceService*)(CreateService(MgServiceType::ResourceService));
Ptr<MgFeatureService> pFeatureService = (MgFeatureService*)(CreateService(MgServiceType::FeatureService));
@@ -111,6 +115,7 @@
pFeatureClasses->Add(((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass)); //NOXLATE
Ptr<MgByteReader> response = pFeatureService->DescribeWfsFeatureType(&idResource,pFeatureClasses);
+ //Ptr<MgByteReader> response = pFeatureService->DescribeWfsFeatureType(&idResource,pFeatureClasses,sOutputFormat);
// Set the result
hResult->SetResultObject(response, response->GetMimeType());
Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -148,6 +148,9 @@
int numFeaturesRetrieved = 0;
int maxFeatures = m_getFeatureParams->GetMaxFeatures();
+
+ STRING sOutputFormat = m_getFeatureParams->GetOutputFormat();
+
for(int i = 0; i < featureTypeList->GetCount(); i++)
{
// Check to see if we've already retrieved the maximum
@@ -220,6 +223,8 @@
// 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);
// 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/WfsGetFeatureParams.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.cpp 2010-08-16 01:52:44 UTC (rev 5090)
@@ -91,6 +91,10 @@
// Return all features by default
m_maxFeatures = -1;
}
+
+ // Get the requested output format
+ m_outputFormat = GetRequestParameter(oServer,MgHttpResourceStrings::reqWfsOutputFormat);
+
}
WfsGetFeatureParams::~WfsGetFeatureParams()
@@ -328,6 +332,16 @@
{
return m_srs;
}
+/// <summary>
+/// Retrieves the output format of the feautre information
+/// </summary>
+/// <returns>
+/// A STRING defining the output format
+/// </returns>
+STRING WfsGetFeatureParams::GetOutputFormat()
+{
+ return m_outputFormat;
+}
/// <summary>
/// Performs a minimum amount of request parsing in order to determine
Modified: trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h 2010-08-12 17:38:29 UTC (rev 5089)
+++ trunk/MgDev/Web/src/HttpHandler/WfsGetFeatureParams.h 2010-08-16 01:52:44 UTC (rev 5090)
@@ -102,6 +102,14 @@
STRING GetSrs();
/// <summary>
+ /// Retrieves the output format of the feature information
+ /// </summary>
+ /// <returns>
+ /// A STRING defining the output format
+ /// </returns>
+ STRING GetOutputFormat();
+
+ /// <summary>
/// Performs a minimum amount of request parsing in order to determine
/// whether this class can handle the specified XML request
/// </summary>
@@ -152,6 +160,7 @@
MgXmlNamespaceManager* m_pNamespaces; // collect namespaces (ns#) namespaces
INT32 m_maxFeatures;
STRING m_srs;
+ STRING m_outputFormat;
};
#endif // _FS_WFS_GET_FEATURE_PARAMS_H
More information about the mapguide-commits
mailing list