Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16197

Implement relational storage for properties of type "List of users" and "List of groups"

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 9.11.3
    • Old Core
    • None
    • Unknown

    Description

      Currently, when adding a property of type "List of users" or a property of type "List of groups", in the class editor the checkbox "relational storage" is visible, and can be checked for the property.

      However, this doesn't actually enable the relational storage for these properties, they're still stored as large strings:

      mysql> select XWO_NAME, xwikiproperties.* from xwikiobjects join xwikiproperties on XWO_ID = XWP_ID and XWO_NAME='Sandbox.TestDocument';
      +----------------------+----------------------+------------------+-------------------------------------------+
      | XWO_NAME             | XWP_ID               | XWP_NAME         | XWP_CLASSTYPE                             |
      +----------------------+----------------------+------------------+-------------------------------------------+
      | Sandbox.TestDocument | -3231396520757276881 | listofgroups     | com.xpn.xwiki.objects.LargeStringProperty |
      | Sandbox.TestDocument | -3231396520757276881 | listofgroups-rel | com.xpn.xwiki.objects.LargeStringProperty |
      | Sandbox.TestDocument | -3231396520757276881 | listofusers      | com.xpn.xwiki.objects.LargeStringProperty |
      | Sandbox.TestDocument | -3231396520757276881 | listofusers-rel  | com.xpn.xwiki.objects.LargeStringProperty |
      +----------------------+----------------------+------------------+-------------------------------------------+
      4 rows in set (0.00 sec)
      

      It's really important to be able to have relational storage possible for properties of type list of users and list of groups for these properties to be usable with multiselect.

      Today querying reliably whether a user is a member of such a property is a pain, as we need to query with a 'like' clause, and pad both the prop value and searched string with the separator in order to avoid collisions between users like XWiki.aluca and XWiki.alucas , for example.
      This is so much of a pain that I'm actually tempted on making a simple database list property instead of using the list of users / list of groups.

      I hesitated reporting this as a bug (the fact that relational storage checkbox doesn't work) but wanted to avoid just removing the relational storage checkbox .

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lucaa Anca Luca
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: