I'm not doing anything real here, just playing around and trying to register some kind of a mode-aware gateway-wide configuration option.
I've gathered that:
- I need to register a
ResourceTypeMeta
with the ConfigurationManager::ResourceTypeMetaRegistry
.
- The
WebResourceManager
now has a NavigationModel
, where I can add things to the UI.
I think can stumble my way through creating a resource type and creating a UI, but what I don’t understand the relationship between ResourceTypes
and ExtensionPoints
.
- Do all
ResourceTypes
have to correspond to an ExtensionPoint
?
- If not, when should my resource be an
ExtensionPoint
resource?
Extension points, like they were in 8.1 and prior versions are...points where an original author deliberately bakes in extensibility.
Think "device drivers", or "audit profiles", or "tag providers".
Essentially it's an Ignition/module specific interface/abstract class definition.
You may want to implement one or more existing extension points in your module, but it's pretty unusual to define new extension points that you expect other modules to implement.
1 Like
Gotcha.
But if I do define my own extension point type, would that allow me to use ExtensionPointResourceForm to get a “standard” config UI?
I don't think the plumbing is hooked up in such a way that happens automagically like it did in Wicket-land with RecordEditForm
.
I'm way out of my depth with web UI stuff, but as far as I know it's still all a bit handcranked on the frontend side (for now?) even if you do all the "right" things on the backend.
1 Like
On the ExtensionPoint, you can override a method called getWebUiComponent
, which requires that you return a WebUiComponent
(Either a hand cranked React component or an ExtensionPointResourceForm
, for now). If you choose the ExtensionPointResourceForm
then by default the UI will be auto-generated based off of a schema. The schema is defined by using decorators on the resource profile config (the file that defines the fields for your extension point).
@Override
public Optional<WebUiComponent> getWebUiComponent(ComponentType type) {
return Optional.of(new ExtensionPointResourceForm(
<String resource type>,
<String resource noun>,
<String extensionpoint type>,
<JSONObject profile schema>,
<JSONObject settings schema>,
<Optional Set<string> categories you want in advanced section
));
}
@Required
@FormCategory("SOME GROUPING CATEGORY")
@Label("FORM INPUT LABEL")
@FormField(FormFieldType.TEXT)
@Description("DESCRIPTION")
@DefaultValue("default")
String someField,
4 Likes