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)
Modifier and Type | Field and Description |
---|---|
static String |
CURRENT_USER |
protected JiraAuthenticationContext |
jiraAuthenticationContext |
static String |
PROFILE_USER |
Constructor and Description |
---|
AbstractUserProfileFragment(JiraAuthenticationContext jiraAuthenticationContext,
VelocityTemplatingEngine templatingEngine,
VelocityParamFactory velocityParamFactory) |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
public static final String PROFILE_USER
public static final String CURRENT_USER
protected final JiraAuthenticationContext jiraAuthenticationContext
public AbstractUserProfileFragment(JiraAuthenticationContext jiraAuthenticationContext, VelocityTemplatingEngine templatingEngine, VelocityParamFactory velocityParamFactory)
public boolean showFragment(com.atlassian.crowd.embedded.api.User profileUser, com.atlassian.crowd.embedded.api.User currentUser)
showFragment
in interface UserProfileFragment
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current userpublic String getFragmentHtml(com.atlassian.crowd.embedded.api.User profileUser, com.atlassian.crowd.embedded.api.User currentUser)
UserProfileFragment.getId()
getFragmentHtml
in interface UserProfileFragment
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current userprotected Map<String,Object> createVelocityParams(com.atlassian.crowd.embedded.api.User profileUser, com.atlassian.crowd.embedded.api.User currentUser)
profileUser
- The user whose profile the current user is looking atcurrentUser
- The current userCopyright © 2002-2016 Atlassian. All Rights Reserved.