com.atlassian.jira.user.profile
Class AbstractUserProfileFragment
java.lang.Object
com.atlassian.jira.user.profile.AbstractUserProfileFragment
- All Implemented Interfaces:
- UserProfileFragment
- Direct Known Subclasses:
- AssignedAndOpenUserProfileFragment, DetailsUserProfileFragment, PreferencesUserProfileFragment
public abstract class AbstractUserProfileFragment
- extends java.lang.Object
- implements UserProfileFragment
Abstract class for UserProfileFragment
that helps writing fragments that are
velocity rendered. It simply renders the template based of the fragment id and the implementing class can also
overide createVelocityParams(com.opensymphony.user.User, com.opensymphony.user.User)
- Since:
- v4.1
Method Summary |
protected java.util.Map<java.lang.String,java.lang.Object> |
createVelocityParams(com.opensymphony.user.User profileUser,
com.opensymphony.user.User currentUser)
Creates the parameters passed to the velocity template. |
java.lang.String |
getFragmentHtml(com.opensymphony.user.User profileUser,
com.opensymphony.user.User currentUser)
Creates the HTML for this fragment. |
boolean |
showFragment(com.opensymphony.user.User profileUser,
com.opensymphony.user.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 |
applicationProperties
protected final ApplicationProperties applicationProperties
jiraAuthenticationContext
protected final JiraAuthenticationContext jiraAuthenticationContext
AbstractUserProfileFragment
public AbstractUserProfileFragment(ApplicationProperties applicationProperties,
JiraAuthenticationContext jiraAuthenticationContext,
com.atlassian.velocity.VelocityManager velocityManager)
showFragment
public boolean showFragment(com.opensymphony.user.User profileUser,
com.opensymphony.user.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 java.lang.String getFragmentHtml(com.opensymphony.user.User profileUser,
com.opensymphony.user.User currentUser)
- Creates the HTML for this fragment.
This implementation renders the template based off of the frgmant 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 java.util.Map<java.lang.String,java.lang.Object> createVelocityParams(com.opensymphony.user.User profileUser,
com.opensymphony.user.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.
Copyright © 2002-2010 Atlassian. All Rights Reserved.