Wiki source code of Live Data
Last modified by superadmin on 2026/10/14 18:26
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | Live Data is a feature provided by the [[Live Data Macro>>doc:extensions:Extension.Live Data.Macro.WebHome]] extension. It displays structured data in a customizable way, and it provides APIs to define custom data sources as well as to configure the existing ones. | ||
| 2 | |||
| 3 | A Live Data instance is built in two parts, which meet in a JSON document. On the server, the [["liveData" Macro>>doc:documentation.xs.user.livedata.display-data.macro.WebHome]] or the [[Script Service>>doc:documentation.xs.dev.livedata.script-service.WebHome]] turns its parameters and the advanced configuration written in the Macro content into a complete [[Live Data Configuration>>doc:documentation.xs.dev.livedata.configuration.WebHome]]. In the browser, a Vue widget reads that configuration and renders the entries using the layout, the displayers and the filters it names, fetching the entries themselves over REST. | ||
| 4 | |||
| 5 | {{plantuml}} | ||
| 6 | @startuml | ||
| 7 | !theme bluegray | ||
| 8 | skinparam componentStyle rectangle | ||
| 9 | |||
| 10 | component "**liveData Macro**\nLiveDataMacro" as MACRO | ||
| 11 | component "**LiveDataScriptService**\n$services.liveData" as SS | ||
| 12 | component "**LiveDataRenderer**\nmerges parameters and content" as REND | ||
| 13 | component "**LiveDataConfigurationResolver**\nadds the default values" as RES | ||
| 14 | component "**Live Data widget**\nVue, in the browser" as VUE | ||
| 15 | component "**Live Data REST resources**\nLiveDataEntriesResource\nLiveDataPropertiesResource" as REST | ||
| 16 | component "**LiveDataSource**\nlooked up under the source hint" as SRC | ||
| 17 | component "**LiveDataEntryStore**\nget, save, update, remove" as ES | ||
| 18 | component "**LiveDataPropertyDescriptorStore**\nwhich properties exist" as PS | ||
| 19 | database "The entries\nwiki objects, or anything else" as DATA | ||
| 20 | |||
| 21 | MACRO --> REND | ||
| 22 | SS --> REND | ||
| 23 | REND --> RES : resolves the merged configuration | ||
| 24 | REND --> VUE : writes the JSON configuration in the page | ||
| 25 | VUE --> REST : queries entries and properties | ||
| 26 | REST --> SRC | ||
| 27 | SRC --> ES | ||
| 28 | SRC --> PS | ||
| 29 | ES --> DATA | ||
| 30 | PS ..> DATA : describes | ||
| 31 | @enduml | ||
| 32 | {{/plantuml}} | ||
| 33 | |||
| 34 | Everything the widget knows about the data comes from its source, which is looked up as a [[Component>>doc:extensions:Extension.Component Module]] under the hint given in the ##source## Macro parameter. A source answers two questions, through two stores: which entries match a query, and which properties those entries have (including whether each one can be sorted, filtered or edited). A source that implements none of the writing operations simply yields a Live Data the reader can browse but not change. | ||
| 35 | |||
| 36 | The front-end is extended the same way: layouts, displayers, filters and panels are registered by name, and picked up by the configuration that names them. All the roles, on both sides, are listed in [[Live Data Extension Points>>doc:documentation.xs.dev.livedata.extension-points.WebHome]]. The widget itself ships as a webjar, described in [[Live Data Webjar API>>doc:documentation.xs.dev.livedata.webjar.WebHome]], and exposes a [[JavaScript API>>doc:documentation.xs.dev.livedata.javascript-api.WebHome]] on the container of each instance. When a Live Data returns the wrong entries, it can be [[debugged by reading its query from the logs>>doc:documentation.xs.dev.livedata.sql-query-debugging.WebHome]]. |