public abstract class SharedEntitySearchViewHelper<E extends SharedEntity> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SharedEntitySearchViewHelper.SearchResult<E>
Represents a page of results of the search.
|
static class |
SharedEntitySearchViewHelper.SortColumn
Container for sorting constants.
|
Constructor and Description |
---|
SharedEntitySearchViewHelper(ShareTypeFactory shareTypeFactory,
JiraAuthenticationContext authCtx,
String applicationContext,
String actionUrlPrefix,
String viewParameter,
String viewValue,
SharedEntity.TypeDescriptor entityType,
FeatureManager featureManager,
UserManager userManager,
GlobalPermissionManager permissionManager) |
Modifier and Type | Method and Description |
---|---|
protected StringBuffer |
addParameter(StringBuffer url,
String key,
Object value) |
protected StringBuffer |
createBasicUrlSearchParams()
Creates 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.
|
String |
generateSortCssClass(String sortColumnName)
Return the CSS class(es) to display the passed column's sort status.
|
String |
generateSortIcon(String sortColumnName)
Return the HTML for the sort icon used to display the sort order for the passed column.
|
String |
generateSortUrl(String sortColumnName)
Return the URL that can be used to sort by the passed column.
|
abstract SharedEntitySearchContext |
getEntitySearchContext() |
String |
getGroupShare() |
Long |
getPagingOffset() |
List<E> |
getPopularFilters(JiraServiceContext jiraServiceContext)
Gets the filters which have been made favourite by the most people.
|
String |
getProjectShare() |
String |
getRoleShare() |
String |
getSearchName() |
String |
getSearchOwnerUserName() |
String |
getSearchShareType() |
String |
getSearchShareTypeJSON()
Produces a JSON representation of the current form state.
|
List<ShareTypeRendererBean> |
getShareTypeRendererBeans()
Returns the
ShareTypeRendererBeans used by the front end to render each type of
sharing that a filter could have. |
String |
getSortColumn() |
String |
getUserShare() |
boolean |
isSortAscending() |
SharedEntitySearchViewHelper.SearchResult<E> |
search(JiraServiceContext jiraServiceContext)
Performs the search for filters based on the configured state.
|
void |
setGroupShare(String groupShare) |
void |
setPagingOffset(Long pagingOffset) |
void |
setProjectShare(String projectShare) |
void |
setRoleShare(String roleShare) |
void |
setSearchName(String searchName) |
void |
setSearchOwnerUserName(String searchOwnerUserName) |
void |
setSearchShareType(String searchShareType) |
void |
setSortAscending(boolean sortAscending) |
void |
setSortColumn(String sortColumn) |
void |
setUserShare(String userShare) |
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.
|
public SharedEntitySearchViewHelper(ShareTypeFactory shareTypeFactory, JiraAuthenticationContext authCtx, String applicationContext, String actionUrlPrefix, String viewParameter, String viewValue, SharedEntity.TypeDescriptor entityType, FeatureManager featureManager, UserManager userManager, GlobalPermissionManager permissionManager)
public String getSearchName()
public void setSearchName(String searchName)
public String getSearchOwnerUserName()
public void setSearchOwnerUserName(String searchOwnerUserName)
public String getSearchShareType()
public void setSearchShareType(String searchShareType)
public void setGroupShare(String groupShare)
public String getGroupShare()
public String getUserShare()
public void setUserShare(String userShare)
public Long getPagingOffset()
public void setProjectShare(String projectShare)
public String getProjectShare()
public void setRoleShare(String roleShare)
public String getRoleShare()
public void setPagingOffset(Long pagingOffset)
public String getSortColumn()
public void setSortColumn(String sortColumn)
public boolean isSortAscending()
public void setSortAscending(boolean sortAscending)
public abstract SharedEntitySearchContext getEntitySearchContext()
public List<ShareTypeRendererBean> getShareTypeRendererBeans()
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.ShareTypes
.public String generateSortUrl(String sortColumnName)
sortColumnName
- the column to sort by.public String generateSortIcon(String sortColumnName)
sortColumnName
- the name of the columnpublic String generateSortCssClass(String sortColumnName)
sortColumnName
- the column to get the classes for.public SharedEntitySearchViewHelper.SearchResult<E> search(JiraServiceContext jiraServiceContext)
jiraServiceContext
- the service context to use for performing the search with the underlying service.public List<E> getPopularFilters(JiraServiceContext jiraServiceContext)
jiraServiceContext
- the service context to use for performing the search.SharedEntity
objects.public String getSearchShareTypeJSON()
protected StringBuffer createBasicUrlSearchParams()
protected StringBuffer addParameter(StringBuffer url, String key, Object value)
protected abstract SharedEntitySearchResult<E> doExecuteSearch(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth)
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.protected abstract boolean validateSearchParameters(JiraServiceContext ctx, SharedEntitySearchParameters searchParameters, int pageOffset, int pageWidth)
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.Copyright © 2002-2022 Atlassian. All Rights Reserved.