[mapguide-commits] r5842 -
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue May 24 07:57:41 EDT 2011
Author: jng
Date: 2011-05-24 04:57:41 -0700 (Tue, 24 May 2011)
New Revision: 5842
Modified:
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/FeatureSchema.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSourceDescription.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/XmlNamespaces.cs
Log:
#1319: API documentation for classes in the Schema namespace
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/ClassDefinition.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -52,6 +52,9 @@
this.Description = description;
}
+ /// <summary>
+ /// Gets or sets the base class
+ /// </summary>
public ClassDefinition BaseClass { get; set; }
/// <summary>
@@ -314,6 +317,11 @@
public FeatureSchema Parent { get; internal set; }
+ /// <summary>
+ /// Gets a Property Definition by its name
+ /// </summary>
+ /// <param name="name"></param>
+ /// <returns>The matching property definition. null if none found</returns>
public PropertyDefinition FindProperty(string name)
{
foreach (var prop in _properties)
@@ -324,6 +332,9 @@
return null;
}
+ /// <summary>
+ /// Gets the qualified name of this class. The qualified name takes the form [Schema Name]:[Class Name]
+ /// </summary>
public string QualifiedName { get { return this.Parent != null ? this.Parent.Name + ":" + this.Name : this.Name; } }
public void WriteXml(XmlDocument doc, XmlNode currentNode)
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/DataPropertyDefinition.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -25,6 +25,11 @@
namespace OSGeo.MapGuide.MaestroAPI.Schema
{
+ /// <summary>
+ /// Derives from <see cref="T:OSGeo.MapGuide.MaestroAPI.Schema.PropertyDefinition"/> and represents simple values or
+ /// collections of simple values. This can take on any of the data types listed in the
+ /// <see cref="T:OSGeo.MapGuide.MaestroAPI.Schema.DataPropertyType"/> enumeration.
+ /// </summary>
public class DataPropertyDefinition : PropertyDefinition
{
private DataPropertyDefinition() { this.DataType = DataPropertyType.String; }
@@ -36,22 +41,49 @@
this.Description = description;
}
+ /// <summary>
+ /// Gets the data type of this property
+ /// </summary>
public DataPropertyType DataType { get; set; }
+ /// <summary>
+ /// Gets or sets the default value. Applies only to string data types
+ /// </summary>
public string DefaultValue { get; set; }
+ /// <summary>
+ /// Gets or sets the length of this property. Applies only to string and blob/clob data types
+ /// </summary>
public int Length { get; set; }
+ /// <summary>
+ /// Gets or sets whether this property accepts null values
+ /// </summary>
public bool IsNullable { get; set; }
+ /// <summary>
+ /// Gets or sets the precision of this property. Applies only to decimal data types
+ /// </summary>
public int Precision { get; set; }
+ /// <summary>
+ /// Gets or sets whether this property is read-only
+ /// </summary>
public bool IsReadOnly { get; set; }
+ /// <summary>
+ /// Gets or sets the scale of this property. Applies only to decimal data types.
+ /// </summary>
public int Scale { get; set; }
+ /// <summary>
+ /// Gets or sets whether this property automatically generates a value on insert.
+ /// </summary>
public bool IsAutoGenerated { get; set; }
+ /// <summary>
+ /// Gets the type of Property Definition
+ /// </summary>
public override PropertyDefinitionType Type
{
get { return PropertyDefinitionType.Data; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSchema.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -25,8 +25,10 @@
namespace OSGeo.MapGuide.MaestroAPI.Schema
{
- //TODO: Expand on documentation as this is an important class
-
+ /// <summary>
+ /// Contains all of the classes and relationships that make up a particular data model. This class is used to
+ /// represent the internal logical structure of a Feature Source
+ /// </summary>
public class FeatureSchema : SchemaElement, IFdoSerializable
{
private List<ClassDefinition> _classes;
@@ -73,6 +75,11 @@
return false;
}
+ /// <summary>
+ /// Returns the Class Definition by its name
+ /// </summary>
+ /// <param name="name"></param>
+ /// <returns>The matching Class Definition. null if it doesn't exist</returns>
public ClassDefinition GetClass(string name)
{
foreach (var cls in _classes)
@@ -157,6 +164,10 @@
}
}
+ /// <summary>
+ /// Removes a class definition by its name
+ /// </summary>
+ /// <param name="className"></param>
public void RemoveClass(string className)
{
var cls = GetClass(className);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSourceDescription.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSourceDescription.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/FeatureSourceDescription.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -31,7 +31,7 @@
}
/// <summary>
- /// Class that represents a the layout of a datasource
+ /// Class that represents a the layout of a feature source
/// </summary>
public class FeatureSourceDescription
{
@@ -61,10 +61,21 @@
this.Schemas = schemas.ToArray();
}
+ /// <summary>
+ /// Gets whether this description is a partial description (ie. It doesn't represent the full feature source)
+ /// </summary>
public bool IsPartial { get; internal set; }
+ /// <summary>
+ /// Gets an array of feature schemas in this feature source
+ /// </summary>
public FeatureSchema[] Schemas { get; private set; }
+ /// <summary>
+ /// Gets a feature schema by its name
+ /// </summary>
+ /// <param name="schemaName"></param>
+ /// <returns>The matching feature schema. null if not found</returns>
public FeatureSchema GetSchema(string schemaName)
{
foreach (var fsc in this.Schemas)
@@ -77,6 +88,9 @@
return null;
}
+ /// <summary>
+ /// Gets an array of feature schema names
+ /// </summary>
public string[] SchemaNames
{
get
@@ -90,6 +104,11 @@
}
}
+ /// <summary>
+ /// Gets all the Class Definitions in this feature source. In the event of identically named Class Definitions beloning
+ /// in different parent schemas. Use the <see cref="M:OSGeo.MapGuide.MaestroAPI.Schema.ClassDefinition.QualifiedName"/> property
+ /// to distinguish them.
+ /// </summary>
public IEnumerable<ClassDefinition> AllClasses
{
get
@@ -104,6 +123,12 @@
}
}
+ /// <summary>
+ /// Gets the specified class definition by its name and parent schema name
+ /// </summary>
+ /// <param name="schemaName"></param>
+ /// <param name="className"></param>
+ /// <returns>The matching class definition. null if not found</returns>
public ClassDefinition GetClass(string schemaName, string className)
{
var fsc = GetSchema(schemaName);
@@ -230,6 +255,10 @@
*/
#endregion
+ /// <summary>
+ /// Gets whether there are any class definitions
+ /// </summary>
+ /// <returns></returns>
public bool HasClasses()
{
if (this.Schemas.Length == 0)
@@ -243,6 +272,11 @@
return false;
}
+ /// <summary>
+ /// Gets the specified class definition by its fully qualified name
+ /// </summary>
+ /// <param name="qualifiedName"></param>
+ /// <returns>The matching class definition. null if not found</returns>
public ClassDefinition GetClass(string qualifiedName)
{
Check.NotEmpty(qualifiedName, "qualifiedName");
@@ -253,114 +287,4 @@
return GetClass(tokens[0], tokens[1]);
}
}
-
-
- /*
- internal class ClassPropertyColumn : FeatureSetColumn
- {
- internal ClassPropertyColumn(XmlNode node)
- : base()
- {
- if (node.Name == "PropertyDefinition" || node.Name == "Column")
- {
- m_name = node["Name"].InnerText;
- m_allowNull = true;
- switch (node["Type"].InnerText.ToLower().Trim())
- {
- case "string":
- m_type = typeof(string);
- break;
- case "byte":
- m_type = typeof(Byte);
- break;
- case "int32":
- case "int":
- case "integer":
- m_type = typeof(int);
- break;
- case "int16":
- m_type = typeof(short);
- break;
- case "int64":
- case "long":
- m_type = typeof(long);
- break;
- case "float":
- case "single":
- m_type = typeof(float);
- break;
- case "double":
- case "decimal":
- m_type = typeof(double);
- break;
- case "boolean":
- case "bool":
- m_type = typeof(bool);
- return;
- case "datetime":
- case "date":
- m_type = typeof(DateTime);
- break;
- case "raster":
- m_type = Utility.RasterType;
- break;
- case "geometry":
- m_type = Utility.GeometryType;
- break;
- default:
- //throw new Exception("Failed to find appropriate type for: " + node["xs:simpleType"]["xs:restriction"].Attributes["base"].Value);
- m_type = Utility.UnmappedType;
- break;
- }
- }
- else
- {
- m_name = node.Attributes["name"].Value;
- m_allowNull = node.Attributes["minOccurs"] != null && node.Attributes["minOccurs"].Value == "0";
- if (node.Attributes["type"] != null && node.Attributes["type"].Value == "gml:AbstractGeometryType")
- m_type = Utility.GeometryType;
- else if (node["xs:simpleType"] == null)
- m_type = Utility.RasterType;
- else
- switch (node["xs:simpleType"]["xs:restriction"].Attributes["base"].Value.ToLower())
- {
- case "xs:string":
- m_type = typeof(string);
- break;
- case "fdo:byte":
- m_type = typeof(Byte);
- break;
- case "fdo:int32":
- m_type = typeof(int);
- break;
- case "fdo:int16":
- m_type = typeof(short);
- break;
- case "fdo:int64":
- m_type = typeof(long);
- break;
- case "xs:float":
- case "xs:single":
- case "fdo:single":
- m_type = typeof(float);
- break;
- case "xs:double":
- case "xs:decimal":
- m_type = typeof(double);
- break;
- case "xs:boolean":
- m_type = typeof(bool);
- return;
- case "xs:datetime":
- m_type = typeof(DateTime);
- break;
- default:
- //throw new Exception("Failed to find appropriate type for: " + node["xs:simpleType"]["xs:restriction"].Attributes["base"].Value);
- m_type = Utility.UnmappedType;
- break;
- }
- }
- }
- }
- */
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/GeometricPropertyDefinition.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -27,6 +27,7 @@
/// <summary>
/// Defines the valid types of geometric storage in a geometric property
/// </summary>
+ [Flags]
public enum FeatureGeometricType
{
Point = 1,
@@ -68,16 +69,33 @@
this.Description = description;
}
+ /// <summary>
+ /// Gets or sets a Boolean value that indicates if this geometric property is read-only.
+ /// </summary>
public bool IsReadOnly { get; set; }
+ /// <summary>
+ /// Gets or sets a Boolean value that indicates if the geometry of this property includes measurement values that can be used for dynamic segmentation.
+ /// </summary>
public bool HasMeasure { get; set; }
+ /// <summary>
+ /// Gets or sets a Boolean value that indicates if the geometry of this property include elevation values.
+ /// </summary>
public bool HasElevation { get; set; }
+ /// <summary>
+ /// Gets or sets the Spatial Context name associated to this geometric property.
+ /// </summary>
public string SpatialContextAssociation { get; set; }
private FeatureGeometricType _geometricTypes;
+ /// <summary>
+ /// Gets or sets the <see cref="T:OSGeo.MapGuide.MaestroAPI.Schema.FeatureGeometricType"/> that can be stored in this geometric
+ /// property. The returned value may be any combination of the values from the <see cref="T:OSGeo.MapGuide.MaestroAPI.Schema.FeatureGeometricType"/>
+ /// enumeration combined via a bit-wise or operation.
+ /// </summary>
public FeatureGeometricType GeometricTypes
{
get { return _geometricTypes; }
@@ -118,6 +136,10 @@
private SpecificGeometryType[] _sgts;
+ /// <summary>
+ /// Gets or sets the specific set of geometry types that can be stored in this geometric property. The provided value is a
+ /// list of geometry types that are supported. Usually, one specific type is supported, but there can be more than one.
+ /// </summary>
public SpecificGeometryType[] SpecificGeometryTypes
{
get { return _sgts; }
@@ -179,6 +201,9 @@
}
}
+ /// <summary>
+ /// Gets the type of property definition
+ /// </summary>
public override PropertyDefinitionType Type
{
get { return PropertyDefinitionType.Geometry; }
@@ -229,6 +254,12 @@
return string.Join(" ", values.ToArray());
}
+ /// <summary>
+ /// Gets an array of the individual <see cref="T:OSGeo.MapGuide.MaestroAPI.Schema.FeatureGeometricType"/> values that
+ /// compose the final masked value that is returned by the <see cref="M:OSGeo.MapGuide.MaestroAPI.GeometricPropertyDefinition.GeometricTypes"/>
+ /// property
+ /// </summary>
+ /// <returns></returns>
public FeatureGeometricType[] GetIndividualGeometricTypes()
{
List<FeatureGeometricType> gts = new List<FeatureGeometricType>();
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/PropertyDefinition.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -95,6 +95,12 @@
public abstract void ReadXml(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr);
+ /// <summary>
+ /// Parses the specified XML node into a Property Definition
+ /// </summary>
+ /// <param name="node"></param>
+ /// <param name="mgr"></param>
+ /// <returns></returns>
public static PropertyDefinition Parse(System.Xml.XmlNode node, System.Xml.XmlNamespaceManager mgr)
{
PropertyDefinition prop = null;
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/RasterPropertyDefinition.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -23,6 +23,10 @@
namespace OSGeo.MapGuide.MaestroAPI.Schema
{
+ /// <summary>
+ /// Has the information needed to create or completely describe a raster property. This class encapsulates the information
+ /// necessary to insert a 'new' raster, in the absence of any other information, for the properties defined using this schema element.
+ /// </summary>
public class RasterPropertyDefinition : PropertyDefinition
{
public RasterPropertyDefinition(string name, string description)
@@ -31,16 +35,34 @@
this.Description = description;
}
+ /// <summary>
+ /// Gets or sets the default size of image file in the horizontal direction in pixels (number of columns).
+ /// </summary>
public int DefaultImageXSize { get; set; }
+ /// <summary>
+ /// Gets or sets the default size of an image file in the vertical direction in pixels (number of rows).
+ /// </summary>
public int DefaultImageYSize { get; set; }
+ /// <summary>
+ /// Gets or sets whether this property's value can be null.
+ /// </summary>
public bool IsNullable { get; set; }
+ /// <summary>
+ /// Gets or sets whether this property is read-only.
+ /// </summary>
public bool IsReadOnly { get; set; }
+ /// <summary>
+ /// Gets or sets the Spatial Context name associated to this raster property.
+ /// </summary>
public string SpatialContextAssociation { get; set; }
+ /// <summary>
+ /// Gets the type of property definition
+ /// </summary>
public override PropertyDefinitionType Type
{
get { return PropertyDefinitionType.Raster; }
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/XmlNamespaces.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/XmlNamespaces.cs 2011-05-24 11:38:54 UTC (rev 5841)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Schema/XmlNamespaces.cs 2011-05-24 11:57:41 UTC (rev 5842)
@@ -26,7 +26,7 @@
/// <summary>
/// A set of XML namespaces commonly used in FDO XML documents
/// </summary>
- public class XmlNamespaces
+ public static class XmlNamespaces
{
/// <summary>
/// XML Schema namespace
More information about the mapguide-commits
mailing list