[mapguide-commits] r5867 - in trunk/Tools/Maestro: MaestroAPITests
MaestroAPITests/UserTestData OSGeo.MapGuide.MaestroAPI
OSGeo.MapGuide.MaestroAPI/ObjectModels
OSGeo.MapGuide.MaestroAPI/Schema
OSGeo.MapGuide.MaestroAPI/SchemaOverrides
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu May 26 12:37:41 EDT 2011
Author: jng
Date: 2011-05-26 09:37:41 -0700 (Thu, 26 May 2011)
New Revision: 5867
Added:
trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config2.xml
Modified:
trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs
trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/OdbcTableItem.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs
Log:
#1700: Relax the requirement of the fdo: element/attribute qualifier being required for XML configuration documents. Added attached example from the ticket as part of the unit test suite. Also fix class names not being FDO decoded in OdbcTableItem
Modified: trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -40,6 +40,13 @@
}
[Test]
+ public void TestOdbcLoad2()
+ {
+ var conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\odbc_example_config2.xml")) as OdbcConfigurationDocument;
+ Assert.NotNull(conf);
+ }
+
+ [Test]
public void TestOdbcSaveLoad()
{
var schema = new FeatureSchema("Default", "Test schema");
@@ -133,21 +140,23 @@
}
[Test]
- public void TestGdalSaveLoad()
- {
-
- }
-
- [Test]
public void TestWmsLoad()
{
var conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\NASA_WMS_config_doc.xml")) as WmsConfigurationDocument;
Assert.NotNull(conf);
+ }
- conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\wms_config_example1.xml")) as WmsConfigurationDocument;
+ [Test]
+ public void TestWmsLoad2()
+ {
+ var conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\wms_config_example1.xml")) as WmsConfigurationDocument;
Assert.NotNull(conf);
+ }
- conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\wms_config_example2.xml")) as WmsConfigurationDocument;
+ [Test]
+ public void TestWmsLoad3()
+ {
+ var conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\wms_config_example2.xml")) as WmsConfigurationDocument;
Assert.NotNull(conf);
}
Modified: trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj 2011-05-26 16:37:41 UTC (rev 5867)
@@ -591,6 +591,9 @@
<Content Include="UserTestData\odbc_example_config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Content Include="UserTestData\odbc_example_config2.xml">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="UserTestData\wms_config_example1.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Added: trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config2.xml
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config2.xml (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config2.xml 2011-05-26 16:37:41 UTC (rev 5867)
@@ -0,0 +1,656 @@
+<?xml version="1.0" encoding="utf-8"?>
+<fdo:DataStore xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:fds="http://fdo.osgeo.org/schemas/fds">
+ <gml:DerivedCRS gml:id="CSRS.UTM-20N">
+ <gml:remarks>CSRS.UTM-20N</gml:remarks>
+ <gml:srsName>CSRS.UTM-20N</gml:srsName>
+ <!-- TODO: Maestro does not know how to read the coordsys extent -->
+ <gml:validArea>
+ <gml:boundingBox>
+ <gml:pos>0 0</gml:pos>
+ <gml:pos>0 0</gml:pos>
+ </gml:boundingBox>
+ </gml:validArea>
+ <gml:baseCRS>
+ <fdo:WKTCRS gml:id="CSRS.UTM-20N">
+ <gml:srsName>CSRS.UTM-20N</gml:srsName>
+ <fdo:WKT>PROJCS["CSRS.UTM-20N",GEOGCS["LL-CSRS",DATUM["CSRS",SPHEROID["GRS1980",6378137.000,298.25722210]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",500000.000],PARAMETER["false_northing",0.000],PARAMETER["central_meridian",-63.00000000000000],PARAMETER["scale_factor",0.9996],PARAMETER["latitude_of_origin",0.000],UNIT["Meter",1.00000000000000]]</fdo:WKT>
+ </fdo:WKTCRS>
+ </gml:baseCRS>
+ <gml:definedByConversion xlink:href="http://fdo.osgeo.org/coord_conversions#identity" />
+ <gml:derivedCRSType codeSpace="http://fdo.osgeo.org/crs_types">geographic</gml:derivedCRSType>
+ <gml:usesCS xlink:href="http://fdo.osgeo.org/cs#default_cartesian" />
+ </gml:DerivedCRS>
+ <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/Default" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:Fdo="http://fdo.osgeo.org/schemas/feature/Fdo" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:Default="http://fdo.osgeo.org/schemas/feature/Default">
+ <xs:element name="Section_Data" type="Default:Section_DataType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Section_DataKey">
+ <xs:selector xpath=".//Section_Data" />
+ <xs:field xpath="ID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="Section_DataType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SectionID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Station" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Elevation" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Sections" type="Default:SectionsType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="SectionsKey">
+ <xs:selector xpath=".//Sections" />
+ <xs:field xpath="SectionID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="SectionsType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="SectionID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Name" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="River_Chainage" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="StartX" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="StartY" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="EndX" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="EndY" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="ZeroX" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="ZeroY" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="OriginalZeroX" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="OriginalZeroY" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Descriptive_Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Mirror_Old_Data">
+ <xs:simpleType>
+ <xs:restriction base="xs:boolean" />
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Surveys" type="Default:SurveysType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="SurveysKey">
+ <xs:selector xpath=".//Surveys" />
+ <xs:field xpath="SurveyID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="SurveysType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="SurveyID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Date" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Description" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Date_For_Sorting_Only" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:dateTime" />
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Thalweg_Data" type="Default:Thalweg_DataType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Thalweg_DataKey">
+ <xs:selector xpath=".//Thalweg_Data" />
+ <xs:field xpath="ID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="Thalweg_DataType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SectionID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Station" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Elevation" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Volume_Calculations" type="Default:Volume_CalculationsType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Volume_CalculationsKey">
+ <xs:selector xpath=".//Volume_Calculations" />
+ <xs:field xpath="ID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="Volume_CalculationsType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="Digitized_Sections_AvailableType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="Name" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Description" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Survey-x20-Date" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SectionID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="CombinedID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="255" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Section-x20-Data" type="Default:Section-x20-DataType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Section-x20-DataKey">
+ <xs:selector xpath=".//Section-x20-Data" />
+ <xs:field xpath="SectionID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="Section-x20-DataType" abstract="false" hasGeometry="false">
+ <xs:complexContent>
+ <xs:extension base="fdo:ClassType">
+ <xs:sequence>
+ <xs:element name="Station" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Elevation" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SectionID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Name" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Date" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="Survey_TypesType" abstract="false" hasGeometry="false">
+ <xs:sequence>
+ <xs:element name="Location" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="Thalweg_Coordinates" type="Default:Thalweg_CoordinatesType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Thalweg_CoordinatesKey">
+ <xs:selector xpath=".//Thalweg_Coordinates" />
+ <xs:field xpath="ID" />
+ </xs:key>
+ </xs:element>
+ <xs:complexType name="Thalweg_CoordinatesType" abstract="false" hasGeometry="true" geometryName="Geometry">
+ <xs:complexContent>
+ <xs:extension base="gml:AbstractFeatureType">
+ <xs:sequence>
+ <xs:element name="ID" fdo:readOnly="true" fdo:autogenerated="true">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SurveyID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="SectionID" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="fdo:int32" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Station" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Elevation" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:float" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="StaEasting" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="StaNorthing" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:double" />
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Date" minOccurs="0">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:maxLength value="50" />
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:element>
+ <xs:element name="Geometry" type="gml:AbstractGeometryType" hasMeasure="false" hasElevation="false" geometricTypes="point" geometryTypes="point multipoint" />
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <gml:DerivedCRS gml:id="CSRS.UTM-20N">
+ <gml:remarks>CSRS.UTM-20N</gml:remarks>
+ <gml:srsName>CSRS.UTM-20N</gml:srsName>
+ <!-- TODO: Maestro does not know how to read the coordsys extent -->
+ <gml:validArea>
+ <gml:boundingBox>
+ <gml:pos>0 0</gml:pos>
+ <gml:pos>0 0</gml:pos>
+ </gml:boundingBox>
+ </gml:validArea>
+ <gml:baseCRS>
+ <fdo:WKTCRS gml:id="CSRS.UTM-20N">
+ <gml:srsName>CSRS.UTM-20N</gml:srsName>
+ <fdo:WKT>PROJCS["CSRS.UTM-20N",GEOGCS["LL-CSRS",DATUM["CSRS",SPHEROID["GRS1980",6378137.000,298.25722210]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",500000.000],PARAMETER["false_northing",0.000],PARAMETER["central_meridian",-63.00000000000000],PARAMETER["scale_factor",0.9996],PARAMETER["latitude_of_origin",0.000],UNIT["Meter",1.00000000000000]]</fdo:WKT>
+ </fdo:WKTCRS>
+ </gml:baseCRS>
+ <gml:definedByConversion xlink:href="http://fdo.osgeo.org/coord_conversions#identity" xmlns:xlink="http://www.w3.org/1999/xlink" />
+ <gml:derivedCRSType codeSpace="http://fdo.osgeo.org/crs_types">geographic</gml:derivedCRSType>
+ <gml:usesCS xlink:href="http://fdo.osgeo.org/cs#default_cartesian" xmlns:xlink="http://www.w3.org/1999/xlink" />
+ </gml:DerivedCRS>
+ <xs:element name="Digitized_Sections_Available" type="Default:Digitized_Sections_AvailableType" abstract="false" substitutionGroup="gml:_Feature">
+ <xs:key name="Digitized_Sections_AvailableKey">
+ <xs:selector xpath=".//Digitized_Sections_Available" />
+ <xs:field xpath="CombinedID" />
+ </xs:key>
+ </xs:element>
+ </xs:schema>
+ <SchemaMapping xmlns:rdb="http://fdordbms.osgeo.org/schemas" xmlns="http://fdoodbc.osgeo.org/schemas" provider="OSGeo.ODBC.3.5" name="Default">
+ <complexType name="Section_DataType">
+ <Table name="Section_Data" />
+ <element name="ID">
+ <Column name="ID" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="Station">
+ <Column name="Station" />
+ </element>
+ <element name="Elevation">
+ <Column name="Elevation" />
+ </element>
+ </complexType>
+ <complexType name="SectionsType">
+ <Table name="Sections" />
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="Name">
+ <Column name="Name" />
+ </element>
+ <element name="Location">
+ <Column name="Location" />
+ </element>
+ <element name="River_Chainage">
+ <Column name="River_Chainage" />
+ </element>
+ <element name="StartX">
+ <Column name="StartX" />
+ </element>
+ <element name="StartY">
+ <Column name="StartY" />
+ </element>
+ <element name="EndX">
+ <Column name="EndX" />
+ </element>
+ <element name="EndY">
+ <Column name="EndY" />
+ </element>
+ <element name="ZeroX">
+ <Column name="ZeroX" />
+ </element>
+ <element name="ZeroY">
+ <Column name="ZeroY" />
+ </element>
+ <element name="OriginalZeroX">
+ <Column name="OriginalZeroX" />
+ </element>
+ <element name="OriginalZeroY">
+ <Column name="OriginalZeroY" />
+ </element>
+ <element name="Descriptive_Location">
+ <Column name="Descriptive_Location" />
+ </element>
+ <element name="Mirror_Old_Data">
+ <Column name="Mirror_Old_Data" />
+ </element>
+ </complexType>
+ <complexType name="SurveysType">
+ <Table name="Surveys" />
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="Date">
+ <Column name="Date" />
+ </element>
+ <element name="Description">
+ <Column name="Description" />
+ </element>
+ <element name="Location">
+ <Column name="Location" />
+ </element>
+ <element name="Date_For_Sorting_Only">
+ <Column name="Date_For_Sorting_Only" />
+ </element>
+ </complexType>
+ <complexType name="Thalweg_DataType">
+ <Table name="Thalweg_Data" />
+ <element name="ID">
+ <Column name="ID" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="Station">
+ <Column name="Station" />
+ </element>
+ <element name="Elevation">
+ <Column name="Elevation" />
+ </element>
+ </complexType>
+ <complexType name="Volume_CalculationsType">
+ <Table name="Volume_Calculations" />
+ <element name="ID">
+ <Column name="ID" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ </complexType>
+ <complexType name="Digitized_Sections_AvailableType">
+ <Table name="Digitized_Sections_Available" />
+ <element name="Name">
+ <Column name="Name" />
+ </element>
+ <element name="Description">
+ <Column name="Description" />
+ </element>
+ <element name="Location">
+ <Column name="Location" />
+ </element>
+ <element name="Survey-x20-Date">
+ <Column name="Survey-x20-Date" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="CombinedID">
+ <Column name="CombinedID" />
+ </element>
+ </complexType>
+ <complexType name="Section-x20-DataType">
+ <Table name="Section-x20-Data" />
+ <element name="Station">
+ <Column name="Station" />
+ </element>
+ <element name="Elevation">
+ <Column name="Elevation" />
+ </element>
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="Name">
+ <Column name="Name" />
+ </element>
+ <element name="Location">
+ <Column name="Location" />
+ </element>
+ <element name="Date">
+ <Column name="Date" />
+ </element>
+ </complexType>
+ <complexType name="Survey_TypesType">
+ <Table name="Survey_Types" />
+ <element name="Location">
+ <Column name="Location" />
+ </element>
+ </complexType>
+ <complexType name="Thalweg_CoordinatesType">
+ <Table name="Thalweg_Coordinates" />
+ <element name="ID">
+ <Column name="ID" />
+ </element>
+ <element name="SurveyID">
+ <Column name="SurveyID" />
+ </element>
+ <element name="SectionID">
+ <Column name="SectionID" />
+ </element>
+ <element name="Station">
+ <Column name="Station" />
+ </element>
+ <element name="Elevation">
+ <Column name="Elevation" />
+ </element>
+ <element name="StaEasting">
+ <Column name="StaEasting" />
+ </element>
+ <element name="StaNorthing">
+ <Column name="StaNorthing" />
+ </element>
+ <element name="Date">
+ <Column name="Date" />
+ </element>
+ <element name="Geometry" xColumnName="StaEasting" yColumnName="StaNorthing" zColumnName="Elevation" />
+ </complexType>
+ </SchemaMapping>
+</fdo:DataStore>
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -23,6 +23,7 @@
using System.Xml.Serialization;
using OSGeo.MapGuide.MaestroAPI.Schema;
using System.Globalization;
+using OSGeo.MapGuide.MaestroAPI;
namespace OSGeo.MapGuide.ObjectModels.Common
{
@@ -190,9 +191,9 @@
{
var genMeta = meta["gml:GenericMetaData"];
- var scType = genMeta["fdo:SCExtentType"];
- var xyTol = genMeta["fdo:XYTolerance"];
- var zTol = genMeta["fdo:ZTolerance"];
+ var scType = Utility.GetFdoElement(genMeta, "SCExtentType");
+ var xyTol = Utility.GetFdoElement(genMeta, "XYTolerance");
+ var zTol = Utility.GetFdoElement(genMeta, "ZTolerance");
//this.ExtentType = (scType == null || scType.InnerText == "dynamic") ? FdoSpatialContextListSpatialContextExtentType.Dynamic : FdoSpatialContextListSpatialContextExtentType.Static;
@@ -254,11 +255,13 @@
this.CoordinateSystemName = href.Substring(href.LastIndexOf("#") + 1);
}
- if (baseCrs["fdo:WKTCRS"] != null)
+ var wktCrs = Utility.GetFdoElement(baseCrs, "WKTCRS");
+ if (wktCrs != null)
{
- if (baseCrs["fdo:WKTCRS"]["fdo:WKT"] != null)
+ var wkt = Utility.GetFdoElement(wktCrs, "WKT");
+ if (wkt != null)
{
- this.CoordinateSystemWkt = baseCrs["fdo:WKTCRS"]["fdo:WKT"].InnerText;
+ this.CoordinateSystemWkt = wkt.InnerText;
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -421,7 +421,8 @@
}
//Set designated geometry property
- var geom = node.Attributes["fdo:geometryName"];
+ var geom = Utility.GetFdoAttribute(node, "geometryName");
+
if (geom != null)
this.DefaultGeometryPropertyName = geom.Value;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -188,10 +188,13 @@
public override void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
{
+ var ro = Utility.GetFdoAttribute(node, "readOnly");
+ var autogen = Utility.GetFdoAttribute(node, "autogenerated");
+
this.DataType = GetDataType(node["xs:simpleType"]["xs:restriction"].Attributes["base"].Value.ToLower());
this.IsNullable = (node.Attributes["minOccurs"] != null && node.Attributes["minOccurs"].Value == "0");
- this.IsReadOnly = (node.Attributes["fdo:readOnly"] != null && node.Attributes["fdo:readOnly"].Value == "true");
- this.IsAutoGenerated = (node.Attributes["fdo:autogenerated"] != null && node.Attributes["fdo:autogenerated"].Value == "true");
+ this.IsReadOnly = (ro != null && ro.Value == "true");
+ this.IsAutoGenerated = (autogen != null && autogen.Value == "true");
this.DefaultValue = (node.Attributes["default"] != null ? node.Attributes["default"].Value : string.Empty);
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -226,12 +226,12 @@
public override void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
{
- var gt = node.Attributes["fdo:geometricTypes"];
- var gt2 = node.Attributes["fdo:geometryTypes"];
- var gtro = node.Attributes["fdo:geometryReadOnly"];
- var hms = node.Attributes["fdo:hasMeasure"];
- var hev = node.Attributes["fdo:hasElevation"];
- var srs = node.Attributes["fdo:srsName"];
+ var gt = Utility.GetFdoAttribute(node, "geometricTypes");
+ var gt2 = Utility.GetFdoAttribute(node, "geometryTypes");
+ var gtro = Utility.GetFdoAttribute(node, "geometryReadOnly");
+ var hms = Utility.GetFdoAttribute(node, "hasMeasure");
+ var hev = Utility.GetFdoAttribute(node, "hasElevation");
+ var srs = Utility.GetFdoAttribute(node, "srsName");
this.GeometricTypes = ProcessGeometricTypes(gt.Value);
if (gt2 != null)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -82,9 +82,10 @@
public override void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
{
- var dix = node.Attributes["fdo:defaultImageXSize"];
- var diy = node.Attributes["fdo:defaultImageYSize"];
- var srs = node.Attributes["fdo:srsName"];
+ var dix = Utility.GetFdoAttribute(node, "defaultImageXSize");
+ var diy = Utility.GetFdoAttribute(node, "defaultImageYSize");
+ var srs = Utility.GetFdoAttribute(node, "srsName");
+ var ro = Utility.GetFdoAttribute(node, "readOnly");
this.DefaultImageXSize = Convert.ToInt32(dix.Value);
this.DefaultImageYSize = Convert.ToInt32(diy.Value);
@@ -92,7 +93,7 @@
//TODO: Just copypasta'd from DataPropertyDefinition assuming the same attributes would be used
//to indicate nullability and read-only states. Would be nice to verify with an actual example property
this.IsNullable = (node.Attributes["minOccurs"] != null && node.Attributes["minOccurs"].Value == "0");
- this.IsReadOnly = (node.Attributes["fdo:readOnly"] != null && node.Attributes["fdo:readOnly"].Value == "true");
+ this.IsReadOnly = (ro != null && ro.Value == "true");
this.SpatialContextAssociation = (srs != null ? srs.Value : string.Empty);
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/OdbcTableItem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/OdbcTableItem.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/OdbcTableItem.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -123,7 +123,7 @@
this.SchemaName = sn.Value;
var cn = node.Attributes["name"];
- this.ClassName = cn.Value.Substring(0, cn.Value.Length - "Type".Length);
+ this.ClassName = Utility.DecodeFDOName(cn.Value.Substring(0, cn.Value.Length - "Type".Length));
var cls = this.Parent.GetClass(this.SchemaName, this.ClassName);
if (!string.IsNullOrEmpty(cls.DefaultGeometryPropertyName))
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs 2011-05-26 12:55:33 UTC (rev 5866)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Utility.cs 2011-05-26 16:37:41 UTC (rev 5867)
@@ -26,6 +26,7 @@
using System.Collections.Specialized;
using OSGeo.MapGuide.MaestroAPI.CoordinateSystem;
using OSGeo.MapGuide.ObjectModels;
+using System.Xml;
namespace OSGeo.MapGuide.MaestroAPI
{
@@ -712,5 +713,36 @@
return null;
}
}
+
+ /// <summary>
+ /// Gets an fdo-related attribute from the specified xml element using the
+ /// unqualified name and trying again with the fdo: qualifier if it didn't exist
+ /// </summary>
+ /// <param name="node"></param>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ internal static XmlAttribute GetFdoAttribute(XmlNode node, string name)
+ {
+ var att = node.Attributes[name];
+ if (att == null)
+ return node.Attributes["fdo:" + name];
+
+ return att;
+ }
+
+ /// <summary>
+ /// Gets an fdo-related element from the specified xml element using the
+ /// unqualified name and trying again with the fdo: qualifier if it didn't exist
+ /// </summary>
+ /// <param name="el"></param>
+ /// <param name="name"></param>
+ /// <returns></returns>
+ internal static XmlElement GetFdoElement(XmlElement el, string name)
+ {
+ var element = el[name];
+ if (element == null)
+ return el["fdo:" + name];
+ return element;
+ }
}
}
More information about the mapguide-commits
mailing list