The ui for the metadata tab is made from a list of field components.
The type of the field component and how they behave can be configured in the yaml file.
All fields should be configured as a list which has the parent key attributes.
The key is the identifier for the field and should therefore be unique.
Other configurations can refer the field by using this identifier. E.g the geonetwork mapping, internationalization.
If present this value will be used as the label for the field.
When the label is not present in the yaml configuration the key will be used as label.
Note: when the key is present in the internationalization (i18n) file see Internationalization support than the value from that file will be used as the label.
The value for occurrence determines whether or not the field should displayed as a table or as a single input field.
SINGLE will result in one input field.
Conditional attributes are attributes that are only visible for some layers. A typical example are attributes only present for raster or vector layers.
The condition is specified in CQL which is evaluated against the layer’s ResourceInfo object.
Optionally, attributes may be displayed on separate tabs. All tabs must be listed under tabs in the main configuration. Then this
property is used to assign each attribute to one or more tab (separated by comma),
so that the custom metadata panel is divided in tabs:
The choices in a DROPDOWN, SUGGESTBOX or REQUIREBOX can be set using the values attribute in the yaml.
This is useful for small list, for larger list it can be better to list the choices in a separate .csv file.
Only used in the DERIVED field. The attribute derivedFrom contains the key for the parent on which the DERIVED field depends.
Follow the link for more information on the DERIVED field.
The typename is a required attribute for COMPLEX fields. It contains the key pointing to the definition of the COMPLEX field.
A special typename featureAttribute is reserved for the Feature Catalog Generation and should not be used.
A field for selecting a value from a dropdown.
The values can be configured with the values attribute in the yaml or they can be configured in an other .csv file which is used for dropdowns with a lot of choices.
To configure the values in a separate file add a yaml key csvImports on the same level as attributes and add the list of CSV files under this key.
The first line in each CSV file should contain the key of the dropdown field for which you want to add the choices.
A field for selecting a value from a suggestbox. Suggestions will be given for the values where the input matches the beginning of the possible values.
The values can be put in a separate CSV file in the same way as for the DROPDOWN field.
This type is identical to suggestbox, except that the user is not allowed to fill in a custom value but enforced to choose a suggested value.
This can be handy when an field value must be an element from a list, but this list is too long for a dropdown to be practical.
A derived field is a hidden field whose value depends on an other field. The yaml key derivedFrom should contain the key of the field it depends on.
When a value is selected in the parent field a matching value for the derived field is searched in csv file or the value with the same index is picked from the values list.
The CSV file should have at least two columns and start with the key of the parent field in the first column followed by the values for the parent field, the other columns should contain the key(s) of the derived field(s) in the first row followed by the matching values.
A complex field is composed of multiple other fields. The yaml key typename is added to the field configuration.
On the root level the yaml key types indicates the beginning of all complex type definition.
A type definition should contain the typename followed by the key attributes which contains the configuration for the subfields.
To create a feature catalog for a vector layer, a complex structure is needed to describe all the attributes. A lot of this information is already present in the GeoServer feature type or the database.
Metadata supports automatically generating a new structure in the metadata from the information at hands that can be customised afterwards.
To create support for this feature in your configuration, define a repeatable COMPLEX field with built-in fieldType featureAttribute .
In the example the featureCatalog object has two attributes. A unique identifier of the type UUID and the feature attribute field.
Using the existing data in the database for this attribute.
Using data from a look-up table in the same database. In this case you must specify the table, an attribute from which to take values and an attribute from which to take definitions.
All metadata field labels that appear in the Metadata fields can be internationalized.
This is performed by creating an internationalization (i18n) file named metadata.properties.
Create an entry for each key in the gui configuration following this pattern: PREFIX.attribute-key
Drop-down labels can be translated too, in the same properties file, using the key metadata.generated.form.[attributeKey].[value]=[label].
The value that will be internally stored for this field stays the same.