[mapguide-commits] r4703 - sandbox/adsk/2.2gp/Web/src/schemareport
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Mar 26 02:20:33 EDT 2010
Author: liuar
Date: 2010-03-26 02:20:28 -0400 (Fri, 26 Mar 2010)
New Revision: 4703
Modified:
sandbox/adsk/2.2gp/Web/src/schemareport/showclass.php
sandbox/adsk/2.2gp/Web/src/schemareport/showgeom.php
Log:
Submit on behalf of Buddy Hu
Port fix of Ticket #1298 to adsk branch
[Problem]:
Create a join and a calculation due to the SDF/SHP data source. Preview the new class in the MapGuide Studio, and view data. There is a FDO exception: ?\226?\128?\156An exception occurred in FDO component. Item '' not found in collection?\226?\128?\157.
[Reason]:
In MG Server, in the MgOpSelectFeatures::Execute()method, we get the className from WebTier. And the className should be qualified, formatted like schemaName:className(e.g. Default:Class1).
Then we parse the qualified schemaName by invoke the function MgUtil::ParseQualifiedClassName(CREFSTRING qualifiedClassName, REFSTRING parsedSchemaName, REFSTRING parsedClassName). If the schemaName is not qualified, the parsedSchemeName will be empty.
At last use the parsedSchemaName to get schema from the SchemaCollection like this: FdoPtr<FdoFeatureSchema> schema = (FdoFeatureSchema *)schemas->GetItem(parsedSchemaName.c_str());
If the parsedSchemeName is empty, the GetItem method will throw a FDO exception as above.
The problem is, in the WebTier( in showclass.php), we are using a unqualified className to select features like this: $featureReader = $featureSrvc->SelectFeatures($resId, $className, null);
Then the exception is thrown from the MG Server.
[Solution]:
In the showclass.php, we should use the qualified className to select features.
$qualifiedClassName = $schemaName . ":" . $className;
$featureReader = $featureSrvc->SelectFeatures($resId, $qualifiedClassName, null);
Modified: sandbox/adsk/2.2gp/Web/src/schemareport/showclass.php
===================================================================
--- sandbox/adsk/2.2gp/Web/src/schemareport/showclass.php 2010-03-26 06:18:26 UTC (rev 4702)
+++ sandbox/adsk/2.2gp/Web/src/schemareport/showclass.php 2010-03-26 06:20:28 UTC (rev 4703)
@@ -65,8 +65,10 @@
$schemaName = substr(strrchr($schemaName, "/"), 1);
$classDef = $featureSrvc->GetClassDefinition($resId, $schemaName, $className);
$geomName = $classDef->GetDefaultGeometryPropertyName();
- $featureReader = $featureSrvc->SelectFeatures($resId, $className, null);
+ $qualifiedClassName = $schemaName . ":" . $className;
+ $featureReader = $featureSrvc->SelectFeatures($resId, $qualifiedClassName, null);
+
// Calculate total number of entries.
while($featureReader->ReadNext())
$totalEntries++;
@@ -104,7 +106,7 @@
try
{
- $featureReader = $featureSrvc->SelectFeatures($resId, $className, null);
+ $featureReader = $featureSrvc->SelectFeatures($resId, $qualifiedClassName, null);
// Find the correct index on featureReader
$count = $index;
Modified: sandbox/adsk/2.2gp/Web/src/schemareport/showgeom.php
===================================================================
--- sandbox/adsk/2.2gp/Web/src/schemareport/showgeom.php 2010-03-26 06:18:26 UTC (rev 4702)
+++ sandbox/adsk/2.2gp/Web/src/schemareport/showgeom.php 2010-03-26 06:20:28 UTC (rev 4703)
@@ -75,7 +75,7 @@
$geomProp = $classDef->GetProperties()->GetItem($geomName);
$spatialContext = $geomProp->GetSpatialContextAssociation();
- $featureReader = $featureSrvc->SelectFeatures($featuresId, $className, null);
+ $featureReader = $featureSrvc->SelectFeatures($featuresId, $featureName, null);
while($featureReader->ReadNext())
$totalEntries++;
$featureReader->Close();
More information about the mapguide-commits
mailing list