|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CustomField
Custom Field interface.
Typically one obtains a CustomField usingCustomFieldManager
,
eg. CustomFieldManager.getCustomFieldObjectByName(String)
To create or update an instance of a CustomField for an issue (a CustomFieldValue
),
use OrderableField.createValue(com.atlassian.jira.issue.Issue,Object)
or 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)
.
CustomFieldValue - a value of this field for a specific issue
,
CustomFieldType - The type of custom field (text, number, user picker etc).
Field Summary |
---|
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 |
Method Summary | |
---|---|
int |
compare(Issue issue1,
Issue issue2)
This method compares the values of this custom field in two given issues. |
List |
getAssociatedIssueTypes()
Returns a list of issue types associated with this project. |
List |
getAssociatedProjectCategories()
Returns a list of associated project categories for this custom field. |
List |
getAssociatedProjects()
Returns a list of projects associated with this project. |
List |
getConfigurationSchemes()
Returns a list of configuration schemes. |
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 |
getDescription()
Returns the description of this custom field. |
FieldConfig |
getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project,
List issueTypeIds)
Deprecated. |
org.ofbiz.core.entity.GenericValue |
getGenericValue()
Deprecated. |
Long |
getIdAsLong()
Returns ID of this custom field. |
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. |
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. |
Object |
getValue(Issue issue)
Retrieves and returns the Object representing the this CustomField 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 getConfigurationSchemes() are enabled. |
boolean |
isGlobal()
Returns true if this custom field applies for all projects and all issue types. |
boolean |
isInScope(User remoteUser,
org.ofbiz.core.entity.GenericValue project,
List issueTypeIds)
This is used for determining whether we can view a custom field in view issue. |
boolean |
isInScope(User user,
SearchContext searchContext)
Determines wheteher this custom field is in scope. |
Set |
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 |
setCustomFieldSearcher(CustomFieldSearcher searcher)
Sets the CustomFieldSearcher for this custom field. |
void |
setDescription(String description)
Sets the description of this custom field. |
void |
setName(String name)
Sets the name of this custom field. |
void |
store()
Stores this custom field. |
void |
validateFromActionParams(Map actionParameters,
ErrorCollection errorCollection,
FieldConfig config)
Validates relevant parameters on custom field type of this custom field. |
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField |
---|
getColumnCssClass, getColumnHeadingKey, getColumnViewHtml, getDefaultSortOrder, getHiddenFieldId, getSortComparatorSource, getSorter, prettyPrintChangeHistory, prettyPrintChangeHistory |
Methods inherited from interface com.atlassian.jira.issue.fields.ConfigurableField |
---|
getConfigurationItemTypes |
Methods inherited from interface com.atlassian.jira.issue.fields.OrderableField |
---|
availableForBulkEdit, createValue, getBulkEditHtml, getCreateHtml, getCreateHtml, getDefaultValue, getEditHtml, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasValue, isShown, needsMove, populateDefaults, populateForMove, populateFromIssue, populateFromParams, populateParamsFromString, removeValue, updateIssue, updateValue, validateParams |
Methods inherited from interface com.atlassian.jira.issue.fields.SearchableField |
---|
getAssociatedSearchers |
Methods inherited from interface com.atlassian.jira.issue.fields.renderer.RenderableField |
---|
getId, getValueFromIssue, isRenderable |
Method Detail |
---|
boolean isInScope(User remoteUser, org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
remoteUser
- current userproject
- project generic valueissueTypeIds
- issue type IDs, e.g. ["1", "2"] for Bugs and New Features
org.ofbiz.core.entity.GenericValue getGenericValue()
int compare(Issue issue1, Issue issue2) throws IllegalArgumentException
issue1
- issue to compareissue2
- issue to compare
IllegalArgumentException
- if any of given issues is nullCustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
customFieldValuesHolder
- containing all params
CustomFieldParams
of String
objectsObject getValue(Issue issue)
CustomFieldType.getValueFromIssue(CustomField,Issue)
.
This is only used to communicate with the 'view' JSP. Multiselects will return a list, dates a date, etc.
issue
- issue to retrieve the value from
OrderableField.getValueFromParams(java.util.Map)
Set remove()
Options getOptions(String key, JiraContextNode jiraContextNode)
MultipleCustomFieldType
type. Otherwise returns null.
As this is just used by the view layer, it can be a list of objects
key
- not usedjiraContextNode
- JIRA context node
MultipleCustomFieldType
type, null otherwisevoid setName(String name)
name
- name to setString getDescription()
void setDescription(String description)
description
- description to setCustomFieldSearcher getCustomFieldSearcher()
CustomFieldSearcher
for this custom field.
The seracher, if found is initialized with this custom field before it is returned.
void setCustomFieldSearcher(CustomFieldSearcher searcher)
CustomFieldSearcher
for this custom field.
searcher
- custom field searcher to associate with this custom fieldvoid store()
boolean isEditable()
Long getIdAsLong()
List getConfigurationSchemes()
FieldConfigScheme
objectsOptions getOptions(String key, FieldConfig config, JiraContextNode contextNode)
MultipleCustomFieldType
type. Otherwise returns null.
As this is just used by the view layer, it can be a list of objects
key
- not usedconfig
- relevant field configcontextNode
- JIRA context node
MultipleCustomFieldType
type, null otherwiseFieldConfig getRelevantConfig(Issue issue)
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.
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.FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
project
- projectissueTypeIds
- issue type IDs
void validateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config)
CustomFieldType.validateFromParams(CustomFieldParams,ErrorCollection,FieldConfig)
actionParameters
- action parameterserrorCollection
- error collection to add errors toconfig
- field configList getAssociatedProjectCategories()
getConfigurationSchemes()
returns null.
It returns an empty list if the getConfigurationSchemes()
returns an empty list.
The returned list should be sorted by project category name.
GenericValue
objects that represent associated project categories
as ProjectCategoryContext
objectsList getAssociatedProjects()
getAssociatedProjects
in interface ConfigurableField
List getAssociatedIssueTypes()
boolean isGlobal()
boolean isAllProjects()
boolean isAllIssueTypes()
boolean isEnabled()
getConfigurationSchemes()
are enabled.
CustomFieldType getCustomFieldType()
CustomFieldType
. It can return null if the custom
field type cannot be found in the CustomFieldManager
.
FieldConfig getRelevantConfig(IssueContext issueContext)
getRelevantConfig
in interface ConfigurableField
issueContext
- issue context to find the relevant field config for
FieldConfig getReleventConfig(SearchContext searchContext)
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.
searchContext
- search context
boolean isInScope(User user, SearchContext searchContext)
user
- current usersearchContext
- search context
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |