Class AbstractUserSearchRenderer
java.lang.Object
com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
com.atlassian.jira.issue.search.searchers.renderer.AbstractUserSearchRenderer
- All Implemented Interfaces:
SearchRenderer
- Direct Known Subclasses:
AssigneeSearchRenderer
,CreatorSearchRenderer
,ReporterSearchRenderer
,UserPickerGroupCustomFieldRenderer
public abstract class AbstractUserSearchRenderer
extends AbstractSearchRenderer
implements SearchRenderer
An search renderer for the user fields.
- Since:
- v4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final PermissionManager
static final String
static final String
static final String
protected UserSearcherHelper
Fields inherited from class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
EDIT_TEMPLATE_SUFFIX, VIEW_TEMPLATE_SUFFIX
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractUserSearchRenderer
(UserFieldSearchConstants searchConstants, String nameKey, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, UserSearchService searchService, UserManager userManager, PermissionManager permissionManager) AbstractUserSearchRenderer
(UserFieldSearchConstantsWithEmpty searchConstants, String nameKey, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, UserSearchService searchService, UserManager userManager, PermissionManager permissionManager) -
Method Summary
Modifier and TypeMethodDescriptionaddUserGroupSuggestionParams
(FieldValuesHolder fieldValuesHolder, ApplicationUser user, SearchContext searchContext, List<String> selectedUsers) add user and group suggestions into parameters.getEditHtml
(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) Used to produce an HTML input that is rendered on the JIRA issue navigator.protected abstract String
getSelectedListOptions
(ApplicationUser searcher) protected String
getTextForuser
(ApplicationUser searcher, FieldValuesHolder fieldValuesHolder) getVelocityParams
(ApplicationUser searcher, SearchContext searchContext, FieldLayoutItem fieldLayoutItem, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) getViewHtml
(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) Used to produce the HTML that displays a searchers summary information (e.g.boolean
isRelevantForQuery
(ApplicationUser user, Query query) Checks if the searchRequest object has a search representation that was created by the searcher and is used to determine if the#getViewHtml(User, com.atlassian.jira.issue.search.SearchContext, com.atlassian.jira.issue.transport.FieldValuesHolder, java.util.Map, webwork.action.Action)
method should be called when rendering the search summary.Methods inherited from class com.atlassian.jira.issue.search.searchers.renderer.AbstractSearchRenderer
getI18n, isRelevantForQuery, renderEditTemplate, renderViewTemplate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer
isShown
-
Field Details
-
SELECT_LIST_NONE
- See Also:
-
SELECT_LIST_USER
- See Also:
-
SELECT_LIST_GROUP
- See Also:
-
permissionManager
-
userSearcherHelper
-
-
Constructor Details
-
AbstractUserSearchRenderer
public AbstractUserSearchRenderer(UserFieldSearchConstantsWithEmpty searchConstants, String nameKey, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, UserSearchService searchService, UserManager userManager, PermissionManager permissionManager) -
AbstractUserSearchRenderer
public AbstractUserSearchRenderer(UserFieldSearchConstants searchConstants, String nameKey, VelocityRequestContextFactory velocityRequestContextFactory, ApplicationProperties applicationProperties, VelocityTemplatingEngine templatingEngine, UserSearchService searchService, UserManager userManager, PermissionManager permissionManager)
-
-
Method Details
-
getEditHtml
public String getEditHtml(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) Description copied from interface:SearchRenderer
Used to produce an HTML input that is rendered on the JIRA issue navigator. This HTML provides the UI for searching a fields content. There will be a correspondingSearchInputTransformer
that will know how to transform these input parameters into JIRA search objects.- Specified by:
getEditHtml
in interfaceSearchRenderer
- Parameters:
user
- performing this action.searchContext
- the search context of the current search request that may be participating in rendering the issue navigator.fieldValuesHolder
- contains any request parameters that the HTML input may need to use to pre-populate the input (e.g. if this is the priority renderer and the search request being rendered has two priorities already selected these params will contain these request parameters). These parameters will have been populated via a call tocom.atlassian.jira.issue.search.searchers.transformer.SearchInputTransformer#populateFromQuery(User, com.atlassian.jira.issue.transport.FieldValuesHolder, com.atlassian.query.Query, com.atlassian.jira.issue.search.SearchContext)
if there is a SearchRequest involved in the rendering this IssueNavigator call.displayParameters
- are a map of "hints" that can be passed from the caller to this code which can use these hints to alter the way it renders the HTML.action
- is the WebWork 1 action object that is rendering the Issue Navigator view. This can be used to invoke methods on the view.- Returns:
- a String that contains HTML that can be rendered on the left-hand side of the JIRA issue navigator.
-
getViewHtml
public String getViewHtml(ApplicationUser user, SearchContext searchContext, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) Description copied from interface:SearchRenderer
Used to produce the HTML that displays a searchers summary information (e.g. if this is the priority searcher and a user has selected two priorities then this method will render HTML that shows something like 'priority: Major, Minor').- Specified by:
getViewHtml
in interfaceSearchRenderer
- Parameters:
user
- performing this action.searchContext
- the search context of the current search request that may be participating in rendering the issue navigator.fieldValuesHolder
- contains any request parameters that the HTML input may need to use to pre-populate the input (e.g. if this is the priority renderer and the search request being rendered has two priorities already selected these params will contain these request parameters). These parameters will have been populated via a call tocom.atlassian.jira.issue.search.searchers.transformer.SearchInputTransformer#populateFromQuery(User, com.atlassian.jira.issue.transport.FieldValuesHolder, com.atlassian.query.Query, com.atlassian.jira.issue.search.SearchContext)
if there is a SearchRequest involved in the rendering this IssueNavigator call.displayParameters
- are a map of "hints" that can be passed from the caller to this code which can use these hints to alter the way it renders the HTML.action
- is the WebWork 1 action object that is rendering the Issue Navigator view. This can be used to invoke methods on the view.- Returns:
- a String that contains HTML that can be rendered on the left-hand side of the issue navigator to show a SearchRequest summary.
-
isRelevantForQuery
Description copied from interface:SearchRenderer
Checks if the searchRequest object has a search representation that was created by the searcher and is used to determine if the#getViewHtml(User, com.atlassian.jira.issue.search.SearchContext, com.atlassian.jira.issue.transport.FieldValuesHolder, java.util.Map, webwork.action.Action)
method should be called when rendering the search summary.- Specified by:
isRelevantForQuery
in interfaceSearchRenderer
- Parameters:
user
- performing this action.query
- contains the search criteria used to determine if this query is relevevant to the searcher.- Returns:
- true if the query has relevant clauses to the searchers, false otherwise.
-
getSelectedListOptions
- Parameters:
searcher
- performing the action.- Returns:
- the select list options that are displayed for this user searcher (e.g. SpecificUser, CurrentUser...)
-
getEmptyValueKey
- Returns:
- the i18n key for the text that describes an empty value for this searcher.
-
getTextForuser
-
getVelocityParams
protected Map<String,Object> getVelocityParams(ApplicationUser searcher, SearchContext searchContext, FieldLayoutItem fieldLayoutItem, FieldValuesHolder fieldValuesHolder, Map displayParameters, webwork.action.Action action) - Overrides:
getVelocityParams
in classAbstractSearchRenderer
-
addUserGroupSuggestionParams
protected Map<String,Object> addUserGroupSuggestionParams(FieldValuesHolder fieldValuesHolder, ApplicationUser user, SearchContext searchContext, List<String> selectedUsers) add user and group suggestions into parameters. subclasses could override it to provide customized suggestions.default implementation returns recently selected users and the first few users from the system, if not enough recently selected users, and returns the groups the user is in, or first few groups in the system, if the user is not specified.
- Parameters:
fieldValuesHolder
-user
-searchContext
-selectedUsers
- recently selected users- Returns:
-