Package com.atlassian.jira.issue.fields
Class NavigableFieldImpl
java.lang.Object
com.atlassian.jira.issue.fields.AbstractField
com.atlassian.jira.issue.fields.NavigableFieldImpl
- All Implemented Interfaces:
Field
,NavigableField
,Comparable
- Direct Known Subclasses:
AbstractDurationSystemField
,AbstractProgressBarSystemField
,CreatedSystemField
,CreatorSystemField
,KeySystemField
,LastViewedSystemField
,ResolutionDateSystemField
,StatusSystemField
,SubTaskSystemField
,ThumbnailSystemField
,UpdatedSystemField
,VotesSystemField
,WatchesSystemField
,WorkRatioSystemField
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ApplicationProperties
protected final VelocityTemplatingEngine
Fields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContext
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
-
Constructor Summary
ConstructorsConstructorDescriptionNavigableFieldImpl
(String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext) NavigableFieldImpl
(String id, String nameKey, String columnHeadingKey, String defaultSortOrder, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationProperties
The order in which to sort the field when it is sorted for the first time.Returns the id of the field to check for visibility.org.apache.lucene.search.FieldComparatorSource
A default implementation that returns aMappedSortComparator
fromNavigableField.getSorter()
.List<org.apache.lucene.search.SortField>
getSortFields
(boolean sortOrder) Return a list of Lucene SortFields to be used for sorting search results.getVelocityParams
(FieldLayoutItem fieldLayoutItem, I18nHelper i18nHelper, Map<String, Object> displayParams, Issue issue) prettyPrintChangeHistory
(String changeHistory) prettyPrintChangeHistory
(String changeHistory, I18nHelper i18nHelper) Used for email notification templates - allows changelog to be displayed in language of the recipient.protected String
renderTemplate
(String template, Map<String, Object> velocityParams) Methods inherited from class com.atlassian.jira.issue.fields.AbstractField
compareTo, equals, getAuthenticationContext, getId, getName, getNameKey, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getColumnViewHtml, getSorter, prettyPrintChangeHistory
-
Field Details
-
templatingEngine
-
applicationProperties
-
-
Constructor Details
-
NavigableFieldImpl
public NavigableFieldImpl(String id, String nameKey, String columnHeadingKey, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext) -
NavigableFieldImpl
public NavigableFieldImpl(String id, String nameKey, String columnHeadingKey, String defaultSortOrder, VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext)
-
-
Method Details
-
getColumnHeadingKey
- Specified by:
getColumnHeadingKey
in interfaceNavigableField
-
getColumnCssClass
- Specified by:
getColumnCssClass
in interfaceNavigableField
-
getDefaultSortOrder
Description copied from interface:NavigableField
The order in which to sort the field when it is sorted for the first time.- Specified by:
getDefaultSortOrder
in interfaceNavigableField
- Returns:
- Either
NavigableField.ORDER_ASCENDING
orNavigableField.ORDER_DESCENDING
-
getSortComparatorSource
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()A default implementation that returns aMappedSortComparator
fromNavigableField.getSorter()
.- Specified by:
getSortComparatorSource
in interfaceNavigableField
- Returns:
- A SortComparatorSource that can be used to sort, or null if this field does not use custom sorting
-
getSortFields
Description copied from interface:NavigableField
Return a list of Lucene SortFields to be used for sorting search results.Using this method allows the field to specify the most performant way to perform a search. If a field can be sorted directly using the term in the index then this should just return a singleton list with the sort field.
return Collections.singletonList(new SortField(fieldName, sortOrder));
The default implementation builds this using the FieldComparatorSource returned by
NavigableField.getSortComparatorSource()
If you implement this method there is no need to implement
NavigableField.getSortComparatorSource()
.- Specified by:
getSortFields
in interfaceNavigableField
- Returns:
- The name of the indexed term to be used for native Lucene sorting.
-
renderTemplate
-
getVelocityParams
protected Map<String,Object> getVelocityParams(FieldLayoutItem fieldLayoutItem, I18nHelper i18nHelper, Map<String, Object> displayParams, Issue issue) -
getHiddenFieldId
Description copied from interface:NavigableField
Returns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.- Specified by:
getHiddenFieldId
in interfaceNavigableField
-
getApplicationProperties
-
prettyPrintChangeHistory
- Specified by:
prettyPrintChangeHistory
in interfaceNavigableField
-
prettyPrintChangeHistory
Description copied from interface:NavigableField
Used for email notification templates - allows changelog to be displayed in language of the recipient.- Specified by:
prettyPrintChangeHistory
in interfaceNavigableField
- Parameters:
changeHistory
- - label- Returns:
- String change history formatted according to locale in i18nHelper
-