Web Portal Panel Customization¶
Introduction¶
The panel configuration depends on the backend system and the connector. Here, the configuration of the Web Portal panel is described.
The Web Portal panel comes pre-configured and is ready to use. By changing the panel.json for it you can decide which metadata can be added to shared files.
The default configuration of the Web Portal panel can be found at the following directory:
%PROGRAMFILES%\SEAL Systems\seal-operator-webportal\lib\defaultConfig
It consists of three files:
-
settings.json
for fields displayed when creating shares: -
public-settings.json
to use instead ofsettings.json
if the public access option is enabled. For more information, refer to Enable Public Link Access to Shares. -
panel.json
for metadata fields displayed for shared files:
Create Custom Configuration Files¶
To prevent your settings from being overwritten by an update, create a customer directory for your custom configuration. Adding the customer name to the file name is also recommended. Finally, the custom configuration files need to be specified in the corresponding keys DEFAULT_WEBPORTAL_PANEL
and DEFAULT_WEBPORTAL_SCHEMA
.
Step by step instructions:
-
Copy the default configuration files to a customer directory with a customized name.
cp %PROGRAMFILES%\SEAL Systems\seal-operator-webportal\lib\defaultConfig\panel.json <customer_dir>\panel-<customer_name>.json
cp %PROGRAMFILES%\SEAL Systems\seal-operator-webportal\lib\defaultConfig\settings.json <customer_dir>\settings-<customer_name>.json
-
Export the current configuration of SEAL Operator to ensure that you're using the correct configuration settings.
operator config export <filename>.yml --insecure
-
In the
env
section, specify the following additional keys for theoperator-webportal
service:-
DEFAULT_WEBPORTAL_PANEL
: path to the JSON file containing the fields and default values for metadata files displayed for single files -
DEFAULT_WEBPORTAL_SCHEMA
: path to the JSON file containing the fields and default values available for shares
env: service: ... operator-webportal: tag: any: AUTH_PROVIDER: generic DEFAULT_WEBPORTAL_PANEL: <customer_dir>/panel-<customer_name>.json DEFAULT_WEBPORTAL_SCHEMA: <customer_dir>/settings-<customer_name>.json ...
Literature - keys
For further information about available keys, refer to the Key Reference.
-
-
Save the
<filename>.yml
file -
Re-import it to Consul.
operator config import <filename>.yml --insecure
Change Configuration¶
The two panel configuration files have similar structures.
Caution - JSON structure
Pay attention to keep the JSON structure in the panel configuration files! For further information, refer to the JSON Schema.
Hint - JSON syntax check and file encoding
With online validation tools such as https://jsonlint.com/ you can check the syntax of your JSON file. However, the validation tools are not able to check if the semantic is correct.
Make sure the configuration files are encoded in UTF otherwise special characters won't be displayed correctly. HTML entities are not supportet.
Use Version ID and Package Number¶
The panel configuration files are customer-specific. For this, using a version ID and a package number makes sense. The keys version
and package
are available for this purpose.
{
"name": "Web Portal",
"type": "webportal",
"pid": "f75bf1b0-6920-41cb-9fc8-a88191710f41",
"version": "$Id: $",
"package": "$Package: $",
...
}
Restart the Services¶
After changing the configuration files, restart the following services:
-
seal-operator-webportal
-
seal-operator-server
operator service start seal-operator-p4 seal-operator-server
Examples¶
Default panel.json
[
{
"name": "Web Portal",
"type": "webportal",
"pid": "8376eb11-68e7-49c5-af60-5d46cb102304",
"json_schema": {
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"description": {
"type": "string",
"description": {
"de": "Beschreibung",
"en": "Description"
}
}
},
"fieldsets": [
{
"fields": [
"description"
]
}
]
},
"details_view": {
"custom_tools": [],
"restricted_fields": [],
"preview_page_count": 3,
"hide_preview_actions": true
}
}
]
panel.json with grouped option fieds
[
{
"name": "Web Portal",
"type": "webportal",
"pid": "8376eb11-68e7-49c5-af60-5d46cb102304",
"json_schema": {
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"description": {
"type": "string",
"description": {
"de": "Beschreibung",
"en": "Description"
}
},
"due_date": {
"type": "string",
"description": {
"de": "Fälligkeitsdatum",
"en": "Due date"
}
},
"internal": {
"type": "string",
"description": {
"de": "Nur für internen Gebrauch",
"en": "For internal use only"
},
"default": "YES",
"widget": "select",
"oneOf": [
{
"enum": ["YES"],
"description": {
"de": "Ja",
"en": "Yes"
}
},
{
"enum": ["NO"],
"description": {
"de": "Nein",
"en": "No"
}
}
]
},
"printable": {
"type": "string",
"description": {
"de": "Kann gedruckt werden",
"en": "May be printed"
},
"default": "NO",
"widget": "select",
"oneOf": [
{
"enum": ["YES"],
"description": {
"de": "Ja",
"en": "Yes"
}
},
{
"enum": ["NO"],
"description": {
"de": "Nein",
"en": "No"
}
}
]
}
},
"fieldsets": [
{
"title": {"de": "Allgemein", "en": "General"},
"fields": [
"description",
"due_date"
]
},
{
"title": {"de": "Geheimhaltung", "en": "Security"},
"fields": [
"internal",
"printable"
]
}
]
},
"details_view": {
"custom_tools": [],
"restricted_fields": [],
"preview_page_count": 3,
"hide_preview_actions": true
}
}
]
For more examples refer to Examples for Panel Customization.