Export
You can export the current state of one or more panels as HTML files to the filesystem of the Boomack Server. You can export the following selection:
- All panels
- One individual panel
- One individual slot
When exporting you can specify a relative path as target directory.
The path is resolved relative to the server configuration option
export.local.location
.
Important: Exporting to the filesystem of the server is deactivated by default.
To activate the export API routes, you need to start the Boomack Server
with the configuration option api.enable.export=true
, and
export.local.location
set to a relative or absolute path on the server filesystem.
If the configured location is relative, the path resolved relative to the location
of the current working directory of the server.
Example:
- Current working directory of the Boomack Server:
/var/lib/boomack
export.local.location
:export
- Export request with
Path
:my-snapshots
, andName
:my-panel-01
The location of the exported HTML file is
/var/lib/boomack/export/my-snapshots/my-panel-01.html
.
Missing directories in the path are created automatically.
The resource files for the HTML file (CSS, JavaScript, Fonts, ...)
are stored in sub-folders of /var/lib/boomack/export/my-snapshots
and shared between exports to the same location.
The following examples assume you already have a configured
BoomackClient
instance in the variable client
.
See Get Started if you do not know how to configure
a BoomackClient instance.
Export All Panels
When exporting all panels, one HTML file for each panel is created. The names of the HTML files corresponds to the panel IDs.
Export directly to the configured target location, without any further options:
await client.ExportAllPanels();
Export to the sub-folder full-snapshot-01
using the theme science:
await client.ExportAllPanels(new ExportRequest()
{
Path = "full-snapshot-01",
Theme = "science",
});
Currently, no index.html
file is created.
The Name
property of the export request is ignored if set.
Export Single Panel
Export directly to the configured target location with the default theme of the panel and the panel ID as filename:
await client.ExportPanel("my-panel");
Export into a sub-sub-folder of the configured target location
with an explicit filename (my-panel-01.html
) and the theme dark:
await client.ExportPanel("my-panel", new ExportRequest()
{
Path = "snapshots/panels",
Name = "my-panel-01",
Theme = "dark",
});
Export Single Slot
Export directly to the configured target location with the default theme of the panel and the slot ID as filename:
await client.ExportSlot(panelId: "my-panel", slotId: "main");
Export into a sub-sub-folder of the configured target location
with an explicit filename (main-slot.html
) and the theme dark:
await client.ExportPanel("my-panel", "main", new ExportRequest()
{
Path = "snapshots/slots",
Name = "main-slot",
Theme = "dark",
});