Live Data Sources

Last modified by Eleni Cojocariu on 2026/09/11 15:51

Reference

A Live Data source provides both the entries and what the Live Data needs in order to interact with them: which properties exist, which of them can be sorted, filtered or edited, and how each is displayed. The source Macro parameter names one by its Component hint, and sourceParameters carries the query string that source understands.

SourceHintEntries come from
Live Table resultsliveTableAny live table results page, which makes an existing live table usable as a Live Data
In-line dataN/AThe Macro content itself, written as JSON

Implementing a new source is described in Live Data Extension Points.

Live Table Source

The liveTable source exposes any live table results page as a Live Data. Adding useLiveData=true to the query string of a page holding a live table previews it as a Live Data without changing the page.

It accepts these live table parameters:

NameDefault ValueDescription
classNameN/AThe class whose objects are listed. Its properties become the properties of the entries.
resultPageXWiki.LiveTableResultsThe page producing the results.
queryFilterscurrentlanguage,hiddenThe query filters applied. With the default value the content is translated to the locale of the reader, and hidden pages are listed only for readers whose profile sets "Display hidden pages" to "Yes".
translationPrefixN/AThe prefix of the translation keys used for the property names.
templateN/AUse this in case you have a live table with results generated from a Velocity template. The value of this parameter should match the template specified in the url live table configuration using the xpage query string.
hasEditModefalseXWiki 18.7.0+ Whether the reader may switch the Live Data to Edit mode.
newRowLocationN/AXWiki 18.7.0+ Location to store pages when creating new rows. Requires a compatible row naming strategy, e.g., uuid.
newRowNamingStrategyN/AXWiki 18.7.0+ Strategy to use to generate page names when creating new rows. Right now, the only value supported is uuid which uses a random UUID for each new page and create them in the location set by newRowLocation.

The extraParams live table parameter is deliberately unsupported: its main use is filtering, and a Live Data expresses filters generically. Migrate a Live Table to Live Data says what to do with it. A live table that built its parameters in Velocity, as in:

{{velocity}}
#set ($options = {
  'className': 'ExtensionCode.ExtensionVersionClass',
  'location': "${doc.space}"
})

{{liveData
  id="versions"
  properties="version,notes"
  source="liveTable"
  sourceParameters="$services.rendering.escape($escapetool.url($options), 'xwiki/2.1')"
/}}
{{/velocity}}

passes them to the source the same way, once URL-encoded and escaped for the wiki syntax.

Properties from Other Classes

XWiki 18.0.0+

It is possible to specify a property from another class than the one named in className by passing a <property>_class source parameter, and it can then be filtered, sorted and edited like any other. When a displayed page holds no object of that class yet, one is created the first time the property is saved.

{{liveData properties="doc.location,doc.title,tags" source="liveTable" sourceParameters="tags_class=XWiki.TagClass&translationPrefix=platform.index."/}}

In-line Data

The entries are written directly in the Macro content as JSON, together with the property descriptors saying how to display them. No source is named in that case.

{{liveData
  id="movies"
  properties="title,genre,releaseDate,director"
}}{
  "data": {
    "count": 2,
    "entries": [
      {
        "title": "Meet John Doe",
        "url": "https://www.imdb.com/title/tt0033891/",
        "genre": ["Comedy", "Romance"],
        "releaseDate": -904615200,
        "director": "Frank Capra",
        "directorURL": "https://www.imdb.com/name/nm0001008/"
      },
      {
        "title": "Modern Times",
        "url": "https://www.imdb.com/title/tt0027977/",
        "genre": ["Comedy", "Drama"],
        "releaseDate": -1068256800,
        "director": "Charlie Chaplin",
        "directorURL": "https://www.imdb.com/name/nm0000122/"
      }
    ]
  },
  "meta": {
    "propertyDescriptors": [
      {"id": "title", "name": "Title", "visible": true, "displayer": {"id": "link", "propertyHref": "url"}},
      {"id": "genre", "name": "Genre", "visible": true},
      {"id": "releaseDate", "name": "Release Date", "visible": true, "displayer": "date"},
      {"id": "director", "name": "Director", "visible": true, "displayer": {"id": "link", "propertyHref": "directorURL"}}
    ]
  }
}{{/liveData}}
Warning

Please note that In-Line Data currently does not support filtering, sorting, or pagination. Therefore, it is recommended to deactivate these features to avoid unexpected error messages when the table Topbar and the Bottombar is used. While filtering and sorting are disabled by default if not set, pagination must be explicitly disabled in the "meta" section of the JSON configuration:

"pagination": {
  "showEntryRange": false,
  "showNextPrevious": false,
  "showFirstLast": false
}

If you want to avoid also displaying the remaining and buggy Page Counter or hide the entire Topbar/Bottombar without disabling pagination in the JSON configuration, you can achieve this using a XWiki.StyleSheetExtension for that specific page, as documented in the Skin Extension Tutorial:
.livedata-topbar {display: none !important;} .livedata-bottombar {display: none !important;}

FAQ

Can a Live Data list entries from another wiki of the farm?

Working around XWIKI-22688, name the results page with its full reference, as in resultPage=xwiki:XWiki.LiveTableResults, and set the displayers by hand.

How do I check what a live table would look like as a Live Data?

Add useLiveData=true to the query string of the page holding it. Nothing is modified.

Why are the property names displayed as translation keys?

Because translationPrefix is missing, or does not match the keys declaring the property names.

Related

Get Connected