Class SharedEntitySearchViewHelper<E extends SharedEntity>
java.lang.Object
com.atlassian.jira.web.action.util.sharing.SharedEntitySearchViewHelper<E>
- Direct Known Subclasses:
ConfigurePortalPages.PortalPageViewHelper,FilterViewHelper
A class that makes searching for Shared Entities easier.
- Since:
- v3.13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents a page of results of the search.static final classContainer for sorting constants. -
Constructor Summary
ConstructorsConstructorDescriptionSharedEntitySearchViewHelper(ShareTypeFactory shareTypeFactory, JiraAuthenticationContext authCtx, String applicationContext, String actionUrlPrefix, String viewParameter, String viewValue, SharedEntity.TypeDescriptor entityType, FeatureManager featureManager, UserManager userManager, GlobalPermissionManager permissionManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBufferaddParameter(StringBuffer url, String key, Object value) protected StringBufferCreates the basic URL parameters needed to keep the current search state.protected abstract SharedEntitySearchResult<E>doExecuteSearch(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth) Execute the search for the passed parameters.generateSortCssClass(String sortColumnName) Return the CSS class(es) to display the passed column's sort status.generateSortIcon(String sortColumnName) Return the HTML for the sort icon used to display the sort order for the passed column.generateSortUrl(String sortColumnName) Return the URL that can be used to sort by the passed column.abstract SharedEntitySearchContextgetPopularFilters(JiraServiceContext jiraServiceContext) Gets the filters which have been made favourite by the most people.Produces a JSON representation of the current form state.Returns theShareTypeRendererBeansused by the front end to render each type of sharing that a filter could have.booleansearch(JiraServiceContext jiraServiceContext) Performs the search for filters based on the configured state.voidsetGroupShare(String groupShare) voidsetPagingOffset(Long pagingOffset) voidsetProjectShare(String projectShare) voidsetRoleShare(String roleShare) voidsetSearchName(String searchName) voidsetSearchOwnerUserName(String searchOwnerUserName) voidsetSearchShareType(String searchShareType) voidsetSortAscending(boolean sortAscending) voidsetSortColumn(String sortColumn) voidsetUserShare(String userShare) protected abstract booleanvalidateSearchParameters(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth) Ensure that it is possible to execute a search with the passed parameters.
-
Constructor Details
-
Method Details
-
getSearchName
-
setSearchName
-
getSearchOwnerUserName
-
setSearchOwnerUserName
-
getPagingOffset
-
setPagingOffset
-
getSortColumn
-
setSortColumn
-
isSortAscending
public boolean isSortAscending() -
setSortAscending
public void setSortAscending(boolean sortAscending) -
getEntitySearchContext
-
generateSortUrl
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
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
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
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
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
SharedEntityobjects.
-
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
-