Parsley is a template parser for WO. It's based on WOOgnl and thus supports it's inline binding syntax. It's a pure WO project, meaning it does not require Project Wonder (although, of course, it works fine with Project Wonder as well).
To get nice inline error messages when template parser errors occur (rather than huge stack-tracey exception pages). Currently, this only applies when you attempt to use an element/component that doesn't exist and for handling UnknownKeyEception
(badly formed keypaths in bindings) and WODynamicElementCreationException
which for well designed elements will cover things like wrong binding configuration.
Actually, this isn't the real "why" of the project. But it's currently the nicest byproduct visible to the user, making for a good cover story.
To use the current development version of the parser, clone this repo and import the project to your workspace or mvn install
it.
Then add this dependency to your pom.xml
:
<dependency>
<groupId>is.rebbi</groupId>
<artifactId>parsley</artifactId>
<version>1.2.0-SNAPSHOT</version>
</dependency>
Parsley will soon start releasing to the WOCommunity maven repo.
To enable Parsley, add this somewhere in your application's initialization, for example in the Application class constructor:
public Application() {
parsley.Parsley.register();
parsley.Parsley.showInlineRenderingErrors( isDevelopmentModeSafe() ); // For enabling inline error reporting in dev mode
}
- We don't support OGNL expressions in binding paths. Support could be added as a plugin, but I'm not a fan of it myself so...
- We don't support WOOGnl's
parseStandardTags
behaviour. Might be looked into if anyone actually uses it, which I doubt. - We don't support tag processors (WOOgnl's
<wo:not>
being an example use). Never used them but the idea isn't that bad. However functionality of that kind needs work in the parser so that's for later. - For inline bindings, only exactly
$true
and$false
will get interpreted as booleans.
- Only handle rendering exceptions inline that we excplicitly know how to handle
- Initial release