Package com.atlassian.jira.user.profile
Class AbstractUserProfileFragment
java.lang.Object
com.atlassian.jira.user.profile.AbstractUserProfileFragment
- All Implemented Interfaces:
UserProfileFragment
- Direct Known Subclasses:
PluggableUserProfileFragment
Abstract class for UserProfileFragment
that helps writing fragments that
are rendered by velocity.
It simply renders the template based of the fragment id and the implementing class can also
override createVelocityParams(User, User)
- Since:
- v4.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected final JiraAuthenticationContext
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractUserProfileFragment
(JiraAuthenticationContext jiraAuthenticationContext, VelocityTemplatingEngine templatingEngine, VelocityParamFactory velocityParamFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateVelocityParams
(ApplicationUser profileUser, ApplicationUser currentUser) Creates the parameters passed to the velocity template.getFragmentHtml
(ApplicationUser profileUser, ApplicationUser currentUser) Creates the HTML for this fragment.boolean
showFragment
(ApplicationUser profileUser, ApplicationUser currentUser) Whether or not we display this fragment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.user.profile.UserProfileFragment
getId
-
Field Details
-
PROFILE_USER
- See Also:
-
CURRENT_USER
- See Also:
-
jiraAuthenticationContext
-
-
Constructor Details
-
AbstractUserProfileFragment
public AbstractUserProfileFragment(JiraAuthenticationContext jiraAuthenticationContext, VelocityTemplatingEngine templatingEngine, VelocityParamFactory velocityParamFactory)
-
-
Method Details
-
showFragment
Whether or not we display this fragment. By default we do.- Specified by:
showFragment
in interfaceUserProfileFragment
- Parameters:
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current user- Returns:
- true if we should disply this fragment, otherwise false
-
getFragmentHtml
Creates the HTML for this fragment.This implementation renders the template based off of the fragment id -
UserProfileFragment.getId()
- Specified by:
getFragmentHtml
in interfaceUserProfileFragment
- Parameters:
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current user- Returns:
- The HTML of this fragment
-
createVelocityParams
protected Map<String,Object> createVelocityParams(ApplicationUser profileUser, ApplicationUser currentUser) Creates the parameters passed to the velocity template.By default this contains "fragId", "profileUser", "currentUser"
Implmentors of this abstract class can override this method to provide their own params.
- Parameters:
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current user- Returns:
- a map of the params passed to the velocity template.
- Since:
- v4.3
-