Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349659 - Central Input Validation derived from config
Summary: Central Input Validation derived from config
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-17 04:58 EDT by Ivan Motsch CLA
Modified: 2021-08-19 11:07 EDT (History)
0 users

See Also:
mvi: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Motsch CLA 2011-06-17 04:58:44 EDT
Scout has two sides: client modeling and server service modeling.
Building client models involves configuring properties such as mandatory (required), maxLength, min,max, codeType etc.

SDK creates and manages the form data for a form. The form data is the "data" copy of the form (bean).

It would be of great benefit if the sdk would also copy in some form the validation rule attributes to the form data, so the server side could (scout-based) perform central iniput validation based on these rules.
Comment 1 Ivan Motsch CLA 2011-06-17 05:13:02 EDT
Base concept is designed and implemented:
There is a new annotation "ValidationRule" that is added to all getConfigured methods on form fields that influence validation. Can also be custom ones.

For example the AbstractStringField has such an annotation at 
@ValidationRule(ValidationRule.MAX_LENGTH)
getConfiguredMaxLength

The sdk will detect this and add code to the form field data (shared area).

The serve side may override the ServiceTunnelServlet.filterInbound method and perform all the default checks with 3 lines of code (central input validation):

if(obj instanceof AbstractFormData){
  new DefaultFormDataValidator((AbstractFormData)obj).validate();
}

So far the runtime framework part is done, the sdk part is in development.
Comment 2 Judith Gull CLA 2013-03-05 04:48:27 EST
I updated the javadoc in ServiceTunnelServlet to match the current implementation.

What is missing for Scout SDK? Some code is already generated for input validation in the formdata. Please close this ticket and create a ticket for Scout SDK with the desired features.
Comment 3 Matthias Villiger CLA 2013-03-07 05:53:14 EST
sdk part implemented
Comment 4 Matthias Villiger CLA 2013-03-07 05:56:24 EST
Bug closed, shipped with 3.8.0 (Juno)