public class ImmutableCustomField extends Object implements CustomField
CustomFieldManager
.ENTITY_CF_TYPE_KEY, ENTITY_CUSTOM_FIELD_SEARCHER, ENTITY_DESCRIPTION, ENTITY_ID, ENTITY_ISSUES_WITH_VALUE, ENTITY_ISSUETYPE, ENTITY_LAST_VALUE_UPDATE, ENTITY_NAME, ENTITY_PROJECT, ENTITY_TABLE_NAME
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY
Modifier and Type | Method and Description |
---|---|
protected static boolean |
areDifferent(Object obj1,
Object obj2)
Compare two objects - return false if both are null or equal.
|
String |
availableForBulkEdit(BulkEditBean bulkEditBean)
Checks if custom field is available for bulk edit operation, whether 'shown' and if user has bulk update
permission.
|
boolean |
canRemoveValueFromIssueObject(Issue issue)
Returns
true if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value. |
int |
compare(Issue issue1,
Issue issue2)
This method compares the values of this custom field in two given issues.
|
int |
compareTo(Object o) |
SearchHandler |
createAssociatedSearchHandler()
Return
SearchHandler for the field. |
void |
createValue(Issue issue,
Object value)
Create the value of the issue in the data store.
|
boolean |
equals(Object o) |
List<IssueType> |
getAssociatedIssueTypeObjects() |
List<IssueType> |
getAssociatedIssueTypes()
Returns a list of
IssueType s directly associated with this CustomField . |
List<Project> |
getAssociatedProjectObjects()
Returns a list of
Project s directly associated with this CustomField . |
String |
getBulkEditHtml(OperationContext operationContext,
webwork.action.Action action,
BulkEditBean bulkEditBean,
Map displayParameters)
Returns HTML that should be shown when the issue is being bulk edited.
|
ClauseNames |
getClauseNames()
Return the JQL clause names that this custom field should be recognized by.
|
String |
getColumnCssClass() |
String |
getColumnHeadingKey() |
String |
getColumnViewHtml(FieldLayoutItem fieldLayoutItem,
Map displayParams,
Issue issue) |
List |
getConfigurationItemTypes()
Returns a List of
FieldConfigItemType objects. |
List<FieldConfigScheme> |
getConfigurationSchemes()
Returns a list of configuration schemes.
|
String |
getCreateHtml(FieldLayoutItem fieldLayoutItem,
OperationContext operationContext,
webwork.action.Action action,
Issue issue)
Returns the HTML that should be shown when the issue is being created.
|
String |
getCreateHtml(FieldLayoutItem fieldLayoutItem,
OperationContext operationContext,
webwork.action.Action action,
Issue issue,
Map dispayParameters)
Returns the HTML that should be shown when the issue is being created.
|
CustomFieldSearcher |
getCustomFieldSearcher()
Retrieves the
CustomFieldSearcher for this custom field looking it up in the customFieldManager by the
searcher key retrieved from CustomField.ENTITY_CUSTOM_FIELD_SEARCHER underlying generic value attribute. |
CustomFieldType |
getCustomFieldType()
Looks up the
CustomFieldType in the customFieldTypeModuleDescriptors by the key retrieved from the CustomField.ENTITY_CF_TYPE_KEY attribute of the
underlying generic value. |
CustomFieldParams |
getCustomFieldValues(Map customFieldValuesHolder)
Get the custom field string values that are relevant to this particular custom field
|
String |
getDefaultSortOrder()
Returns
NavigableField.ORDER_ASCENDING . |
Object |
getDefaultValue(Issue issue)
The value that should be set on the issue if the field is not shown for some reason.
|
DefaultValueOperations<Object> |
getDefaultValueOperations() |
String |
getDescription()
Returns the i18n'ed description of this custom field.
|
RenderableProperty |
getDescriptionProperty()
Returns a
RenderableProperty for rendering this custom field's description. |
String |
getEditHtml(FieldLayoutItem fieldLayoutItem,
OperationContext operationContext,
webwork.action.Action action,
Issue issue)
Returns HTML that should be shown when the issue is being edited.
|
String |
getEditHtml(FieldLayoutItem fieldLayoutItem,
OperationContext operationContext,
webwork.action.Action action,
Issue issue,
Map dispayParameters)
Returns HTML that should be shown when the issue is being edited.
|
protected com.atlassian.event.api.EventPublisher |
getEventPublisher()
Overridable location to retrieve an
EventPublisher to publish events through. |
String |
getFieldName()
Returns the title of this custom field.
|
FieldTypeInfo |
getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
|
org.ofbiz.core.entity.GenericValue |
getGenericValue()
Returns a generic value that represents this custom field.
|
String |
getHiddenFieldId()
Returns the id of the field to check for visibility.
|
protected I18nHelper |
getI18nHelper() |
String |
getId()
The unique id of the field
|
Long |
getIdAsLong()
Returns ID of this custom field.
|
Long |
getIssuesWithValue()
Returns number of issues containing at least one non empty value for the custom field.
|
JsonData |
getJsonDefaultValue(IssueContext issueCtx)
Return The default data for this system field.
|
FieldJsonRepresentation |
getJsonFromIssue(Issue issue,
boolean renderedVersionRequested,
FieldLayoutItem fieldLayoutItem)
Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation
of the rendered data for easy display.
|
JsonType |
getJsonSchema()
Return a description of the shape of this field when represented as JSON.
|
Timestamp |
getLastValueUpdate()
Returns the latest date of either:
- creation date of an issue with a non default value of the custom field
- issue update date when value of the custom field has been changed
|
String |
getName()
Returns the name of this custom field.
|
String |
getNameKey()
The i18n key that is used to lookup the field's name when it is displayed
|
Options |
getOptions(String key,
FieldConfig config,
JiraContextNode contextNode)
Returns options for this custom field if it is of
MultipleCustomFieldType type. |
Options |
getOptions(String key,
JiraContextNode jiraContextNode)
Returns options for this custom field if it is of
MultipleCustomFieldType type. |
com.opensymphony.module.propertyset.PropertySet |
getPropertySet() |
FieldConfig |
getRelevantConfig(Issue issue)
Returns a relevant
FieldConfig for the given issue. |
FieldConfig |
getRelevantConfig(IssueContext issueContext)
Returns the relevant field config of this custom field for the give issue context
|
FieldConfig |
getReleventConfig(SearchContext searchContext)
Return the relevant field config for the search context specified.
|
RestFieldOperationsHandler |
getRestFieldOperation() |
org.apache.lucene.search.FieldComparatorSource |
getSortComparatorSource()
Return a SortComparatorSource that uses either a custom field searcher that implements
SortableCustomFieldSearcher or a custom field that implements SortableCustomField . |
LuceneFieldSorter |
getSorter()
If this field has a searcher, and this searcher implements
SortableCustomFieldSearcher then return SortableCustomFieldSearcher.getSorter(CustomField) . |
List<org.apache.lucene.search.SortField> |
getSortFields(boolean sortOrder)
Return a list of Lucene SortFields to be used for sorting search results.
|
String |
getUntranslatedDescription()
Returns the description of this custom field by reading
CustomField.ENTITY_DESCRIPTION of the underlying generic
value. |
RenderableProperty |
getUntranslatedDescriptionProperty()
Returns a
RenderableProperty for rendering this custom field's description. |
String |
getUntranslatedName()
Returns the name of this custom field by reading
CustomField.ENTITY_NAME of the underlying generic value. |
Object |
getValue(Issue issue)
Retrieves and returns the Object representing the this CustomField value for the given issue.
|
String |
getValueFromIssue(Issue issue)
Gets the value stored for this field on the provided issue.
|
Object |
getValueFromParams(Map params)
Get a field value from the map of parameters passed.
|
String |
getViewHtml(FieldLayoutItem fieldLayoutItem,
webwork.action.Action action,
Issue issue) |
String |
getViewHtml(FieldLayoutItem fieldLayoutItem,
webwork.action.Action action,
Issue issue,
Map displayParameters) |
String |
getViewHtml(FieldLayoutItem fieldLayoutItem,
webwork.action.Action action,
Issue issue,
Object value,
Map displayParameters) |
protected boolean |
hasBulkUpdatePermission(BulkEditBean bulkEditBean,
Issue issue)
Checks whether the user has the permission to execute the bulk operation for the provided issue.
|
int |
hashCode() |
boolean |
hasParam(Map parameters)
Checks to see if the (web) parameters contains a relevant value with which to populate the issue
|
boolean |
hasValue(Issue issue)
Determines if the field has a value for the given issue.
|
boolean |
isAllIssueTypes()
Returns true if it applies for all issue types, false otherwise.
|
boolean |
isAllProjects()
Checks whether this custom field applies for all projects.
|
boolean |
isEditable()
Returns true if this custom field has an edit template, false otherwise.
|
boolean |
isEnabled()
Returns true if any configuration scheme returned by
getConfigurationSchemes() is enabled. |
boolean |
isGlobal()
Returns true if this custom field applies for all projects and all issue types.
|
boolean |
isInScope(long projectId,
String issueTypeId)
Determines if this custom field is within the scope of the given project, and Issue Type.
|
boolean |
isInScope(Project project,
List<String> issueTypeIds)
Determines if this custom field is within the scope of the given project, and list of Issue Types.
|
boolean |
isInScope(SearchContext searchContext)
Determines whether this custom field is in scope.
|
boolean |
isInScopeForSearch(Project project,
List<String> issueTypeIds)
Determines if this custom field is within the scope of the given project, and list of Issue Types.
|
boolean |
isRelevantForIssueContext(IssueContext issueContext)
Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.
|
boolean |
isRenderable()
This is the conjunction point with CustomFieldTypes and this is delegated off to customField Types.
|
boolean |
isShown(Issue issue)
Tests field specific way to determine if it should be shown or not.
|
MessagedResult |
needsMove(Collection originalIssues,
Issue targetIssue,
FieldLayoutItem targetFieldLayoutItem)
Used to determine if the field needs input from user to be moved to the new project and/or issue type.
|
void |
populateDefaults(Map<String,Object> customFieldValuesHolder,
Issue issue)
Populate the fieldValueHolder with a value that should be shown by default when the issue
has not been created yet.
|
void |
populateForMove(Map<String,Object> fieldValuesHolder,
Issue originalIssue,
Issue targetIssue)
Used to populate the fieldValueHolder with parameters for move issue screen.
|
void |
populateFromIssue(Map<String,Object> customFieldValuesHolder,
Issue issue)
Puts the custom field parameters retrieved from the given issue to the given customFieldValuesHolder map.
|
void |
populateFromParams(Map<String,Object> customFieldValuesHolder,
Map<String,String[]> params)
Puts the relevant parameters from the given params map to the given customFieldValuesHolder map.
|
void |
populateParamsFromString(Map<String,Object> fieldValuesHolder,
String stringValue,
Issue issue)
Does nothing.
|
String |
prettyPrintChangeHistory(String changeHistory)
Returns the same string.
|
String |
prettyPrintChangeHistory(String changeHistory,
I18nHelper i18nHelper)
Returns the same string.
|
Set<Long> |
remove()
Removes this custom field and returns a set of issue IDs of all issues that are affected by removal of this
custom field.
|
void |
removeValueFromIssueObject(MutableIssue issue)
Removes the field value from the given MutableIssue object.
|
String |
toString() |
void |
updateIssue(FieldLayoutItem fieldLayoutItem,
MutableIssue issue,
Map fieldValueHolder)
Record the value on the issue (not saving it to the database, see updateValue).
|
void |
updateValue(FieldLayoutItem fieldLayoutItem,
Issue issue,
ModifiedValue modifiedValue,
IssueChangeHolder issueChangeHolder)
Update the issue in the data store.
|
void |
validateFromActionParams(Map actionParameters,
ErrorCollection errorCollection,
FieldConfig config)
Validates relevant parameters on custom field type of this custom field.
|
void |
validateParams(OperationContext operationContext,
ErrorCollection errorCollectionToAddTo,
I18nHelper i18n,
Issue issue,
FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
Ensure that the parameters are valid
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
prettyPrintChangeHistory
public boolean isInScope(Project project, List<String> issueTypeIds)
CustomField
isInScope
in interface CustomField
project
- The project.issueTypeIds
- A list of IssueType ids.true
if this custom field is within the given scope.public boolean isInScope(long projectId, String issueTypeId)
CustomField
isInScope
in interface CustomField
projectId
- The project.issueTypeId
- The issueTypeIdtrue
if this custom field is within the given scope.CustomField.isRelevantForIssueContext(com.atlassian.jira.issue.context.IssueContext)
public boolean isInScopeForSearch(Project project, List<String> issueTypeIds)
CustomField
If the project is null, then it is treated as any project. If the issueTypeIds list is null or an empty list, then it is treated as any issue type.
If the passed project is any project, this method will search in all the FieldConfigScheme
of this custom field, ignoring the projects that they apply to (since the given project is any)
and looking for at least one of them that applies to at least one of the given issue type ids.
If the passed list of issue types is any issue type, this method will search for at least one FieldConfigScheme
that applies to the given project, ignoring the issue types that it applies to (since the given issue type ids are any).
If both the project and issue types are any, the question being asked is "is this custom field in the scope of any project and any issue type?", which will always be true.
isInScopeForSearch
in interface CustomField
public FieldConfig getReleventConfig(SearchContext searchContext)
getReleventConfig
in interface CustomField
searchContext
- search contextpublic ClauseNames getClauseNames()
CustomField
getClauseNames
in interface CustomField
public boolean isInScope(SearchContext searchContext)
CustomField
isInScope
in interface CustomField
searchContext
- search contextpublic void validateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config)
CustomFieldType.validateFromParams(CustomFieldParams, ErrorCollection, FieldConfig)
validateFromActionParams
in interface CustomField
actionParameters
- action parameterserrorCollection
- error collection to add errors toconfig
- field configpublic Object getValue(Issue issue)
CustomFieldType.getValueFromIssue(CustomField, Issue)
getValue
in interface CustomField
issue
- issue to retrieve the value fromOrderableField.getValueFromParams(java.util.Map)
public boolean isRenderable()
isRenderable
in interface RenderableField
public void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
OrderableField
Fields that are simply stored in the JIRAISSUE DB table, need not do anything here as this table is written to one time to include all fields that changed. Fields using other DB tables must update that table with the appropriate values.
updateValue
in interface OrderableField<Object>
fieldLayoutItem
- for this field within this contextissue
- Issue this field is part ofmodifiedValue
- new value to set field to. Cannot be null.issueChangeHolder
- an object to record any changes made to the issue by this method.public String prettyPrintChangeHistory(String changeHistory)
prettyPrintChangeHistory
in interface NavigableField
changeHistory
- change history stringpublic String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
prettyPrintChangeHistory
in interface NavigableField
changeHistory
- change history stringi18nHelper
- not usedpublic boolean isEditable()
isEditable
in interface CustomField
public Options getOptions(String key, JiraContextNode jiraContextNode)
MultipleCustomFieldType
type. Otherwise returns null.getOptions
in interface CustomField
key
- not usedjiraContextNode
- JIRA context nodeMultipleCustomFieldType
type, null otherwisepublic Options getOptions(String key, FieldConfig config, JiraContextNode contextNode)
MultipleCustomFieldType
type. Otherwise returns null.getOptions
in interface CustomField
key
- not usedconfig
- relevant field configcontextNode
- JIRA context nodeMultipleCustomFieldType
type, null otherwisepublic void populateDefaults(Map<String,Object> customFieldValuesHolder, Issue issue)
OrderableField
populateDefaults
in interface OrderableField<Object>
customFieldValuesHolder
- The fieldValuesHolder Map to be populated.issue
- The Issue.public boolean isRelevantForIssueContext(IssueContext issueContext)
CustomField
This is equivalent to calling
getRelevantConfig(issueContext) != nullbut in general can run faster because it does not have to resolve the actual FieldConfig.
isRelevantForIssueContext
in interface CustomField
issueContext
- IssueContext whose project and issue type will be used to check if the field has a configFieldConfig
representing the configuration of the field for issue's
project/issue type. If the field does not have a config for issue's project/issue type, null is returned.CustomField.getRelevantConfig(com.atlassian.jira.issue.context.IssueContext)
,
CustomField.isInScope(long, String)
public FieldConfig getRelevantConfig(IssueContext issueContext)
getRelevantConfig
in interface ConfigurableField<Object>
getRelevantConfig
in interface CustomField
issueContext
- issue context to find the relevant field config forCustomField.isRelevantForIssueContext(com.atlassian.jira.issue.context.IssueContext)
public FieldConfig getRelevantConfig(Issue issue)
CustomField
FieldConfig
for the given issue. If the field has
a config for the issue then one will be returned, otherwise null is returned.
For example, if we have 2 projects: project A and project B, and a custom field is configured to be only applicable to project A, calling getRelevantConfig with an issue from project A should return the config (i.e. not null). Calling this method with an issue from project B should return null.
getRelevantConfig
in interface CustomField
issue
- issue whose project and issue type will be used to check if the field has a configFieldConfig
representing the configuration of the field for issue's
project/issue type. If the field does not have a config for issue's project/issue type, null is returned.CustomField.isRelevantForIssueContext(com.atlassian.jira.issue.context.IssueContext)
public boolean hasParam(Map parameters)
OrderableField
hasParam
in interface OrderableField<Object>
parameters
- Map of HTTP request parameters ("Action parameters").public void populateFromParams(Map<String,Object> customFieldValuesHolder, Map<String,String[]> params)
populateFromParams
in interface OrderableField<Object>
customFieldValuesHolder
- map of custom field valuesparams
- map of parameterspublic void populateFromIssue(Map<String,Object> customFieldValuesHolder, Issue issue)
populateFromIssue
in interface OrderableField<Object>
customFieldValuesHolder
- map of custom field valuesissue
- issue to get the custom field parameters frompublic Object getValueFromParams(Map params) throws FieldValidationException
OrderableField
getValueFromParams
in interface OrderableField<Object>
params
- the map of parameters.FieldValidationException
- if there is a problem with Field Validation.public void populateParamsFromString(Map<String,Object> fieldValuesHolder, String stringValue, Issue issue)
populateParamsFromString
in interface OrderableField<Object>
fieldValuesHolder
- not usedstringValue
- not usedissue
- not usedUnsupportedOperationException
- alwayspublic List getConfigurationItemTypes()
ConfigurableField
FieldConfigItemType
objects. This opens up possibilties for configurable custom fieldsgetConfigurationItemTypes
in interface ConfigurableField<Object>
FieldConfigItemType
@Nonnullpublic SearchHandler createAssociatedSearchHandler()
SearchableField
SearchHandler
for the field. This object tells JIRA how to search for values within the field.createAssociatedSearchHandler
in interface SearchableField
null
when no searcher
is associated with the field. This will mainly happen when a customfield is configured to have no
searcher.public void createValue(Issue issue, Object value)
OrderableField
createValue
in interface OrderableField<Object>
issue
- Issue this field is part ofvalue
- Value to store in this field (eg. Collection for Version fields). Cannot be null.public void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
OrderableField
validateParams
in interface OrderableField<Object>
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
- FieldScreenRenderLayoutItempublic CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
CustomField
getCustomFieldValues
in interface CustomField
customFieldValuesHolder
- containing all paramsCustomFieldParams
of String
objectspublic Set<Long> remove() throws DataAccessException
CustomField
remove
in interface CustomField
DataAccessException
- if removal of generic value failspublic String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
getColumnViewHtml
in interface NavigableField
protected I18nHelper getI18nHelper()
public String getHiddenFieldId()
NavigableField
getHiddenFieldId
in interface NavigableField
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getCreateHtml
in interface OrderableField<Object>
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- Issuepublic String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
OrderableField
getCreateHtml
in interface OrderableField<Object>
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- IssuedispayParameters
- Map of display parameters.public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getEditHtml
in interface OrderableField<Object>
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- Issuepublic String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map dispayParameters)
OrderableField
getEditHtml
in interface OrderableField<Object>
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- IssuedispayParameters
- Map of display parameters.public String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters)
OrderableField
getBulkEditHtml
in interface OrderableField<Object>
operationContext
- OperationContextaction
- ActionbulkEditBean
- BulkEditBeandisplayParameters
- Map of display parameters.public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
getViewHtml
in interface OrderableField<Object>
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters)
getViewHtml
in interface OrderableField<Object>
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters)
getViewHtml
in interface OrderableField<Object>
public boolean isShown(Issue issue)
OrderableField
isShown
in interface OrderableField<Object>
issue
- The Issue.public Object getDefaultValue(Issue issue)
OrderableField
For example: The user does not have permission to see the field, or the field is not part of the create screen.
getDefaultValue
in interface OrderableField<Object>
issue
- the Issue.public void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
OrderableField
updateIssue
in interface OrderableField<Object>
fieldLayoutItem
- FieldLayoutItemissue
- MutableIssuefieldValueHolder
- Field Value Holder MapOrderableField.updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.ModifiedValue, com.atlassian.jira.issue.util.IssueChangeHolder)
public MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
OrderableField
needsMove
in interface OrderableField<Object>
originalIssues
- Collection of original Issues.targetIssue
- Nonexistent issue object with values representing those of issue(s) after movetargetFieldLayoutItem
- FieldLayoutItempublic void populateForMove(Map<String,Object> fieldValuesHolder, Issue originalIssue, Issue targetIssue)
OrderableField
OrderableField.needsMove(java.util.Collection, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem)
returned true, and the remote user (the one performing the move) has the permission to actually update this field.populateForMove
in interface OrderableField<Object>
fieldValuesHolder
- Map of field Values.originalIssue
- orignal IssuetargetIssue
- target Issuepublic void removeValueFromIssueObject(MutableIssue issue)
OrderableField
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.
removeValueFromIssueObject
in interface OrderableField<Object>
issue
- The issue object to be effected.OrderableField.canRemoveValueFromIssueObject(com.atlassian.jira.issue.Issue)
,
OrderableField.updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.ModifiedValue, com.atlassian.jira.issue.util.IssueChangeHolder)
public boolean canRemoveValueFromIssueObject(Issue issue)
OrderableField
true
if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.
There a few different reasons why this method may return false:
canRemoveValueFromIssueObject
in interface OrderableField<Object>
issue
- The Issue object.true
if a call to OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
will actually remove the value.OrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)
public boolean hasValue(Issue issue)
OrderableField
hasValue
in interface OrderableField<Object>
issue
- the Issue.public String getId()
Field
getId
in interface Field
getId
in interface RenderableField
public String getValueFromIssue(Issue issue)
RenderableField
getValueFromIssue
in interface RenderableField
issue
- identifies the issue that will contain the value for this field.public Long getIdAsLong()
getIdAsLong
in interface CustomField
public Timestamp getLastValueUpdate()
CustomField
getLastValueUpdate
in interface CustomField
public Long getIssuesWithValue()
CustomField
getIssuesWithValue
in interface CustomField
public List<FieldConfigScheme> getConfigurationSchemes()
getConfigurationSchemes
in interface CustomField
FieldConfigScheme
objectspublic String getNameKey()
Field
getNameKey
in interface Field
@Nonnull public List<Project> getAssociatedProjectObjects()
CustomField
Project
s directly associated with this CustomField
.
This method can return an empty result when the CustomField
is associated with all Project
s.
Please use CustomField.isAllProjects()
prior to this method to detect this."
getAssociatedProjectObjects
in interface ConfigurableField<Object>
getAssociatedProjectObjects
in interface CustomField
Project
s directly associated with this CustomField
.@Nonnull public List<IssueType> getAssociatedIssueTypes()
CustomField
IssueType
s directly associated with this CustomField
.
In case when this CustomField
CustomField.isAllIssueTypes()
it will be associated
with all IssueType
s but this method can still return empty result.
getAssociatedIssueTypes
in interface CustomField
IssueType
s directly associated with this CustomField
.public List<IssueType> getAssociatedIssueTypeObjects()
getAssociatedIssueTypeObjects
in interface CustomField
CustomField.getAssociatedIssueTypes()
public boolean isGlobal()
isGlobal
in interface CustomField
public boolean isAllProjects()
isAllProjects
in interface CustomField
public boolean isAllIssueTypes()
getAssociatedIssueTypes()
contains null - all issue types.isAllIssueTypes
in interface CustomField
public boolean isEnabled()
getConfigurationSchemes()
is enabled.isEnabled
in interface CustomField
public String availableForBulkEdit(BulkEditBean bulkEditBean)
availableForBulkEdit
in interface OrderableField<Object>
bulkEditBean
- bulk edit beanprotected static boolean areDifferent(Object obj1, Object obj2)
obj1
- the first object to compareobj2
- the second object to compareprotected boolean hasBulkUpdatePermission(BulkEditBean bulkEditBean, Issue issue)
bulkEditBean
- bulk edit beanissue
- issue to check permission onpublic String getName()
public String getUntranslatedName()
CustomField.ENTITY_NAME
of the underlying generic value.getUntranslatedName
in interface CustomField
public String getFieldName()
CustomField
getFieldName
in interface CustomField
public String getDescription()
getDescription
in interface CustomField
public String getUntranslatedDescription()
CustomField.ENTITY_DESCRIPTION
of the underlying generic
value.getUntranslatedDescription
in interface CustomField
@Nonnull public RenderableProperty getDescriptionProperty()
RenderableProperty
for rendering this custom field's description.getDescriptionProperty
in interface CustomField
@Nonnull public RenderableProperty getUntranslatedDescriptionProperty()
RenderableProperty
for rendering this custom field's description.getUntranslatedDescriptionProperty
in interface CustomField
public CustomFieldSearcher getCustomFieldSearcher()
CustomFieldSearcher
for this custom field looking it up in the customFieldManager by the
searcher key retrieved from CustomField.ENTITY_CUSTOM_FIELD_SEARCHER
underlying generic value attribute. The
seracher, if found is initialized with this custom field before it is returned.
Before v7.3.6 this would execute once and then return the value forever.
After v7.3.6 this will execute each time until a value is returned, and if the module can not be found, it is treated as returning null from this call, but re-attempt to find a value the next time it is called.
getCustomFieldSearcher
in interface CustomField
public CustomFieldType getCustomFieldType()
CustomFieldType
in the customFieldTypeModuleDescriptors
by the key retrieved from the CustomField.ENTITY_CF_TYPE_KEY
attribute of the
underlying generic value. This only happens if typeRef
is null, then the custom field type is set
and returned each time. It can return null if the custom field type cannot be found by that key.
Before v7.3.6 this would execute once and then return the value forever.
After v7.3.6 this will execute each time until a value is returned, and if the module can not be found, it is treated as returning null from this call, but re-attempt to find a value the next time it is called.
getCustomFieldType
in interface CustomField
public String getColumnHeadingKey()
getColumnHeadingKey
in interface NavigableField
public String getColumnCssClass()
getColumnCssClass
in interface NavigableField
public String getDefaultSortOrder()
NavigableField.ORDER_ASCENDING
.getDefaultSortOrder
in interface NavigableField
NavigableField.ORDER_ASCENDING
valuepublic int compare(Issue issue1, Issue issue2) throws IllegalArgumentException
SortableCustomField
If either of given issues is null a IllegalArgumentException is thrown.compare
in interface CustomField
issue1
- issue to compareissue2
- issue to compareIllegalArgumentException
- if any of given issues is nullpublic LuceneFieldSorter getSorter()
SortableCustomFieldSearcher
then return SortableCustomFieldSearcher.getSorter(CustomField)
. Else return null.getSorter
in interface NavigableField
NavigableField.getSortComparatorSource()
DocumentIssueImpl
,
MappedSortComparator
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()
SortableCustomFieldSearcher
or a custom field that implements SortableCustomField
. If neither are found,
this method returns null.getSortComparatorSource
in interface NavigableField
public List<org.apache.lucene.search.SortField> getSortFields(boolean sortOrder)
NavigableField
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()
.
getSortFields
in interface NavigableField
public org.ofbiz.core.entity.GenericValue getGenericValue()
getGenericValue
in interface CustomField
public int compareTo(Object o)
compareTo
in interface Comparable
public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareField
getFieldTypeInfo
in interface RestAwareField
fieldTypeInfoContext
- the FieldTypeInfoContext
contains context information that is relevant to generate the FieldTypeInfo
public JsonType getJsonSchema()
RestAwareField
getJsonSchema
in interface RestAwareField
public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem)
RestAwareField
getJsonFromIssue
in interface RestAwareField
issue
- to get field data fromrenderedVersionRequested
- whether the use requested the return of rendered/pretty data as well as raw datafieldLayoutItem
- field layout for this field. Will only be supplied if the field is also an ordereable field.public RestFieldOperationsHandler getRestFieldOperation()
getRestFieldOperation
in interface RestFieldOperations
public JsonData getJsonDefaultValue(IssueContext issueCtx)
RestFieldOperations
getJsonDefaultValue
in interface RestFieldOperations
issueCtx
- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.public DefaultValueOperations<Object> getDefaultValueOperations()
getDefaultValueOperations
in interface DefaultValueField<Object>
protected com.atlassian.event.api.EventPublisher getEventPublisher()
EventPublisher
to publish events through. It's not injected via the
constructor because it has too many adverse impacts on APIs and existing usages.EventPublisher
.public com.opensymphony.module.propertyset.PropertySet getPropertySet()
getPropertySet
in interface CustomField
Copyright © 2002-2022 Atlassian. All Rights Reserved.