[mapguide-commits] r5273 - in sandbox/maestro-3.0:
Maestro.Base/Editor Maestro.Base/UI Maestro.Editors
Maestro.Editors/Common Maestro.Editors/FeatureSource
Maestro.Editors/FeatureSource/Extensions
Maestro.Editors/LayerDefinition
Maestro.Editors/LayerDefinition/Vector
Maestro.Editors/LayerDefinition/Vector/StyleEditors
Maestro.Editors/LayerDefinition/Vector/Thematics
Maestro.Editors/WebLayout/Commands Maestro.ResourceValidation
OSGeo.MapGuide.MaestroAPI OSGeo.MapGuide.MaestroAPI/Commands
OSGeo.MapGuide.MaestroAPI/Feature
OSGeo.MapGuide.MaestroAPI/ObjectModels
OSGeo.MapGuide.MaestroAPI/Resource
OSGeo.MapGuide.MaestroAPI/Services OSGeo.MapGuide.MaestroAPI.Http
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Oct 12 00:35:24 EDT 2010
Author: jng
Date: 2010-10-11 21:35:24 -0700 (Mon, 11 Oct 2010)
New Revision: 5273
Added:
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/ClassDefinition.cs
Modified:
sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs
sandbox/maestro-3.0/Maestro.Base/UI/ResourcePropertiesDialog.cs
sandbox/maestro-3.0/Maestro.Editors/Common/ExpressionEditor.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs
sandbox/maestro-3.0/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
sandbox/maestro-3.0/Maestro.ResourceValidation/FeatureSourceValidator.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureSetReader.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSetReader.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSourceDescription.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Resource/BaseLayerDefinitionValidator.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs
sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
Log:
3.0 sandbox changes:
- Rename FeatureSourceSchema to ClassDefinition to better reflect FDO terminology.
- Also clean up the naming of some of the properties in this class.
Modified: sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Base/Editor/ResourceEditorService.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -52,7 +52,7 @@
public event EventHandler DirtyStateChanged;
- public string EditExpression(string currentExpr, OSGeo.MapGuide.MaestroAPI.FeatureSourceDescription.FeatureSourceSchema schema, string providerName, string featureSourceId)
+ public string EditExpression(string currentExpr, OSGeo.MapGuide.MaestroAPI.ClassDefinition schema, string providerName, string featureSourceId)
{
var ed = new ExpressionEditor();
var caps = this.FeatureService.GetProviderCapabilities(providerName);
Modified: sandbox/maestro-3.0/Maestro.Base/UI/ResourcePropertiesDialog.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Base/UI/ResourcePropertiesDialog.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Base/UI/ResourcePropertiesDialog.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -866,7 +866,7 @@
bool failures = false;
Envelope env = null;
- foreach (FeatureSourceDescription.FeatureSourceSchema scm in fs.Describe().Schemas)
+ foreach (ClassDefinition scm in fs.Describe().Classes)
{
foreach (FeatureSetColumn col in scm.Columns)
{
Modified: sandbox/maestro-3.0/Maestro.Editors/Common/ExpressionEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/Common/ExpressionEditor.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/Common/ExpressionEditor.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -72,7 +72,7 @@
public partial class ExpressionEditor : Form
{
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private IFeatureService _featSvc;
private string m_featureSource = null;
@@ -89,7 +89,7 @@
set { ExpressionText.Text = value; }
}
- public void Initialize(IFeatureService featSvc, FdoProviderCapabilities caps, FeatureSourceDescription.FeatureSourceSchema schema, string featuresSourceId)
+ public void Initialize(IFeatureService featSvc, FdoProviderCapabilities caps, ClassDefinition schema, string featuresSourceId)
{
try
{
@@ -751,7 +751,7 @@
try
{
retry = false;
- using (FeatureSetReader rd = _featSvc.QueryFeatureSource(m_featureSource, m_schema.FullnameDecoded, filter, new string[] { ColumnName.Text }))
+ using (FeatureSetReader rd = _featSvc.QueryFeatureSource(m_featureSource, m_schema.QualifiedNameDecoded, filter, new string[] { ColumnName.Text }))
{
while (rd.Read())
{
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/CalculationSettings.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -38,10 +38,10 @@
}
private IEditorService _edSvc;
- private FeatureSourceDescription.FeatureSourceSchema _cls;
+ private ClassDefinition _cls;
private IFeatureSource _parent;
- public CalculationSettings(IEditorService edSvc, FeatureSourceDescription.FeatureSourceSchema cls, IFeatureSource parent, ICalculatedProperty calc)
+ public CalculationSettings(IEditorService edSvc, ClassDefinition cls, IFeatureSource parent, ICalculatedProperty calc)
: this()
{
_edSvc = edSvc;
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/ExtendedClassSettings.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -37,7 +37,7 @@
InitializeComponent();
}
- public ExtendedClassSettings(FeatureSourceDescription.FeatureSourceSchema[] classes, IFeatureSourceExtension ext)
+ public ExtendedClassSettings(ClassDefinition[] classes, IFeatureSourceExtension ext)
: this()
{
cmbBaseClass.DisplayMember = "Fullname";
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/Extensions/JoinSettings.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -91,9 +91,9 @@
if (rt == ResourceTypes.FeatureSource)
{
var fs = _edSvc.FeatureService.DescribeFeatureSource(txtFeatureSource.Text);
- cmbFeatureClass.DataSource = fs.Schemas;
+ cmbFeatureClass.DataSource = fs.Classes;
- if (fs.Schemas.Length > 0)
+ if (fs.Classes.Length > 0)
{
cmbFeatureClass.SelectedIndex = 0;
UpdateSecondary();
@@ -168,7 +168,7 @@
if (!_init)
_rel.RemoveAllRelateProperties();
- var item = cmbFeatureClass.SelectedItem as FeatureSourceDescription.FeatureSourceSchema;
+ var item = cmbFeatureClass.SelectedItem as ClassDefinition;
if (item != null)
{
cmbSecondary.DisplayMember = "Name";
Modified: sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/FeatureSource/ExtensionsCtrl.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -317,7 +317,7 @@
var calc = e.Node.Tag as ICalculatedProperty;
if (ext != null)
{
- var ctl = new ExtendedClassSettings(CachedSchema().Schemas, ext);
+ var ctl = new ExtendedClassSettings(CachedSchema().Classes, ext);
ctl.Dock = DockStyle.Fill;
//If editing to something valid, update the toolbar
ctl.ResourceChanged += (s, evt) =>
@@ -335,10 +335,10 @@
ext = e.Node.Parent.Tag as IFeatureSourceExtension;
if (ext != null)
{
- FeatureSourceDescription.FeatureSourceSchema cls = null;
- foreach (var c in CachedSchema().Schemas)
+ ClassDefinition cls = null;
+ foreach (var c in CachedSchema().Classes)
{
- if (c.Fullname == ext.FeatureClass)
+ if (c.QualifiedName == ext.FeatureClass)
{
cls = c;
break;
@@ -360,10 +360,10 @@
ext = e.Node.Parent.Tag as IFeatureSourceExtension;
if (ext != null)
{
- FeatureSourceDescription.FeatureSourceSchema cls = null;
- foreach (var c in CachedSchema().Schemas)
+ ClassDefinition cls = null;
+ foreach (var c in CachedSchema().Classes)
{
- if (c.Fullname == ext.FeatureClass)
+ if (c.QualifiedName == ext.FeatureClass)
{
cls = c;
break;
Modified: sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/IEditorService.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -113,7 +113,7 @@
/// <param name="providerName"></param>
/// <param name="featureSourceId"></param>
/// <returns></returns>
- string EditExpression(string currentExpr, FeatureSourceDescription.FeatureSourceSchema schema, string providerName, string featureSourceId);
+ string EditExpression(string currentExpr, ClassDefinition schema, string providerName, string featureSourceId);
/// <summary>
/// Gets the resource ID of the resource, whose session-copy is being edited
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/LayerPropertiesSectionCtrl.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -72,9 +72,9 @@
private void PopulatePropertyList()
{
var desc = _edsvc.FeatureService.DescribeFeatureSource(_vl.ResourceId);
- foreach (var sc in desc.Schemas)
+ foreach (var sc in desc.Classes)
{
- if (sc.Fullname == _vl.FeatureName)
+ if (sc.QualifiedName == _vl.FeatureName)
{
grdProperties.Rows.Clear();
foreach (var col in sc.Columns)
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/AreaFeatureStyleEditor.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -70,12 +70,12 @@
public event EventHandler Changed;
private IEditorService m_editor;
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private string m_featureSource;
private string m_providername;
private ILayerElementFactory _factory;
- public AreaFeatureStyleEditor(IEditorService editor, FeatureSourceDescription.FeatureSourceSchema schema, string featureSource)
+ public AreaFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
: this()
{
m_editor = editor;
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/FontStyleEditor.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -103,13 +103,13 @@
public event EventHandler Changed;
private IEditorService m_editor;
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private string m_featureSource;
private string m_providername;
private ILayerElementFactory _factory;
- public FontStyleEditor(IEditorService editor, FeatureSourceDescription.FeatureSourceSchema schema, string featureSource)
+ public FontStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
: this()
{
m_editor = editor;
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/LineFeatureStyleEditor.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -73,12 +73,12 @@
public event EventHandler Changed;
private IEditorService m_editor;
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private string m_featureSource;
private string m_providername;
private ILayerElementFactory _factory;
- public LineFeatureStyleEditor(IEditorService editor, FeatureSourceDescription.FeatureSourceSchema schema, string featureSource, ILayerElementFactory factory)
+ public LineFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource, ILayerElementFactory factory)
: this()
{
m_editor = editor;
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/StyleEditors/PointFeatureStyleEditor.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -109,12 +109,12 @@
public event EventHandler Changed;
private IEditorService m_editor;
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private string m_featureSource;
private string m_providername;
private ILayerElementFactory _factory;
- public PointFeatureStyleEditor(IEditorService editor, FeatureSourceDescription.FeatureSourceSchema schema, string featureSource)
+ public PointFeatureStyleEditor(IEditorService editor, ClassDefinition schema, string featureSource)
: this()
{
m_editor = editor;
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/Thematics/ThemeCreator.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -45,7 +45,7 @@
private IEditorService m_editor;
private ILayerDefinition m_layer;
- private FeatureSourceDescription.FeatureSourceSchema m_schema;
+ private ClassDefinition m_schema;
private Dictionary<object, long> m_values;
private Type m_dataType;
@@ -77,7 +77,7 @@
private ILayerElementFactory _factory;
- public ThemeCreator(IEditorService editor, ILayerDefinition layer, FeatureSourceDescription.FeatureSourceSchema schema, object ruleCollection)
+ public ThemeCreator(IEditorService editor, ILayerDefinition layer, ClassDefinition schema, object ruleCollection)
: this()
{
m_editor = editor;
@@ -232,7 +232,7 @@
try
{
IVectorLayerDefinition vl = (IVectorLayerDefinition)m_layer.SubLayer;
- using (FeatureSetReader rd = m_editor.FeatureService.QueryFeatureSource(vl.ResourceId, m_schema.FullnameDecoded, filter, new string[] { col.Name }))
+ using (FeatureSetReader rd = m_editor.FeatureService.QueryFeatureSource(vl.ResourceId, m_schema.QualifiedNameDecoded, filter, new string[] { col.Name }))
{
while (rd.Read() && m_values.Count < 100000) //No more than 100.000 records in memory
{
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/Vector/VectorLayerSettingsSectionCtrl.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -89,9 +89,9 @@
{
_cachedDesc = _edsvc.FeatureService.DescribeFeatureSource(txtFeatureSource.Text);
List<string> schemas = new List<string>();
- foreach (var sc in _cachedDesc.Schemas)
+ foreach (var sc in _cachedDesc.Classes)
{
- schemas.Add(sc.Fullname);
+ schemas.Add(sc.QualifiedName);
}
cmbSchema.DataSource = schemas;
}
@@ -101,9 +101,9 @@
if (cmbSchema.SelectedItem != null)
{
var name = cmbSchema.SelectedItem.ToString();
- foreach (var sc in _cachedDesc.Schemas)
+ foreach (var sc in _cachedDesc.Classes)
{
- if (name == sc.Fullname)
+ if (name == sc.QualifiedName)
{
List<string> geoms = new List<string>();
foreach (var col in sc.Columns)
@@ -134,13 +134,13 @@
get { return txtFeatureSource.Text; }
}
- internal FeatureSourceDescription.FeatureSourceSchema GetSelectedClass()
+ internal ClassDefinition GetSelectedClass()
{
if (cmbSchema.SelectedItem != null)
{
- foreach (var schema in _cachedDesc.Schemas)
+ foreach (var schema in _cachedDesc.Classes)
{
- if (schema.Fullname == cmbSchema.SelectedItem.ToString())
+ if (schema.QualifiedName == cmbSchema.SelectedItem.ToString())
{
return schema;
}
Modified: sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/LayerDefinition/VectorLayerEditorCtrl.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -62,7 +62,7 @@
}
- internal FeatureSourceDescription.FeatureSourceSchema Schema
+ internal ClassDefinition Schema
{
get { return resSettings.GetSelectedClass(); }
}
Modified: sandbox/maestro-3.0/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.Editors/WebLayout/Commands/SearchCmdCtrl.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -44,7 +44,7 @@
private IEditorService _edsvc;
private WebLayoutType _wl;
private OSGeo.MapGuide.ObjectModels.WebLayout.SearchCommandType _cmd;
- private FeatureSourceDescription.FeatureSourceSchema _cls;
+ private ClassDefinition _cls;
private bool _init = true;
Modified: sandbox/maestro-3.0/Maestro.ResourceValidation/FeatureSourceValidator.cs
===================================================================
--- sandbox/maestro-3.0/Maestro.ResourceValidation/FeatureSourceValidator.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/Maestro.ResourceValidation/FeatureSourceValidator.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -67,7 +67,7 @@
try
{
fsd = feature.Describe();
- if (fsd == null || fsd.Schemas == null || fsd.Schemas.Length == 0)
+ if (fsd == null || fsd.Classes == null || fsd.Classes.Length == 0)
issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, Properties.Resources.FS_SchemasMissingWarning));
}
catch (Exception ex)
@@ -77,7 +77,7 @@
}
- foreach (var cl in fsd.Schemas)
+ foreach (var cl in fsd.Classes)
{
string[] ids = cl.GetIdentityProperties();
if (ids == null || ids.Length == 0)
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Commands/ExecuteLoadProcedure.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -341,15 +341,15 @@
//Step 1: Describe the schema
FeatureSourceDescription desc = this.Parent.FeatureService.DescribeFeatureSource(fsId);
- if (desc.Schemas.Length > 0)
+ if (desc.Classes.Length > 0)
{
//Step 2: Find the first feature class with a geometry property
- FeatureSourceDescription.FeatureSourceSchema clsDef = null;
+ ClassDefinition clsDef = null;
FeatureSetColumn geom = null;
bool done = false;
- foreach (FeatureSourceDescription.FeatureSourceSchema cls in desc.Schemas)
+ foreach (ClassDefinition cls in desc.Classes)
{
if (done) break;
@@ -374,7 +374,7 @@
ld.ResourceID = lyrId;
var vld = ld.SubLayer as IVectorLayerDefinition;
vld.ResourceId = fsId;
- vld.FeatureName = clsDef.FullnameDecoded;
+ vld.FeatureName = clsDef.QualifiedNameDecoded;
vld.Geometry = geom.Name;
//Step 4: Infer geometry storage support and remove unsupported styles
@@ -568,15 +568,15 @@
//Step 1: Describe the schema
FeatureSourceDescription desc = this.Parent.FeatureService.DescribeFeatureSource(fsId);
- if (desc.Schemas.Length > 0)
+ if (desc.Classes.Length > 0)
{
//Step 2: Find the first feature class with a geometry property
- FeatureSourceDescription.FeatureSourceSchema clsDef = null;
+ ClassDefinition clsDef = null;
FeatureSetColumn geom = null;
bool done = false;
- foreach (FeatureSourceDescription.FeatureSourceSchema cls in desc.Schemas)
+ foreach (ClassDefinition cls in desc.Classes)
{
if (done) break;
@@ -601,7 +601,7 @@
ld.ResourceID = lyrId;
var vld = ld.SubLayer as IVectorLayerDefinition;
vld.ResourceId = fsId;
- vld.FeatureName = clsDef.Fullname;
+ vld.FeatureName = clsDef.QualifiedName;
vld.Geometry = geom.Name;
//Step 4: Infer geometry storage support and remove unsupported styles
Added: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/ClassDefinition.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/ClassDefinition.cs (rev 0)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/ClassDefinition.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -0,0 +1,138 @@
+#region Disclaimer / License
+// Copyright (C) 2009, Kenneth Skovhede
+// http://www.hexad.dk, opensource at hexad.dk
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+//
+#endregion
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OSGeo.MapGuide.MaestroAPI
+{
+ public class ClassDefinition
+ {
+ private string m_name;
+ private string m_schema;
+ private FeatureSetColumn[] m_columns;
+
+ internal ClassDefinition(XmlNode node, XmlNamespaceManager mgr)
+ {
+ XmlNode root = node.ParentNode;
+ if (root.NodeType == XmlNodeType.XmlDeclaration)
+ root = root.NextSibling;
+ m_schema = root.Attributes["targetNamespace"] == null ? null : root.Attributes["targetNamespace"].Value;
+ if (m_schema != null && m_schema.IndexOf("/") > 0)
+ m_schema = m_schema.Substring(m_schema.LastIndexOf("/") + 1);
+ m_name = node.Attributes["name"].Value;
+ if (m_name.EndsWith("Type"))
+ m_name = m_name.Substring(0, m_name.Length - "Type".Length);
+
+ XmlNodeList lst;
+ if (node.ChildNodes.Count == 0)
+ {
+ m_columns = new FeatureSetColumn[0];
+ return;
+ }
+ else if (node.FirstChild.Name == "xs:sequence")
+ lst = node.SelectNodes("xs:sequence/xs:element", mgr);
+ else
+ lst = node.SelectNodes("xs:complexContent/xs:extension/xs:sequence/xs:element", mgr);
+
+
+ m_columns = new FeatureSetColumn[lst.Count];
+ for (int i = 0; i < lst.Count; i++)
+ m_columns[i] = new ClassPropertyColumn(lst[i]);
+
+ XmlNode extension = node.SelectSingleNode("xs:complexContent/xs:extension", mgr);
+ if (extension != null && extension.Attributes["base"] != null)
+ {
+ string extTypeName = extension.Attributes["base"].Value;
+ extTypeName = extTypeName.Substring(extTypeName.IndexOf(":") + 1);
+
+ XmlNode baseEl = node.ParentNode.SelectSingleNode("xs:complexType[@name='" + extTypeName + "']", mgr);
+ if (baseEl != null)
+ {
+ ClassDefinition tmpScm = new ClassDefinition(baseEl, mgr);
+ FeatureSetColumn[] tmpCol = new FeatureSetColumn[m_columns.Length + tmpScm.m_columns.Length];
+ Array.Copy(m_columns, tmpCol, m_columns.Length);
+ Array.Copy(tmpScm.m_columns, 0, tmpCol, m_columns.Length, tmpScm.m_columns.Length);
+ m_columns = tmpCol;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets the name of this class definition
+ /// </summary>
+ public string Name { get { return m_name; } }
+
+ /// <summary>
+ /// Gets the name of the schema which this class definition belongs to
+ /// </summary>
+ public string SchemaName { get { return m_schema; } }
+
+ /// <summary>
+ /// Gets the fully qualified name of this class definition ([schema_name]:[name])
+ /// </summary>
+ public string QualifiedName { get { return m_schema == null ? m_name : m_schema + ":" + m_name; } }
+
+ /// <summary>
+ /// Gets the decoded fully qualified name of this class definition ([schema_name]:[name])
+ /// </summary>
+ public string QualifiedNameDecoded { get { return Utility.DecodeFDOName(this.QualifiedName); } }
+
+ /// <summary>
+ /// Gets an array of columns defining the properties in this class definition
+ /// </summary>
+ public FeatureSetColumn[] Columns { get { return m_columns; } }
+
+ public override string ToString()
+ {
+ return this.QualifiedNameDecoded;
+ }
+
+ internal void MarkIdentityProperties(IEnumerable<string> keyFieldNames)
+ {
+ foreach (var name in keyFieldNames)
+ {
+ foreach (var col in m_columns)
+ {
+ if (col.Name.Equals(name))
+ {
+ col.IsIdentity = true;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets an array of names of the identity properties
+ /// </summary>
+ /// <returns></returns>
+ public string[] GetIdentityProperties()
+ {
+ List<string> keys = new List<string>();
+ foreach (var col in m_columns)
+ {
+ if (col.IsIdentity)
+ keys.Add(col.Name);
+ }
+ return keys.ToArray();
+ }
+ }
+}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSetReader.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSetReader.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSetReader.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -304,6 +304,8 @@
public class GeometryMetadata
{
+ public const string SPATIAL_CONTEXT = "SPATIAL_CONTEXT";
+
public const string GEOM_TYPES = "GEOM_TYPES";
public const string GEOM_TYPE_POINT = "point";
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSourceDescription.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSourceDescription.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Feature/FeatureSourceDescription.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -35,7 +35,7 @@
/// </summary>
public class FeatureSourceDescription
{
- private FeatureSourceSchema[] m_schemas;
+ private ClassDefinition[] m_schemas;
public FeatureSourceDescription(System.IO.Stream stream)
{
@@ -59,13 +59,13 @@
mgr.AddNamespace("fdo", "http://fdo.osgeo.org/schemas");
var keys = new Dictionary<string, string[]>();
- var classMap = new Dictionary<string, FeatureSourceSchema>();
+ var classMap = new Dictionary<string, ClassDefinition>();
XmlNodeList lst = root.SelectNodes("xs:schema/xs:complexType[@abstract='false']", mgr);
- m_schemas = new FeatureSourceSchema[lst.Count];
+ m_schemas = new ClassDefinition[lst.Count];
for (int i = 0; i < m_schemas.Length; i++)
{
- m_schemas[i] = new FeatureSourceSchema(lst[i], mgr);
- classMap.Add(m_schemas[i].FullnameDecoded, m_schemas[i]);
+ m_schemas[i] = new ClassDefinition(lst[i], mgr);
+ classMap.Add(m_schemas[i].QualifiedNameDecoded, m_schemas[i]);
}
XmlNodeList keyNodes = root.SelectNodes("xs:schema/xs:element[@abstract='false']", mgr);
foreach (XmlNode keyNode in keyNodes)
@@ -95,10 +95,10 @@
}
}
- public FeatureSourceSchema[] Schemas { get { return m_schemas; } }
+ public ClassDefinition[] Classes { get { return m_schemas; } }
- public FeatureSourceSchema this[int index] { get { return m_schemas[index]; } }
- public FeatureSourceSchema this[string index]
+ public ClassDefinition this[int index] { get { return m_schemas[index]; } }
+ public ClassDefinition this[string index]
{
get
{
@@ -109,97 +109,10 @@
throw new OverflowException("No such item found: " + index);
}
}
-
- public class FeatureSourceSchema
- {
- private string m_name;
- private string m_schema;
- private FeatureSetColumn[] m_columns;
-
- public FeatureSourceSchema(XmlNode node, XmlNamespaceManager mgr)
- {
- XmlNode root = node.ParentNode;
- if (root.NodeType == XmlNodeType.XmlDeclaration)
- root = root.NextSibling;
- m_schema = root.Attributes["targetNamespace"] == null ? null : root.Attributes["targetNamespace"].Value;
- if (m_schema != null && m_schema.IndexOf("/") > 0)
- m_schema = m_schema.Substring(m_schema.LastIndexOf("/") + 1);
- m_name = node.Attributes["name"].Value;
- if (m_name.EndsWith("Type"))
- m_name = m_name.Substring(0, m_name.Length - "Type".Length);
-
- XmlNodeList lst;
- if (node.ChildNodes.Count == 0)
- {
- m_columns = new FeatureSetColumn[0];
- return;
- }
- else if (node.FirstChild.Name == "xs:sequence")
- lst = node.SelectNodes("xs:sequence/xs:element", mgr);
- else
- lst = node.SelectNodes("xs:complexContent/xs:extension/xs:sequence/xs:element", mgr);
-
-
- m_columns = new FeatureSetColumn[lst.Count];
- for(int i = 0;i<lst.Count;i++)
- m_columns[i] = new ClassPropertyColumn(lst[i]);
-
- XmlNode extension = node.SelectSingleNode("xs:complexContent/xs:extension", mgr);
- if (extension != null && extension.Attributes["base"] != null)
- {
- string extTypeName = extension.Attributes["base"].Value;
- extTypeName = extTypeName.Substring(extTypeName.IndexOf(":") + 1);
-
- XmlNode baseEl = node.ParentNode.SelectSingleNode("xs:complexType[@name='" + extTypeName + "']", mgr);
- if (baseEl != null)
- {
- FeatureSourceSchema tmpScm = new FeatureSourceSchema(baseEl, mgr);
- FeatureSetColumn[] tmpCol = new FeatureSetColumn[m_columns.Length + tmpScm.m_columns.Length];
- Array.Copy(m_columns, tmpCol, m_columns.Length);
- Array.Copy(tmpScm.m_columns, 0, tmpCol, m_columns.Length, tmpScm.m_columns.Length);
- m_columns = tmpCol;
- }
- }
- }
-
- public string Name { get { return m_name; } }
- public string Schema { get { return m_schema; } }
- public string Fullname { get { return m_schema == null ? m_name : m_schema + ":" + m_name; } }
- public string FullnameDecoded { get { return Utility.DecodeFDOName(this.Fullname); } }
- public FeatureSetColumn[] Columns { get { return m_columns; } }
-
- public override string ToString()
- {
- return this.FullnameDecoded;
- }
-
- internal void MarkIdentityProperties(IEnumerable<string> keyFieldNames)
- {
- foreach (var name in keyFieldNames)
- {
- foreach (var col in m_columns)
- {
- if (col.Name.Equals(name))
- {
- col.IsIdentity = true;
- }
- }
- }
- }
-
- public string[] GetIdentityProperties()
- {
- List<string> keys = new List<string>();
- foreach (var col in m_columns)
- {
- if (col.IsIdentity)
- keys.Add(col.Name);
- }
- return keys.ToArray();
- }
- }
}
+
+
internal class ClassPropertyColumn : FeatureSetColumn
{
internal ClassPropertyColumn(XmlNode node)
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2010-10-12 04:35:24 UTC (rev 5273)
@@ -172,6 +172,7 @@
<Compile Include="Exceptions\SerializationException.cs" />
<Compile Include="Exceptions\UnsupportedResourceTypeException.cs" />
<Compile Include="Exceptions\UnsupportedServiceTypeException.cs" />
+ <Compile Include="Feature\ClassDefinition.cs" />
<Compile Include="IConnectionCapabilities.cs" />
<Compile Include="MaestroApiProviderAttribute.cs" />
<Compile Include="ConnectionProviderRegistry.cs" />
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ObjectModels/FeatureSourceInterfaces.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -240,7 +240,7 @@
/// </summary>
/// <param name="qualifiedName"></param>
/// <returns></returns>
- public static FeatureSourceDescription.FeatureSourceSchema GetClass(this IFeatureSource fs, string qualifiedName)
+ public static ClassDefinition GetClass(this IFeatureSource fs, string qualifiedName)
{
Check.NotNull(fs, "fs");
return fs.CurrentConnection.FeatureService.GetFeatureSourceSchema(fs.ResourceID, qualifiedName);
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Resource/BaseLayerDefinitionValidator.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Resource/BaseLayerDefinitionValidator.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Resource/BaseLayerDefinitionValidator.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -122,8 +122,8 @@
bool foundGeometry = false;
FeatureSourceDescription desc = fs.Describe();
- foreach (FeatureSourceDescription.FeatureSourceSchema scm in desc.Schemas)
- if (scm.FullnameDecoded == schema)
+ foreach (ClassDefinition scm in desc.Classes)
+ if (scm.QualifiedNameDecoded == schema)
{
foundSchema = true;
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/ServerConnectionBase.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -1427,7 +1427,7 @@
protected Dictionary<string, FeatureSourceDescription> m_featureSchemaCache = new Dictionary<string, FeatureSourceDescription>();
- protected Dictionary<string, FeatureSourceDescription.FeatureSourceSchema> m_featureSchemaNameCache = new Dictionary<string, FeatureSourceDescription.FeatureSourceSchema>();
+ protected Dictionary<string, ClassDefinition> m_featureSchemaNameCache = new Dictionary<string, ClassDefinition>();
public virtual FeatureSourceDescription GetFeatureSourceDescription(string resourceID)
{
@@ -1436,8 +1436,8 @@
try
{
m_featureSchemaCache[resourceID] = this.DescribeFeatureSource(resourceID);
- foreach (FeatureSourceDescription.FeatureSourceSchema scm in m_featureSchemaCache[resourceID].Schemas)
- m_featureSchemaNameCache[resourceID + "!" + scm.FullnameDecoded] = scm;
+ foreach (ClassDefinition scm in m_featureSchemaCache[resourceID].Classes)
+ m_featureSchemaNameCache[resourceID + "!" + scm.QualifiedNameDecoded] = scm;
}
catch
{
@@ -1450,7 +1450,7 @@
}
- public virtual FeatureSourceDescription.FeatureSourceSchema GetFeatureSourceSchema(string resourceID, string schema)
+ public virtual ClassDefinition GetFeatureSourceSchema(string resourceID, string schema)
{
/*if (schema != null && schema.IndexOf(":") > 0)
schema = schema.Substring(0, schema.IndexOf(":"));*/
@@ -1468,7 +1468,7 @@
public virtual void ResetFeatureSourceSchemaCache()
{
m_featureSchemaCache = new Dictionary<string, FeatureSourceDescription>();
- m_featureSchemaNameCache = new Dictionary<string, FeatureSourceDescription.FeatureSourceSchema>();
+ m_featureSchemaNameCache = new Dictionary<string, ClassDefinition>();
}
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI/Services/IFeatureService.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -88,7 +88,7 @@
FeatureSourceDescription DescribeFeatureSource(string resourceID);
FeatureSourceDescription DescribeFeatureSource(string resourceID, string schema);
- FeatureSourceDescription.FeatureSourceSchema GetFeatureSourceSchema(string resourceID, string schema);
+ ClassDefinition GetFeatureSourceSchema(string resourceID, string schema);
FeatureSourceDescription GetFeatureSourceDescription(string resourceID);
void ResetFeatureSourceSchemaCache();
Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureSetReader.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureSetReader.cs 2010-10-12 00:22:24 UTC (rev 5272)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/XmlFeatureSetReader.cs 2010-10-12 04:35:24 UTC (rev 5273)
@@ -227,6 +227,11 @@
{
m_type = Utility.GeometryType;
this.SetMetadata(GeometryMetadata.GEOM_TYPES, node.Attributes["fdo:geometricTypes"].Value);
+ try
+ {
+ this.SetMetadata(GeometryMetadata.SPATIAL_CONTEXT, node.Attributes["fdo:srsName"].Value);
+ }
+ catch { }
}
else if (node["xs:simpleType"] == null)
{
More information about the mapguide-commits
mailing list