je4.github.io

gocfl / ocfl / extensions

View My GitHub Profile

Deutsch

OCFL Extensions

OCFL is designed so that the core standard remains lean and stable, while specific functionalities are represented through extensions. These make it possible to customize the behavior of the archive without jeopardizing basic compatibility.

1. The Concept of Extensions

Extensions are located in both the storage root and the individual OCFL objects in the respective extensions/ directory.

Why Extensions?

2. Registered vs. Local Extensions

3. Extensions in Practice

As we saw during the initialization of the storage root, gocfl automatically creates configuration directories. A detailed overview of the extensions used in this workshop can be found here:

4. Hooks in gocfl

The implementation of extensions in gocfl is based on various call points (hooks) where the logic of the extension intervenes in the OCFL workflow. If an interface has multiple hooks, an extension using it must implement all the hooks defined therein.

These differ depending on the context:

5. Mapping in the Extension Manager

The NNNN-gocfl-extension-manager uses specific keys in its config.json to address the various extension types. Here is the mapping of the Go interfaces to the configuration entries:

Interface Key in config.json
ExtensionBuildStorageRootPath StorageRootPath
ExtensionObjectContentPath ObjectContentPath
ExtensionObjectExtractPath ObjectExtractPath
ExtensionObjectStatePath ObjectStatePath
ExtensionArea Area
ExtensionStream Stream
ExtensionContentChange ContentChange
ExtensionObjectChange ObjectChange
ExtensionFixityDigest FixityDigest
ExtensionMetadata Metadata
ExtensionNewVersion NewVersion
ExtensionVersionDone VersionDone

6. Self-Describing via Documentation

An important aspect of gocfl is that for every enabled extension, the corresponding documentation should be copied directly into the storage root as a Markdown file (e.g., NNNN-gocfl-extension-manager.md).

This guarantees that even in decades, it will still be possible to understand which rules applied to the storage and processing of the data, even if the original software or website no longer exists.


Back to Table of Contents Next Topic: Creating Objects