|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.fields.MockCustomField
public class MockCustomField
Simple implementation of CustomField
for.
Field Summary |
---|
Fields inherited from interface com.atlassian.jira.issue.fields.CustomField |
---|
ENTITY_CF_TYPE_KEY, ENTITY_CUSTOM_FIELD_SEARCHER, ENTITY_DESCRIPTION, ENTITY_ID, ENTITY_ISSUETYPE, ENTITY_NAME, ENTITY_PROJECT, ENTITY_TABLE_NAME |
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 |
Constructor Summary | |
---|---|
MockCustomField()
|
|
MockCustomField(String id,
String name,
CustomFieldType customFieldType)
|
Method Summary | |
---|---|
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 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. |
MockCustomFieldType |
createCustomFieldType()
|
void |
createValue(Issue issue,
Object value)
Create the value of the issue in the data store. |
List<org.ofbiz.core.entity.GenericValue> |
getAssociatedIssueTypes()
Returns a list of issue types associated with this custom field. |
List<org.ofbiz.core.entity.GenericValue> |
getAssociatedProjectCategories()
Returns a list of associated project categories for this custom field. |
List<ProjectCategory> |
getAssociatedProjectCategoryObjects()
Returns a list of associated project categories for this custom field. |
List<Project> |
getAssociatedProjectObjects()
Returns a list of projects associated with this custom field. |
List<org.ofbiz.core.entity.GenericValue> |
getAssociatedProjects()
Returns a list of projects associated with this custom field. |
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<FieldConfigItemType> |
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 displayParameters)
Returns the HTML that should be shown when the issue is being created. |
CustomFieldSearcher |
getCustomFieldSearcher()
Retrieves the CustomFieldSearcher for this custom field. |
CustomFieldType |
getCustomFieldType()
Looks up the CustomFieldType . |
CustomFieldParams |
getCustomFieldValues(Map customFieldValuesHolder)
Get the custom field string values that are relevant to this particular custom field |
String |
getDefaultSortOrder()
The order in which to sort the field when it is sorted for the first time. |
Object |
getDefaultValue(Issue issue)
The value that should be set on the issue if the field is not shown for some reason. |
String |
getDescription()
Returns the 1i8n'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 displayParameters)
Returns HTML that should be shown when the issue is being edited. |
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. |
String |
getId()
The unique id of the field |
Long |
getIdAsLong()
Returns ID of this 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. |
String |
getName()
Returns i18n'ed name of the 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)
The FieldConfig that is relevent to all issue contexts in the search context
Checks that all configs within search context are the same - i.e. |
RestFieldOperationsHandler |
getRestFieldOperation()
|
org.apache.lucene.search.FieldComparatorSource |
getSortComparatorSource()
A sortComparatorSource object to be used for sorting columns in a table. |
LuceneFieldSorter |
getSorter()
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. |
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 untranslated description, for admin. |
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)
|
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 can be edited, false otherwise. |
boolean |
isEnabled()
Returns true if all configuration schemes returned by CustomField.getConfigurationSchemes() are enabled. |
boolean |
isGlobal()
Returns true if this custom field applies for all projects and all issue types. |
boolean |
isInScope(org.ofbiz.core.entity.GenericValue project,
List<String> issueTypeIds)
This is used for determining whether we can view a custom field in view issue. |
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 |
isInScope(com.atlassian.crowd.embedded.api.User user,
SearchContext searchContext)
Determines whether this custom field is in scope. |
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. |
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 fieldValuesHolder,
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 fieldValuesHolder,
Issue issue)
Used to initialise the fieldValuesHolder from the current value of teh issue. |
void |
populateFromParams(Map fieldValuesHolder,
Map parameters)
Populate the fieldValuesHolder with a value from (web) parameters. |
void |
populateParamsFromString(Map fieldValuesHolder,
String stringValue,
Issue issue)
Used to convert from a user friendly string value and put the result into the fieldValuesHolder. |
String |
prettyPrintChangeHistory(String changeHistory)
|
String |
prettyPrintChangeHistory(String changeHistory,
I18nHelper i18nHelper)
Used for email notification templates - allows changelog to be displayed in language of the recipient. |
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. |
void |
setCustomFieldSearcher(CustomFieldSearcher searcher)
Sets the CustomFieldSearcher for this custom field. |
MockCustomField |
setCustomFieldType(CustomFieldType type)
|
void |
setDescription(String description)
Sets the description of this custom field. |
MockCustomField |
setId(String id)
|
void |
setName(String name)
Sets the name of this custom field. |
void |
store()
Stores the generic value of this custom field |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MockCustomField()
public MockCustomField(String id, String name, CustomFieldType customFieldType)
Method Detail |
---|
public boolean isInScope(Project project, List<String> issueTypeIds)
CustomField
If the issueTypeIds list is null or an empty list, then it is treated as a wildcard.
isInScope
in interface CustomField
project
- The project.issueTypeIds
- List of IssueType ID's.
true
if this custom field is within the given scope.public boolean isInScope(org.ofbiz.core.entity.GenericValue project, List<String> issueTypeIds)
CustomField
isInScope
in interface CustomField
project
- project generic valueissueTypeIds
- issue type IDs, e.g. ["1", "2"] for Bugs and New Features
public boolean isInScope(SearchContext searchContext)
CustomField
isInScope
in interface CustomField
searchContext
- search context
public boolean isInScope(com.atlassian.crowd.embedded.api.User user, SearchContext searchContext)
CustomField
isInScope
in interface CustomField
user
- current usersearchContext
- search context
public org.ofbiz.core.entity.GenericValue getGenericValue()
CustomField
getGenericValue
in interface CustomField
public int compare(Issue issue1, Issue issue2) throws IllegalArgumentException
CustomField
compare
in interface CustomField
issue1
- issue to compareissue2
- issue to compare
IllegalArgumentException
- if any of given issues is nullpublic CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
CustomField
getCustomFieldValues
in interface CustomField
customFieldValuesHolder
- containing all params
CustomFieldParams
of String
objectspublic Object getValue(Issue issue)
CustomField
CustomFieldType.getValueFromIssue(CustomField,Issue)
.
This is only used to communicate with the 'view' JSP. Multiselects will return a list, dates a date, etc.
getValue
in interface CustomField
issue
- issue to retrieve the value from
OrderableField.getValueFromParams(java.util.Map)
public Set<Long> remove()
CustomField
remove
in interface CustomField
public Options getOptions(String key, JiraContextNode jiraContextNode)
CustomField
MultipleCustomFieldType
type. Otherwise returns null.
As this is just used by the view layer, it can be a list of objects
getOptions
in interface CustomField
key
- not usedjiraContextNode
- JIRA context node
MultipleCustomFieldType
type, null otherwisepublic void setName(String name)
CustomField
setName
in interface CustomField
name
- name to setpublic String getDescription()
CustomField
CustomField.getDescriptionProperty()
.
getDescription
in interface CustomField
@Nonnull public RenderableProperty getDescriptionProperty()
CustomField
RenderableProperty
for rendering this custom field's description.
getDescriptionProperty
in interface CustomField
public void setDescription(String description)
CustomField
setDescription
in interface CustomField
description
- description to setpublic CustomFieldSearcher getCustomFieldSearcher()
CustomField
CustomFieldSearcher
for this custom field.
The searcher, if found is initialized with this custom field before it is returned.
getCustomFieldSearcher
in interface CustomField
public void setCustomFieldSearcher(CustomFieldSearcher searcher)
CustomField
CustomFieldSearcher
for this custom field.
setCustomFieldSearcher
in interface CustomField
searcher
- custom field searcher to associate with this custom fieldpublic void store()
CustomField
store
in interface CustomField
public boolean isEditable()
CustomField
isEditable
in interface CustomField
public Long getIdAsLong()
CustomField
getIdAsLong
in interface CustomField
public List<FieldConfigScheme> getConfigurationSchemes()
CustomField
getConfigurationSchemes
in interface CustomField
FieldConfigScheme
objects.public Options getOptions(String key, FieldConfig config, JiraContextNode contextNode)
CustomField
MultipleCustomFieldType
type. Otherwise returns null.
As this is just used by the view layer, it can be a list of objects
getOptions
in interface CustomField
key
- not usedconfig
- relevant field configcontextNode
- JIRA context node
MultipleCustomFieldType
type, null otherwisepublic 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
rerurn null.
getRelevantConfig
in interface CustomField
issue
- issue whose project and issue type will be used to check if the field has a config
FieldConfig
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.public void validateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config)
CustomField
CustomFieldType.validateFromParams(CustomFieldParams,ErrorCollection,FieldConfig)
validateFromActionParams
in interface CustomField
actionParameters
- action parameterserrorCollection
- error collection to add errors toconfig
- field configpublic List<org.ofbiz.core.entity.GenericValue> getAssociatedProjectCategories()
CustomField
CustomField.getConfigurationSchemes()
returns null.
It returns an empty list if the CustomField.getConfigurationSchemes()
returns an empty list.
The returned list should be sorted by project category name.
getAssociatedProjectCategories
in interface CustomField
GenericValue
objects that represent associated project categories
as ProjectCategoryContext
objectspublic List<ProjectCategory> getAssociatedProjectCategoryObjects()
CustomField
CustomField.getConfigurationSchemes()
returns null.
It returns an empty list if the CustomField.getConfigurationSchemes()
returns an empty list.
The returned list should be sorted by project category name.
getAssociatedProjectCategoryObjects
in interface CustomField
ProjectCategoryContext
objectspublic List<FieldConfigItemType> getConfigurationItemTypes()
ConfigurableField
FieldConfigItemType
objects. This opens up possibilties for configurable custom fields
getConfigurationItemTypes
in interface ConfigurableField
FieldConfigItemType
@Nonnullpublic List<org.ofbiz.core.entity.GenericValue> getAssociatedProjects()
CustomField
getAssociatedProjects
in interface ConfigurableField
getAssociatedProjects
in interface CustomField
public List<Project> getAssociatedProjectObjects()
CustomField
getAssociatedProjectObjects
in interface ConfigurableField
getAssociatedProjectObjects
in interface CustomField
public List<org.ofbiz.core.entity.GenericValue> getAssociatedIssueTypes()
CustomField
getAssociatedIssueTypes
in interface CustomField
public boolean isGlobal()
CustomField
isGlobal
in interface CustomField
public boolean isAllProjects()
CustomField
isAllProjects
in interface CustomField
public boolean isAllIssueTypes()
CustomField
isAllIssueTypes
in interface CustomField
public boolean isEnabled()
CustomField
CustomField.getConfigurationSchemes()
are enabled.
isEnabled
in interface CustomField
public CustomFieldType getCustomFieldType()
CustomField
CustomFieldType
. It can return null if the custom
field type cannot be found in the CustomFieldManager
.
getCustomFieldType
in interface CustomField
public MockCustomField setCustomFieldType(CustomFieldType type)
public MockCustomFieldType createCustomFieldType()
public FieldConfig getRelevantConfig(IssueContext issueContext)
CustomField
getRelevantConfig
in interface ConfigurableField
getRelevantConfig
in interface CustomField
issueContext
- issue context to find the relevant field config for
public FieldConfig getReleventConfig(SearchContext searchContext)
CustomField
FieldConfig
that is relevent to all issue contexts in the search context
Checks that all configs within search context are the same - i.e. all null or all the same config.
Returns null if any two configs are different.
Note: null config is not equal to non-null config. Previously, a non-null config was returned even if the first
config(s) was null.
getReleventConfig
in interface CustomField
searchContext
- search context
public ClauseNames getClauseNames()
CustomField
getClauseNames
in interface CustomField
public String getColumnHeadingKey()
getColumnHeadingKey
in interface NavigableField
public String getColumnCssClass()
getColumnCssClass
in interface NavigableField
public String getDefaultSortOrder()
NavigableField
getDefaultSortOrder
in interface NavigableField
NavigableField.ORDER_ASCENDING
or NavigableField.ORDER_DESCENDING
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()
NavigableField
MappedSortComparator
using the NavigableField.getSorter()
method. However, fields can provide any sorting mechanism that they wish.
If a field can be sorted directly using terms in the Lucene index then the field should implement NavigableField.getSortFields(boolean sortOrder)
rather than this method.
In large installations custom sorting may incur a maor performance penalty.
getSortComparatorSource
in interface NavigableField
public LuceneFieldSorter getSorter()
NavigableField
getSorter
in interface NavigableField
NavigableField.getSortComparatorSource()
DocumentIssueImpl
,
MappedSortComparator
public List<org.apache.lucene.search.SortField> getSortFields(boolean sortOrder)
NavigableField
return Collections.singletonList(new SortField(fieldName, sortOrder));
NavigableField.getSortComparatorSource()
If you implement this method there is no need to implement NavigableField.getSortComparatorSource()
.
getSortFields
in interface NavigableField
public String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
getColumnViewHtml
in interface NavigableField
public String getHiddenFieldId()
NavigableField
getHiddenFieldId
in interface NavigableField
public String prettyPrintChangeHistory(String changeHistory)
prettyPrintChangeHistory
in interface NavigableField
public String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
NavigableField
prettyPrintChangeHistory
in interface NavigableField
public String getValueFromIssue(Issue issue)
RenderableField
getValueFromIssue
in interface RenderableField
issue
- identifies the issue that will contain the value for this field.
public boolean isRenderable()
RenderableField
isRenderable
in interface RenderableField
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getCreateHtml
in interface OrderableField
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- Issue
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters)
OrderableField
getCreateHtml
in interface OrderableField
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- IssuedisplayParameters
- Map of display parameters.
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue)
OrderableField
getEditHtml
in interface OrderableField
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- Issue
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters)
OrderableField
getEditHtml
in interface OrderableField
fieldLayoutItem
- FieldLayoutItemoperationContext
- OperationContextaction
- Actionissue
- IssuedisplayParameters
- Map of display parameters.
public String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters)
OrderableField
getBulkEditHtml
in interface OrderableField
operationContext
- OperationContextaction
- ActionbulkEditBean
- BulkEditBeandisplayParameters
- Map of display parameters.
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue)
getViewHtml
in interface OrderableField
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters)
getViewHtml
in interface OrderableField
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters)
getViewHtml
in interface OrderableField
public boolean isShown(Issue issue)
OrderableField
isShown
in interface OrderableField
issue
- The Issue.
public void populateDefaults(Map fieldValuesHolder, Issue issue)
OrderableField
populateDefaults
in interface OrderableField
fieldValuesHolder
- The fieldValuesHolder Map to be populated.issue
- The Issue.public boolean hasParam(Map parameters)
OrderableField
hasParam
in interface OrderableField
parameters
- Map of HTTP request parameters ("Action parameters").public void populateFromParams(Map fieldValuesHolder, Map parameters)
OrderableField
populateFromParams
in interface OrderableField
fieldValuesHolder
- The fieldValuesHolder Map to be populated.parameters
- Map of HTTP parameters.public void populateFromIssue(Map fieldValuesHolder, Issue issue)
OrderableField
populateFromIssue
in interface OrderableField
fieldValuesHolder
- The fieldValuesHolder Map to be populated.issue
- The Issue.public void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
OrderableField
validateParams
in interface OrderableField
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 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
issue
- the Issue.
public void createValue(Issue issue, Object value)
OrderableField
createValue
in interface OrderableField
issue
- Issue this field is part ofvalue
- Value to store in this field (eg. Collection for Version fields). Cannot be null.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
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 void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
OrderableField
updateIssue
in interface OrderableField
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 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
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
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 MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
OrderableField
needsMove
in interface OrderableField
originalIssues
- Collection of original Issues.targetIssue
- Target Issue.targetFieldLayoutItem
- FieldLayoutItem
public 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
fieldValuesHolder
- Map of field Values.originalIssue
- orignal IssuetargetIssue
- target Issuepublic boolean hasValue(Issue issue)
OrderableField
hasValue
in interface OrderableField
issue
- the Issue.
public String availableForBulkEdit(BulkEditBean bulkEditBean)
OrderableField
availableForBulkEdit
in interface OrderableField
bulkEditBean
- holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)
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 Object getValueFromParams(Map params) throws FieldValidationException
OrderableField
getValueFromParams
in interface OrderableField
params
- the map of parameters.
FieldValidationException
- if there is a problem with Field Validation.public void populateParamsFromString(Map fieldValuesHolder, String stringValue, Issue issue) throws FieldValidationException
OrderableField
populateParamsFromString
in interface OrderableField
fieldValuesHolder
- Map of field Values.stringValue
- user friendly string valueissue
- the Issue
FieldValidationException
- if cannot convert to a value from the given stringpublic 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 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, @Nullable 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 String getId()
Field
getId
in interface Field
getId
in interface RenderableField
public MockCustomField setId(String id)
public String getNameKey()
Field
getNameKey
in interface Field
public String getName()
Field
getName
in interface Field
public String getFieldName()
CustomField
getFieldName
in interface CustomField
public int compareTo(Object o)
compareTo
in interface Comparable
public String toString()
toString
in class Object
public com.opensymphony.module.propertyset.PropertySet getPropertySet()
getPropertySet
in interface CustomField
public String getUntranslatedDescription()
CustomField
CustomField.ENTITY_DESCRIPTION
of the underlying generic value.
getUntranslatedDescription
in interface CustomField
public String getUntranslatedName()
CustomField
CustomField.ENTITY_NAME
of the underlying generic value.
getUntranslatedName
in interface CustomField
@Nonnull public RenderableProperty getUntranslatedDescriptionProperty()
CustomField
RenderableProperty
for rendering this custom field's untranslated description, for admin.
getUntranslatedDescriptionProperty
in interface CustomField
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |