org.kuali.rice.krad.service.impl
Class ViewValidationServiceImpl

java.lang.Object
  extended by org.kuali.rice.krad.service.impl.ViewValidationServiceImpl
All Implemented Interfaces:
ViewValidationService

public class ViewValidationServiceImpl
extends Object
implements ViewValidationService

Implementation of Validation service for views, uses the same validation mechanisms as DictionaryValidationService but uses a different AttributeValueReader to get the correct information from InputFields - which include any AttributeDefinition defined attributes, if defined and not overriden

See Also:
ViewValidationService

Field Summary
protected  DictionaryValidationService dictionaryValidationService
           
 
Constructor Summary
ViewValidationServiceImpl()
           
 
Method Summary
 DictionaryValidationService getDictionaryValidationService()
          Gets the DictionaryValidationService to use for View validation
 void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
          Set the DictionaryValidationService
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dictionaryValidationService

protected DictionaryValidationService dictionaryValidationService
Constructor Detail

ViewValidationServiceImpl

public ViewValidationServiceImpl()
Method Detail

validateView

public DictionaryValidationResult validateView(ViewModel model)
Description copied from interface: ViewValidationService
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.

Specified by:
validateView in interface ViewValidationService
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
See Also:
ViewValidationService.validateView(org.kuali.rice.krad.uif.view.ViewModel)

validateView

public DictionaryValidationResult validateView(View view,
                                               ViewModel model)
Description copied from interface: ViewValidationService
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.

Specified by:
validateView in interface ViewValidationService
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
See Also:
ViewValidationService.validateView(View, ViewModel)

validateViewSimulation

public void validateViewSimulation(View view,
                                   ViewModel model)
Description copied from interface: ViewValidationService
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.

Specified by:
validateViewSimulation in interface ViewValidationService
Parameters:
view - the View to be validated
model - the model which contains the values to validated
See Also:
ViewValidationService.validateViewSimulation(View, ViewModel)

validateViewSimulation

public void validateViewSimulation(View view,
                                   ViewModel model,
                                   String untilState)
Description copied from interface: ViewValidationService
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.

Specified by:
validateViewSimulation in interface ViewValidationService
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
See Also:
ViewValidationService.validateViewSimulation(View, ViewModel, String)

validateView

public DictionaryValidationResult validateView(View view,
                                               ViewModel model,
                                               String forcedValidationState)
Description copied from interface: ViewValidationService
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.

Specified by:
validateView in interface ViewValidationService
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
See Also:
ViewValidationService.validateView(View, ViewModel, String)

validateViewAgainstNextState

public DictionaryValidationResult validateViewAgainstNextState(View view,
                                                               ViewModel model)
Description copied from interface: ViewValidationService
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.

Specified by:
validateViewAgainstNextState in interface ViewValidationService
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
See Also:
ViewValidationService.validateViewAgainstNextState(View, ViewModel)

getDictionaryValidationService

public DictionaryValidationService getDictionaryValidationService()
Gets the DictionaryValidationService to use for View validation

Returns:
DictionaryValidationService

setDictionaryValidationService

public void setDictionaryValidationService(DictionaryValidationService dictionaryValidationService)
Set the DictionaryValidationService

Parameters:
dictionaryValidationService -


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