• Save
MyFaces Extensions Validator r3 News
Upcoming SlideShare
Loading in...5
×
 

MyFaces Extensions Validator r3 News

on

  • 5,758 views

These slides give a short overview of the new features of the 3rd release of MyFaces ExtVal

These slides give a short overview of the new features of the 3rd release of MyFaces ExtVal

Statistics

Views

Total Views
5,758
Views on SlideShare
3,670
Embed Views
2,088

Actions

Likes
0
Downloads
0
Comments
0

37 Embeds 2,088

http://os890.blogspot.com 1076
http://os890.blogspot.co.at 334
http://os890.blogspot.de 250
http://os890.blogspot.com.br 65
http://os890.blogspot.nl 44
http://os890.blogspot.fr 31
http://os890.blogspot.se 28
http://os890.blogspot.no 24
http://os890.blogspot.ca 24
http://os890.blogspot.in 21
http://os890.blogspot.mx 18
http://os890.blogspot.cz 17
http://www.slideshare.net 17
http://os890.blogspot.it 16
http://os890.blogspot.com.es 15
http://os890.blogspot.ch 14
http://os890.blogspot.jp 13
http://os890.blogspot.co.uk 13
http://os890.blogspot.ru 8
http://os890.blogspot.hk 8
http://os890.blogspot.com.au 8
http://os890.blogspot.be 7
http://os890.blogspot.dk 6
http://os890.blogspot.co.nz 4
http://os890.blogspot.fi 3
http://os890.blogspot.kr 3
http://os890.blogspot.ie 3
http://os890.blogspot.sk 3
http://os890.blogspot.gr 2
http://os890.blogspot.hu 2
http://translate.googleusercontent.com 2
http://os890.blogspot.pt 2
http://os890.blogspot.co.il 2
http://os890.blogspot.com.tr 2
http://os890.blogspot.com.ar 1
http://os890.blogspot.tw 1
http://os890.blogspot.ae 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    MyFaces Extensions Validator r3 News MyFaces Extensions Validator r3 News Presentation Transcript

    • JSF in der Praxis 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 1
    • MyFaces Extensions-Validator What’s new in version 3 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 2
    • Agenda - 1 • Bean-Validation Integration Module (JSR 303 for JSF 1.x & 2.x + special Features) • Improved Support for 3rd Party Component Libraries • Typesafe Constraint Parameters • Constraint Severity • Pluggable Storages • Meta-Data Filters • Validation Interception 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 3
    • Agenda - 2 • SkipValidationEvaluator • Optional Invocation Order • Integration of RAD-Add-on • Additional Static Syntax for @JoinValidation • Empty-/Null-Value Markers • Other Improvements • New Add-ons 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 4
    • Bean-Validation Integration • JSR 303 for JSF 1.x and JSF 2.x • Integration Module as alternative/addition to the Property-Validation Module • Compatible with all BV conform implementations • Module provides additional features • Advantage: It’s the (new) standard • Disadvantage: Not all features of ExtVal will be available (due to spec. restrictions) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 5
    • ExtVal vs. JSF 2 BV-Integration • With ExtVal • @NotNull validation enabled by default (deactivation via std. JSF config) • Typesafe group validation • No Validation Markup in the Page • The ExtValBeanValidationContext allows custom implementations e.g. tags, configs,… • Component initialization (e.g. @NotNull client-side required) • Severity aware validation 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 6
    • ExtVal vs. JSF 2 BV-Integration • Model based validation • Sorted violation messages • Out-of-the-box dependency injection support for constraint-validators 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 7
    • ExtVal Annotations for BV • @BeanValidation for Group-Validation • @ModelValidation class level validation of an explicit or implicit target 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 8
    • @BeanValidation • Normally used in Page-Beans • Available attributes • viewIds (default: * for all pages) • useGroups (default: Default.class) • restrictGroups (default: -) • conditions (default: #{true}) • modelValidation (default: -) • List (equivalent to multi-constraint syntax of JSR 303) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 9
    • @BeanValidation - Examples • Simple group validation @BeanValidation(useGroups=Admin.class) • Group validation for a specific view @BeanValidation(viewIds="/login.xhtml", useGroups=Admin.class) • If group validation is defined for the whole bean, it might be required to exclude groups for special properties and/or views @BeanValidation(restrictGroups=Admin.class) • Conditional group validation @BeanValidation(useGroups = Admin.class, conditions="#{user.role.privileged}") 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 10
    • @ModelValidation • To trigger bean-validation after „Update model values" phase • Also uses information of @BeanValidation • Difference: @ModelValidation isn‘t accumulated • Available attributes • isActive (default: false) • displayInline (default: false) • validationTargets (default: current base object) • message (default: -) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 11
    • 3rd Party Component Libraries • Improved support for • Trinidad • ICEfaces • RichFaces • New sandbox project e.g. for external component support modules to improve compatibility with 3rd party component libraries (http://code.google.com/p/sandbox890) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 12
    • Typesafe Constraint Parameters • Similar to the payload-attribute of BV (Payload is the subset of Constraint Parameters of ExtVal) • Allows typesafe and reusable parameters • Simple example - alternative for: @MyConstraint(payload = "warn") With Bean-Validation: @MyConstraint(payload = Warn.class) • Processed by Add-ons or Component Libraries 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 13
    • Constraint Severity • Constraints with Severity Info and Warn don‘t "stop" the JSF-Lifecycle • ExtVal 1.x.3 provides out-of-the-box • ViolationSeverity.Info.class • ViolationSeverity.Warn.class • ViolationSeverity.Error.class (= default) • ViolationSeverity.Fatal.class 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 14
    • Optional: Pluggable Parameters • ExtVal allows to map custom classes to the default implementations (esp. to avoid dependencies of BV Constraints to ExtVal) • Mapping via • Global-ExtVal-Parameter • Static config • Examples are available in the ExtVal Wiki 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 15
    • Pluggable Storages • Generic mechanism which provides scoped storages with custom APIs • Allows to create multiple storages of the same type with different names • Allows to create different storage types • StorageManager (per storage type) • Responsible for scoping • Allows to create and reset (custom) storages via an API (independent of the storage type) • Allows to provide custom (tweaked) storage implementations easily 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 16
    • Meta-Data Filters • Filters meta-data before it gets added to the meta-data storage • Only for static meta-data manipulation • Meta-data extraction interceptors are only for dynamic meta-data manipulation 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 17
    • Validation Interception - 1 • Invocation: • Global interceptors: before and after the validation of a property • Local interceptors: before and after the validation of a constraint • Allows to bypass validation of a • Property • Constraint 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 18
    • Validation Interception - Example • Implementation public class CustomInterceptor implements PropertyValidationInterceptor { public boolean beforeValidation( FacesContext fC, UIComponent c, Object convertedObject, Map<String, Object> p) { //... return true; } public void afterValidation( FacesContext fC, UIComponent c, Object convertedObject, Map<String, Object> p) { //... } } 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 19
    • Validation Interception - Example • Usage • Global interceptors ExtValContext.getContext() .addPropertyValidationInterceptor( new CustomInterceptor()); • Local interceptors @Required(parameters = CustomInterceptor.class) private String name; 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 20
    • SkipValidationEvaluator • Evaluates if the validation process for the current property should be skipped • Allows to provide a custom evaluator 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 21
    • Optional Invocation Order • Classes which implement an interface which is annotated with @InvocationOrderSupport are allowed to use @InvocationOrder • The annotation allows to register artifacts which get called e.g. before internal artifacts • Default order: 1000 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 22
    • Integration of RAD-Add-on • It‘s possible to use input components without value-bindings. • Use-Case: During prototyping sometimes developers have to create dummy pages without functionality. 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 23
    • Static Syntax for @JoinValidation • In addition to the existing notations it‘s possible to refer a target property via the fully qualified class name + the property name • Example: @JoinValidation("at.irian.demo.domain.Person:password") 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 24
    • Empty-/Null-Value Markers • Marker for validation strategies instead of actively ignoring empty/null values • Via Annotations • @EmptyValueAwareValidationStrategy • @NullValueAwareValidationStrategy 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 25
    • Other Improvements • Structural improvements • Performance improvements • (JSF-) ProjectStage support 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 26
    • New Add-ons - 1 • Add-ons compatible with Property- and Bean-Validation module • Transactional model validation (light) • Continue with warnings • Add-ons compatible with Property- Validation module • Advanced meta-data • Java based config (Syntax inspired by Google Guice) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 27
    • New Add-ons - 2 • Bean-Validation module • Spring managed constraint validation (us dependency injection in custom constraint validator implementations) 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 28
    • Links • http://svn.apache.org/repos/asf/myfaces/extensi ons/validator • http://issues.apache.org/jira/browse/EXTVAL • http://wiki.apache.org/myfaces/Extensions/Valid ator/Versions/Versions/UpgradeGuide • http://os890.blogspot.com • http://code.google.com/p/os890/source/browse/tr unk/java/web/jsf/extval • http://people.apache.org/~gpetracek/myfaces/ex tval 24.03.2010 DI (FH) Gerhard Petracek / MyFaces-Extensions-Validator 29