User Resource API

Last modified by Vincent Massol on 2024/07/05 18:12

cogResource APIs for users and groups
TypeJAR
CategoryAPI
Developed by

XWiki Development Team

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

Allows computing a user profile URL.

Examples

  • Get a relative profile URL:
    @Inject
    private ResourceReferenceSerializer<ResourceReference, ExtendedURL> serializer:

    UserReference userReference = ...
    ResourceReference userResourceReference = new UserResourceReference(userReference);
    String profileURL = this.serializer.serialize(userResourceReference);
  • Get a full profile URL:
    @Inject
    private ResourceReferenceSerializer<ResourceReference, ExtendedURL> serializer:

    @Inject
    @Named("url")
    private URLNormalizer<URL> normalizer;

    UserReference userReference = ...
    ResourceReference userResourceReference = new UserResourceReference(userReference);
    URL profileURL = this.normalizer.normalize(this.serializer.serialize(userResourceReference));

Get Connected