Chosing Configuration File from Template

There are two template configuration files in the config/ folder:

tglab_config.xml

is to be used to import data into the TG-lab, so you can work with your data inside the chosen TextGrid project.The data will not be visible to users other than you and the users you decide to share it with. All non-public services are preconfigured in this file.

tgrep_config.xml

is to be used to import directly to the TG-rep. Your data is visible to the public immediately (at first in the TextGrid Repository Sandbox only, and after finally publishing for everyone and everywhere).

Please chose one of that files according to your import plans.

Editing the Config File

Commonly used settings

<field>defaultPolicyName</field>

Setting the import policy: The parameter defaultPolicyName can address the following policies (as existing in the policies.xml file). Edit the config file of your choice, and chose a value. Depending on your import policy, other configuration values have to be set, please see below.

aggregation_import
This policy is used to automatically create TextGrid metadata for each file out of the file name and the detected file format. For every folder a TextGrid aggregation is created and imported, so the folder structure will appear in TextGrid the same as in the import folder itself.
complete_import
If you use this policy, all given files simply are imported, no addittional metadata is created, so you need to have a complete set of TextGrid objects including TextGrid metadata and also containing TextGrid URIs (e.g. by using the TG-crud’s method #GETURIS, and arrange them accordingly). File extensions for existing TextGrid editions, collections, works, aggregations, XML and metadata files can be configured if needed.
continue_import
Use this policy to continue a broken or stopped import (e.g. in case of an error). Just configure the hotfolder to be the temp folder, the files were processed in.
delete_import
An already imported set of objects can be deleted from the sandbox again. Uses the TG-crud service directly. This can be used with an URI list (as a file) or by giving a root URI. Please see configuration of the class DeleteFiles.
publish_import
An already imported set of objects will be finally published. Uses the TG-publish service. This can be used with an URI list (as a file) or by giving a root URI. Please see configuration of the class PublishFiles.
dfgviewermets_import
Takes as input one (or more) DFG Viewer METS file according to the DFG Viewer METS Specification and creates a folder structure from the physical and logical StructMap, that then is imported into the TextGrid. MODS and/or TEI metadata will be mapped to TextGrid metadata via existing MODS/TEI XSL transformation files, or can be done via custom XSL files.

<field>tgcrudServerUrl</field>

Choosing the TG-crud service: Depending on your chosen import location (TG-lab or TG-rep) the TG-crud endpoint already is correctly configured.

<field>rbacSessionId</field>, <field>projectId</field>

Authentication and project settings: Please add the two values with your TextGrid Project ID (projectId) and your Session ID (rbacSessionId).

<field>logParameter</field>

TextGrid logging: Can be left empty... is not used at the moment anymore.

<field>getPids</field>

PID generation: If set to true, persistent identifiers are generated for every TextGrid object using the GWDG Handle service. That only makes sense, if you put data directly into the TG-rep.

Aggregation import configuration

If you are using aggregation_import, just set the data as described above and run the koLibRI.

<field>hotfolderDir</field>

Choosing a hotfolder: As hotfolder ./folders/hotfolder/ is pre-configured. Just copy your data to publish into the data/ folder. The data is copied before processing starts, so the original data will not be touched. If chosen aggregation_import as policy, please put only ONE folder in the hotfolder containing files and folders to import 8this would be the already existing data/ folder). All those files will be imported in ONE TextGrid project as files and aggregations.

<field>useBaseUrisInAggregations</field>

Base URIs: Last but not least you can choose (only with policy aggregation_import) if TextGrid base URIs are put into the generated aggregations (such as textgrid:1234), or the generated absolute URIs (such as textgrid:1234.0). The latter would be mandatory if directly importing into the TG-rep.

Complete import configuration

If you are using complete_import, just set the data as described above and run the koLibRI.

<field>hotfolderDir</field>

Choosing a hotfolder: As hotfolder ./folders/hotfolder/ is pre-configured. Just copy your data to publish in the data/ folder. The data is copied before processing starts, so the original data will not be touched. All data will exactly be imported as prepared by the user. Everything else works according to the aggregation import hotfolderDir documentation.

