Package com.atlassian.jira.issue.fields
Class DescriptionSystemField
java.lang.Object
com.atlassian.jira.issue.fields.AbstractField
com.atlassian.jira.issue.fields.AbstractOrderableField<String>
com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl<String>
com.atlassian.jira.issue.fields.AbstractTextSystemField
com.atlassian.jira.issue.fields.DescriptionSystemField
- All Implemented Interfaces:
ExportableSystemField,ConfigurableField<String>,DefaultValueField<String>,Field,HideableField,NavigableField,OrderableField<String>,RenderableField,RequirableField,RestAwareField,RestFieldOperations,SearchableField,Comparable
public class DescriptionSystemField
extends AbstractTextSystemField
implements HideableField, RequirableField, RestFieldOperations, DefaultValueField<String>
Represents the field which renders an
Issue description.-
Field Summary
FieldsFields inherited from class com.atlassian.jira.issue.fields.AbstractField
authenticationContextFields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATHFields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH -
Constructor Summary
ConstructorsConstructorDescriptionDescriptionSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, DescriptionSearchHandlerFactory searchHandlerFactory, MentionService mentionService, TextFieldCharacterLengthValidator textFieldCharacterLengthValidator, GenericConfigManager genericConfigManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionavailableForBulkEdit(BulkEditBean bulkEditBean) Determines whether the field is available for bulk editing given the BulkEditBean.booleanReturnstrueif a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)will actually remove the value.Returns a list of projects associated with this field.protected StringReturns a List ofFieldConfigItemTypeobjects.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 StringgetFieldSorts(FieldSort.Order sortOrder) Returns a list ofFieldSortobjects that can be used to sort this field.getJsonDefaultValue(IssueContext issueCtx) Return The default data for this system field.getRelevantConfig(IssueContext issueContext) getValueFromIssue(Issue issue) Gets the value stored for this field on the provided issue.A loader to be used when loading the value of the field from the index.booleanTests field specific way to determine if it should be shown or not.voidpopulateDefaults(Map<String, Object> fieldValuesHolder, Issue issue) Populate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet.protected voidpopulateVelocityParams(Map fieldValuesHolder, Map params) voidRemoves the field value from the given MutableIssue object.voidupdateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder) Record the value on the issue (not saving it to the database, see updateValue).voidvalidateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem) Ensure that the parameters are validMethods inherited from class com.atlassian.jira.issue.fields.AbstractTextSystemField
createValue, getChangeLogFieldName, getChangelogValue, getColumnViewHtml, getCreateHtml, getEditHtml, getFieldTypeInfo, getJsonFromIssue, getJsonSchema, getRelevantParams, getRepresentationFromIssue, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasValue, isInvertCollapsedState, isRenderable, needsMove, populateForMove, populateFromIssue, populateParamsFromString, populateVelocityParams, updateValue, valuesEqualMethods inherited from class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
getColumnCssClass, getHiddenFieldId, getVelocityParams, prettyPrintChangeHistory, prettyPrintChangeHistoryMethods 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, valuesEqualMethods inherited from class com.atlassian.jira.issue.fields.AbstractField
compareTo, equals, getAuthenticationContext, getId, getName, getNameKey, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKeyMethods inherited from interface com.atlassian.jira.issue.fields.NavigableField
hasSortsDefined, prettyPrintChangeHistoryMethods inherited from interface com.atlassian.jira.issue.fields.OrderableField
createValue, getBulkEditHtml, getCreateHtml, getCreateHtml, getEditHtml, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasParam, hasValue, needsMove, populateForMove, populateFromIssue, populateFromParams, populateParamsFromString, updateValueMethods inherited from interface com.atlassian.jira.issue.fields.renderer.RenderableField
getIdMethods inherited from interface com.atlassian.jira.issue.fields.SearchableField
createAssociatedSearchHandler
-
Field Details
-
DEFAULT_VALUE_TYPE
- See Also:
-
-
Constructor Details
-
DescriptionSystemField
public DescriptionSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, RendererManager rendererManager, PermissionManager permissionManager, DescriptionSearchHandlerFactory searchHandlerFactory, MentionService mentionService, TextFieldCharacterLengthValidator textFieldCharacterLengthValidator, GenericConfigManager genericConfigManager, FeatureManager featureManager)
-
-
Method Details
-
isShown
Description copied from interface:OrderableFieldTests field specific way to determine if it should be shown or not.- Specified by:
isShownin 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) Description copied from interface:OrderableFieldEnsure that the parameters are valid- Specified by:
validateParamsin interfaceOrderableField<String>- Parameters:
operationContext- OperationContexterrorCollectionToAddTo- ErrorCollection to add to.i18n- I18nHelperissue- This is passed to get the value of other fields that may or may not have been modified.fieldScreenRenderLayoutItem- FieldScreenRenderLayoutItem
-
populateVelocityParams
- Overrides:
populateVelocityParamsin classAbstractTextSystemField
-
populateDefaults
Description copied from interface:OrderableFieldPopulate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet.- Specified by:
populateDefaultsin interfaceOrderableField<String>- Overrides:
populateDefaultsin classAbstractTextSystemField- Parameters:
fieldValuesHolder- The fieldValuesHolder Map to be populated.issue- The Issue.
-
getDefaultValue
Description copied from interface:OrderableFieldThe 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:
getDefaultValuein interfaceOrderableField<String>- Parameters:
issue- the Issue.- Returns:
- The default value. It can be null, or an empty collection.
-
getValueFromIssue
Description copied from interface:RenderableFieldGets the value stored for this field on the provided issue.- Specified by:
getValueFromIssuein interfaceRenderableField- Specified by:
getValueFromIssuein 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:OrderableFieldRecord the value on the issue (not saving it to the database, see updateValue).- Specified by:
updateIssuein interfaceOrderableField<String>- Parameters:
fieldLayoutItem- FieldLayoutItemissue- MutableIssuefieldValueHolder- Field Value Holder Map- See Also:
-
removeValueFromIssueObject
Description copied from interface:OrderableFieldRemoves 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:
removeValueFromIssueObjectin interfaceOrderableField<String>- Parameters:
issue- The issue object to be effected.- See Also:
-
canRemoveValueFromIssueObject
Description copied from interface:OrderableFieldReturnstrueif 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:
canRemoveValueFromIssueObjectin interfaceOrderableField<String>- Parameters:
issue- The Issue object.- Returns:
trueif a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)will actually remove the value.- See Also:
-
getColumnHeadingKey
- Specified by:
getColumnHeadingKeyin interfaceNavigableField
-
getDefaultSortOrder
Description copied from interface:NavigableFieldThe order in which to sort the field when it is sorted for the first time.- Specified by:
getDefaultSortOrderin interfaceNavigableField- Returns:
- Either
NavigableField.ORDER_ASCENDINGorNavigableField.ORDER_DESCENDING
-
getValueLoader
Description copied from interface:NavigableFieldA loader to be used when loading the value of the field from the index.- Specified by:
getValueLoaderin interfaceNavigableField- Returns:
- A loader that can be used to load the value of the field
- See Also:
-
getFieldSorts
Description copied from interface:NavigableFieldReturns a list ofFieldSortobjects that can be used to sort this field.- Specified by:
getFieldSortsin interfaceNavigableField- Parameters:
sortOrder- the order in which to sort the field- Returns:
- a list of
FieldSortobjects that can be used to sort this field
-
getEditTemplateName
- Specified by:
getEditTemplateNamein classAbstractTextSystemField
-
getColumnViewTemplateName
- Specified by:
getColumnViewTemplateNamein classAbstractTextSystemField
-
availableForBulkEdit
Description copied from interface:OrderableFieldDetermines whether the field is available for bulk editing given the BulkEditBean.- Specified by:
availableForBulkEditin interfaceOrderableField<String>- Parameters:
bulkEditBean- holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)- Returns:
nullif 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:
getRestFieldOperationin interfaceRestFieldOperations- Returns:
- the RestFieldOperationsHandler for this field.
-
getJsonDefaultValue
Description copied from interface:RestFieldOperationsReturn The default data for this system field. May be null if there is no default.- Specified by:
getJsonDefaultValuein interfaceRestFieldOperations- Parameters:
issueCtx- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.
-
getConfigurationItemTypes
Description copied from interface:ConfigurableFieldReturns a List ofFieldConfigItemTypeobjects. This opens up possibilties for configurable custom fields- Specified by:
getConfigurationItemTypesin interfaceConfigurableField<String>- Returns:
- List of
FieldConfigItemType@Nonnull
-
getAssociatedProjectObjects
Description copied from interface:ConfigurableFieldReturns a list of projects associated with this field. Will be null if the field is global- Specified by:
getAssociatedProjectObjectsin interfaceConfigurableField<String>- Returns:
- a list of projects associated with this field.
-
getRelevantConfig
- Specified by:
getRelevantConfigin interfaceConfigurableField<String>
-
getDefaultValueOperations
- Specified by:
getDefaultValueOperationsin interfaceDefaultValueField<String>
-