Skip to content

About

This project is a command-line interface (CLI) tool for importing metadata into the MyCoRe repository system. It supports importing publication metadata from Excel files, performing duplicate checks against the repository, and combining both workflows with reporting.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Metadata Importer CLI for MyCoRe

Important Note

So far, only the following functions have been tested:

  • import of title
  • import of author
  • import of year
  • duplicate checking

All tests have been carried out only for the specific repository used by the developer. For use with other repositories, the metadata schema and the configuration files must be adapted accordingly.

Overview

This project is a command-line interface (CLI) tool for importing metadata into the MyCoRe repository system. It supports importing publication metadata from Excel files, performing duplicate checks against the repository, and combining both workflows with reporting.

The tool is designed to be user-friendly and interactive, guiding users through selecting publication types, specifying Excel files, and entering credentials. It uses mapping configurations to translate Excel columns into MODS metadata fields and communicates with MyCoRe via REST API.

Preparing Excel Files

Excel files must be in .xlsx format with:

  • The first row containing column headers
  • Each subsequent row representing one metadata record
  • Required columns must be present; optional columns can be omitted

Flexible Column Names

The system automatically recognizes columns in multiple languages through the Column Alias System:

  • English: "Title", "Author", "Year", "Publisher", "Abstract", "Keywords", etc.
  • German: "Titel", "Autor", "Jahr", "Verlag", "Zusammenfassung", "Schlagwörter", etc.
  • Italian: "Titolo", "Autore", "Anno", "Editore", "Riassunto", "Parole chiave", etc.
  • Case-insensitive: "TITLE", "Title", "title" are all recognized

The system automatically translates these variations to the canonical German names used in mapping configurations, so you don't need to rename your Excel columns.

For the complete list of recognized aliases, see Configuration Files.

Building the Project

Clone the repository and build using Maven:

# Build with tests
mvn clean package

# Build without tests (faster for deployment)
mvn clean package -DskipTests

This will produce an executable JAR file in the target/ directory.

Running the CLI Application

Run the application using:

java -jar target/metadata-importer-0.0.1-SNAPSHOT.jar

Safe Defaults and Local Overrides

The repository is configured to be safe-by-default for new contributors:

  • mycore.import.dry-run=true
  • Local placeholder endpoints for Solr/MyCoRe

To use real endpoints on your machine, create a local override file:

  1. Copy application-local-example.properties to application-local.properties in the project root.
  2. Update values (solr.server.url, mycore.api.url, mycore.import.dry-run) for your environment.

application-local.properties is automatically loaded if present and is ignored by Git.

Quick launchers (Windows)

  • Double-click Start-ImportApplication.bat to open a cmd window and run the CLI.
  • Double-click Start-ImportApplication.ps1 (or Right-click → Run with PowerShell) to run via PowerShell.

The CLI will prompt you to choose one of three modes:

  1. Import metadata: Import metadata from an Excel file into MyCoRe.
  2. Duplicate check only: Check an Excel file for potential duplicates in the repository.
  3. Import with duplicate check: Perform duplicate check first, then import if confirmed.

You can type stop at any prompt to exit the application.

Modes Explained

The CLI offers three main modes:

  1. Import metadata: Import metadata from an Excel file into MyCoRe.
  2. Duplicate check only: Check an Excel file for potential duplicates in the repository.
  3. Import with duplicate check: Perform duplicate check first, then import if confirmed.

For detailed usage instructions, mapping configurations, and troubleshooting, see USAGE.md.

Additional Information

  • Mapping configuration files are located in src/main/resources/mappings/.
  • Column alias mappings are configured in src/main/resources/column-aliases.yaml.
  • Duplicate reports are generated as Excel files in reports/dubCheckReports/.
  • Non-duplicate reports are generated alongside duplicate reports in the same folder.
  • Import reports are generated as Excel files in reports/importReports/ with an importedObjectUrl column.
  • Import logs are written to a temp file path printed in the CLI output.
  • Enhanced Duplicate Detection: Reports now include actual repository IDs of duplicate documents for precise identification.
  • Flexible Column Names: Excel files can use column names in English, German, Italian, or other variants—the system automatically recognizes and translates them.

Configuration Files

The application uses the following configuration files:

File Location Purpose
application.properties src/main/resources/ External service URLs (Solr, MyCoRe API), logging, application settings
column-aliases.yaml src/main/resources/ Maps alternative column names to canonical German names used in mappings
type-labels.yaml src/main/resources/ Display labels for publication types in CLI menus
type-normalization.yaml src/main/resources/ Normalizes publication type values applied during import
*-thesis.yaml, article.yaml, speech.yaml src/main/resources/mappings/ Field mappings for each publication type

For technical architecture details, see HELP.md. For comprehensive testing information, see src/test/TEST_GUIDE.md.

Helper Methods Ordering Convention

Private helper methods in ImportApplication.java are ordered as follows:

  1. User input (prompt...)
  2. Utility/transformation (normalize..., build...)
  3. Output/report (write...)

This improves code maintainability and readability.

Support

For issues and feature requests, use GitHub Issues.

Before contributing, please read:

About

This project is a command-line interface (CLI) tool for importing metadata into the MyCoRe repository system. It supports importing publication metadata from Excel files, performing duplicate checks against the repository, and combining both workflows with reporting.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages