[mapguide-commits] r9147 - in trunk/MgDev: UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Apr 18 09:07:16 PDT 2017
Author: jng
Date: 2017-04-18 09:07:16 -0700 (Tue, 18 Apr 2017)
New Revision: 9147
Modified:
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/describedrawingform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawinglayers.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsectionresources.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsections.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerategroupsform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeraterepositoriesform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateusersform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getfeaturesetenvelopeform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositorycontentform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositoryheaderform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html
trunk/MgDev/Web/src/HttpHandler/HttpDescribeDrawing.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingLayers.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSectionResources.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSections.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateGroups.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateRepositories.cpp
trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUsers.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetFeatureSetEnvelope.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryContent.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryHeader.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp
trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp
Log:
#2767: Add missing JSON format conversion support for the following mapagent operations:
- DESCRIBEDRAWING
- ENUMERATEDRAWINGLAYERS
- ENUMERATEDRAWINGSECTIONRESOURCES
- ENUMERATEDRAWINGSECTIONS
- ENUMERATEGROUPS
- ENUMERATEUSERS
- ENUMERATEREPOSITORIES
- GETFEATURESETENVELOPE
- GETREPOSITORYCONTENT
- GETREPOSITORYHEADER
- GETSITEINFO
- GETSITESTATUS
- GETSITEVERSION
- GETTILEPROVIDERS
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/describedrawingform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/describedrawingform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/describedrawingform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -20,6 +20,11 @@
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p> Resource ID:
<input type="text" name="RESOURCEID" value="Library://Drawings/World.DrawingSource" size="100" ID="Text5">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawinglayers.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawinglayers.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawinglayers.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -21,6 +21,11 @@
<input type="text" name="RESOURCEID" value="Library://Drawings/World.DrawingSource" size="100" ID="Text5">
<p> Section name:
<input type="text" name="SECTION" value="" size="100" ID="Text6">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsectionresources.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsectionresources.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsectionresources.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -17,6 +17,11 @@
<P>Resource ID: <INPUT id="Text5" type="text" size="100" value="Library://Drawings/World.DrawingSource"
name="RESOURCEID">
<P>Section name: <INPUT id="Text6" type="text" size="100" name="SECTION">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<P>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</FORM>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsections.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsections.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeratedrawingsections.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -16,7 +16,11 @@
<P>Locale: <INPUT id="Text4" type="text" size="10" value="en" name="LOCALE">
<P>Resource ID: <INPUT id="Text5" type="text" size="100" value="Library://Drawings/World.DrawingSource"
name="RESOURCEID">
- </P>
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p><input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset"></p>
</FORM>
</body>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerategroupsform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerategroupsform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerategroupsform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -14,6 +14,11 @@
<input type="text" name="LOCALE" value="en" size="10">
<p> Client Agent:
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+<p> Format:
+<select name="FORMAT">
+<option value="text/xml">text/xml</option>
+<option value="application/json">application/json</option>
+</select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset"></form>
</body>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeraterepositoriesform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeraterepositoriesform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumeraterepositoriesform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -16,6 +16,11 @@
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p> Type:
<input type="text" name="TYPE" value="Session" size="20">
+<p> Format:
+<select name="FORMAT">
+<option value="text/xml">text/xml</option>
+<option value="application/json">application/json</option>
+</select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateusersform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateusersform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/enumerateusersform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -16,6 +16,11 @@
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p> Group:
<input type="text" name="GROUP" value="" size="20">
+<p> Format:
+<select name="FORMAT">
+<option value="text/xml">text/xml</option>
+<option value="application/json">application/json</option>
+</select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getfeaturesetenvelopeform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getfeaturesetenvelopeform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getfeaturesetenvelopeform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -18,6 +18,13 @@
Map name: <input type="text" name="MAPNAME" value="TestMap" size="100" ID="Text4">
<p>
FeatureSet XML: <input type="text" name="FEATURESET" size="100" ID="Text4">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
+ <p>
+ <input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</div>
</form>
</body>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositorycontentform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositorycontentform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositorycontentform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -16,6 +16,11 @@
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p> Resource ID:
<input type="text" name="RESOURCEID" value="Library://" size="100">
+<p> Format:
+<select name="FORMAT">
+<option value="text/xml">text/xml</option>
+<option value="application/json">application/json</option>
+</select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositoryheaderform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositoryheaderform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getrepositoryheaderform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -16,6 +16,11 @@
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p> Resource ID:
<input type="text" name="RESOURCEID" value="Library://" size="100">
+<p> Format:
+<select name="FORMAT">
+<option value="text/xml">text/xml</option>
+<option value="application/json">application/json</option>
+</select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteinfoform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -18,6 +18,11 @@
<input type="text" name="LOCALE" value="en" size="10" ID="Text4">
<p> Client Agent:
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsitestatusform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -18,6 +18,11 @@
<input type="text" name="LOCALE" value="en" size="10" ID="Text4">
<p> Client Agent:
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -18,6 +18,11 @@
<input type="text" name="LOCALE" value="en" size="10" ID="Text4">
<p> Client Agent:
<input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
+ <p> Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
<p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>
Modified: trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html
===================================================================
--- trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/UnitTest/WebTier/MapAgent/MapAgentForms/gettileprovidersform.html 2017-04-18 16:07:16 UTC (rev 9147)
@@ -13,6 +13,12 @@
<p>
Client Agent: <input type="text" name="CLIENTAGENT" value="MapGuide Developer" size="100">
<p>
+ Format:
+ <select name="FORMAT">
+ <option value="text/xml">text/xml</option>
+ <option value="application/json">application/json</option>
+ </select>
+ <p>
<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</div>
</form>
Modified: trunk/MgDev/Web/src/HttpHandler/HttpDescribeDrawing.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpDescribeDrawing.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpDescribeDrawing.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -61,6 +61,10 @@
// call the C++ API
Ptr<MgByteReader> byteReaderResult = service->DescribeDrawing(&resId);
+
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpDescribeDrawing.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingLayers.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingLayers.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingLayers.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -63,7 +63,13 @@
// call the C++ API
Ptr<MgStringCollection> layers = service->EnumerateLayers(&resId, m_sectionName);
- hResult->SetResultObject(layers, MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = layers->ToXml();
+
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateDrawingLayers.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSectionResources.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSectionResources.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSectionResources.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -62,8 +62,12 @@
Ptr<MgDrawingService> service = (MgDrawingService*)(CreateService(MgServiceType::DrawingService));
// call the C++ API
- Ptr<MgByteReader> sectionResources = service->EnumerateSectionResources(&resId, m_sectionName);
- hResult->SetResultObject(sectionResources, MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = service->EnumerateSectionResources(&resId, m_sectionName);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateDrawingSectionResources.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSections.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSections.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateDrawingSections.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -60,8 +60,12 @@
Ptr<MgDrawingService> service = (MgDrawingService*)(CreateService(MgServiceType::DrawingService));
// call the C++ API
- Ptr<MgByteReader> sections = service->EnumerateSections(&resId);
- hResult->SetResultObject(sections, MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = service->EnumerateSections(&resId);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateDrawingSections.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateGroups.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateGroups.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateGroups.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -59,6 +59,9 @@
// Run API command
Ptr<MgByteReader> byteReaderResult = mgSite->EnumerateGroups();
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateGroups.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateRepositories.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateRepositories.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateRepositories.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -64,6 +64,9 @@
// Run API command
Ptr<MgByteReader> byteReaderResult = mgprService->EnumerateRepositories(m_type);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateRepositories.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUsers.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUsers.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpEnumerateUsers.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -64,6 +64,9 @@
// Run API command
Ptr<MgByteReader> byteReaderResult = mgSite->EnumerateUsers( m_group );
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpEnumerateUsers.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetFeatureSetEnvelope.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetFeatureSetEnvelope.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetFeatureSetEnvelope.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -66,7 +66,10 @@
Ptr<MgEnvelope> envelope = selection->GetExtents(featureService);
Ptr<MgByteReader> byteReader = envelope->ToXml();
- hResult->SetResultObject(byteReader, MgMimeType::Xml);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReader);
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetFeatureSetEnvelope.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryContent.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryContent.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryContent.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -67,6 +67,9 @@
// Run API command
Ptr<MgByteReader> byteReaderResult = mgprService->GetRepositoryContent(&mgrIdentifier);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetRepositoryContent.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryHeader.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryHeader.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetRepositoryHeader.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -67,6 +67,9 @@
// Run API command
Ptr<MgByteReader> byteReaderResult = mgprService->GetRepositoryHeader(&mgrIdentifier);
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(byteReaderResult);
+
hResult->SetResultObject(byteReaderResult, byteReaderResult->GetMimeType());
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetRepositoryHeader.Execute")
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetSiteInfo.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -125,12 +125,18 @@
}
xml += EndXml();
- Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
- if(!value)
- throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+ std::string mbXml;
+ MgUtil::WideCharToMultiByte(xml, mbXml);
- hResult->SetResultObject(value, MgMimeType::Xml);
+ Ptr<MgByteSource> byteSource = new MgByteSource((BYTE_ARRAY_IN)mbXml.c_str(), (INT32)mbXml.length());
+ byteSource->SetMimeType(MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = byteSource->GetReader();
+ //Convert to alternate response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteInfo.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetSiteStatus.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -105,12 +105,18 @@
xml += EndXml();
- Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
- if(!value)
- throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+ std::string mbXml;
+ MgUtil::WideCharToMultiByte(xml, mbXml);
- hResult->SetResultObject(value, MgMimeType::Xml);
+ Ptr<MgByteSource> byteSource = new MgByteSource((BYTE_ARRAY_IN)mbXml.c_str(), (INT32)mbXml.length());
+ byteSource->SetMimeType(MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = byteSource->GetReader();
+ //Convert to alternate response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteStatus.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetSiteVersion.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -117,12 +117,18 @@
}
xml += EndXml();
- Ptr<MgHttpPrimitiveValue> value = new MgHttpPrimitiveValue(xml);
- if(!value)
- throw new MgOutOfMemoryException(L"", __LINE__, __WFILE__, NULL, L"", NULL);
+ std::string mbXml;
+ MgUtil::WideCharToMultiByte(xml, mbXml);
- hResult->SetResultObject(value, MgMimeType::Xml);
+ Ptr<MgByteSource> byteSource = new MgByteSource((BYTE_ARRAY_IN)mbXml.c_str(), (INT32)mbXml.length());
+ byteSource->SetMimeType(MgMimeType::Xml);
+ Ptr<MgByteReader> byteReader = byteSource->GetReader();
+ //Convert to alternate response format, if necessary
+ ProcessFormatConversion(byteReader);
+
+ hResult->SetResultObject(byteReader, byteReader->GetMimeType());
+
MG_HTTP_HANDLER_CATCH_AND_THROW_EX(L"MgHttpGetSiteVersion.Execute")
}
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp 2017-04-13 08:41:24 UTC (rev 9146)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetTileProviders.cpp 2017-04-18 16:07:16 UTC (rev 9147)
@@ -59,6 +59,9 @@
// Call the C++ API
Ptr<MgByteReader> providers = service->GetTileProviders();
+ // Convert to requested response format, if necessary
+ ProcessFormatConversion(providers);
+
// Set the result
hResult->SetResultObject(providers, providers->GetMimeType());
}
More information about the mapguide-commits
mailing list