[mapguide-commits] r6830 - branches/2.4/MgDev/Desktop/MgDesktop/Services

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jul 2 05:51:20 PDT 2012


Author: jng
Date: 2012-07-02 05:51:20 -0700 (Mon, 02 Jul 2012)
New Revision: 6830

Modified:
   branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
Log:
#2050: Make schema name an optional parameter for GetClasses

Modified: branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp
===================================================================
--- branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2012-07-01 13:54:36 UTC (rev 6829)
+++ branches/2.4/MgDev/Desktop/MgDesktop/Services/FeatureService.cpp	2012-07-02 12:51:20 UTC (rev 6830)
@@ -5630,8 +5630,8 @@
     MG_LOG_OPERATION_MESSAGE_PARAMETERS_END();
 
 	CHECK_FEATURE_SOURCE_ARGUMENT(resource, L"MgdFeatureService::GetClasses");
-	if (schemaName.empty())
-		throw new MgInvalidArgumentException(L"MgdFeatureService::GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
+	//if (schemaName.empty())
+	//	throw new MgInvalidArgumentException(L"MgdFeatureService::GetClasses", __LINE__, __WFILE__, NULL, L"", NULL);
 
     Ptr<MgFeatureConnection> connWrap = new MgFeatureConnection(resource);
 	FdoPtr<FdoIConnection> conn = connWrap->GetConnection();
@@ -5639,7 +5639,8 @@
 	if (SupportsPartialSchemaDiscovery(conn))
 	{
 		FdoPtr<FdoIGetClassNames> fetch = (FdoIGetClassNames*)conn->CreateCommand(FdoCommandType_GetClassNames);
-		fetch->SetSchemaName(schemaName.c_str());
+        if (!schemaName.empty())
+		    fetch->SetSchemaName(schemaName.c_str());
 		FdoPtr<FdoStringCollection> names = fetch->Execute();
 
 		classNames = MgFeatureUtil::FdoToMgStringCollection(names, false);
@@ -5654,7 +5655,7 @@
 		{
 			FdoPtr<FdoFeatureSchema> schema = schemas->GetItem(i);
 			STRING name = schema->GetName();
-			if (name != schemaName)
+			if (!schemaName.empty() && name != schemaName)
 				continue;
 
 			FdoPtr<FdoClassCollection> classes = schema->GetClasses();



More information about the mapguide-commits mailing list