Livetable Exporter Macro
Add an export button to a livetable. |
Type | XAR |
Category | Macro |
Developed by | Guillaume Delhumeau, Ludovic Dubost, Anca Luca, slauriere |
Active Installs | 61 |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Adds an export button to a livetable generated by the Livetable Macro for exporting data in CSV, JSON or XLS.
Usage
- Step 1: add a livetable to a page using the Livetable Macro.
- Step 2: add the code below to the page, and replace "livetable-id" by the identifier of the livetable to be exported, created in step 1.
If you need to let users export a livetable in different formats, you will need to call the macros several times, for instance as follows:
This macro obsoletes LiveTableExcelExport Macro.
Parameters
Name | Description | Mandatory | Default |
---|---|---|---|
livetable | The livetable where you want to add the file export. | Yes | |
withPageName | Set to "true" for adding a column containing the wiki page name. | No | true |
withPageURL | Set to "true" for adding a column containing the wiki page URL. | No | true |
withAllFields | Set to "true" for forcing the export of all the fields of the class of the livetable (if any class is selected), instead of just the ones displayed as columns in the displayed livetable. | No | false |
filename | The output filename (without extension), to which the results will be exported. | No | |
customResults | Name of a custom page generating the results, if different than the default. | No | Macros.LivetableExporterMacroResults |
format | Export format to be used: "excel" (default), "csv" or "json". | No | excel |
label | Label of the export button. | No |
Note on scalability
This macro exports all the results from the target livetable, while upon display on screen the results are paginated. Because of this, the time needed to perform the export depends on the total number of entries in the livetable. Depending on the application server settings, the web server (the servlet container or another HTTP server such as Apache) may return an internal server error before the export completes, and thus the export will not work. A solution in this case is to increase the timeout delay of the web server, that is the delay after which the server will return an error.
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). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
In order to perform exports in XLS format, the Excel plugin needs to get installed, and declared in the xwiki.cfg in the list of active plugins.
Troubleshooting
In old wikis, the macro may not work. In case you face the issue please edit the page "Macros.AddExcelExportToLivetableMacro" with the object editor, find the "WikiMacroClass" object and remove the following line from the object content:
Release Notes
v4.0.1
v4.0
v3.1
v3.0
Dependencies
Dependencies for this extension (org.xwiki.contrib:xwiki-livetable-exporter-macro 4.0.1):
- com.opencsv:opencsv 3.10
- org.xwiki.contrib:xwiki-plugin-excel 1.0
- org.xwiki.contrib:macro-job 1.5
- org.xwiki.platform:xwiki-platform-livetable-ui 6.0