[mapguide-commits] r5658 - in trunk/Tools/Maestro: .
Maestro.Base/Commands/SiteExplorer Maestro.Base/Editor
MaestroAPITests OSGeo.MapGuide.MaestroAPI
OSGeo.MapGuide.MaestroAPI/Resource
OSGeo.MapGuide.MaestroAPI/Resource/Validation
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Wed Mar 23 07:45:27 EDT 2011
Author: jng
Date: 2011-03-23 04:45:27 -0700 (Wed, 23 Mar 2011)
New Revision: 5658
Modified:
trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/ValidateCommand.cs
trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs
trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs
trunk/Tools/Maestro/build.bat
Log:
This submission includes the following changes:
- #1638: Implement validation status codes
- #1472: Fix layer definition validator falsely reporting overlapping scales. Add a unit test to verify this.
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/ValidateCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/ValidateCommand.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/SiteExplorer/ValidateCommand.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -132,15 +132,13 @@
IResource item = null;
try
{
- //TODO: This will validate resources multiple times, if they are referenced by
- //resources inside the folder
item = _conn.ResourceService.GetResource(s);
set.AddIssues(ResourceValidatorSet.Validate(context, item, true));
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- set.AddIssue(new ValidationIssue(item, ValidationStatus.Error, string.Format(Properties.Resources.ValidationResourceLoadFailed, msg)));
+ set.AddIssue(new ValidationIssue(item, ValidationStatus.Error, ValidationStatusCode.Error_General_ValidationError, string.Format(Properties.Resources.ValidationResourceLoadFailed, msg)));
}
i++;
worker.ReportProgress((int)((i / (double)documents.Count) * 100), s);
Modified: trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/Maestro.Base/Editor/XmlEditor.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -107,11 +107,11 @@
var issues = new List<ValidationIssue>();
foreach (string err in errors)
{
- issues.Add(new ValidationIssue(this.Resource, ValidationStatus.Error, err));
+ issues.Add(new ValidationIssue(this.Resource, ValidationStatus.Error, ValidationStatusCode.Error_General_ValidationError, err));
}
foreach (string warn in warnings)
{
- issues.Add(new ValidationIssue(this.Resource, ValidationStatus.Warning, warn));
+ issues.Add(new ValidationIssue(this.Resource, ValidationStatus.Warning, ValidationStatusCode.Warning_General_ValidationWarning, warn));
}
//Put through ValidationResultSet to weed out redundant messages
Modified: trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/MaestroAPITests/ValidationTests.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -31,6 +31,7 @@
using OSGeo.MapGuide.ObjectModels;
using OSGeo.MapGuide.MaestroAPI.Services;
using OSGeo.MapGuide.MaestroAPI.Schema;
+using OSGeo.MapGuide.ObjectModels.LayerDefinition;
namespace MaestroAPITests
{
@@ -57,9 +58,9 @@
var res3 = mocks.NewMock<IResource>();
Expect.AtLeastOnce.On(res3).GetProperty("ResourceID").Will(Return.Value("Library://Test.FeatureSource"));
- var msg1 = new ValidationIssue(res1, ValidationStatus.Error, "Epic Fail");
- var msg2 = new ValidationIssue(res2, ValidationStatus.Error, "Epic Fail");
- var msg3 = new ValidationIssue(res3, ValidationStatus.Error, "Not so epic fail");
+ var msg1 = new ValidationIssue(res1, ValidationStatus.Error, ValidationStatusCode.Dummy, "Epic Fail");
+ var msg2 = new ValidationIssue(res2, ValidationStatus.Error, ValidationStatusCode.Dummy, "Epic Fail");
+ var msg3 = new ValidationIssue(res3, ValidationStatus.Error, ValidationStatusCode.Dummy, "Not so epic fail");
Assert.AreEqual(msg1.GetHashCode(), msg2.GetHashCode());
Assert.IsTrue(msg1.Equals(msg2));
@@ -81,9 +82,9 @@
var res3 = mocks.NewMock<IResource>();
Expect.AtLeastOnce.On(res3).GetProperty("ResourceID").Will(Return.Value("Library://Test.FeatureSource"));
- var msg1 = new ValidationIssue(res1, ValidationStatus.Error, "Epic Fail");
- var msg2 = new ValidationIssue(res2, ValidationStatus.Error, "Epic Fail");
- var msg3 = new ValidationIssue(res3, ValidationStatus.Error, "Not so epic fail");
+ var msg1 = new ValidationIssue(res1, ValidationStatus.Error, ValidationStatusCode.Dummy, "Epic Fail");
+ var msg2 = new ValidationIssue(res2, ValidationStatus.Error, ValidationStatusCode.Dummy, "Epic Fail");
+ var msg3 = new ValidationIssue(res3, ValidationStatus.Error, ValidationStatusCode.Dummy, "Not so epic fail");
var set = new ValidationResultSet();
set.AddIssues(new ValidationIssue[] { msg1, msg2, msg3 });
@@ -473,5 +474,85 @@
//Not supported
Assert.AreEqual(1, set.GetAllIssues().Length);
}
+
+ [Test]
+ public void TestLayerScaleRangeOverlap()
+ {
+ var mock = new Mockery();
+ var conn = mock.NewMock<IServerConnection>();
+ var ldf1 = ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Vector, new Version(1, 0, 0));
+ ldf1.ResourceID = "Library://Test/Foo.LayerDefinition";
+
+ var vl1 = (IVectorLayerDefinition)ldf1.SubLayer;
+ vl1.ResourceId = "Library://Test/Foo.FeatureSource";
+ vl1.FeatureName = "Foo:Bar";
+ vl1.Geometry = "Geometry";
+
+ var vsr1 = ldf1.CreateVectorScaleRange();
+ var vsr2 = ldf1.CreateVectorScaleRange();
+
+ vsr1.MaxScale = 9999;
+ vsr2.MinScale = 9384;
+ vsr2.MaxScale = 11000;
+
+ vl1.RemoveAllScaleRanges();
+ vl1.AddVectorScaleRange(vsr1);
+ vl1.AddVectorScaleRange(vsr2);
+
+ var featSvc = new MockFeatureService();
+ var resSvc = new MockResourceService();
+
+ var validator = new LayerDefinitionValidator();
+
+ var context = new ResourceValidationContext(resSvc, featSvc);
+ var issues = validator.Validate(context, ldf1, false);
+
+ bool hasIssue = false;
+ foreach (var issue in issues)
+ {
+ if (issue.StatusCode == ValidationStatusCode.Info_LayerDefinition_ScaleRangeOverlap)
+ {
+ hasIssue = true;
+ break;
+ }
+ }
+
+ Assert.True(hasIssue);
+
+ //Case described in trac #1472
+ var ldf2 = ObjectFactory.CreateDefaultLayer(conn, OSGeo.MapGuide.ObjectModels.LayerDefinition.LayerType.Vector, new Version(1, 0, 0));
+ ldf2.ResourceID = "Library://Test/Foo.LayerDefinition";
+
+ var vl2 = (IVectorLayerDefinition)ldf2.SubLayer;
+ vl2.ResourceId = "Library://Test/Foo.FeatureSource";
+ vl2.FeatureName = "Foo:Bar";
+ vl2.Geometry = "Geometry";
+
+ vsr1 = ldf2.CreateVectorScaleRange();
+ vsr2 = ldf2.CreateVectorScaleRange();
+
+ vsr1.MinScale = 10000;
+ vsr2.MinScale = 9384;
+ vsr2.MaxScale = 9999;
+
+ vl2.RemoveAllScaleRanges();
+ vl2.AddVectorScaleRange(vsr1);
+ vl2.AddVectorScaleRange(vsr2);
+
+ context = new ResourceValidationContext(resSvc, featSvc);
+ issues = validator.Validate(context, ldf2, false);
+
+ hasIssue = false;
+ foreach (var issue in issues)
+ {
+ if (issue.StatusCode == ValidationStatusCode.Info_LayerDefinition_ScaleRangeOverlap)
+ {
+ hasIssue = true;
+ break;
+ }
+ }
+
+ Assert.False(hasIssue);
+ }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/OSGeo.MapGuide.MaestroAPI.csproj 2011-03-23 11:45:27 UTC (rev 5658)
@@ -209,6 +209,7 @@
<Compile Include="Feature\RecordBase.cs" />
<Compile Include="ObjectModels\IFdoSpatialContext.cs" />
<Compile Include="ObjectModels\SymbolDefFactory.cs" />
+ <Compile Include="Resource\Validation\ValidationStatusCode.cs" />
<Compile Include="SchemaOverrides\GdalConfigurationDocument.cs" />
<Compile Include="SchemaOverrides\GdalRasterItem.cs" />
<Compile Include="SchemaOverrides\OdbcTableItem.cs" />
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResourceValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/IResourceValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -57,7 +57,7 @@
/// <param name="res">The res.</param>
/// <param name="stat">The stat.</param>
/// <param name="msg">The MSG.</param>
- public ValidationIssue(IResource res, ValidationStatus stat, string msg)
+ public ValidationIssue(IResource res, ValidationStatus stat, ValidationStatusCode code, string msg)
{
Check.NotNull(res, "res");
Check.NotEmpty(msg, "msg");
@@ -65,9 +65,15 @@
this.Resource = res;
this.Status = stat;
this.Message = msg;
+ this.StatusCode = code;
}
/// <summary>
+ /// Gets the validation status code
+ /// </summary>
+ public ValidationStatusCode StatusCode { get; private set; }
+
+ /// <summary>
/// Gets the message for the validation issue
/// </summary>
public string Message { get; private set; }
@@ -103,7 +109,8 @@
ValidationIssue vi = (ValidationIssue)obj;
return this.Resource.ResourceID.Equals(vi.Resource.ResourceID) &&
this.Message.Equals(vi.Message) &&
- this.Status == vi.Status;
+ this.Status == vi.Status &&
+ this.StatusCode == vi.StatusCode;
}
/// <summary>
@@ -121,6 +128,7 @@
hash = hash * 23 + this.Resource.ResourceID.GetHashCode();
hash = hash * 23 + this.Message.GetHashCode();
hash = hash * 23 + this.Status.GetHashCode();
+ hash = hash * 23 + this.StatusCode.GetHashCode();
return hash;
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ApplicationDefinitionValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -60,7 +60,7 @@
IApplicationDefinition fusionApp = resource as IApplicationDefinition;
if (fusionApp.MapSet == null || fusionApp.MapSet.MapGroupCount == 0)
- issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, string.Format(Properties.Resources.ADF_MapMissingError)));
+ issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, ValidationStatusCode.Error_Fusion_MissingMap, string.Format(Properties.Resources.ADF_MapMissingError)));
else
{
if (recurse)
@@ -82,7 +82,7 @@
var mdfId = map.GetMapDefinition();
if (string.IsNullOrEmpty(mdfId) || !resource.CurrentConnection.ResourceService.ResourceExists(mdfId))
{
- issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, string.Format(Properties.Resources.ADF_MapInvalidError, mapGroup.id)));
+ issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, ValidationStatusCode.Error_Fusion_InvalidMap, string.Format(Properties.Resources.ADF_MapInvalidError, mapGroup.id)));
}
else
{
@@ -97,7 +97,7 @@
if (mapGroup.InitialView != null)
{
if (!mapEnv.Contains(mapGroup.InitialView.CenterX, mapGroup.InitialView.CenterY))
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, string.Format(Properties.Resources.ADF_ViewOutsideMapExtents)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, ValidationStatusCode.Warning_Fusion_InitialViewOutsideMapExtents, string.Format(Properties.Resources.ADF_ViewOutsideMapExtents)));
}
}
}
@@ -105,7 +105,7 @@
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, string.Format(Properties.Resources.ADF_MapValidationError, mapGroup.id, msg)));
+ issues.Add(new ValidationIssue(fusionApp, ValidationStatus.Error, ValidationStatusCode.Error_Fusion_MapValidationError, string.Format(Properties.Resources.ADF_MapValidationError, mapGroup.id, msg)));
}
}
@@ -117,7 +117,7 @@
var csCode = resource.CurrentConnection.CoordinateSystemCatalog.ConvertWktToCoordinateSystemCode(wkt);
if (csCode.ToUpper() != "WGS84.PSEUDOMERCATOR")
{
- issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, string.Format(Properties.Resources.ADF_MapWithIncompatibleCommericalCs, mdf.ResourceID)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_Fusion_MapCoordSysIncompatibleWithCommericalLayers, string.Format(Properties.Resources.ADF_MapWithIncompatibleCommericalCs, mdf.ResourceID)));
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLayerDefinitionValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -74,17 +74,17 @@
List<ValidationIssue> issues = new List<ValidationIssue>();
if (ldef.SubLayer == null)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_LayerNullError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_LayerNull, Properties.Resources.LDF_LayerNullError));
if (vldef != null)
{
if (string.IsNullOrEmpty(vldef.FeatureName))
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_MissingFeatureSourceError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinitionMissingFeatureSource, Properties.Resources.LDF_MissingFeatureSourceError));
if (string.IsNullOrEmpty(vldef.Geometry))
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_MissingGeometryError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinitionMissingGeometry, Properties.Resources.LDF_MissingGeometryError));
if (vldef.VectorScaleRange == null || !vldef.HasVectorScaleRanges())
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_MissingScaleRangesError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinitionMissingScaleRanges, Properties.Resources.LDF_MissingScaleRangesError));
else
{
//Test for overlapping scale ranges
@@ -103,23 +103,25 @@
min = Math.Min(min, sr.Value);
max = Math.Max(max, sr.Key);
if (sr.Key < sr.Value)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_MinAndMaxScaleSwappedError, sr.Value, sr.Key)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_MinMaxScaleSwapped, string.Format(Properties.Resources.LDF_MinAndMaxScaleSwappedError, sr.Value, sr.Key)));
}
+ ranges.Sort(CompareScales);
+
//TODO: Detect gaps in scale ranges
for (int i = 0; i < ranges.Count; i++)
for (int j = i + 1; j < ranges.Count; j++)
if (ranges[i].Key > ranges[j].Value || ranges[i].Value > ranges[j].Value)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Information, string.Format(Properties.Resources.LDF_ScaleRangesOverlapInformation, ranges[i].Value, ranges[i].Key, ranges[j].Value, ranges[j].Key)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Information, ValidationStatusCode.Info_LayerDefinition_ScaleRangeOverlap, string.Format(Properties.Resources.LDF_ScaleRangesOverlapInformation, ranges[i].Value, ranges[i].Key, ranges[j].Value, ranges[j].Key)));
}
}
else if (gldef != null)
{
if (gldef.GridScaleRange == null || gldef.GridScaleRangeCount == 0)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_MissingScaleRangesError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_NoGridScaleRanges, Properties.Resources.LDF_MissingScaleRangesError));
else if (gldef.GridScaleRangeCount != 1)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LDF_MultipleScaleRangesWarning));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LayerDefinition_MultipleGridScaleRanges, Properties.Resources.LDF_MultipleScaleRangesWarning));
}
else if (dldef != null)
{
@@ -130,7 +132,7 @@
}
catch (Exception)
{
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.LDF_DrawingSourceError));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_DrawingSourceError, Properties.Resources.LDF_DrawingSourceError));
}
if (dws != null)
@@ -153,7 +155,7 @@
if (sheet == null)
{
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_SheetNotFound, dldef.Sheet)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_DrawingSourceSheetNotFound, string.Format(Properties.Resources.LDF_SheetNotFound, dldef.Sheet)));
}
else
{
@@ -173,7 +175,7 @@
foreach (var sl in specifiedLayers)
{
if (!dwLayers.ContainsKey(sl.Trim()))
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_SheetLayerNotFound, sl.Trim(), sheet.Name)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_DrawingSourceSheetLayerNotFound, string.Format(Properties.Resources.LDF_SheetLayerNotFound, sl.Trim(), sheet.Name)));
}
}
}
@@ -182,7 +184,7 @@
}
else
{
- issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LDF_UnsupportedLayerTypeWarning));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LayerDefinition_UnsupportedLayerType, Properties.Resources.LDF_UnsupportedLayerTypeWarning));
}
if (recurse)
@@ -199,7 +201,7 @@
}
catch (Exception)
{
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_FeatureSourceLoadError)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_FeatureSourceLoadError, string.Format(Properties.Resources.LDF_FeatureSourceLoadError)));
}
if (fs != null)
@@ -245,7 +247,7 @@
}
}
if (!found)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_SchemaMissingError, qualClassName, fs.ResourceID)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_ClassNotFound, string.Format(Properties.Resources.LDF_SchemaMissingError, qualClassName, fs.ResourceID)));
}
}
@@ -255,13 +257,13 @@
}
if (!foundSchema)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_SchemaMissingError, qualClassName, fs.ResourceID)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_ClassNotFound, string.Format(Properties.Resources.LDF_SchemaMissingError, qualClassName, fs.ResourceID)));
else if (!foundGeometry)
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, string.Format(Properties.Resources.LDF_GeometryMissingError, geometry, qualClassName, fs.ResourceID)));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_GeometryNotFound, string.Format(Properties.Resources.LDF_GeometryMissingError, geometry, qualClassName, fs.ResourceID)));
}
catch (Exception)
{
- issues.Add(new ValidationIssue(fs, ValidationStatus.Error, string.Format(Properties.Resources.LDF_SchemaAndColumnReadFailedError)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Error, ValidationStatusCode.Error_LayerDefinition_Generic, string.Format(Properties.Resources.LDF_SchemaAndColumnReadFailedError)));
}
}
}
@@ -280,5 +282,11 @@
{
get;
}
+
+ private static int CompareScales(KeyValuePair<double, double> rangeA, KeyValuePair<double, double> rangeB)
+ {
+ //We are comparing from scales of both ranges
+ return rangeA.Key.CompareTo(rangeB.Key);
+ }
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseLoadProcedureValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -59,31 +59,31 @@
if (loadProc.Type == LoadType.Dwg)
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_DWGNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_DwgNotSupported, Properties.Resources.LPROC_DWGNotSupported));
return set.GetAllIssues(); //all she wrote
}
if (loadProc.Type == LoadType.Raster)
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_RasterNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_RasterNotSupported, Properties.Resources.LPROC_RasterNotSupported));
return set.GetAllIssues(); //all she wrote
}
if (loadProc.Type == LoadType.Sdf)
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_Sdf2OptionsNotSupported));
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_GeneralizationNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_Sdf2OptionsNotSupported, Properties.Resources.LPROC_Sdf2OptionsNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_GeneralizationNotSupported, Properties.Resources.LPROC_GeneralizationNotSupported));
}
if (loadProc.Type == LoadType.Shp)
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_ConvertToSdf3NotSupported));
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_GeneralizationNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_ConvertToSdf3NotSupported, Properties.Resources.LPROC_ConvertToSdf3NotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_GeneralizationNotSupported, Properties.Resources.LPROC_GeneralizationNotSupported));
}
if (loadProc.Type == LoadType.Sqlite)
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, Properties.Resources.LPROC_GeneralizationNotSupported));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_GeneralizationNotSupported, Properties.Resources.LPROC_GeneralizationNotSupported));
}
var fproc = loadProc as IBaseLoadProcedure;
@@ -93,7 +93,7 @@
{
if (!System.IO.File.Exists(fn))
{
- set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, string.Format(Properties.Resources.LPROC_SourceFileNotFound, fn)));
+ set.AddIssue(new ValidationIssue(resource, ValidationStatus.Warning, ValidationStatusCode.Warning_LoadProcedure_SourceFileNotFound, string.Format(Properties.Resources.LPROC_SourceFileNotFound, fn)));
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/BaseWebLayoutValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -62,7 +62,7 @@
IWebLayout layout = resource as IWebLayout;
if (layout.Map == null || layout.Map.ResourceId == null)
{
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_MissingMapError)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_MissingMap, string.Format(Properties.Resources.WL_MissingMapError)));
}
else
{
@@ -72,7 +72,7 @@
foreach (ICommand cmd in cmdSet.Commands)
{
if (cmds.ContainsKey(cmd.Name))
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_DuplicateCommandName, cmd.Name)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_DuplicateCommandName, string.Format(Properties.Resources.WL_DuplicateCommandName, cmd.Name)));
else
cmds[cmd.Name] = cmd;
}
@@ -87,7 +87,7 @@
foreach (IResultColumn resCol in search.ResultColumns.Column)
{
if (resColProps.ContainsKey(resCol.Property))
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_DuplicateSearchResultColumn, search.Name, resCol.Property)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_DuplicateSearchCommandResultColumn, string.Format(Properties.Resources.WL_DuplicateSearchResultColumn, search.Name, resCol.Property)));
else
resColProps.Add(resCol.Property, resCol.Property);
}
@@ -101,7 +101,7 @@
{
ICommandItem cmdRef = (ICommandItem)item;
if (!cmds.ContainsKey(cmdRef.Command))
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentMenuCommandReference, cmdRef.Command)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_NonExistentCommandReference, string.Format(Properties.Resources.WL_NonExistentMenuCommandReference, cmdRef.Command)));
}
}
@@ -111,7 +111,7 @@
{
ICommandItem cmdRef = (ICommandItem)item;
if (!cmds.ContainsKey(cmdRef.Command))
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentTaskPaneCommandReference, cmdRef.Command)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_NonExistentTaskPaneCommandReference, string.Format(Properties.Resources.WL_NonExistentTaskPaneCommandReference, cmdRef.Command)));
}
}
@@ -121,7 +121,7 @@
{
ICommandItem cmdRef = (ICommandItem)item;
if (!cmds.ContainsKey(cmdRef.Command))
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_NonExistentToolbarCommandReference, cmdRef.Command)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_NonExistentToolbarCommandReference, string.Format(Properties.Resources.WL_NonExistentToolbarCommandReference, cmdRef.Command)));
}
}
@@ -137,14 +137,14 @@
{
var mapEnv = ObjectFactory.CreateEnvelope(mdef.Extents.MinX, mdef.Extents.MaxX, mdef.Extents.MinY, mdef.Extents.MaxY);
if (!mapEnv.Contains(layout.Map.InitialView.CenterX, layout.Map.InitialView.CenterY))
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, string.Format(Properties.Resources.WL_StartViewOutsideExtentsWarning)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, ValidationStatusCode.Warning_WebLayout_InitialViewOutsideMapExtents, string.Format(Properties.Resources.WL_StartViewOutsideExtentsWarning)));
}
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(layout, ValidationStatus.Error, string.Format(Properties.Resources.WL_MapValidationError, layout.Map.ResourceId, msg)));
+ issues.Add(new ValidationIssue(layout, ValidationStatus.Error, ValidationStatusCode.Error_WebLayout_Generic, string.Format(Properties.Resources.WL_MapValidationError, layout.Map.ResourceId, msg)));
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/DrawingSourceValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -53,10 +53,10 @@
IDrawingSource dws = (IDrawingSource)resource;
if (string.IsNullOrEmpty(dws.SourceName))
- issues.Add(new ValidationIssue(resource, ValidationStatus.Error, Properties.Resources.DS_NoSourceSpecified));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Error, ValidationStatusCode.Error_DrawingSource_NoSourceDwf, Properties.Resources.DS_NoSourceSpecified));
if (string.IsNullOrEmpty(dws.CoordinateSpace))
- issues.Add(new ValidationIssue(resource, ValidationStatus.Information, Properties.Resources.DS_NoCoordinateSpace));
+ issues.Add(new ValidationIssue(resource, ValidationStatus.Information, ValidationStatusCode.Info_DrawingSource_NoCoordinateSpace, Properties.Resources.DS_NoCoordinateSpace));
context.MarkValidated(resource.ResourceID);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/FeatureSourceValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -58,25 +58,25 @@
//Note: Must be saved!
string s = feature.CurrentConnection.FeatureService.TestConnection(feature.ResourceID);
if (s.Trim().ToUpper() != true.ToString().ToUpper())
- return new ValidationIssue[] { new ValidationIssue(feature, ValidationStatus.Error, Properties.Resources.FS_ConnectionTestFailed) };
+ return new ValidationIssue[] { new ValidationIssue(feature, ValidationStatus.Error, ValidationStatusCode.Error_FeatureSource_ConnectionTestFailed, Properties.Resources.FS_ConnectionTestFailed) };
try
{
System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.InvariantCulture;
FdoSpatialContextList lst = context.GetSpatialContexts(feature.ResourceID);
if (lst == null || lst.SpatialContext == null || lst.SpatialContext.Count == 0)
- issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, Properties.Resources.FS_NoSpatialContextWarning));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, ValidationStatusCode.Warning_FeatureSource_NoSpatialContext, Properties.Resources.FS_NoSpatialContextWarning));
else
foreach (FdoSpatialContextListSpatialContext c in lst.SpatialContext)
if (c.Extent == null || c.Extent.LowerLeftCoordinate == null || c.Extent.UpperRightCoordinate == null)
- issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, Properties.Resources.FS_EmptySpatialContextWarning));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, ValidationStatusCode.Warning_FeatureSource_EmptySpatialContext, Properties.Resources.FS_EmptySpatialContextWarning));
else if (double.Parse(c.Extent.LowerLeftCoordinate.X, ci) <= -1000000 && double.Parse(c.Extent.LowerLeftCoordinate.Y, ci) <= -1000000 && double.Parse(c.Extent.UpperRightCoordinate.X, ci) >= 1000000 && double.Parse(c.Extent.UpperRightCoordinate.Y, ci) >= 1000000)
- issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, Properties.Resources.FS_DefaultSpatialContextWarning));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, ValidationStatusCode.Warning_FeatureSource_DefaultSpatialContext, Properties.Resources.FS_DefaultSpatialContextWarning));
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Properties.Resources.FS_SpatialContextReadError, msg)));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Error, ValidationStatusCode.Error_FeatureSource_SpatialContextReadError, string.Format(Properties.Resources.FS_SpatialContextReadError, msg)));
}
List<string> classes = new List<string>();
@@ -85,12 +85,12 @@
{
fsd = context.DescribeFeatureSource(feature.ResourceID);
if (fsd == null || fsd.Schemas.Length == 0)
- issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, Properties.Resources.FS_SchemasMissingWarning));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Warning, ValidationStatusCode.Warning_FeatureSource_NoSchemasFound, Properties.Resources.FS_SchemasMissingWarning));
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(feature, ValidationStatus.Error, string.Format(Properties.Resources.FS_SchemaReadError, msg)));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Error, ValidationStatusCode.Error_FeatureSource_SchemaReadError, string.Format(Properties.Resources.FS_SchemaReadError, msg)));
}
@@ -98,7 +98,7 @@
{
var ids = cl.IdentityProperties;
if (ids.Count == 0)
- issues.Add(new ValidationIssue(feature, ValidationStatus.Information, string.Format(Properties.Resources.FS_PrimaryKeyMissingInformation, cl.QualifiedName)));
+ issues.Add(new ValidationIssue(feature, ValidationStatus.Information, ValidationStatusCode.Info_FeatureSource_NoPrimaryKey, string.Format(Properties.Resources.FS_PrimaryKeyMissingInformation, cl.QualifiedName)));
}
context.MarkValidated(resource.ResourceID);
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/MapDefinitionValidator.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -60,9 +60,9 @@
foreach (IMapLayerGroup g in mdef.MapLayerGroup)
if (g.ShowInLegend && (g.LegendLabel == null || g.LegendLabel.Trim().Length == 0))
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, string.Format(Properties.Resources.MDF_GroupMissingLabelInformation, g.Name)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, ValidationStatusCode.Info_MapDefinition_GroupMissingLabelInformation, string.Format(Properties.Resources.MDF_GroupMissingLabelInformation, g.Name)));
else if (g.ShowInLegend && g.LegendLabel.Trim().ToLower() == "layer group")
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, string.Format(Properties.Resources.MDF_GroupHasDefaultLabelInformation, g.Name)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, ValidationStatusCode.Info_MapDefinition_GroupHasDefaultLabel, string.Format(Properties.Resources.MDF_GroupHasDefaultLabelInformation, g.Name)));
List<IBaseMapLayer> layers = new List<IBaseMapLayer>();
foreach (IBaseMapLayer l in mdef.MapLayer)
@@ -71,7 +71,7 @@
if (mdef.BaseMap != null && mdef.BaseMap.HasGroups())
{
if (mdef.BaseMap.ScaleCount == 0)
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, Properties.Resources.MDF_NoFiniteDisplayScalesSpecified));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, ValidationStatusCode.Error_MapDefinition_NoFiniteDisplayScales, Properties.Resources.MDF_NoFiniteDisplayScalesSpecified));
foreach (IBaseMapGroup g in mdef.BaseMap.BaseMapLayerGroup)
{
@@ -84,12 +84,12 @@
foreach (IBaseMapLayer l in layers)
{
if (nameCounter.ContainsKey(l.Name))
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, string.Format(Properties.Resources.MDF_LayerNameDuplicateWarning, l.Name, l.ResourceId, nameCounter[l.Name].ResourceId)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Warning, ValidationStatusCode.Warning_MapDefinition_DuplicateLayerName, string.Format(Properties.Resources.MDF_LayerNameDuplicateWarning, l.Name, l.ResourceId, nameCounter[l.Name].ResourceId)));
else
nameCounter.Add(l.Name, l);
if (l.ShowInLegend && (string.IsNullOrEmpty(l.LegendLabel) || l.LegendLabel.Trim().Length == 0))
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, string.Format(Properties.Resources.MDF_LayerMissingLabelInformation, l.Name)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Information, ValidationStatusCode.Warning_MapDefinition_LayerMissingLegendLabel, string.Format(Properties.Resources.MDF_LayerMissingLabelInformation, l.Name)));
if (recurse)
{
@@ -126,11 +126,11 @@
FdoSpatialContextList scList = context.GetSpatialContexts(fs.ResourceID);
if (scList.SpatialContext == null || scList.SpatialContext.Count == 0)
- issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, string.Format(Properties.Resources.MDF_MissingSpatialContextWarning, fs.ResourceID)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, ValidationStatusCode.Warning_MapDefinition_MissingSpatialContext, string.Format(Properties.Resources.MDF_MissingSpatialContextWarning, fs.ResourceID)));
else
{
if (scList.SpatialContext.Count > 1)
- issues.Add(new ValidationIssue(fs, ValidationStatus.Information, string.Format(Properties.Resources.MDF_MultipleSpatialContextsInformation, fs.ResourceID)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Information, ValidationStatusCode.Info_MapDefinition_MultipleSpatialContexts, string.Format(Properties.Resources.MDF_MultipleSpatialContextsInformation, fs.ResourceID)));
bool skipGeomCheck = false;
@@ -139,9 +139,9 @@
if (scList.SpatialContext[0].CoordinateSystemWkt != mdef.CoordinateSystem)
{
if (layer.SubLayer.LayerType == LayerType.Raster && mdef.CurrentConnection.SiteVersion <= SiteVersions.GetVersion(OSGeo.MapGuide.MaestroAPI.KnownSiteVersions.MapGuideOS2_0_2))
- issues.Add(new ValidationIssue(fs, ValidationStatus.Error, string.Format(Properties.Resources.MDF_RasterReprojectionError, fs.ResourceID)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Error, ValidationStatusCode.Error_MapDefinition_RasterReprojection, string.Format(Properties.Resources.MDF_RasterReprojectionError, fs.ResourceID)));
else
- issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, string.Format(Properties.Resources.MDF_DataReprojectionWarning, fs.ResourceID)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, ValidationStatusCode.Warning_MapDefinition_LayerReprojection, string.Format(Properties.Resources.MDF_DataReprojectionWarning, fs.ResourceID)));
skipGeomCheck = true;
}
@@ -150,20 +150,20 @@
{
var env = fs.GetSpatialExtent(vl.FeatureName, vl.Geometry);
if (!env.Intersects(mapEnv))
- issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, string.Format(Properties.Resources.MDF_DataOutsideMapWarning, fs.ResourceID)));
+ issues.Add(new ValidationIssue(fs, ValidationStatus.Warning, ValidationStatusCode.Warning_MapDefinition_DataOutsideMapBounds, string.Format(Properties.Resources.MDF_DataOutsideMapWarning, fs.ResourceID)));
}
}
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(layer, ValidationStatus.Error, string.Format(Properties.Resources.MDF_ResourceReadError, fs.ResourceID, msg)));
+ issues.Add(new ValidationIssue(layer, ValidationStatus.Error, ValidationStatusCode.Error_MapDefinition_ResourceRead, string.Format(Properties.Resources.MDF_ResourceReadError, fs.ResourceID, msg)));
}
}
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Properties.Resources.MDF_FeatureSourceReadError, l.ResourceId, msg)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, ValidationStatusCode.Error_MapDefinition_FeatureSourceRead, string.Format(Properties.Resources.MDF_FeatureSourceReadError, l.ResourceId, msg)));
}
}
@@ -171,7 +171,7 @@
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, string.Format(Properties.Resources.MDF_LayerReadError, l.ResourceId, msg)));
+ issues.Add(new ValidationIssue(mdef, ValidationStatus.Error, ValidationStatusCode.Error_MapDefinition_LayerRead, string.Format(Properties.Resources.MDF_LayerReadError, l.ResourceId, msg)));
}
}
}
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Resource/Validation/ResourceValidatorSet.cs 2011-03-23 11:45:27 UTC (rev 5658)
@@ -74,7 +74,7 @@
var issueSet = new ValidationResultSet();
if (!HasValidator(item.ResourceType, item.ResourceVersion))
{
- issueSet.AddIssue(new ValidationIssue(item, ValidationStatus.Warning, string.Format(Properties.Resources.ERR_NO_REGISTERED_VALIDATOR, item.ResourceType, item.ResourceVersion)));
+ issueSet.AddIssue(new ValidationIssue(item, ValidationStatus.Warning, ValidationStatusCode.Warning_General_NoRegisteredValidatorForResource, string.Format(Properties.Resources.ERR_NO_REGISTERED_VALIDATOR, item.ResourceType, item.ResourceVersion)));
}
else
{
@@ -92,7 +92,7 @@
catch (Exception ex)
{
string msg = NestedExceptionMessageProcessor.GetFullMessage(ex);
- issueSet.AddIssue(new ValidationIssue(item, ValidationStatus.Error, "Failed in validator: " + msg));
+ issueSet.AddIssue(new ValidationIssue(item, ValidationStatus.Error, ValidationStatusCode.Error_General_ValidationError, "Failed in validator: " + msg));
}
}
}
Modified: trunk/Tools/Maestro/build.bat
===================================================================
--- trunk/Tools/Maestro/build.bat 2011-03-23 05:51:23 UTC (rev 5657)
+++ trunk/Tools/Maestro/build.bat 2011-03-23 11:45:27 UTC (rev 5658)
@@ -2,7 +2,7 @@
SET TYPEACTION=build
SET TYPEBUILD=Release
SET PLATFORM=Any CPU
-SET RELEASE_VERSION=3.0b1
+SET RELEASE_VERSION=3.0b2
SET OLDPATH=%PATH%
SET PATH=%PATH%;%CD%\Thirdparty\NSIS;C:\Windows\Microsoft.NET\Framework\v3.5
More information about the mapguide-commits
mailing list