com.atlassian.jira.plugin.profile
Interface UserFormat

All Known Implementing Classes:
FullNameUserFormat, FullProfileUserFormat, ProfileLinkUserFormat, ReferenceFullNameUserFormat, UserNameUserFormat

@PublicSpi
public interface UserFormat

Provides a format to display a user on screen. This may be simply the user's full name surrounded by a link to the user's profile, or something more advanced such as the user's name and profile picture.

Since:
v3.13
See Also:
UserFormatModuleDescriptor, UserFormats

Field Summary
static String VIEW_TEMPLATE
          The default velocity template name that is used to render the view.
 
Method Summary
 String format(String username, String id)
          Renders the formatted user for a given section on the screen.
 String format(String username, String id, Map<String,Object> params)
          Renders the formatted user for a given section on the screen.
 

Field Detail

VIEW_TEMPLATE

static final String VIEW_TEMPLATE
The default velocity template name that is used to render the view.

See Also:
Constant Field Values
Method Detail

format

String format(String username,
              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:
username - the user's username to format.
id - A value providing extra context to the rendering process.
Returns:
the formatted user

format

String format(String username,
              String id,
              Map<String,Object> 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:
username - the user's username to format.
id - A value providing extra context to the rendering process.
params - Additional context to pass to the renderer
Returns:
the formatted user


Copyright © 2002-2013 Atlassian. All Rights Reserved.