public class

ProfileLinkUserFormat

extends Object
implements UserFormat
java.lang.Object
   ↳ com.atlassian.jira.plugin.userformat.ProfileLinkUserFormat

Class Overview

Very simple implementation that only renders the users full name with a link to the user's profile page. If the username is null, it will display 'Anonymous'. If no user matching the username can be found, ony the username will be printed.

Summary

Constants
String TYPE
[Expand]
Inherited Constants
From interface com.atlassian.jira.plugin.profile.UserFormat
Public Constructors
ProfileLinkUserFormat(AvatarService avatarService, I18nHelper i18nHelper, JiraAuthenticationContext jiraAuthenticationContext, UserFormatModuleDescriptor moduleDescriptor, UserKeyService userKeyService, UserUtil userUtil)
Public Methods
String format(String key, String id)
Renders the formatted user for a given section on the screen.
String format(String key, String id, Map<StringObject> params)
Renders the formatted user for a given section on the screen.
SoyTemplateRenderer getSoyRenderer()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.plugin.profile.UserFormat

Constants

public static final String TYPE

Constant Value: "profileLink"

Public Constructors

public ProfileLinkUserFormat (AvatarService avatarService, I18nHelper i18nHelper, JiraAuthenticationContext jiraAuthenticationContext, UserFormatModuleDescriptor moduleDescriptor, UserKeyService userKeyService, UserUtil userUtil)

Public Methods

public String format (String key, String id)

Renders the formatted user for a given section on the screen. Please note that the username may be null (eg for empty fields, anonymous user's, etc) or the user may not exist. Implementations should handle these cases.

Extra context can be passed to the renderer via the id attribute. Ideally an implementation might include this id in the rendered output such that it can be used for test assertions.

The result should always be ready to display in an HTML response i.e. it should be HTML encoded if necessary.

Parameters
key the user's userkey to format.
id A value providing extra context to the rendering process.
Returns
  • the formatted user

public String format (String key, String id, Map<StringObject> params)

Renders the formatted user for a given section on the screen. Please note that the username may be null (eg for empty fields, anonymous user's, etc) or the user may not exist. Implementations should handle these cases.

Extra context can be passed to the renderer via the params attribute.

The result should always be ready to display in an HTML response i.e. it should be HTML encoded if necessary.

Parameters
key the user's userkey to format.
id A value providing extra context to the rendering process.
params Additional context to pass to the renderer
Returns
  • the formatted user

public SoyTemplateRenderer getSoyRenderer ()