Automatic pagination based on file names
This is a technical documentation for the plugin to automatically create a pagination based on filenames.
This documentation describes the installation, configuration and use of the plugin. This plugin can be used to automatically prepare METS-files, create a basic structure and set a pagination.
The precondition for using the plugin is the use of Goobi at least version 3.0.10, the correct installation and configuration of the plugin and the correct integration of the plugin into the desired work steps of the workflows..
The plugin consists of two files:
plugin_intranda_step-imagename-analyse.jarcontains the program logic and must be installed to the
tomcatuser readable in the following directory:
plugin_intranda_step_imagename_analyse.xmlmust also be readable by the
tomcatuser and installed into the following directory:
This file is used to configure the plugin and must have the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<item filepart="ER" docstruct="RearCover" />
<item filepart="SV" docstruct="FrontSection" />
<item filepart="VD" docstruct="FrontCover" />
<item filepart="HD" docstruct="BackCover" />
<item filepart="VS" docstruct="Endsheet" />
<item filepart="NS" docstruct="Postscript" />
<item filepart="FR" docstruct="Fragment" />
<item filepart="Fragm" docstruct="Fragment" />
skipWhenDataExistsdefines how the plugin behaves if a pagination already exists. With the value
truethe execution is skipped, with
falsethe existing structure and pagination is removed and a new one is created.
paginationRegexcontains a regular expression which tries to extract the logical page number from the filename. The value from the first group is copied to the METS file.
If the regular expression was not successful, the system then checks whether the file name describes a special structure such as
Contents. This structure is defined within
structureList. A (partial) string, which must occur in the file name, is defined within the item element in the
filepartattribute. In the
docstructattribute, the structural element is defined that is to be created in this case.
Once the plugin has been installed and configured, it can be used by Goobi within a single step.
To do this, the
intranda_step_imagename_analyseplugin must be selected within the desired task. In addition, the
Automatic taskcheckbox must be set.
The way the plugin works within the correctly configured workflow looks like this:
- If the plugin was called within the workflow, it opens the METS file and first checks whether a pagination already exists.
- If this is the case, based on the configured value in
skipWhenDataExiststhe step is either completed without further changes or the existing pagination and structuring is removed from the METS file.
- Then the files are read from the master folder and sorted alphanumerically.
- For each file it is now checked whether it corresponds to the configured regular expression.
- If this is the case, a new page is created. The physical order corresponds to the sorting in the file system, the logical page number is taken from the first group of the regular expression.
- If the regular expression does not apply, the system then runs through the list of configured items and checks whether the file name ends with the expression followed by an optional number and an optional recto-verso specification (r or v). If this is the case, the configured structural element is created and the page is assigned to this element. By specifying a count, new structural elements of the same type can be defined. If two or more files have no count or the same count, they are assigned to the same structural element.
- If neither the regular expression nor the list of structural elements apply to the file names, a page with the logical sorting "uncounted" is created and an entry is written in the process log.
The following examples are based on the configuration defined above: