Interface ViewValidationService


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

    Modifier and Type
    Method
    Description
    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.
    validateView(ViewModel model, String forcedValidationState)
    Validate the view against the specific validationState instead of the default (current state).
    Validate the view against the next state based on the order of the states in the views StateMapping.
    void
    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
    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 Details

    • validateView

      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(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:
      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(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:
      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(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:
      model - the model which contains the values to validated
    • validateViewSimulation

      void validateViewSimulation(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:
      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