Package com.atlassian.jira.issue.fields
Class AffectedVersionsSystemField
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.AbstractPickerFieldImpl<Collection<Version>>
com.atlassian.jira.issue.fields.AbstractVersionsSystemField
com.atlassian.jira.issue.fields.AffectedVersionsSystemField
- All Implemented Interfaces:
ExportableSystemField
,AffectedVersionsField
,Field
,HideableField
,NavigableField
,OrderableField<Collection<Version>>
,RequirableField
,RestAwareField
,RestFieldOperations
,SearchableField
,Comparable
public class AffectedVersionsSystemField
extends AbstractVersionsSystemField
implements AffectedVersionsField, RestFieldOperations
Copyright (c) 2002-2004
All rights reserved.
-
Field Summary
FieldsFields inherited from class com.atlassian.jira.issue.fields.AbstractVersionsSystemField
RELEASED_VERSION_ID, searchLinkGenerator, UNKNOWN_VERSION_ID, UNRELEASED_VERSION_ID, versionHelperBean, versionManager
Fields inherited from class com.atlassian.jira.issue.fields.AbstractPickerFieldImpl
DEFAULT_MAX_OPTIONS_VALUE, MAX_OPTIONS_NUMBER
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
-
Constructor Summary
ConstructorsConstructorDescriptionAffectedVersionsSystemField
(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, VersionManager versionManager, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, RaisedInVersionStatisticsMapper raisedInVersionStatsMapper, VersionHelperBean versionHelperBean, AffectedVersionSearchHandlerFactory searchHandlerFactory, JiraBaseUrls jiraBaseUrls, JqlStringSupport jqlStringSupport, SearchLinkGenerator searchLinkGenerator, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFieldRequiredErrorMessage
(Issue issue, ErrorCollection errorCollection, I18nHelper i18n) boolean
Returnstrue
if a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.protected String
protected String
protected Collection<Version>
getCurrentVersions
(Issue issue) 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.protected String
A sorter to be used when sorting columns in a table.protected boolean
boolean
Tests field specific way to determine if it should be shown or not.protected JqlClauseBuilder
queryArchivedVersionsField
(JqlClauseBuilder queryBuilder, Version version) 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).protected List<ChangeItemBean>
updateIssueValue
(Issue issue, Collection<Version> newValue) Methods inherited from class com.atlassian.jira.issue.fields.AbstractVersionsSystemField
addViewVelocityParams, availableForBulkEdit, createValue, getBulkEditHtml, getColumnViewHtml, getCreateHtml, getCurrentVersionIds, getDefaultSortOrder, getEditHtml, getFieldTypeInfo, getJsonFromIssue, getJsonSchema, getPossibleVersions, getRelevantParams, getRepresentationFromIssue, getValueFromParams, getVersionManager, getViewHtml, getViewHtml, hasValue, needsMove, populateDefaults, populateForMove, populateFromIssue, populateParamsFromString, updateValue, validateParams
Methods inherited from class com.atlassian.jira.issue.fields.AbstractPickerFieldImpl
getVelocityParams, shouldUseRestEndpoint, userPickerEnabled
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
getColumnCssClass, getHiddenFieldId, getSortComparatorSource, getSortFields, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistory
Methods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableField
createAssociatedSearchHandler, getApplicationProperties, 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.NavigableField
getColumnCssClass, getColumnViewHtml, getDefaultSortOrder, getHiddenFieldId, getSortComparatorSource, getSortFields, prettyPrintChangeHistory, prettyPrintChangeHistory, prettyPrintChangeHistory
Methods inherited from interface com.atlassian.jira.issue.fields.OrderableField
availableForBulkEdit, createValue, getBulkEditHtml, getCreateHtml, getCreateHtml, getEditHtml, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasParam, hasValue, needsMove, populateDefaults, populateForMove, populateFromIssue, populateFromParams, populateParamsFromString, updateValue, validateParams
Methods inherited from interface com.atlassian.jira.issue.fields.SearchableField
createAssociatedSearchHandler
-
Field Details
-
CHANGE_ITEM_FIELD
- See Also:
-
-
Constructor Details
-
AffectedVersionsSystemField
public AffectedVersionsSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, VersionManager versionManager, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, RaisedInVersionStatisticsMapper raisedInVersionStatsMapper, VersionHelperBean versionHelperBean, AffectedVersionSearchHandlerFactory searchHandlerFactory, JiraBaseUrls jiraBaseUrls, JqlStringSupport jqlStringSupport, SearchLinkGenerator searchLinkGenerator, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
isShown
Description copied from interface:OrderableField
Tests field specific way to determine if it should be shown or not.- Specified by:
isShown
in interfaceOrderableField<Collection<Version>>
- Parameters:
issue
- The Issue.- Returns:
- true if it should be shown.
-
getCurrentVersions
- Specified by:
getCurrentVersions
in classAbstractVersionsSystemField
-
getArchivedVersionsFieldTitle
- Specified by:
getArchivedVersionsFieldTitle
in classAbstractVersionsSystemField
-
queryArchivedVersionsField
protected JqlClauseBuilder queryArchivedVersionsField(JqlClauseBuilder queryBuilder, Version version) - Specified by:
queryArchivedVersionsField
in classAbstractVersionsSystemField
-
getUnreleasedVersionsFirst
protected boolean getUnreleasedVersionsFirst()- Specified by:
getUnreleasedVersionsFirst
in classAbstractVersionsSystemField
-
addFieldRequiredErrorMessage
protected void addFieldRequiredErrorMessage(Issue issue, ErrorCollection errorCollection, I18nHelper i18n) - Specified by:
addFieldRequiredErrorMessage
in classAbstractVersionsSystemField
-
getColumnHeadingKey
- Specified by:
getColumnHeadingKey
in interfaceNavigableField
-
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:
-
getIssueRelationName
- Specified by:
getIssueRelationName
in classAbstractVersionsSystemField
-
getChangeItemFieldName
- Specified by:
getChangeItemFieldName
in classAbstractVersionsSystemField
-
updateIssueValue
- Specified by:
updateIssueValue
in classAbstractVersionsSystemField
-
getModifiedWithoutPermissionErrorMessage
- Specified by:
getModifiedWithoutPermissionErrorMessage
in classAbstractVersionsSystemField
-
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<Collection<Version>>
- Overrides:
getDefaultValue
in classAbstractVersionsSystemField
- Parameters:
issue
- the Issue.- Returns:
- The default value. It can be null, or an empty collection.
-
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<Collection<Version>>
- 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<Collection<Version>>
- 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<Collection<Version>>
- Parameters:
issue
- The Issue object.- Returns:
true
if a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.- See Also:
-
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.
-