org.kuali.rice.krad.service
Interface ViewValidationService

All Known Implementing Classes:
ViewValidationServiceImpl

public interface ViewValidationService

Validation service for KRAD views. The ViewValidationService uses the DictionaryValidationService to validate the fields of the View by using the constraints that were set at either the InputField or AttributeDefinition level for that field. If errors/warnings are found they are added to the messageMap and when the view is returned these messages are displayed.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 DictionaryValidationResult validateView(ViewModel model)
          This is the main validation method that should be used when validating Views Validates the view based on the model passed in, this will correctly use previousView by default as it automatically contains the generated data the validation requires.
 DictionaryValidationResult validateView(View view, ViewModel model)
          Additional validation method when you want to explicitly define the View being validated.
 DictionaryValidationResult validateView(View view, ViewModel model, String forcedValidationState)
          Validate the view against the specific validationState instead of the default (current state).
 DictionaryValidationResult validateViewAgainstNextState(View view, ViewModel model)
          Validate the view against the next state based on the order of the states in the views StateMapping.
 void validateViewSimulation(View view, ViewModel model)
          Simulate view validation - this will run all validations against all states from the current state to the last state in the list of states in the view's stateMapping.
 void validateViewSimulation(View view, ViewModel model, String untilState)
          Simulate view validation - this will run all validations against all states from the current state to the untilState specified in the list of states in the view's stateMapping.
 

Method Detail

validateView

DictionaryValidationResult validateView(ViewModel model)
This is the main validation method that should be used when validating Views Validates the view based on the model passed in, this will correctly use previousView by default as it automatically contains the generated data the validation requires. Validates against the current state if state based validation is setup.

Parameters:
model - the model which contains the values (and View) to validated
Returns:
DictionaryValidationResult that contains any errors/messages if any, messages will have already been added to the MessageMap

validateView

DictionaryValidationResult validateView(View view,
                                        ViewModel model)
Additional validation method when you want to explicitly define the View being validated. Note that the view must have the correct binding information on its InputFields already generated by its lifecycle for this method to be used correctly. Validates against the current state if state based validation is setup.

Parameters:
view - the View to be validated
model - the model which contains the values to validated
Returns:
DictionaryValidationResult that contains any errors/messages if any,, messages will have already been added to the MessageMap

validateView

DictionaryValidationResult validateView(View view,
                                        ViewModel model,
                                        String forcedValidationState)
Validate the view against the specific validationState instead of the default (current state). If forcedValidationState is null, validates against the current state if state validation is setup.

Parameters:
view - the View to be validated
model - the model which contains the values to validated
forcedValidationState - the state being validated against
Returns:
that contains any errors/messages if any,, messages will have already been added to the MessageMap

validateViewAgainstNextState

DictionaryValidationResult validateViewAgainstNextState(View view,
                                                        ViewModel model)
Validate the view against the next state based on the order of the states in the views StateMapping. This will validate against current state + 1. If there is no next state, this will validate against the current state.

Parameters:
view - the View to be validated
model - the model which contains the values to validated
Returns:
that contains any errors/messages if any,, messages will have already been added to the MessageMap

validateViewSimulation

void validateViewSimulation(View view,
                            ViewModel model)
Simulate view validation - this will run all validations against all states from the current state to the last state in the list of states in the view's stateMapping. Validation errors received for the current state will be added as errors to the MessageMap. Validation errors for future states will be warnings.

Parameters:
view - the View to be validated
model - the model which contains the values to validated

validateViewSimulation

void validateViewSimulation(View view,
                            ViewModel model,
                            String untilState)
Simulate view validation - this will run all validations against all states from the current state to the untilState specified in the list of states in the view's stateMapping. Validation errors received for the current state will be added as errors to the MessageMap. Validation errors for future states will be warnings.

Parameters:
view - the View to be validated
model - the model which contains the values to validated
untilState - state to perform simulation to, if not set performs simulation up to the last state


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.