Configure an user property to be displayed as hint by the user picker

Hi everyone,

In a large XWiki instance it is possible to have multiple users with the same or very similar name. This can lead to mistakes (e.g. selecting the wrong user) when using the user picker because we are currently displaying only the avatar and user full name. I’m trying to fix this with Loading... . The idea is to:

  • add a new configuration property whose value is the name of a user property (from XWikiUsers class)
  • show the value of the configured user property as hint in the user picker (or anywhere we display the user in a compact mode: e.g. #displayUser Velocity macro, useravatar macro, etc.)

For the first point I propose to:

This would allow me to use $services.user.configuration.userQualifierProperty to access the configured user property name.

WDYT?

Thanks,
Marius

+1

+1

+1 Thanks

Out of curiosity, do you plan to make this additional property to be usable in users search?

I’m not sure I understand your question. I’m not planning to add a new user property. I’m only adding a new configuration property that points to an user property. Indeed, what I forgot to mention is that in XWiki Standard I’m going to leave this configuration empty because none of the existing / standard user properties match the use case. But users (administrators) can use this new configuration to show additional information in the user picker. They will probably add a custom user property (if they don’t have it already) and use the new configuration to point to it.

Or maybe your question is whether the user picker is going to search in the indicated qualifier property or not? I don’t plan to make any changes here, and it some cases it won’t be even possible to search in the indicated user property: e.g. when that property is computed. I imagine that in some cases the additional information:

  • could be collected from multiple user properties
  • could depend on some condition (scripting)

For this the users can add a computed custom user property and point the new configuration to it.

Thanks,
Marius

Maybe Manuel was highlighting another possible use case for this new property which is to use it in the search result UI (either in the “last modified by” user - either in alt or elsewhere, or when returning user profile page results). I think the general answer is that anywhere a user is displayed (we’ll update the velocity or rendering macros that display users probably), we’ll use this new property (either visible directly, e.g. in the user picker, or in the alt text), with the idea of making it easy for users to differentiate between users.

Yes, that’s the plan.

Implemented in Loading...