Changes between Version 2 and Version 3 of ValidationHook
- Timestamp:
- Aug 2, 2012, 1:12:53 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ValidationHook
v2 v3 38 38 == Proposal == 39 39 40 Currently, a standard post-validation is invoked from 2 places in !DataManager, 'saveValidationStatus ' which saves a summary of the validation result to the database. This proposal would replace these calls with a call to a new method 'postValidation' which first does the same as does 'saveValidationStatus' now, and then invokes the pluggable Validation hook, if any is configured.40 Currently, a standard post-validation is invoked from 2 places in !DataManager, 'saveValidationStatus()' which saves a summary of the validation result to the database. This proposal would replace these calls with a call to a new method 'postValidation' which first does the same as does 'saveValidationStatus()' now, and then invokes the pluggable Validation hook, if any is configured. 41 41 42 It does this in a manner similar to the !StatusActions hook: a Factory class takes the class name of the hook implementation from config.xml. If none is configured, nothing happens and the program behaves exactly as without this proposal. If one is configured, reflection is used to instantiate the class, execute an 'init()' method, and execute an 'onValidate ' method.42 It does this in a manner similar to the !StatusActions hook: a Factory class takes the class name of the hook implementation from config.xml. If none is configured, nothing happens and the program behaves exactly as without this proposal. If one is configured, reflection is used to instantiate the class, execute an 'init()' method, and execute an 'onValidate()' method. 43 43 44 44 User-provided implementations of the Validation hook must conform to the contract of this interface: