Skip to content

Commit 36d4a76

Browse files
Create 0001-stac-admin-plugin-system.md
1 parent b9882a7 commit 36d4a76

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# STAC admin plugin system
2+
3+
Status: IN REVIEW
4+
Deciders: @danielfdsilva @emmanuelmathot @j08lue @oliverroick
5+
Date: 2024-08-26
6+
7+
8+
## Context and Problem Statement
9+
10+
The form to edit the STAC metadata may differ from instance to instance and from collection to collection. Ideally the form should be easily customizable and extensible to suit the different needs.
11+
12+
## Decision Drivers
13+
14+
The chosen option should allow:
15+
- Each instance to define what fields the form editor should have;
16+
- Within an instance, each collection/item to define what fields the form editor should have based on some sort of, possibly dynamic, criteria;
17+
18+
## Decision
19+
20+
The structure of the form is defined by a plugin system. Each plugin is responsible for a section of the editor and defines the fields that should be shown.
21+
This allows for a more modular approach to the editor. Each instance can use a different set of plugins to define the editor's structure. These can be custom plugins that the implementers of a given instance develop or pre-made plugins from the community.
22+
23+
Drawing inspiration from the JSON schema spec, each plugin defines a schema to create the editor. For each field type there is a corresponding default widget to render it, but plugins can define their own widgets (in the form of a React component) to be used by the fields.
24+
25+
### Consequences
26+
27+
#### Pros
28+
With a plugin system the editor can be easily customized to suit the needs of each instance. Implementors have the option to use a pre-made solution and have something up and running quickly or to develop their own plugins with editing widgets that suit their needs.
29+
30+
#### Cons
31+
Having plugins define a schema, inevitably results in some duplication, given that the schema for the different extensions already exists defined in the STAC spec. However this schema may not be a one-to-one match to the desired form structure. Additionally, implementing a full JSON schema renderer would be a significant amount of work and would likely be overkill for the needs of the editor.
32+
33+
Nevertheless, this can be mitigated, by having the plugin query the STAC spec on initialization to get a base schema from which to derive the editor schema.
34+
35+
## More Information
36+
37+
The initial proposal pro the plugin system was outlined in the [Flexible plugin system for the STAC metadata editor](https://github.com/EOEPCA/data-access/issues/73) issue.

0 commit comments

Comments
 (0)