Class SharedEntitySearchViewHelper<E extends SharedEntity>

java.lang.Object
com.atlassian.jira.web.action.util.sharing.SharedEntitySearchViewHelper<E>
Direct Known Subclasses:
ConfigurePortalPages.PortalPageViewHelper, FilterViewHelper

public abstract class SharedEntitySearchViewHelper<E extends SharedEntity> extends Object
A class that makes searching for Shared Entities easier.
Since:
v3.13
  • Constructor Details

  • Method Details

    • getSearchName

      public String getSearchName()
    • setSearchName

      public void setSearchName(String searchName)
    • getSearchOwnerUserName

      public String getSearchOwnerUserName()
    • setSearchOwnerUserName

      public void setSearchOwnerUserName(String searchOwnerUserName)
    • getSearchShareType

      public String getSearchShareType()
    • setSearchShareType

      public void setSearchShareType(String searchShareType)
    • setGroupShare

      public void setGroupShare(String groupShare)
    • getGroupShare

      public String getGroupShare()
    • getUserShare

      public String getUserShare()
    • setUserShare

      public void setUserShare(String userShare)
    • getPagingOffset

      public Long getPagingOffset()
    • setProjectShare

      public void setProjectShare(String projectShare)
    • getProjectShare

      public String getProjectShare()
    • setRoleShare

      public void setRoleShare(String roleShare)
    • getRoleShare

      public String getRoleShare()
    • setPagingOffset

      public void setPagingOffset(Long pagingOffset)
    • getSortColumn

      public String getSortColumn()
    • setSortColumn

      public void setSortColumn(String sortColumn)
    • isSortAscending

      public boolean isSortAscending()
    • setSortAscending

      public void setSortAscending(boolean sortAscending)
    • getEntitySearchContext

      public abstract SharedEntitySearchContext getEntitySearchContext()
    • getShareTypeRendererBeans

      public List<ShareTypeRendererBean> getShareTypeRendererBeans()
      Returns the ShareTypeRendererBeans used by the front end to render each type of sharing that a filter could have. Does lazy initialisation so it's performant to call multiple times in a view. Is only used by the search form.
      Returns:
      the available ShareTypes.
    • generateSortUrl

      public String generateSortUrl(String sortColumnName)
      Return the URL that can be used to sort by the passed column.
      Parameters:
      sortColumnName - the column to sort by.
      Returns:
      the URL that can be used to sort the passed column.
    • generateSortIcon

      public String generateSortIcon(String sortColumnName)
      Return the HTML for the sort icon used to display the sort order for the passed column. The returned String can be empty if the passed passed column should not display an icon.
      Parameters:
      sortColumnName - the name of the column
      Returns:
      the HTML for the icon to display.
    • generateSortCssClass

      public String generateSortCssClass(String sortColumnName)
      Return the CSS class(es) to display the passed column's sort status.
      Parameters:
      sortColumnName - the column to get the classes for.
      Returns:
      the CSS class(es) to represent the passed column's sorting status.
    • search

      public SharedEntitySearchViewHelper.SearchResult<E> search(JiraServiceContext jiraServiceContext)
      Performs the search for filters based on the configured state.
      Parameters:
      jiraServiceContext - the service context to use for performing the search with the underlying service.
      Returns:
      the SearchResult for the search currently configured. null can be returned to indicate an error.
    • getPopularFilters

      public List<E> getPopularFilters(JiraServiceContext jiraServiceContext)
      Gets the filters which have been made favourite by the most people.
      Parameters:
      jiraServiceContext - the service context to use for performing the search.
      Returns:
      the list of SharedEntity objects.
    • getSearchShareTypeJSON

      public String getSearchShareTypeJSON()
      Produces a JSON representation of the current form state. Used to pre-populate the JavaScript-controlled component in select-share-types.jsp.
      Returns:
      the JSON representation to be used by the client to set up the search form controls state.
    • createBasicUrlSearchParams

      protected StringBuffer createBasicUrlSearchParams()
      Creates the basic URL parameters needed to keep the current search state.
      Returns:
      a string buffer containing a URL with the basic search parameters.
    • addParameter

      protected StringBuffer addParameter(StringBuffer url, String key, Object value)
    • doExecuteSearch

      protected abstract SharedEntitySearchResult<E> doExecuteSearch(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth)
      Execute the search for the passed parameters.
      Parameters:
      ctx - the context to execute the search under.
      searchParameters - the parameters for the search.
      pageOffset - the offset of the search result page to return.
      pageWidth - the width of a search result page.
      Returns:
      the result of the search or null if an error occurred.
    • validateSearchParameters

      protected abstract boolean validateSearchParameters(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth)
      Ensure that it is possible to execute a search with the passed parameters.
      Parameters:
      ctx - the context to execute the search under.
      searchParameters - the parameters for the search.
      pageOffset - the offset of the search result page to return.
      pageWidth - the width of a search result page.
      Returns:
      true iff the search can be performed.