Update Live Data Macro Documentation for Filtering by Tags

The Live Data Macro includes an example for filtering by tags, but it doesn’t work for me. The documentation proposes:

{{liveData
  id="documents"
  properties="tags,doc.name"
  source="liveTable"
  filters="tags=aaa&tags=bbb"
  sourceParameters="className=XWiki.TagClass&translationPrefix=platform.index."
}}
  {
  "meta": {
    "propertyDescriptors": [
      {
        "id": "tags",
        "visible": false
      }
    ]
  }
}
{{/liveData}}

What works for me is not using XWiki.TagClass at all, to leave out tags from the properties statement, and use tag instead of tags in the filter statement. After making these changes, the meta description becomes unnecessary. Filtering multiple tags works by using tag=aaa&&bbb instead of tags=aaa&tags=bbb:

{{liveData
  id="documents"
  properties="doc.name"
  source="liveTable"
  filters="tag=aaa&&bbb"
  sourceParameters="className=WhateverClass&translationPrefix=platform.index."
}}
{{/liveData}}

I’d like to update the documentation to reflect the example that actually works without XWiki.TagClass, but I also don’t want to remove information that might still be correct and helpfull. What confuses me is the different syntax for filtering with and without XWiki.TagClass.

The question now is: Is the documentation correct, is it incorrect, or is filtering by tags without using XWiki.TagClass just another example that works as well?

Hello @CycleSEC . Thx for wanting to improve the doc :slight_smile:

I don’t have the answer to your question, I’ll leave that to the LD expert :wink:

However, I wanted to mention 2 points:

  1. If you want, there’s a #xwiki matrix channel where you can discuss and ask questions. All the XWiki devs are there and you can often get answers quickly.
  2. We have now set up the Change Request app on xwiki.org and thus you can propose changes and have them validated by XWiki experts (namely xwiki.org admins, core devs, some power users, etc).
1 Like

Hello @CycleSEC,

The example, introduced by @vmassol in the documentation (see diff), is working fine for me.
What is going wrong more precisely for you?

Your example is also working fine and is interesting because it allows to use a different className is the sourceParameters.
Would you be ok to add it as an alternative solution in the documentation?

Thanks

1 Like

haha I had completely forgotten I added this :wink:

1 Like