[mapguide-commits] r9583 - trunk/MgDev/Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Jul 26 07:54:52 PDT 2019
Author: jng
Date: 2019-07-26 07:54:52 -0700 (Fri, 26 Jul 2019)
New Revision: 9583
Modified:
trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
Log:
Add timestamp property for WFS GetFeatures response for resultType=hits
Fixes #2801
Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2019-07-26 14:32:52 UTC (rev 9582)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2019-07-26 14:54:52 UTC (rev 9583)
@@ -303,6 +303,8 @@
// Is this hit mode? If so, just request the raw total
if (m_getFeatureParams->IsHitMode())
{
+ Ptr<MgDateTime> timestamp = new MgDateTime();
+ std::string mbTs = MgUtil::WideCharToMultiByte(timestamp->ToXmlString());
INT32 total = featureService->GetWfsFeatureTotal(featureSourceId, ((sSchemaHash.size() == 0) ? sClass : sSchemaHash + _(":") + sClass), filter, numFeaturesToRetrieve);
std::string sTotal;
MgUtil::Int32ToString(total, sTotal);
@@ -311,7 +313,9 @@
std::string json = "{";
json += "\"numberOfFeatures\": ";
json += sTotal;
- json += "}";
+ json += ", \"timeStamp\": \"";
+ json += mbTs;
+ json += "\"}";
Ptr<MgByteSource> bs = new MgByteSource((BYTE_ARRAY_IN)json.data(), (INT32)json.length());
bs->SetMimeType(MgMimeType::Json);
resultReader = bs->GetReader();
@@ -329,6 +333,8 @@
xml += "\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/feature.xsd http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd\"";
xml += " numberOfFeatures=\"";
xml += sTotal;
+ xml += "\" timeStamp=\"";
+ xml += mbTs;
xml += "\" />";
Ptr<MgByteSource> bs = new MgByteSource((BYTE_ARRAY_IN)xml.data(), (INT32)xml.length());
bs->SetMimeType(MgMimeType::Xml);
More information about the mapguide-commits
mailing list