Community
Participate
Working Groups
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.
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.
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.
sdk part implemented
Bug closed, shipped with 3.8.0 (Juno)