Class AbstractUserProfileFragment

java.lang.Object
com.atlassian.jira.user.profile.AbstractUserProfileFragment
All Implemented Interfaces:
UserProfileFragment
Direct Known Subclasses:
PluggableUserProfileFragment

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
  • Field Details

  • Constructor Details

  • Method Details

    • showFragment

      public boolean showFragment(ApplicationUser profileUser, ApplicationUser 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 at
      currentUser - The current user
      Returns:
      true if we should disply this fragment, otherwise false
    • getFragmentHtml

      public String getFragmentHtml(ApplicationUser profileUser, ApplicationUser 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 at
      currentUser - 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 at
      currentUser - The current user
      Returns:
      a map of the params passed to the velocity template.
      Since:
      v4.3