[mapguide-commits] r4198 - trunk/MgDev/Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Aug 28 13:27:28 EDT 2009
Author: brucedechant
Date: 2009-08-28 13:27:28 -0400 (Fri, 28 Aug 2009)
New Revision: 4198
Modified:
trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
Log:
Fix for trac ticket 1061 - HttpHandler's GetIdentityProperties throws an unimplemented exception
Notes:
- Updated HTTP API to use updated GetIdentityProperties() API change done in trac ticket 1002
Modified: trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp 2009-08-28 16:49:24 UTC (rev 4197)
+++ trunk/MgDev/Web/src/HttpHandler/HttpGetIdentityProperties.cpp 2009-08-28 17:27:28 UTC (rev 4198)
@@ -60,11 +60,25 @@
STRING schema = hrParam->GetParameterValue(MgHttpResourceStrings::reqFeatSchema);
STRING className = hrParam->GetParameterValue(MgHttpResourceStrings::reqFeatClass);
+ // Throw on empty class name
+ if (className.empty())
+ {
+ throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+
// Create Proxy Feature Service instance
Ptr<MgFeatureService> service = (MgFeatureService*)(CreateService(MgServiceType::FeatureService));
// call the C++ APIs
- Ptr<MgPropertyDefinitionCollection> identityProps = service->GetIdentityProperties(&resId, schema, className);
+ Ptr<MgStringCollection> classNames = new MgStringCollection();
+ classNames->Add(className);
+ Ptr<MgClassDefinitionCollection> idClasses = service->GetIdentityProperties(&resId, schema, classNames);
+ if (idClasses.p == NULL || idClasses->GetCount() == 0)
+ {
+ throw new MgClassNotFoundException(L"MgHttpGetIdentityProperties.Execute", __LINE__, __WFILE__, NULL, L"", NULL);
+ }
+ Ptr<MgClassDefinition> idClass = idClasses->GetItem(0);
+ Ptr<MgPropertyDefinitionCollection> identityProps = idClass->GetIdentityProperties();
Ptr<MgByteReader> byteReader = identityProps->ToXml();
//Convert to alternate response format, if necessary
More information about the mapguide-commits
mailing list