Custom XMP Metadata Definitions

OMN reads and writes XMP metadata that is embedded in assets based on a set of XMP property definitions. In addition to the definitions shipped with OMN, you can register your own custom XMP properties — for example to read or write project-specific fields.

In OMN6 custom XMP properties were registered by building a jar of Spring beans and adding it to the classpath. This mechanism was removed in OMN7. Custom properties are now defined in a single JSON file. See Migrating from OMN6 for how to convert existing definitions.

The xmp-custom.json file

Custom definitions are read from a single file:

/usr/local/omn/config/xmp-custom.json
  • The directory is ${OMN_HOME}/config; OMN_HOME defaults to /usr/local/omn.

  • Mount the file into both the web and the sync container — both load the definitions.

  • Only this one file is evaluated. Its content is a single JSON array of definition objects.

Definition format

Each entry in the array describes one custom XMP property:

Field Required Description

identifier

yes

Unique identifier in the form prefix:Name (e.g. custom:MyField). Used as the key; an entry that reuses the identifier of a built-in definition overrides it.

namespace

yes

The XMP namespace URI the property belongs to (e.g. http://ns.apollon.de/custom/1.0/).

name

yes

The property name within the namespace.

type

yes

The value type, written in uppercase. One of the MetaDataXMPType values: STRING, BOOLEAN, INTEGER, LONG, DOUBLE, DATE, CALENDAR, BASE64, BAG, SEQ, LANG_ALT.

description

no

Free-text description of the property.

struct

no

Name of the parent structure; only for properties that belong to a structured (nested) XMP type.

The following example registers a single string property custom:MyField:

[
  {
    "namespace" : "http://ns.apollon.de/custom/1.0/",
    "identifier" : "custom:MyField",
    "type" : "STRING",
    "name" : "MyField",
    "description" : "Example custom XMP field"
  }
]

Use a custom namespace

A custom property whose value is edited and saved through the OMN UI must use your own namespace (for example http://ns.apollon.de/custom/1.0/). Do not reuse a controlled Adobe schema such as exif or tiff: when the value is saved it passes through an internal XMP round-trip, and a property written under a controlled Adobe namespace is dropped when it is read back.

Applying changes

  • Restart the web and sync containers to load a changed xmp-custom.json.

  • If the file is missing, OMN starts normally and uses only the built-in definitions.

  • If the file cannot be parsed, OMN logs an error and continues with the built-in definitions only — check the container log if a custom property does not appear.

Migrating from OMN6

In OMN6 each custom property was a Spring bean in META-INF/omn/spring/xmp-definitions.xml, packaged as a jar. In OMN7 the same fields are expressed as one JSON object per property. The field names are identical, so the conversion is mechanical.

OMN6 (xmp-definitions.xml):

<bean class="com.meylemueller.xmp.XmpMetaDataDefinition">
    <property name="namespace" value="http://ns.apollon.de/custom/1.0/"/>
    <property name="identifier" value="custom:MyField"/>
    <property name="type" value="STRING"/>
    <property name="name" value="MyField"/>
    <property name="description" value="Example custom XMP field"/>
</bean>

OMN7 (xmp-custom.json):

[
  {
    "namespace" : "http://ns.apollon.de/custom/1.0/",
    "identifier" : "custom:MyField",
    "type" : "STRING",
    "name" : "MyField",
    "description" : "Example custom XMP field"
  }
]

To migrate:

  1. Create one JSON object for each <bean>, copying the namespace, identifier, type, name and description values.

  2. Collect all objects into the single array in /usr/local/omn/config/xmp-custom.json.

  3. Remove the old jar — it is no longer loaded in OMN7.

  4. If a migrated property is edited through the UI and used a controlled Adobe namespace (e.g. exif), move it to your own namespace (see Use a custom namespace).

Welcome to the AI Chat!

Write a prompt to get started...