I think I have come up with a solution to fix the mini-language code:
mini-language auto-correction. If enabled, the element models correct
common mistakes and save the corrections to the original file. This will
still leave some warnings that will need to be fixed manually.
-Adrian
On 4/3/2012 2:07 PM, Adrian Crum wrote:
I added parsing validation to the <set> element to see how it will
work. The validation can be enabled/disabled through a property setting.
Just running the load-demo ant task generates hundreds of warnings -
most of them are caused by <set> attributes being used incorrectly. On
the positive side, a lot of nonsensical code is being revealed; on the
negative side, the log is filled with warnings.
I'm not sure what I will do with this. If I commit the validation
code, then we will have a lot of work to do to clean up the
mini-language code.
-Adrian
On 3/8/2012 6:55 PM, Adrian Crum wrote:
Some more food for thought...
Looking through the Java code, I can see that there is no runtime
validation being performed. Granted, a decent XML editor will warn
you about required attributes and elements and such, but not everyone
uses that type of XML editor. Worse yet, there is no way to know
you've done something wrong - because mini-lang hides the errors in
verbose log statements. So, I would like to add runtime validation.
If the script is coded improperly, then it should throw an exception.
Another change I would like to make is to remove default attribute
values in the schema. From my perspective, defaults should be in the
mini-language code. The wiki page has demonstrated to me how
difficult it is to understand what's going on when you have to look
through Java code, and then also look through the schema to see what
values it is supplying. Plus, it makes me wonder how mini-language
will behave when the server doesn't have access to the schema.
Which brings up another point: Once the grammar has been cleaned up,
we will need a new schema. I think we need to start giving our
schemas version numbers so that XML editors and runtime XML
validation will work properly.
-Adrian
On 3/8/2012 6:19 PM, Jacopo Cappellato wrote:
On Mar 8, 2012, at 7:03 PM, Adrian Crum wrote:
B) instead of:
<fail-property resource="ErrorMessages" property="FooError" />
we could have
<fail-property property="ErrorMessages.FooError" />
Keep in mind that UEL would interpret FooError as an element of a
Map called ErrorMessages.
What you suggested can be done, but it will require more
modifications to the UEL integration - something I try to avoid
because it causes more problems than it solves. I recommend we keep
the resource attribute.
Np then, I was not even sure it was a good idea and if requires
customizations to uel then I agree it is not worth the effort.
Thank you,
Jacopo