Nova Model Binding Validation

Registered by Wilson

Allow page components to use JSR-303 annotations to validate constraints immediately after input using declarative annotations.

Blueprint information

Status:
Not started
Approver:
Wilson
Priority:
Undefined
Drafter:
Wilson
Direction:
Needs approval
Assignee:
Wilson
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

Nova Model Binding Validation allows developers to supply validation metadata to a domain model declaratively using Java annotations via JSR-303. Any validation error message symbols are propagated to the page using a message context implementation.

class Booking {

    @Future(message="booking.not.in.future")
    private Date bookingDate;

    public void setBookingDate(Date bookingDate) {
        this.bookingDate = bookingDate;
    }

   public Date getBookingDate() {
      return bookingDate;
   }

}

<prompt-collect name="getBookingDate" activity="get.booking"
                         binding-expression="bookingDate">
    <prompt-set name="getBookingDate" />
    <grammar-set name="getBookingDate" />
    <validate-property>
        <error name="booking.not.in.future" />
            <prompt-set name="mustBeInPast" />
        </error>
   </validate-property>
<prompt-collect>

We may also require that the WHOLE bean must be valid (such as to enforce business model validation):

<prompt-collect name="getBookingDate" activity="get.booking"
                         binding-expression="bookingDate">
    <prompt-set name="getBookingDate" />
    <grammar-set name="getBookingDate" />
    <validate-model>
         <error name="bla.foo.yadda"/>
    </validate-model>
<prompt-collect>

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.