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 additional 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>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).
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.
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. Please note that you do also need metadata files according to the TextGrid Metadata Schema. 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). It 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).
Please note: 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 after sandbox publishing - every koLibRI import is published to the sandbox first - you must use the policy publish_import.
<field>objectUri</field>¶
Please use import mapping file, project ID, or root URI of TextGrid object to assemble TextGrid objects to be published, such as
- file:./folders/temp/1470065621459_data_URI.imex (URI mapping file)
- file:./folders/temp/1470065621459_data_PID.imex (PID mapping file)
- textgrid:12345.0 (TextGrid URI)
- project:TGPR-f1867520-4a53-9ced-9da5-503762ba0f61 (project ID)
If you are using a TextGrid URI as an object URI, all objects of an edition or collection are being published, including the collection itself. If a single TextGrid item is referenced (no aggregation), only this item will be published.
<field>dryrun</field>¶
Use to check what will happen before publishing anything. Will not publish anything unless set to false recommended)!
Delete Configuration¶
Already published data can still be deleted, if it was imported into the TextGrid Sandbox and has not yet been finally published using the publish_import policy. To delete objects from the sandbox, change the policy to delete_import.
<field>objectUri</field>¶
Please use import mapping file, project ID, or root URI of TextGrid object to assemble TextGrid objects to be deleted, such as
- file:./folders/temp/1470065621459_data_URI.imex (URI mapping file)
- file:./folders/temp/1470065621459_data_PID.imex (PID mapping file)
- textgrid:12345.0 (TextGrid URI)
- project:TGPR-f1867520-4a53-9ced-9da5-503762ba0f61 (project ID)
If using TextGrid URI as object URI, all objects of an edition or collection are being deleted, including the collection itself. If a single TextGrid item is referenced (no aggregation), only this item will be deleted.
<field>dryrun</field>¶
Use to check what will happen before deleting anything. Will not delete anything unless set to false (recommended)!
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 the creation of metadata 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 the file /folders/log/kolibri.log. Please keep all the folders in the /folders/temp/ folder, and especially all the files with suffix _URI.imex for later publication or deletion policies. If PIDs are created, the PID mapping is stored to _PID.imex files. These files format is also being 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! There is some more information for every config file value in the descriptions of each value 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!