Class DefaultOptionsManager
java.lang.Object
com.atlassian.jira.issue.customfields.manager.DefaultOptionsManager
- All Implemented Interfaces:
OptionsManager
- Direct Known Subclasses:
CachedOptionsManager
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultOptionsManager
(OfBizDelegator delegator, FieldConfigManager fieldConfigManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateOption
(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value) Create a new option for the given custom field config.createOptions
(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options) Bulk version ofOptionsManager.createOption(FieldConfig, Long, Long, String)
methodvoid
deleteOptionAndChildren
(Option option) void
disableOption
(Option option) Set an option to disabled.void
enableOption
(Option option) Set an option to enabled.findByOptionId
(Long optionId) findByOptionValue
(String value) Finds all options with the given value.findByParentId
(Long parentOptionId) Finds all options with the given parent option id.Retreives allOption
in the system.getOptions
(FieldConfig fieldConfig) Get options for this particular custom field type.getOptions
(CustomField field, Collection<Long> projectIds, Collection<String> issueTypeIds) Returns all options in the context of given projects and issue types for the custom field.void
removeCustomFieldConfigOptions
(FieldConfig fieldConfig) void
removeCustomFieldOptions
(CustomField customField) void
setRootOptions
(FieldConfig fieldConfig, Options options) void
void
updateOptions
(Collection<Option> options) Update a set of options.
-
Field Details
-
ENTITY_CONFIG_ID
- See Also:
-
ORDER_BY_LIST
-
fieldConfigManager
-
-
Constructor Details
-
DefaultOptionsManager
-
-
Method Details
-
getOptions
Description copied from interface:OptionsManager
Get options for this particular custom field type. As a custom field may have multiple types of options (e.g. cascading drop-downs), the type can be used to signify this- Specified by:
getOptions
in interfaceOptionsManager
- Parameters:
fieldConfig
- For example, retrieved fromCustomField.getRelevantConfig(com.atlassian.jira.issue.Issue)
- Returns:
- An option Object of Options
-
setRootOptions
- Specified by:
setRootOptions
in interfaceOptionsManager
-
removeCustomFieldOptions
- Specified by:
removeCustomFieldOptions
in interfaceOptionsManager
-
removeCustomFieldConfigOptions
- Specified by:
removeCustomFieldConfigOptions
in interfaceOptionsManager
-
updateOptions
Description copied from interface:OptionsManager
Update a set of options. After doing this, any existingOptions
objects may be stale, and should be re-fetched withOptionsManager.getOptions(com.atlassian.jira.issue.fields.config.FieldConfig)
.- Specified by:
updateOptions
in interfaceOptionsManager
- Parameters:
options
- Usually anOptions
implementation.
-
createOption
public Option createOption(FieldConfig fieldConfig, Long parentOptionId, Long sequence, String value) Description copied from interface:OptionsManager
Create a new option for the given custom field config.- Specified by:
createOption
in interfaceOptionsManager
- Parameters:
fieldConfig
- The custom field config to create the option forparentOptionId
- The id of the parent option, or null if this is a root optionsequence
- The sequence of the option (position on the list)value
- The value of the option- Returns:
- The newly created option
-
createOptions
public List<Option> createOptions(FieldConfig config, Long parentOptionId, Long sequence, Iterable<String> options) Description copied from interface:OptionsManager
Bulk version ofOptionsManager.createOption(FieldConfig, Long, Long, String)
method- Specified by:
createOptions
in interfaceOptionsManager
-
deleteOptionAndChildren
- Specified by:
deleteOptionAndChildren
in interfaceOptionsManager
-
getAllOptions
Description copied from interface:OptionsManager
Retreives allOption
in the system.- Specified by:
getAllOptions
in interfaceOptionsManager
- Returns:
- a list of all options in the system
-
disableOption
Description copied from interface:OptionsManager
Set an option to disabled. A disabled option will is not available to be assigned to this associated custom field, It remains valid historically and for searching with.- Specified by:
disableOption
in interfaceOptionsManager
- Parameters:
option
- The option to be disabled.
-
enableOption
Description copied from interface:OptionsManager
Set an option to enabled.- Specified by:
enableOption
in interfaceOptionsManager
- Parameters:
option
- The Option to enable.
-
setValue
- Specified by:
setValue
in interfaceOptionsManager
-
findByOptionValue
Description copied from interface:OptionsManager
Finds all options with the given value. Returns and empty list if no options are found.- Specified by:
findByOptionValue
in interfaceOptionsManager
- Parameters:
value
- the value of the options to find (case insensitive). Must not be null.- Returns:
- the list of found options, empty if non found.
-
findByOptionId
- Specified by:
findByOptionId
in interfaceOptionsManager
-
findByParentId
Description copied from interface:OptionsManager
Finds all options with the given parent option id. Returns an empty list if no options are found.- Specified by:
findByParentId
in interfaceOptionsManager
- Parameters:
parentOptionId
- the id of the parent option.- Returns:
- the list of found options, empty if non found.
-
getOptions
@Nonnull public List<Option> getOptions(@Nonnull CustomField field, @Nonnull Collection<Long> projectIds, @Nonnull Collection<String> issueTypeIds) Description copied from interface:OptionsManager
Returns all options in the context of given projects and issue types for the custom field.- Specified by:
getOptions
in interfaceOptionsManager
- Parameters:
field
- a custom field whose options are requestedprojectIds
- a collection of project idsissueTypeIds
- a collection of issue types ids- Returns:
- a list of options for the given custom field and context or an empty list if no options exist.
- See Also:
-