Class SummarySystemField
- All Implemented Interfaces:
ExportableSystemField
,Field
,MandatoryField
,NavigableField
,OrderableField<String>
,RenderableField
,RestAwareField
,RestFieldOperations
,SearchableField
,SummaryField
,Comparable
-
Field Summary
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
Fields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH
Fields inherited from interface com.atlassian.jira.issue.fields.SummaryField
MAX_LEN
-
Constructor Summary
ConstructorsConstructorDescriptionSummarySystemField
(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, SummarySearchHandlerFactory searchHandlerFactory) -
Method Summary
Modifier and TypeMethodDescriptionavailableForBulkEdit
(BulkEditBean bulkEditBean) Determines whether the field is available for bulk editing given the BulkEditBean.boolean
Returnstrue
if a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.protected String
The order in which to sort the field when it is sorted for the first time.getDefaultValue
(Issue issue) The value that should be set on the issue if the field is not shown for some reason.protected String
getJsonDefaultValue
(IssueContext issueCtx) Return The default data for this system field.getRepresentationFromIssue
(Issue issue) Returns the raw markup for this for example: {pre} "Some *description* here.A sorter to be used when sorting columns in a table.List<org.apache.lucene.search.SortField>
getSortFields
(boolean sortOrder) Return a list of Lucene SortFields to be used for sorting search results.getValueFromIssue
(Issue issue) Gets the value stored for this field on the provided issue.boolean
Defines if a field determines itself as renderable.boolean
Tests field specific way to determine if it should be shown or not.void
populateFromIssue
(Map<String, Object> fieldValuesHolder, Issue issue) Used to initialise the fieldValuesHolder from the current value of teh issue.protected void
populateVelocityParams
(FieldLayoutItem fieldLayoutItem, Issue issue, Map<String, Object> params) protected void
populateVelocityParams
(Map fieldValuesHolder, Map params) void
Removes the field value from the given MutableIssue object.void
updateIssue
(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder) Record the value on the issue (not saving it to the database, see updateValue).void
validateParams
(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem) validate the field valueMethods inherited from class com.atlassian.jira.issue.fields.AbstractTextSystemField
createValue, getChangeLogFieldName, getChangelogValue, getColumnViewHtml, getCreateHtml, getEditHtml, getFieldTypeInfo, getJsonFromIssue, getJsonSchema, getRelevantParams, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasValue, isInvertCollapsedState, needsMove, populateDefaults, populateForMove, populateParamsFromString, updateValue, valuesEqual
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
getColumnCssClass, getHiddenFieldId, getSortComparatorSource, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistory
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableField
createAssociatedSearchHandler, getApplicationProperties, getBulkEditHtml, getCreateHtml, getEditHtml, getFieldLayoutItemForBulkOperation, getIssueForBulkOperation, getPermissionManager, getVelocityParams, getVelocityParams, getVelocityParams, getViewHtml, hasBulkUpdatePermission, hasParam, hasPermission, isHidden, populateFromParams, rendererTypesEqual, renderTemplate, validateBulkEditHtmlProperties, valuesEqual
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.MandatoryField
isSetupFieldInContext
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getColumnCssClass, getColumnViewHtml, getHiddenFieldId, getSortComparatorSource, prettyPrintChangeHistory, prettyPrintChangeHistory, prettyPrintChangeHistory
Methods inherited from interface com.atlassian.jira.issue.fields.OrderableField
createValue, getBulkEditHtml, getCreateHtml, getCreateHtml, getEditHtml, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasParam, hasValue, needsMove, populateDefaults, populateForMove, populateFromParams, populateParamsFromString, updateValue
Methods inherited from interface com.atlassian.jira.issue.fields.renderer.RenderableField
getId
Methods inherited from interface com.atlassian.jira.issue.fields.SearchableField
createAssociatedSearchHandler
-
Constructor Details
-
SummarySystemField
public SummarySystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, SummarySearchHandlerFactory searchHandlerFactory)
-
-
Method Details
-
getEditTemplateName
- Specified by:
getEditTemplateName
in classAbstractTextSystemField
-
getColumnViewTemplateName
- Specified by:
getColumnViewTemplateName
in classAbstractTextSystemField
-
populateVelocityParams
- Overrides:
populateVelocityParams
in classAbstractTextSystemField
-
populateVelocityParams
protected void populateVelocityParams(FieldLayoutItem fieldLayoutItem, Issue issue, Map<String, Object> params) - Overrides:
populateVelocityParams
in classAbstractTextSystemField
-
getValueFromIssue
Description copied from interface:RenderableField
Gets the value stored for this field on the provided issue.- Specified by:
getValueFromIssue
in interfaceRenderableField
- Specified by:
getValueFromIssue
in classAbstractTextSystemField
- Parameters:
issue
- identifies the issue that will contain the value for this field.- Returns:
- the value stored on this issue for this field, null if not applicable.
-
updateIssue
Description copied from interface:OrderableField
Record the value on the issue (not saving it to the database, see updateValue).- Specified by:
updateIssue
in interfaceOrderableField<String>
- Parameters:
fieldLayoutItem
- FieldLayoutItemissue
- MutableIssuefieldValueHolder
- Field Value Holder Map- See Also:
-
removeValueFromIssueObject
Description copied from interface:OrderableField
Removes the field value from the given MutableIssue object.Note that this operation does not actually persist the change, it just clears the value from the given Issue object. The caller will still need to call #updateValue() in order to persist the change.
Some Fields may choose to quietly ignore this request. eg The SecurityLevel Field will not remove Security Level from subtasks because the subtask must always take the Security Level of its parent issue.
- Specified by:
removeValueFromIssueObject
in interfaceOrderableField<String>
- Parameters:
issue
- The issue object to be effected.- See Also:
-
canRemoveValueFromIssueObject
Description copied from interface:OrderableField
Returnstrue
if a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.There a few different reasons why this method may return false:
- The OrderableField can sometimes remove the value, but it decides that it is not relevant for this Issue. eg: Security Level will ignore remove requests on a subtask, as the subtask Security is not set explicitly (it is always inherited from its parent issue).
- It may possible to remove this value, but the OrderableField does not actually do the job, it is done through some special mechanism. eg Attachments.
- This field is some special system field which it is invalid to remove. eg Project. In these cases calling removeValueFromIssueObject() would normally raise an UnsupportedOperationException.
- Specified by:
canRemoveValueFromIssueObject
in interfaceOrderableField<String>
- Parameters:
issue
- The Issue object.- Returns:
true
if a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.- See Also:
-
populateFromIssue
Description copied from interface:OrderableField
Used to initialise the fieldValuesHolder from the current value of teh issue. Used, for example, when showing the Edit Issue screen to show the issue's current values.- Specified by:
populateFromIssue
in interfaceOrderableField<String>
- Overrides:
populateFromIssue
in classAbstractTextSystemField
- Parameters:
fieldValuesHolder
- The fieldValuesHolder Map to be populated.issue
- The Issue.
-
isShown
Description copied from interface:OrderableField
Tests field specific way to determine if it should be shown or not.- Specified by:
isShown
in interfaceOrderableField<String>
- Parameters:
issue
- The Issue.- Returns:
- true if it should be shown.
-
validateParams
public void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem) validate the field value- Specified by:
validateParams
in interfaceOrderableField<String>
- Parameters:
operationContext
- OperationContexterrorCollectionToAddTo
- ErrorCollectioni18n
- I18nHelperissue
- IssuefieldScreenRenderLayoutItem
- FieldScreenRenderLayoutItem
-
getDefaultValue
Description copied from interface:OrderableField
The value that should be set on the issue if the field is not shown for some reason.For example: The user does not have permission to see the field, or the field is not part of the create screen.
- Specified by:
getDefaultValue
in interfaceOrderableField<String>
- Parameters:
issue
- the Issue.- Returns:
- The default value. It can be null, or an empty collection.
-
getColumnHeadingKey
- Specified by:
getColumnHeadingKey
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
-
getSorter
Description copied from interface:NavigableField
A sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.- Specified by:
getSorter
in interfaceNavigableField
- Returns:
- A sorter that can be used to sort this field, or null depending on the value of
NavigableField.getSortComparatorSource()
- See Also:
-
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
- Overrides:
getSortFields
in classAbstractOrderableNavigableFieldImpl<String>
- Returns:
- The name of the indexed term to be used for native Lucene sorting.
-
isRenderable
public boolean isRenderable()Description copied from interface:RenderableField
Defines if a field determines itself as renderable. This is needed because of the way that customfields are implemented. Since all the real work is done in CustomFieldTypes, if we want to treat system fields and custom fields the same way in the renderers then all custom fields must implement this interface. We therefore provide this method so that the CustomFieldImpl can delegate to the CustomFieldTypes to determine if a given custom field is renderable.- Specified by:
isRenderable
in interfaceRenderableField
- Overrides:
isRenderable
in classAbstractTextSystemField
- Returns:
- true if the field is renderable, false otherwise.
-
availableForBulkEdit
Description copied from interface:OrderableField
Determines whether the field is available for bulk editing given the BulkEditBean.- Specified by:
availableForBulkEdit
in interfaceOrderableField<String>
- Parameters:
bulkEditBean
- holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)- Returns:
null
if the field is available for bulk-editing or an i18n key of the error message to show as why the field is not available.
-
getRestFieldOperation
- Specified by:
getRestFieldOperation
in interfaceRestFieldOperations
- Returns:
- the RestFieldOperationsHandler for this field.
-
getJsonDefaultValue
Description copied from interface:RestFieldOperations
Return The default data for this system field. May be null if there is no default.- Specified by:
getJsonDefaultValue
in interfaceRestFieldOperations
- Parameters:
issueCtx
- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.
-
getRepresentationFromIssue
Description copied from class:AbstractTextSystemField
Returns the raw markup for this for example: {pre} "Some *description* here. || markup || should || | be | preserved |" {/pre}- Specified by:
getRepresentationFromIssue
in interfaceExportableSystemField
- Overrides:
getRepresentationFromIssue
in classAbstractTextSystemField
- Parameters:
issue
- to get representation for- Returns:
- Single item with the description as the field.
-