Live Data Macro
Display dynamic lists of data. |
Type | JAR |
Category | Macro |
Developed by | |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
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
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"
/}}
Parameters
Name | Description | Default Value | Since |
---|---|---|---|
id | The live data instance id. | ||
properties | The comma-separated list of properties to fetch and display. | ||
source | The live data source to use, specified as a component hint. | ||
sourceParameters | The live data source parameters, specified as an URL query string. | ||
filters | The initial filters to apply on the live data, specified as an URL query string. | ||
sort | The 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. | ||
limit | The maximum number of live data entries to show on a page. | 15 | |
offset | The index of the first live data entry to show. | 0 | |
layouts | The 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 | |
showPageSizeDropdown | Show or hide the page size drop down that allows the user to change the number of entries displayed per page. | false | |
pageSizes | The 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:
Name | Description |
---|---|
template | Use 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:
Name | Description | Since |
---|---|---|
table | Displays the live data entries using a table, allowing the user to sort and filter from the table header. | |
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. |
Table
Displays the live data entries using a table, allowing the user to sort and filter from the table header.
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.
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):
- org.xwiki.platform:xwiki-platform-livedata-api 12.10
- org.xwiki.platform:xwiki-platform-livedata-webjar 12.10
- org.xwiki.rendering:xwiki-rendering-transformation-macro 12.10
- org.xwiki.platform:xwiki-platform-skin-api 12.10