[mapguide-commits] r1246 - trunk/MgDev/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Mar 15 15:57:54 EDT 2007


Author: brucedechant
Date: 2007-03-15 15:57:54 -0400 (Thu, 15 Mar 2007)
New Revision: 1246

Modified:
   trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.h
   trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h
Log:
Update web tier to properly support the new Major.Minor.Phase HTTP version scheme instead of the old single digit version.

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp	2007-03-15 19:18:29 UTC (rev 1245)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.cpp	2007-03-15 19:57:54 UTC (rev 1246)
@@ -36,8 +36,6 @@
 
     Ptr<MgHttpRequestParam> params = hRequest->GetRequestParam();
 
-    m_version = params->GetParameterValue(MgHttpResourceStrings::reqVersion);
-
     if (m_version == L"1.0.0")
     {
         // Get the map name
@@ -69,11 +67,6 @@
         // Get the scale index and convert to integer
         m_scaleIndex = MgUtil::StringToInt32(params->GetParameterValue(MgHttpResourceStrings::reqRenderingScaleIndex));
     }
-    else
-    {
-        throw new MgInvalidOperationVersionException(
-            L"MgHttpGetTileImage.MgHttpGetTileImage", __LINE__, __WFILE__, NULL, L"", NULL);
-    }
 }
 
 /// <summary>
@@ -146,8 +139,13 @@
 {
     MG_HTTP_HANDLER_TRY()
 
-    // Operation version validation has been moved to constructor
-   
+    // There are multiple supported versions
+    if ((m_version != L"1.0.0") &&
+        (m_version != L"1.2.0"))
+    {
+        throw new MgInvalidOperationVersionException(
+        L"MgHttpGetTileImage.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+
     MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpGetTileImage.ValidateOperationVersion");
 }
-

Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.h	2007-03-15 19:18:29 UTC (rev 1245)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetTileImage.h	2007-03-15 19:57:54 UTC (rev 1246)
@@ -64,7 +64,6 @@
     STRING  m_baseMapLayerGroupName;
     INT32   m_tileCol;
     INT32   m_tileRow;
-    STRING  m_version;
     INT32   m_scaleIndex;
 };
 

Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2007-03-15 19:18:29 UTC (rev 1245)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp	2007-03-15 19:57:54 UTC (rev 1246)
@@ -140,9 +140,7 @@
 {
     MG_HTTP_HANDLER_TRY()
 
-    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();
-
-    if (hrParam->GetParameterValue(MgHttpResourceStrings::reqVersion) == L"")
+    if (m_version == L"")
     {
         MgStringCollection arguments;
         arguments.Add(L"0");
@@ -166,29 +164,13 @@
 {
     MG_HTTP_HANDLER_TRY()
 
-    Ptr<MgHttpRequestParam> hrParam = m_hRequest->GetRequestParam();
-    STRING version = hrParam->GetParameterValue(MgHttpResourceStrings::reqVersion);
-
-    STRING majorVer = L"";
-    size_t pos1;
-
-    pos1 = version.find(L".");
-    if (pos1 != string::npos)
+    if (m_version != L"1.0.0")
     {
-        majorVer = version.substr(0, pos1);
-    }
-    else
-    {
-        majorVer = version;
-    }
-
-    if (majorVer != L"1")
-    {
         throw new MgInvalidOperationVersionException(
-        L"MgHttpRequestResponsehandler.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
+        L"MgHttpRequestResponseHandler.ValidateOperationVersion", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
-    MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpRequestResponseHander.ValidateOperationVersion");
+    MG_HTTP_HANDLER_CATCH_AND_THROW(L"MgHttpRequestResponseHandler.ValidateOperationVersion");
 }
 
 /// <summary>

Modified: trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h	2007-03-15 19:18:29 UTC (rev 1245)
+++ trunk/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.h	2007-03-15 19:57:54 UTC (rev 1246)
@@ -65,7 +65,7 @@
     /// <returns>
     /// nothing
     /// </returns>
-    void ValidateCommonParameters();
+    virtual void ValidateCommonParameters();
 
     /// <summary>
     /// Executes the specific request.



More information about the mapguide-commits mailing list