Permalink
Browse files

fixed SPRNET-1192

fixed SPRNET-1072
  • Loading branch information...
1 parent 06de215 commit f28941261e0a5c908265817793f086badf3cced3 @eeichinger eeichinger committed Apr 16, 2009
View
@@ -1,3 +1,23 @@
+Changes (1.2.0 to 1.2.1)
+
+Spring.Core
+-----------
+
+1. within an ValidationGroup element (<v:group>,<v:exclusive>,..), nested validator elements now must occur after any
+ <v:message>, <v:action> or <v:property> elements. The following was allowed previously, but now will raise a schema
+ validation error:
+
+ <v:group ..>
+ <v:validator ...>
+ <v:action ...>
+
+ change this to
+
+ <v:group ..>
+ <v:action ...>
+ <v:validator ...>
+
+
Changes (1.1.2 to 1.2 RC1 or greater)
Spring.Core
View
@@ -1,6 +1,13 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F04753EF-7A1B-4837-AB63-8C0821E8155D}"
+ ProjectSection(SolutionItems) = preProject
+ BreakingChanges-1.2.txt = BreakingChanges-1.2.txt
+ changelog.txt = changelog.txt
+ readme.txt = readme.txt
+ Spring.build = Spring.build
+ Spring.include = Spring.include
+ EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Core.2008", "src\Spring\Spring.Core\Spring.Core.2008.csproj", "{710961A3-0DF4-49E4-A26E-F5B9C044AC84}"
EndProject
@@ -23,6 +23,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.2008", "..\..\s
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spring.Data.Tests.2008", "..\..\test\Spring\Spring.Data.Tests\Spring.Data.Tests.2008.csproj", "{ACD39D47-1811-40FA-9E7E-5DEA5B9CE6C0}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D8C99188-BAC7-4308-B898-6409EA6933B2}"
+ ProjectSection(SolutionItems) = preProject
+ ..\..\BreakingChanges-1.2.txt = ..\..\BreakingChanges-1.2.txt
+ ..\..\changelog.txt = ..\..\changelog.txt
+ ..\..\readme.txt = ..\..\readme.txt
+ ..\..\Spring.build = ..\..\Spring.build
+ ..\..\Spring.include = ..\..\Spring.include
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|.NET = Debug|.NET
@@ -121,35 +121,23 @@ private IObjectDefinition ParseValidator(string id, XmlElement element, ParserCo
{
string typeName = GetTypeName(element);
string parent = GetAttributeValue(element, ObjectDefinitionConstants.ParentAttribute);
- string test = GetAttributeValue(element, ValidatorDefinitionConstants.TestAttribute);
- string when = GetAttributeValue(element, ValidatorDefinitionConstants.WhenAttribute);
- string validateAll = GetAttributeValue(element, ValidatorDefinitionConstants.CollectionValidateAllAttribute);
- string context = GetAttributeValue(element, ValidatorDefinitionConstants.CollectionContextAttribute);
- string includeElementsErrors = GetAttributeValue(element, ValidatorDefinitionConstants.CollectionIncludeElementsErrors);
string name = "validator: " + (StringUtils.HasText(id) ? id : this.definitionCount.ToString());
MutablePropertyValues properties = new MutablePropertyValues();
- if (StringUtils.HasText(test))
- {
- properties.Add("Test", test);
- }
- if (StringUtils.HasText(when))
- {
- properties.Add("When", when);
- }
- if (StringUtils.HasText(validateAll))
- {
- properties.Add("ValidateAll", validateAll);
- }
- if (StringUtils.HasText(validateAll))
- {
- properties.Add("Context", context);
- }
- if (StringUtils.HasText(includeElementsErrors))
- {
- properties.Add("IncludeElementErrors", includeElementsErrors);
- }
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.TestAttribute, properties, "Test");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.WhenAttribute, properties, "When");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.GroupFastValidateAttribute, properties, "FastValidate");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.RegexExpressionAttribute, properties, "Expression");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.CollectionValidateAllAttribute, properties, "ValidateAll");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.CollectionContextAttribute, properties, "Context");
+ ParseAttributeIntoProperty(element, ValidatorDefinitionConstants.CollectionIncludeElementsErrors, properties, "IncludeElementErrors");
+
+// TODO: (EE) - is this a mistake to check 'validateAll' but add 'context' then?
+// if (StringUtils.HasText(validateAll))
+// {
+// properties.Add("Context", context);
+// }
ManagedList nestedValidators = new ManagedList();
ManagedList actions = new ManagedList();
@@ -200,6 +188,19 @@ IConfigurableObjectDefinition od
}
/// <summary>
+ /// Parses the attribute of the given <paramref name="attName"/> from the XmlElement and, if available, adds a property of the given <paramref name="propName"/> with
+ /// the parsed value.
+ /// </summary>
+ private void ParseAttributeIntoProperty(XmlElement element, string attName, MutablePropertyValues properties, string propName)
+ {
+ string test = GetAttributeValue(element, attName);
+ if (StringUtils.HasText(test))
+ {
+ properties.Add(propName, test);
+ }
+ }
+
+ /// <summary>
/// Parses and potentially registers a validator.
/// </summary>
/// <remarks>
@@ -345,6 +346,10 @@ private class ValidatorDefinitionConstants
public const string ReferenceNameAttribute = "name";
public const string ReferenceContextAttribute = "context";
+ public const string RegexExpressionAttribute = "fast-validate";
+
+ public const string GroupFastValidateAttribute = "fast-validate";
+
public const string CollectionValidateAllAttribute = "validate-all";
public const string CollectionContextAttribute = "context";
public const string CollectionIncludeElementsErrors = "include-element-errors";
Oops, something went wrong.

0 comments on commit f289412

Please sign in to comment.