Skip to content

Cookbook: Validate MIK's input files

Mark Jordan edited this page Feb 7, 2017 · 6 revisions

MIK offers an option to check your .ini file's configuration values, but for some toolchains, you can also validate MIK's input files for correct filenames and directory arrangement. For example, the CSV book and CSV newspaper toolchains expect that page files are named such that each page's sequence number is encoded within the page filenames:

page-01.tif
page-02.tif
page-03.tif

Input validation is currently only available for the CSV single file, compound, book, and newspaper toolchains.

Realtime input validation

By default, MIK applies "realtime" input validation, that is, it validates the input files just before each Islandora ingest package is generated. If validation fails, MIK skips generating the package and adds an entry to the input validation log file and the problem_records.log.

If you do not want validation to be performed, for example if you have already validated MIK's input using the "strict" option as described below, you can turn validation off by adding the following entry to your .ini file:

[FILE_GETTER]
validate_input = false

Strict input validation

You can also tell MIK to validate all of its input before it starts to generate any Islandora ingest packages. This option is called "strict" validation and is useful if you want to validate your input while you are assembling it, or if you are running MIK in an automated workflow. To enable strict input validation, add the following entry to your .ini file:

[FILE_GETTER]
validate_input_type = strict

If strict input validation is configured, and MIK finds a validation error, it will stop running and display a message indicating that it has found errors like this:

./mik -c foo.ini 
Commencing MIK.
Input validation (strict mode) failed; details in /tmp/foo_output/input_validator.log

and will not generate any other output (e.g., it won't generate any Islandora ingest packages). In strict validation mode, MIK will exit with a return code of 1, which you can detect in shell scripts.

Cookbook table of contents

Clone this wiki locally