Live Data Macro

Version 11.1 by Marius Dumitru Florea on 2020/11/26 14:28

tableDisplay dynamic lists of data.
Recommended
TypeJAR
CategoryMacro
Developed by

XWiki Development Team

Rating
1 Votes
LicenseGNU Lesser General Public License 2.1

Installable with the Extension Manager

Description

Displays dynamic lists of data using various layouts (table, cards) providing support for pagination, selection (for batch actions), multi-sort, advanced filtering and in-line data editing.

Usage

{{liveData
  id="recentPages"
  properties="doc.title,doc.location,doc.author,doc.date"
  source="liveTable"
  sourceParameters="translationPrefix=platform.index."
  filters="doc.location=help"
  sort="doc.date:desc"
  limit="5"
/}}

liveData-table.png

Parameters

NameDescriptionDefault ValueSince
idThe live data instance id.
propertiesThe comma-separated list of properties to fetch and display.
sourceThe live data source to use, specified as a component hint.
sourceParametersThe live data source parameters, specified as an URL query string.
filtersThe initial filters to apply on the live data, specified as an URL query string.
sortThe properties to sort on the live data initially, specified as a comma-separated list of property names, where each property name can be optionally suffixed with the sort order using :asc or :desc.
limitThe maximum number of live data entries to show on a page.15
offsetThe index of the first live data entry to show.0
layoutsThe comma-separated list of layouts the user can choose from to display the live data. The first layout in the list will be loaded initially.table,cards
showPageSizeDropdownShow or hide the page size drop down that allows the user to change the number of entries displayed per page.false
pageSizesThe comma-separated list of page sizes to display in the page size drop down.15,25,50,100

Live Data Sources

A live data source is implemented as a component and provides both the data (the live data entries) and information on how to interact with the data (how to display and edit the properties of a live data entry).

Here's a list of known live data sources:

  • liveTable: exposes any live table results page as a live data source, allowing you to easily replace an existing live table with a live data instance.

Live Table Results

The liveTable live data source allows us to reuse any live table results page as a live data source. 

Examples

  • Reuse the default live table results that correspond to a specified class name:
    {{liveData
      id="users"
      properties="_avatar,doc.name,first_name,last_name"
      source="liveTable"
      sourceParameters="className=XWiki.XWikiUsers&translationPrefix=xe.userdirectory."
    /}}
  • Reuse custom live table results page:
  • Reuse custom live table results template:

Parameters

The liveTable live data source supports the following live table parameters:

  • className
  • resultPage
  • queryFilters
  • translationPrefix

Besides these, the following custom parameters are also supported:

NameDescription
templateUse 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.

Layouts

The following layouts are currently supported:

NameDescriptionSince
tableDisplays the live data entries using a table, allowing the user to sort and filter from the table header.
cardsDisplays the live data entries using cards arranged in a grid. Sorting and filtering is performed through dedicated panels that can be accessed from the live data menu.

Table

Displays the live data entries using a table, allowing the user to sort and filter from the table header.

liveData-table.png

Cards

Displays the live data entries using cards arranged in a grid. Sorting and filtering is performed through dedicated panels that can be accessed from the live data menu.

liveData-cards.png

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager).

You can also use the manual method which involves dropping the JAR file and all its dependencies into the WEB-INF/lib folder and restarting XWiki.

Dependencies

Dependencies for this extension (org.xwiki.platform:xwiki-platform-livedata-macro 12.10):

Tags:
    

Get Connected