Rosetta.MDExtractor-plugins are a series of plugins based on JHOVE(https://github.com/openpreserve/jhove) (the JSTOR/Harvard Object Validation Environment, pronounced "jove"), which implemented the APIs according to Rosetta's plugin framework. Rosetta can call the metadata extracting methods of JHOVE via these Rosetta.MDExtractor-plugins.
A unix-like desktop operating system is required for Rosetta.MDExtractor-plugins development. Both physical machine and virtual machine can do work. The installation instruction below are tested on Ubuntu20.04.
Rosetta.MDExtractor-plugins are Java code plugins. JDK and Ant are required to compile and package the Java codes as JAR files. Absolutely you need Git and an IDE to manage and edit your codes.
sudo apt update
sudo apt install openjdk-8-jdk ant git maven -y
sudo snap install intellij-idea-community --classic
- Install the GPG key:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null
- Install the stable version:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
- First of all you need to determine which version (tag or branch) is the right base according to the requirements.
git clone git@github.com:leefrank9527/Rosetta.MDExtractor-plugins.git
- Then, you can checkout the branch and start to work on that.
git checkout origin/<The related branch> -b <a new branch>
git add <The new added and changed files>
git commit -m "Some comments"
git push origin <The local branch name>
You can use the command "ant" to compile and build the souce code. The compiled java classes, the relevant libraries and the metadata files will be packaged into jar files. The "ant" command will collect and package the files based on the rules defined in the "build.xml" file.
cd Rosetta.MDExtractor-plugins
ant
If it's succeed you can find the plugins in the folder: generated-plugins.
Test the plugins on the Rosetta based environment.
You can submit a PR(Pull Request) on Github, and merge the changes to the main branch if it passed all the tests.
You must have the following jars (For JHove 1.26.1):
- jhove-core-1.26.1.jar
- aiff-hul-1.6.2.jar
- ascii-hul-1.4.2.jar
- gif-hul-1.4.3.jar
- html-hul-1.4.2.jar
- jpeg2000-hul-1.4.3.jar
- jpeg-hul-1.5.3.jar
- pdf-hul-1.12.3.jar
- tiff-hul-1.9.3.jar
- utf8-hul-1.7.2.jar
- wave-hul-1.8.2.jar
- xml-hul-1.5.2.jar
- jhove-ext-modules-1.26.1.jar
The dependencies can be fetched from maven repository. The convenient way is to build the jars from source code and pick up the required jars.
git clone git@github.com:openpreserve/jhove.git
cd jhove
git checkout tags/v1.26.1 -b v1.26.1
mvn package
Then you can find the jars in the folders:
- jhove-core/
- jhove-modules/
- jhove-ext-modules/
Open your MDExtractor-plugins java project. Place the new jars under lib folder. The jars names should have the new JHOVE version suffix. (e.g. jhove-core-1.26.1.jar)
3.2.2 Copy the "org" directory from the "jhove-core" jar to the root directory of each MDExtractor plugin, without the .class file.
- Change the jar dependencies to the updated version
- All JHOVE Plugin jars created by the build.xml names should be updated with the current version (destfile name)