[mapguide-commits] r7761 - trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Mon Aug 12 07:46:48 PDT 2013
Author: jng
Date: 2013-08-12 07:46:48 -0700 (Mon, 12 Aug 2013)
New Revision: 7761
Modified:
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
Log:
#2339: Fix Layer Definition editor NRE on multi-schema Feature Sources. The problem was our GetClassDefinitionInternal() method naively assumes a single schema, which obviously is not the case.
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2013-08-11 15:55:40 UTC (rev 7760)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs 2013-08-12 14:46:48 UTC (rev 7761)
@@ -1987,24 +1987,31 @@
var fsd = new FeatureSourceDescription(s);
//We can't just assume first class item is the one, as ones that do not take
//class name hints will return the full schema
- var schema = fsd.Schemas[0];
- if (schema.Classes.Count > 1)
+ var schema = fsd.GetSchema(schemaName);
+ if (schema != null)
{
- //Since we have the full schema anyway, let's cache these other classes
- ClassDefinition ret = null;
- foreach (var cls in schema.Classes)
+ if (schema.Classes.Count > 1)
{
- string key = resourceId + "!" + cls.QualifiedName;
- m_classDefinitionCache[key] = cls;
+ //Since we have the full schema anyway, let's cache these other classes
+ ClassDefinition ret = null;
+ foreach (var cls in schema.Classes)
+ {
+ string key = resourceId + "!" + cls.QualifiedName;
+ m_classDefinitionCache[key] = cls;
- if (cls.Name == className)
- ret = cls;
+ if (cls.Name == className)
+ ret = cls;
+ }
+ return ret;
}
- return ret;
+ else
+ {
+ return schema.GetClass(className);
+ }
}
else
{
- return schema.GetClass(className);
+ return null;
}
}
}
More information about the mapguide-commits
mailing list