Correct XWiki syntax for Live Data page using Live Table from a custom AWM?

Hi there,

I’ve created an AWM (yay!) and would like to have a page with a Live Data table. There are a lot of properties so the Properties Panel would be super useful and make the information display much better.

Where I’m getting stuck is with populating the Live Data table.

I used the XWiki syntax from the Live Data Macro guidance.

My application is named: SPBooksPublisherApplication. Here’s how it looks:

For the Live Data Table, I entered the following syntax in the source code:

{{liveData filters="doc.location=Main.SP.SP_Books" 
id="BooksPublishers" 
limit="5" 
properties="doc.title,notes,salesContact,doc.author"
showPageSizeDropdown="true" 
sort=":asc" 
source="liveTable" 
sourceParameters="doc.location=Main.SP.SP_Books"}}
{{/liveData}}

However when I save and view the page, all of the pages on our wiki are returned and the fields for ‘notes’ and ‘salesContact’ display empty values:

I also don’t see the property names as headers in the table.

I’m curious where I have gone astray :sweat:. Have I defined the source or instance ID incorrectly?

Thanks!

Hello, AFAIU you have created an AWM app and then you have modified the generated pages to replace the LiveTable by a LiveData? I assume this is while waiting for Loading... to be implemented.

I think you’re missing the translationPrefix parameter, see the doc at https://extensions.xwiki.org/xwiki/bin/view/Extension/Live%20Data%20Macro/#HUsage

This looks wrong too, check the usage on the LiveData macro doc page. You should probably specify a classname.

Thanks Vincent!

I am looking to create a separate page with a Live Data macro that pulls in information from the AWM. It is not replacing the content on the application page, but thanks for directing me to the Jira ticket!

Where do I find the className? This is what I see when I look under the Code page for my application:

Reading the XWiki Data Model, it states that the class name “is the name of the document it is attached to.”

However when I specify:

sourceParameters="className=SPBooksPublisherApplication&translationPrefix=platform.index.

…there are no entries loaded.

The property names also don’t display in the header columns (which is a separate Live Data table issue we’ve noticed).

Thanks again!

Based on your screenshot and what you tried, I’m guessing that the reference to the xclass page is SPBooksPublisherApplication.Code.SPBooksPublisherApplicationClass.

To know the reference of a page, see https://www.xwiki.org/xwiki/bin/view/FAQ/How%20can%20I%20get%20the%20reference%20of%20a%20page

Thanks Vincent - that worked!

Sorry to return to one outstanding question…is there something I am missing in the syntax to get the Property column headers to appear or some reason why this would be happening?

Thanks very much - the Live Data macro is a great feature :smiley:

Sorry I don’t know, I’ve not used LD yet :slight_smile: (only LT).

Hi Vincent,

I figured it out! I needed to use the non-pretty name for the field:

Screenshot 2024-08-13 at 9.34.49 AM

Here’s the full code I used for the LiveData macro:

{{liveData filters="doc.location=Main.SP.Journals" id="JournalsPublisherData" limit="10" properties="doc.title,salesContact,technicalContact,pubMetadata,FTPDelivery,loadingSchedule,notes,publisherPage,doc.author" showPageSizeDropdown="true" sort=":asc" source="liveTable" sourceParameters="className=JournalsPublisherApplication.Code.JournalsPublisherApplicationClass&translationPrefix=platform.index."}}{{/liveData}}

And how it appears on the page:

We also solved for the property labels not appearing by removing some custom CSS we had added in an earlier version of XWiki.

Thanks again, go LiveData!

Glad to hear that you’ve figured it out!