I’m still struggling to understand how to make the right questions to catch up with how XWiki works to access any piece of information and need some help.
If I’m able to access any property of XWikiUsers class with this very simple code:
I’m sure our XWiki installation has several pages holding one or more instances of class XWiki.Mail. I’m afraid I’m failing to understand what source=“liveTable” does mean. Any help is greatly appreciated!
Some context to help you understand what’s going on.
Live Data is a generic front-end to display data in different layout. Table by default, but a Card view is also available.
To be able to get data to display in a Live Data, a source must be queried.
One of the main source we support is the liveTable one which works as a bridge to the Livetable source. This is really helpful as it allow to access all the sources already defined during the years where Livetable was the supported front-end to display data (i.e., a lot of sources).
But, you can define your own source in Java if you wish (we are lacking good documentation on this part but I’m working on it).
Then, the liveTable source can be provided with source parameters. The one you correctly used is the className, pointing the class you wish to list on your Live Table.
But, to ease things up and prevent duplication of the main values, we also provide implicit default configurations.
In your case, the queryFilters is set by default to currentlanguage,hidden. Meaning that the values are translated in the current local of the user, and hidden pages are displayed only when the user configuration allows them to be visible.
In my understanding, the user you tested with is not displaying hidden pages. And, all pages containing XWiki.Mail XObjects are hidden. Hence the empty Live Data.
So two options there:
you’d like to keep this behavior. In this case you simply have to allow the view of hidden pages on the user’s properties
you’d like to display the entries regardless of the user’s configuration, in this case you can override the default configuration on the source parameters of your user (see the snippet below).
were evil here! I will read several times your message and think a bit to find where I was lost and I would like to have found a reference to that detail!
I’m still trying to understand the whole thing. Looking for queryFilters I found this release notes for XWiki 6.0. By entering an empty string as a value for queryFilters I can retrieve properties of all objects even although they are instantiated in hidden pages and my user’s display hidden pages remains NO as default. But what I’m not able to get is that properties in their languages. I have this:
In my understanding, this is the expected result. The subject property contains a velocity template used to generate the email subject (see here).
Can you tell us what you’re trying to do? It might help us provide a better answer.
I’m trying to understand how does liveData macro work! That is all so far!
It happens that I ended playing with XWiki class Mail. By using XWikiClasses, I get that there are six pages (Pages Count shows 6) holding Mail class objects instances;
I see that all properties of object XWiki.Mail are localized. Thus, they content strings translated to en, fr, and de:
What I think I understand now thanks to your explanation is that I get the content of the Subject property in the language of the page where the object is instantiated. As XWiki.SharePage has no locale, I get the Subject in the default language of my XWiki installation, English.
Am I correct?
One more thing. Why do I get Page Count = 6? Six is the total number of instances, but they are held by only 4 pages.
I’m still lost with this. SharePage has three instances of XWiki.Mail. Each of them has a different Subject with part of the string in the language in the Language property. I see this, the same as in previous entry above:
As I’m querying XWiki for objects, I would expect to get the properties of every object. And I think I’m not getting that! I’ve added doc.title to be clearer with what I get: