com.atlassian.jira.user.profile
Class AbstractUserProfileFragment
java.lang.Object
com.atlassian.jira.user.profile.AbstractUserProfileFragment
- All Implemented Interfaces:
- UserProfileFragment
- Direct Known Subclasses:
- PlugableUserProfileFragment
public abstract class AbstractUserProfileFragment
- extends Object
- implements UserProfileFragment
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
Method Summary |
protected Map<String,Object> |
createVelocityParams(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User currentUser)
Creates the parameters passed to the velocity template. |
String |
getFragmentHtml(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User currentUser)
Creates the HTML for this fragment. |
boolean |
showFragment(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User 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 |
jiraAuthenticationContext
protected final JiraAuthenticationContext jiraAuthenticationContext
AbstractUserProfileFragment
public AbstractUserProfileFragment(JiraAuthenticationContext jiraAuthenticationContext,
VelocityTemplatingEngine templatingEngine,
VelocityParamFactory velocityParamFactory)
showFragment
public boolean showFragment(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User currentUser)
- Whether or not we display this fragment. By default we do.
- Specified by:
showFragment
in interface UserProfileFragment
- 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
public String getFragmentHtml(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User currentUser)
- Creates the HTML for this fragment.
This implementation renders the template based off of the fragment id -
UserProfileFragment.getId()
- Specified by:
getFragmentHtml
in interface UserProfileFragment
- 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(com.atlassian.crowd.embedded.api.User profileUser,
com.atlassian.crowd.embedded.api.User 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
Copyright © 2002-2014 Atlassian. All Rights Reserved.