[fdo-commits] r90 - branches/3.2.x/Providers/WFS/Src/Provider
svn_fdo at osgeo.org
svn_fdo at osgeo.org
Wed Jan 24 15:47:42 EST 2007
Author: romicadascalescu
Date: 2007-01-24 15:47:42 -0500 (Wed, 24 Jan 2007)
New Revision: 90
Modified:
branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsConnection.cpp
Log:
Fixed WFS: Unexpected feature class appears as non abstract
Modified: branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsConnection.cpp
===================================================================
--- branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsConnection.cpp 2007-01-18 15:47:02 UTC (rev 89)
+++ branches/3.2.x/Providers/WFS/Src/Provider/FdoWfsConnection.cpp 2007-01-24 20:47:42 UTC (rev 90)
@@ -347,6 +347,8 @@
continue;
}
+ FdoPtr<FdoWfsFeatureTypeList> pFeatList = mServiceMetadata->GetFeatureTypeList();
+ FdoPtr<FdoWfsFeatureTypeCollection> pFeatColl = pFeatList->GetFeatureTypes();
bool bNameModified = false;
for (int j = classes->GetCount() - 1; j >= 0; j--) {
FdoPtr<FdoClassDefinition> classDef = classes->GetItem(j);
@@ -382,17 +384,6 @@
break;
classMapping = NULL;
}
- // Prepare for implementation of #4
- FdoPtr<FdoWfsFeatureTypeList> pFeatList = mServiceMetadata->GetFeatureTypeList();
- FdoPtr<FdoWfsFeatureTypeCollection> pFeatColl = pFeatList->GetFeatureTypes();
- FdoPtr<FdoWfsFeatureType> pFeat = pFeatColl->FindItem(classDef->GetName());
- if (pFeat == NULL)
- {
- FdoStringP NameFeat = schema->GetName();
- NameFeat += L":";
- NameFeat += classDef->GetName();
- pFeat = pFeatColl->FindItem(NameFeat);
- }
FdoPtr<FdoPropertyDefinitionCollection> props = classDef->GetProperties();
FdoPtr<FdoXmlElementMappingCollection> elements;
@@ -429,13 +420,6 @@
ids->Add(dataProp);
continue; // no need to do the left adjustments
}
- // Doing #4
- if (prop->GetPropertyType() == FdoPropertyType_GeometricProperty && pFeat != NULL)
- {
- FdoGeometricPropertyDefinition* pPropGeom = static_cast<FdoGeometricPropertyDefinition*>(prop.p);
- if (pPropGeom != NULL && pPropGeom->GetSpatialContextAssociation() == NULL)
- pPropGeom->SetSpatialContextAssociation(pFeat->GetSRS());
- }
// Doing #5
if (elements != NULL)
@@ -519,8 +503,6 @@
props->RemoveAt(k);
// then add another new geometry property with the same name
FdoPtr<FdoGeometricPropertyDefinition> newGeoProp = FdoGeometricPropertyDefinition::Create(prop->GetName(), prop->GetDescription());
- if (pFeat != NULL)
- newGeoProp->SetSpatialContextAssociation(pFeat->GetSRS());
props->Add(newGeoProp);
// and we still have to change the element mapping's class mapping
FdoPtr<FdoXmlClassMapping> elementClass = FdoXmlClassMapping::Create(FdoGml212::mGeometryProperty,
@@ -580,8 +562,6 @@
// then add another new geometry property with the same name
FdoPtr<FdoGeometricPropertyDefinition> newGeoProp = FdoGeometricPropertyDefinition::Create(L"GEOMETRY", FdoGml212::mGeometryProperty);
newGeoProp->SetGeometryTypes(pNewTypeGeom);
- if (pFeat != NULL)
- newGeoProp->SetSpatialContextAssociation(pFeat->GetSRS());
props->Add(newGeoProp);
}
if (bNameModified)
@@ -612,6 +592,37 @@
_setClassDescription (classDef);
} // end of for each class
+ // this step at the end - after we cleaned the class
+ for (int j = classes->GetCount() - 1; j >= 0; j--)
+ {
+ FdoPtr<FdoClassDefinition> classDef = classes->GetItem(j);
+ // Prepare for implementation of #4
+ FdoPtr<FdoWfsFeatureType> pFeat = pFeatColl->FindItem(classDef->GetName());
+ if (pFeat == NULL)
+ {
+ FdoStringP NameFeat = schema->GetName();
+ NameFeat += L":";
+ NameFeat += classDef->GetName();
+ pFeat = pFeatColl->FindItem(NameFeat);
+ }
+ if (pFeat != NULL)
+ {
+ FdoPtr<FdoPropertyDefinitionCollection> props = classDef->GetProperties();
+ for (int k = props->GetCount() - 1; k >= 0; k--)
+ {
+ FdoPtr<FdoPropertyDefinition> prop = props->GetItem(k);
+ // Doing #4
+ if (prop->GetPropertyType() == FdoPropertyType_GeometricProperty)
+ {
+ FdoGeometricPropertyDefinition* pPropGeom = static_cast<FdoGeometricPropertyDefinition*>(prop.p);
+ if (pPropGeom != NULL && pPropGeom->GetSpatialContextAssociation() == NULL)
+ pPropGeom->SetSpatialContextAssociation(pFeat->GetSRS());
+ }
+ }
+ }
+ else
+ classDef->SetIsAbstract(true);
+ }
}// end of for each schema
}
return FDO_SAFE_ADDREF(mSchemas.p);
More information about the fdo-commits
mailing list