Skip to content
Stephan Hirsch edited this page Oct 9, 2018 · 5 revisions

Layout

Configuration

There is one configuration file containing validation rules. For Sources the filename is "conf/editor_configuration/default/configurations/SourcesValidation". The yml file has two sections:

  • server with rules containing server side validation rules
  • client with rules for client validation

Implementation

Validation methods are defined in the MarcValidator class and called by the configuration.

Controller

Validation is done during MarcControllerActions.

Workflow

Validate action

In the editor there is a "Validate" action to check the validity of the record. This calls a ajax action "marc_editor.js#_marc_editor_validate" which post to the "MarcControllerAction#marc_editor_validate". The returning error message is displayed in a div#marc_errors container.

Validate before saving

A validity check is also done before saving with MarcControllerAction#marc_editor_save. In case of server side error messages the page is redirected to back with the according message.

Todo

  • marc_controller_action: marc_edit_validate
  • marc_editor.js: marc_validate
  • link to marc_action on edit page
  • div container for marc_validator.errors
  • show success of marc validator (green box)
  • validator for user ability to create record for his workgroup
  • cleanup of code
Clone this wiki locally