# OpenKM Metadata — Developer Reference This document covers the OpenKM metadata system: how property groups are defined in XML, the full list of supported field and element types with all their attributes, security and internationalisation support, and how to work with metadata programmatically. ## Related references When implementing metadata-driven features you will regularly use the OpenKM API and plugin interfaces. Those are documented in the companion reference files listed below. Load them alongside this file for complete context: - `llms-full-api-*.txt` — OpenKM Java API (OKMPropertyGroup, OKMDocument, OKMFolder, etc.) - `llms-full-core-utils-*.txt` — Core utility classes - `llms-full-plugins-*.txt` — Plugin types including form-related plugins (FormValidator, FormInterceptor, OptionSelectValues, etc.) --- ## Metadata OpenKM organises metadata through **property groups**. A property group is a named collection of typed fields attached to any repository node (document, folder, mail, or record). Groups and their fields are defined in a single XML document managed from the administration panel (**Administration > Repository > Edit metadata**). ### Key concepts - A **property group** corresponds to a UI tab in the metadata panel. - Each **field** within a group defines a typed data entry control. - Groups and fields each have a **name** (system identifier) and a **label** (UI text). - Naming rules: group names must start with `okg:` and field names must start with `okp:`. Both prefixes are followed by alphanumeric characters and underscores only (`[0-9a-zA-Z_]`). Use `snake_case` rather than `camelCase` to avoid truncation issues on Oracle (32-character column name limit). - Each group creates two database tables: `OKM_PGRP_CUR_{GROUP}` (current values) and `OKM_PGRP_HIS_{GROUP}` (historical versions). Column names derive from field names with an `RGT_` prefix (e.g. `okp:consulting.return_place` → `RGT_PRO_RETURN_PLACE`). --- ## Metadata XML definition ### DTD version compatibility The metadata XML format has evolved across OpenKM releases. Always use the DTD that matches (or predates) your installed version. A newer application version supports older DTD versions — backward compatibility is maintained. | DTD version | Available since | Notes | |---|---|---| | `property-groups-3.15.dtd` | 8.2.x | Current version (in-source). Not yet listed on kcenter. | | `property-groups-3.12.dtd` | 8.1.14 | Last version listed on kcenter. | | `property-groups-3.11.dtd` | 7.1.41 | Adds HTML support in `` label. | | `property-groups-3.10.dtd` | 7.1.23 | | | `property-groups-3.9.dtd` | 7.1.22 | | | `property-groups-3.8.dtd` | 7.1.9 | | | `property-groups-3.7.dtd` | 7.1.5 | Earliest version. | ### Document structure ```xml ``` If the OpenKM server has no internet access, use a local DTD reference: ```xml ``` ### `` attributes | Attribute | Type | Required | Default | Description | |---|---|---|---|---| | `label` | String | Yes | — | Text shown as the tab label in the UI. Supports i18n keys (see Metadata internationalisation). | | `name` | String | Yes | — | Unique group identifier. Must start with `okg:` followed by `[0-9a-zA-Z_]` only. | | `visible` | Boolean | No | `true` | Show or hide the entire group in the UI. | | `readonly` | Boolean | No | `false` | When `true`, prevents modification from the UI; changes via the API are still permitted. | | `defaultAccess` | Enum | No | `grant` | Group-level default access policy. `grant` = visible to all users; `revoke` = hidden from all users unless explicitly granted. | | `defaultValueClassName` | String | No | — | Fully-qualified class name of a `FormDefaultValues` plugin that supplies initial field values. | | `validatorClassName` | String | No | — | Fully-qualified class name of a `FormValidator` plugin that validates the entire group on submit. | | `autocompleteValueClassName` | String | No | — | Fully-qualified class name of an `AutocompleteFormValues` plugin that provides autocomplete suggestions for the group. | | `interceptorClassName` | String | No | — | Fully-qualified class name of a `FormInterceptor` plugin that intercepts group-level read and write operations. | ### Database storage Each property group creates two tables: | Table | Purpose | |---|---| | `OKM_PGRP_CUR_{GROUP}` | Current (latest) metadata values | | `OKM_PGRP_HIS_{GROUP}` | Historical versions of metadata values | Column names are derived from field names: the `okp:group.` prefix is stripped, the remaining part is uppercased and prefixed with `RGT_`. Example: `okp:consulting.return_place` → column `RGT_RETURN_PLACE`. ### Default database column sizes | Field type | Default `dbColumnSize` | |---|---| | Input | 128 | | Select | 128 | | SuggestBox | 128 | | TextArea | 256 | | CheckBox | 128 | Override with the `dbColumnSize` attribute on any individual field. ### Complete example ```xml