public class

SummarySystemField

extends AbstractTextSystemField
implements MandatoryField NavigableField SummaryField RestFieldOperations
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.AbstractField
     ↳ com.atlassian.jira.issue.fields.AbstractOrderableField<V>
       ↳ com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl<V>
         ↳ com.atlassian.jira.issue.fields.AbstractTextSystemField
           ↳ com.atlassian.jira.issue.fields.SummarySystemField

Class Overview

Copyright (c) 2002-2004 All rights reserved.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.fields.NavigableField
From interface com.atlassian.jira.issue.fields.OrderableField
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.fields.AbstractField
From interface com.atlassian.jira.issue.fields.SummaryField
Public Constructors
SummarySystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, SummarySearchHandlerFactory searchHandlerFactory)
Public Methods
String availableForBulkEdit(BulkEditBean bulkEditBean)
Determines whether the field is available for bulk editing given the BulkEditBean.
boolean canRemoveValueFromIssueObject(Issue issue)
Returns true if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.
String getColumnHeadingKey()
String getDefaultSortOrder()
The order in which to sort the field when it is sorted for the first time.
String getDefaultValue(Issue issue)
The value that should be set on the issue if the field is not shown for some reason.
JsonData getJsonDefaultValue(IssueContext issueCtx)
Return The default data for this system field.
RestFieldOperationsHandler getRestFieldOperation()
List<SortField> getSortFields(boolean sortOrder)
Return a list of Lucene SortFields to be used for sorting search results.
LuceneFieldSorter getSorter()
A sorter to be used when sorting columns in a table.
String getValueFromIssue(Issue issue)
Gets the value stored for this field on the provided issue.
boolean isRenderable()
Defines if a field determines itself as renderable.
boolean isShown(Issue issue)
Tests field specific way to determine if it should be shown or not.
void populateFromIssue(Map<StringObject> fieldValuesHolder, Issue issue)
void removeValueFromIssueObject(MutableIssue issue)
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 value
Protected Methods
String getColumnViewTemplateName()
String getEditTemplateName()
void populateVelocityParams(Map fieldValuesHolder, Map params)
void populateVelocityParams(FieldLayoutItem fieldLayoutItem, Issue issue, Map<StringObject> params)
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.fields.AbstractTextSystemField
From class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
From class com.atlassian.jira.issue.fields.AbstractOrderableField
From class com.atlassian.jira.issue.fields.AbstractField
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.Field
From interface com.atlassian.jira.issue.fields.NavigableField
From interface com.atlassian.jira.issue.fields.OrderableField
From interface com.atlassian.jira.issue.fields.SearchableField
From interface com.atlassian.jira.issue.fields.renderer.RenderableField
From interface com.atlassian.jira.issue.fields.rest.RestAwareField
From interface com.atlassian.jira.issue.fields.rest.RestFieldOperations
From interface java.lang.Comparable

Public Constructors

public SummarySystemField (VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, SummarySearchHandlerFactory searchHandlerFactory)

Public Methods

public String availableForBulkEdit (BulkEditBean bulkEditBean)

Determines whether the field is available for bulk editing given the BulkEditBean.

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.

public boolean canRemoveValueFromIssueObject (Issue issue)

Returns true if a call to 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.
In general it is safe to call removeValueFromIssueObject() even if this method returns false, as the request will be silently ignored. However there are a couple of special fields where calling removeValueFromIssueObject() will throw an UnsupportedOperationException - eg if you try to remove the Project.

Parameters
issue The Issue object.
Returns

public String getColumnHeadingKey ()

public String getDefaultSortOrder ()

The order in which to sort the field when it is sorted for the first time.

Returns

public String getDefaultValue (Issue issue)

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.

Parameters
issue the Issue.
Returns
  • The default value. It can be null.

public JsonData getJsonDefaultValue (IssueContext issueCtx)

Return The default data for this system field. May be null if there is no default.

Parameters
issueCtx Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.

public RestFieldOperationsHandler getRestFieldOperation ()

public List<SortField> getSortFields (boolean sortOrder)

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 getSortComparatorSource()

If you implement this method there is no need to implement getSortComparatorSource().

Returns
  • The name of the indexed term to be used for native Lucene sorting.

public LuceneFieldSorter getSorter ()

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.

Returns

public String getValueFromIssue (Issue issue)

Gets the value stored for this field on the provided issue.

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.

public boolean isRenderable ()

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.

Returns
  • true if the field is renderable, false otherwise.

public boolean isShown (Issue issue)

Tests field specific way to determine if it should be shown or not.

Parameters
issue The Issue.
Returns
  • true if it should be shown.

public void populateFromIssue (Map<StringObject> fieldValuesHolder, Issue issue)

public void removeValueFromIssueObject (MutableIssue issue)

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.

Parameters
issue The issue object to be effected.

public void updateIssue (FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)

Record the value on the issue (not saving it to the database, see updateValue).

Parameters
fieldLayoutItem FieldLayoutItem
issue MutableIssue
fieldValueHolder Field Value Holder Map

public void validateParams (OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)

validate the field value

Parameters
operationContext OperationContext
errorCollectionToAddTo ErrorCollection
i18n I18nHelper
issue Issue
fieldScreenRenderLayoutItem FieldScreenRenderLayoutItem

Protected Methods

protected String getColumnViewTemplateName ()

protected String getEditTemplateName ()

protected void populateVelocityParams (Map fieldValuesHolder, Map params)

protected void populateVelocityParams (FieldLayoutItem fieldLayoutItem, Issue issue, Map<StringObject> params)