Hi devs,
Simon asked the question about how do we now compute the user profile URL with the new User API. Here’s my proposal:
- Create a new
xwiki-platform-user-resource
module to implement the following classes:-
UserResourceReference
(takes aUserReference
as input) and implementsResourceReference
(from thexwiki-platform-resource
module). Represents a User URI (ie a User profile URI). -
ResourceReferenceSerializer
: takes aUserResourceReference
and generate anExtendedURL
. The goal is to generate the URL for a user profile. Ideally this should extend or reuse the serializer for entity types but since there isn’t one for now, it will use FTM the XWikiServletURLFactory for its implementation.
-
- (Future) Add a new optional property for users. We need to define a key name for it. I propose
profileURL
. If this property is defined thenResourceReferenceSerializer
uses it, otherwise it computes an XWiki User Profile URL. This allows users to have external profile URLs. - (Future) Add a new User
ResourceReferenceHandler
(i.e. introduce a/user/
URL type to point to a user profile instead of using the Entity Reference Handler).
WDYT?
Thanks