[mapguide-commits] r9160 - in sandbox/jng/clean_json: UnitTest/WebTier/MapAgent/MapAgentForms Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Apr 19 10:35:47 PDT 2017


Author: jng
Date: 2017-04-19 10:35:47 -0700 (Wed, 19 Apr 2017)
New Revision: 9160

Modified:
   sandbox/jng/clean_json/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeSchema.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetClassDefinition.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetTileProviders.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
   sandbox/jng/clean_json/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
Log:
- Add missing CLEAN field for GETSITEVERSION test form
- Where applicable, only enable support for the new CLEAN and SIMPLE parameters if the operation version supplied is 3.3.0 or above. For affected operations that do specific version checks in their execution the most recent version check is changed from == to >= to account for the new CLEAN flag in 3.3.0 while still being able to use the parameters of the most recent version.

Modified: sandbox/jng/clean_json/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html
===================================================================
--- sandbox/jng/clean_json/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/UnitTest/WebTier/MapAgent/MapAgentForms/getsiteversionform.html	2017-04-19 17:35:47 UTC (rev 9160)
@@ -24,6 +24,8 @@
         <option value="application/json">application/json</option>
         </select>
         <p>
+            Clean JSON: <input type="text" name="CLEAN" value="0" ID="TextClean">
+        <p>
         <input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
         </form>
     </body>

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpCreateRuntimeMap.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -139,7 +139,8 @@
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(2,6,0) &&
-        version != MG_API_VERSION(3,0,0))
+        version != MG_API_VERSION(3,0,0) &&
+        version != MG_API_VERSION(3,3,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpCreateRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeRuntimeMap.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -119,7 +119,8 @@
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(2,6,0) &&
-        version != MG_API_VERSION(3,0,0))
+        version != MG_API_VERSION(3,0,0) &&
+        version != MG_API_VERSION(3,3,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpDescribeRuntimeMap.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeSchema.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeSchema.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpDescribeSchema.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -43,11 +43,14 @@
         params->GetParameterValue(MgHttpResourceStrings::reqFeatClassNames), L".");
 
     m_bSimple = false;
-    // Get simple flag (SIMPLE)
-    STRING simple = params->GetParameterValue(MgHttpResourceStrings::reqFeatSimple);
-    if (simple.length() > 0)
+    // Get simple flag (SIMPLE). Only recognize this flag for 3.3.0 and above
+    if (m_userInfo->GetApiVersion() >= MG_API_VERSION(3, 3, 0))
     {
-        m_bSimple = (simple == L"1");
+        STRING simple = params->GetParameterValue(MgHttpResourceStrings::reqFeatSimple);
+        if (simple.length() > 0)
+        {
+            m_bSimple = (simple == L"1");
+        }
     }
 }
 

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetClassDefinition.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetClassDefinition.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetClassDefinition.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -38,11 +38,14 @@
     m_resId = params->GetParameterValue(MgHttpResourceStrings::reqFeatResourceId);
 
     m_bSimple = false;
-    // Get simple flag (SIMPLE)
-    STRING simple = params->GetParameterValue(MgHttpResourceStrings::reqFeatSimple);
-    if (simple.length() > 0)
+    // Get simple flag (SIMPLE). Only recognize this flag for 3.3.0 and above
+    if (m_userInfo->GetApiVersion() >= MG_API_VERSION(3, 3, 0))
     {
-        m_bSimple = (simple == L"1");
+        STRING simple = params->GetParameterValue(MgHttpResourceStrings::reqFeatSimple);
+        if (simple.length() > 0)
+        {
+            m_bSimple = (simple == L"1");
+        }
     }
 }
 

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetTileProviders.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetTileProviders.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpGetTileProviders.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -51,7 +51,7 @@
     ValidateCommonParameters();
 
     INT32 version = m_userInfo->GetApiVersion();
-    if (version == MG_API_VERSION(3,0,0))
+    if (version >= MG_API_VERSION(3,0,0))
     {
         // Get Proxy Tile Service instance
         Ptr<MgTileService> service = (MgTileService*)(CreateService(MgServiceType::TileService));
@@ -80,7 +80,8 @@
 
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
-    if (version != MG_API_VERSION(3,0,0))
+    if (version != MG_API_VERSION(3,0,0) &&
+        version != MG_API_VERSION(3,3,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpGetTileProviders.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -142,7 +142,7 @@
     {
         featureDescriptionInfo = controller.QueryMapFeatures(m_mapName, layerNames, filterGeometry, selectionVariant, m_featureFilter, m_maxFeatures, m_persist, m_layerAttributeFilter);
     }
-    else if (version == MG_API_VERSION(2, 6, 0))
+    else if (version >= MG_API_VERSION(2, 6, 0))
     {
         featureDescriptionInfo = controller.QueryMapFeatures(m_mapName, layerNames, filterGeometry, selectionVariant, m_featureFilter, m_maxFeatures, m_persist, m_layerAttributeFilter, m_requestData, m_selectionColor, m_selectionFormat);
     }
@@ -167,7 +167,8 @@
     // There are multiple supported versions
     INT32 version = m_userInfo->GetApiVersion();
     if (version != MG_API_VERSION(1,0,0) &&
-        version != MG_API_VERSION(2,6,0))
+        version != MG_API_VERSION(2,6,0) &&
+        version != MG_API_VERSION(3,3,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpQueryMapFeatures.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);

Modified: sandbox/jng/clean_json/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
===================================================================
--- sandbox/jng/clean_json/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2017-04-19 17:13:03 UTC (rev 9159)
+++ sandbox/jng/clean_json/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2017-04-19 17:35:47 UTC (rev 9160)
@@ -180,11 +180,14 @@
         m_userInfo->SetClientIp(clientIp);
     }
 
-    // Get clean json flag (CLEAN)
-    STRING cleanJson = hrParam->GetParameterValue(MgHttpResourceStrings::reqClean);
-    if (cleanJson.length() > 0)
+    // Get clean json flag (CLEAN). Only recognize this flag for 3.3.0 and above
+    if (version >= MG_API_VERSION(3, 3, 0))
     {
-        m_bCleanJson = (cleanJson == L"1");
+        STRING cleanJson = hrParam->GetParameterValue(MgHttpResourceStrings::reqClean);
+        if (cleanJson.length() > 0)
+        {
+            m_bCleanJson = (cleanJson == L"1");
+        }
     }
 
     // Short circuit the authentication check if no username or session is supplied.
@@ -240,7 +243,8 @@
     if (version != MG_API_VERSION(1,0,0) &&
         version != MG_API_VERSION(1,2,0) &&
         version != MG_API_VERSION(2,0,0) &&
-        version != MG_API_VERSION(2,2,0))
+        version != MG_API_VERSION(2,2,0) &&
+        version != MG_API_VERSION(3,3,0))
     {
         throw new MgInvalidOperationVersionException(
         L"MgHttpRequestResponseHandler.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);



More information about the mapguide-commits mailing list