DFG Viewer METS import configuration

If you are using dfgviewermets_import, just set the data as described above and run the koLibRI.

<field>hotfolderDir</field>

Choosing a hotfolder: As hotfolder ./folders/hotfolder/ is pre-configured. Put all your METS files directly into the hotfolder/ folder. For each METS file there will be created a root Aggregation/Edition/Collection, please see below. It is possible to put more than one METS file into the hotfolder. koLibRI then processes the import concurrently with a configurable number of threads (please see general configuration options in the koLibRI configuration file).

<field>rootAggregationMimetype</field>

DFG Viewer aggregations: For DFG Viewer Import you can chose the format of your root aggregation (there is one root aggregation for every METS file). If can be chosen to be imported as a TextGrid Aggregation (text/tg.aggregation+xml), Edition (text/tg.edition+tg.aggregation+xml) or Collection (text/tg.collection+tg.aggregation+xml).

BTW: Custom XSLT stylesheets for metadata creation can be specified in the properties of <class name=”actionmodule.textgrid.DfgViewerMetadataProcessor”>.

Publish configuration

To finally publish your objects (only after sandbox publishing!) you must use the policy publish_import.

<field>publishViamappingFile</field>

Set to true if you want to use a mapping file created at import. Set hotfolderDir parameter accordingly. Set to FALSE if you want to use the URI of your root object, that predecessors shall be published. rootUri must be set then!

<field>hotfolderDir</field>

Change the hotfolderDir value to the temp folder of the import process to publish, e.g. ./folders/temp/1318521646580_data/. Absolute pathes will work, too. Please note that you cannot use the absolute path to the .imex files itself!

URIs will be taken from the (at import time) created URI mapping file *_URI.imex that is stored in the temp folder.

<field>rootUri</field>

Set the root URI to e.g. textgrid:1234.0 to delete publish that is referenced by that root aggregation (recursively).

Delete Configuration

Already published data can still be deleted, if it was imported into the TextGrid Sandbox. Change the policy to delete_import.

<field>deleteViamappingFile</field>

Set to true if you want to use a mapping file created at import. Set hotfolderDir parameter accordingly. Set to FALSE if you want to use the URI of your root object, that predecessors shall be deleted. rootUri must be set then!

<field>hotfolderDir</field>

Change the hotfolderDir value to the temp folder of the import process to delete, e.g. ./folders/temp/1318521646580_data/. Absolute pathes will work, too. Please note that you cannot use the absolute path to the .imex files itself!

URIs will be taken from the (at import time) created URI mapping file *_URI.imex, that is stored in the temp folder.

<field>rootUri</field>

Set the root URI to e.g. textgrid:1234.0 to delete everything that is referenced by that root aggregation (recursively).

Editing the Metadata Template File (Optional)

The config file for the metadata generation used by some policies such as aggregation_import and dfgviewermets_import in module textgrid.TextgridMetadataProcessor (textgrid_metadata_template.xml) is used for every file to be imported! The metadata stated in this file is used for metadata file creation and can be edited according to the TextGrid Metadata Schema. Metadata not fitting in the schema will not be accepted.

Logging and Keeping

All imports are logged to /folders/log/. Please keep all the folders in the /folders/temp/ folder, and especially all the *_URI.imex files for later publication or deletion policies. If PIDs are created, the PID mapping is stored to *_PID.imex files. These files are also used in the TG-lab import and export module.

Change More Parameters?

Please do not change anything else unless you’re are REALLY sure about it! You can read for example the descriptions of the values in the config file’s module class definitions.

Hints and Tricks

If as hotfolder is given a directory with files contained only the import will do nothing, because the koLibRI will import the one and only directory from WITHIN the hotfolder. If you want to import the files contained in the hotfolder, too, just set the readDirectoriesOnly flag of the processstarter.MonitorHotfolder to FALSE! Beware: All rewriting will be restricted to single files now (so no rewriting will happen at all!) because every file will be handled one after another!