|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<Map<String,Option>,Option>
com.atlassian.jira.issue.customfields.impl.CascadingSelectCFType
public class CascadingSelectCFType
Cascading Select Custom Field Type allows for multiple dependent select lists.
Map, Option
The key in the map represents the field depth of the
select list. eg. a key of null is the root parent, and key of "1" is the first level select list. As at JIRA 3.0,
there can only be one level.Option
String
of option id
Nested Class Summary | |
---|---|
static interface |
CascadingSelectCFType.Visitor<T>
|
Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
AbstractCustomFieldType.VisitorBase<X> |
Field Summary | |
---|---|
static PersistenceFieldType |
CASCADE_VALUE_TYPE
|
static String |
CHILD_KEY
|
static String |
PARENT_KEY
|
Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
DEFAULT_VALUE_TYPE |
Constructor Summary | |
---|---|
CascadingSelectCFType(OptionsManager optionsManager,
CustomFieldValuePersister customFieldValuePersister,
GenericConfigManager genericConfigManager,
JiraBaseUrls jiraBaseUrls)
|
Method Summary | |
---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(Map<String,Option> o1,
Map<String,Option> o2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
int |
compareOption(Option option1,
Option option2)
|
void |
createValue(CustomField field,
Issue issue,
Map<String,Option> cascadingOptions)
Create a cascading select-list instance for an issue. |
String |
getChangelogValue(CustomField field,
Map<String,Option> cascadingOptions)
Returns a values to be stored in the change log, example is the id of the changed item. |
List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
Map<String,Option> |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
FieldTypeInfo |
getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field. |
Set<Long> |
getIssueIdsWithValue(CustomField field,
Option option)
Returns a list of Issue Ids matching the "value" note that the value in this instance is the single object |
JsonData |
getJsonDefaultValue(IssueContext issueCtx,
CustomField field)
Return The default data for this system field. |
FieldJsonRepresentation |
getJsonFromIssue(CustomField field,
Issue issue,
boolean renderedVersionRequested,
FieldLayoutItem fieldLayoutItem)
Return a JsonData representation of the field value |
JsonType |
getJsonSchema(CustomField customField)
Return a description of the shape of this field when represented as JSON. |
Options |
getOptions(FieldConfig fieldConfig,
JiraContextNode jiraContextNode)
Returns all possible Options for this field. |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
RestFieldOperationsHandler |
getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field. |
Option |
getSingularObjectFromString(String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(Option optionObject)
Returns the String representation of a single value within the CustomFieldType. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
Map<String,Option> |
getValueFromCustomFieldParams(CustomFieldParams relevantParams)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings. |
Map<String,Option> |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Transport Object representing the current CustomField value for the given issue. |
Map<String,Object> |
getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
The custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers). |
Set<Long> |
remove(CustomField field)
Performs additional tasks when an entire CustomField of this type is being removed CustomField.remove() . |
void |
removeValue(CustomField field,
Issue issue,
Option option)
Perform any actions required if the option selected by the issue is removed. |
void |
setDefaultValue(FieldConfig fieldConfig,
Map<String,Option> cascadingOptions)
Sets the default value for a Custom Field |
void |
updateValue(CustomField field,
Issue issue,
Map<String,Option> cascadingOptions)
Upadte the value for this Custom Field in a particular issue currently stored in the database. |
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the CustomFieldParams of Strings is a valid representation of the Custom Field values. |
Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
---|
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, init, isRenderable, valuesEqual |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
---|
availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, init, isRenderable, valuesEqual |
Field Detail |
---|
public static final String PARENT_KEY
public static final String CHILD_KEY
public static final PersistenceFieldType CASCADE_VALUE_TYPE
Constructor Detail |
---|
public CascadingSelectCFType(OptionsManager optionsManager, CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, JiraBaseUrls jiraBaseUrls)
Method Detail |
---|
public void removeValue(CustomField field, Issue issue, Option option)
MultipleSettableCustomFieldType
removeValue
in interface MultipleSettableCustomFieldType<Map<String,Option>,Option>
field
- being editedissue
- to remove stuff fromoption
- option being removed.public Set<Long> remove(CustomField field)
CustomFieldType
CustomField.remove()
.
This includes removal of values & options.
remove
in interface CustomFieldType<Map<String,Option>,Option>
field
- The custom field that is being removed, so any data stored for
any issues for that field can be deleted.
Set
of issue ids that has been affectedpublic Options getOptions(FieldConfig fieldConfig, JiraContextNode jiraContextNode)
MultipleCustomFieldType
getOptions
in interface MultipleCustomFieldType<Map<String,Option>,Option>
fieldConfig
- configuration for this fieldjiraContextNode
- context
public Set<Long> getIssueIdsWithValue(CustomField field, Option option)
getIssueIdsWithValue
in interface MultipleSettableCustomFieldType<Map<String,Option>,Option>
field
- the CustomField to search onoption
- the Object representing a single value to search on.
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config)
CustomFieldType
CustomFieldParams
of Strings is a valid representation of the Custom Field values.
Any errors should be added to the ErrorCollection
under the appropriate key as required.
validateFromParams
in interface CustomFieldType<Map<String,Option>,Option>
relevantParams
- parameter object of StringserrorCollectionToAddTo
- errorCollection to which any erros should be added (never null)config
- FieldConfigpublic void createValue(CustomField field, Issue issue, Map<String,Option> cascadingOptions)
createValue
in interface CustomFieldType<Map<String,Option>,Option>
cascadingOptions
- field
- CustomField
for which the value is being storedissue
- The Issue
to be stored against.public void updateValue(CustomField field, Issue issue, Map<String,Option> cascadingOptions)
CustomFieldType
updateValue
in interface CustomFieldType<Map<String,Option>,Option>
field
- CustomField
for which the value is being storedissue
- The Issue
to be stored against.cascadingOptions
- Transport Object representing the value instance of the CustomField.public Map<String,Option> getValueFromIssue(CustomField field, Issue issue)
CustomFieldType
getValueFromIssue
in interface CustomFieldType<Map<String,Option>,Option>
field
- Custom field for which to retrieve the valueissue
- Issue from which to retrieve the value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
public Map<String,Option> getValueFromCustomFieldParams(CustomFieldParams relevantParams) throws FieldValidationException
CustomFieldType
getValueFromCustomFieldParams
in interface CustomFieldType<Map<String,Option>,Option>
relevantParams
- CustomFieldParams of String objects. Will contain one value for Singular field types.
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
, CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, T)
FieldValidationException
- if the String value fails to convert into ObjectsCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
,
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)
,
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)
public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
getStringValueFromCustomFieldParams
in interface CustomFieldType<Map<String,Option>,Option>
parameters
- - CustomFieldParams containing String values
@Nullable public Map<String,Option> getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
getDefaultValue
in interface CustomFieldType<Map<String,Option>,Option>
fieldConfig
- CustomField for default value
public void setDefaultValue(FieldConfig fieldConfig, Map<String,Option> cascadingOptions)
CustomFieldType
setDefaultValue
in interface CustomFieldType<Map<String,Option>,Option>
fieldConfig
- CustomField for which the default is being storedcascadingOptions
- Transport Object representing the value instance of the CustomFieldpublic String getChangelogValue(CustomField field, Map<String,Option> cascadingOptions)
CustomFieldType
getChangelogValue
in interface CustomFieldType<Map<String,Option>,Option>
field
- CustomField that the value belongs tocascadingOptions
- Transport Object representing the value instance of the CustomField
public String getStringFromSingularObject(Option optionObject)
CustomFieldType
String
representation of a single value within the CustomFieldType. This is the value that
is passed to the presentation tier for editing. For single CustomFieldTypes the Singular Object is
the same as a Transport Object. However, for multi-dimensional CustomFieldTypes, the Singular Object is
the Object contained within the Collection
or Map
getStringFromSingularObject
in interface CustomFieldType<Map<String,Option>,Option>
optionObject
- the object
public Option getSingularObjectFromString(String string) throws FieldValidationException
CustomFieldType
getSingularObjectFromString
in interface CustomFieldType<Map<String,Option>,Option>
string
- the String
FieldValidationException
- if the string is an invalid representation of the Object.@NotNull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldType
FieldConfigItemType
objects. Can not be immutable.
This opens up possibilties for configurable custom fields.
getConfigurationItemTypes
in interface CustomFieldType<Map<String,Option>,Option>
getConfigurationItemTypes
in class AbstractCustomFieldType<Map<String,Option>,Option>
FieldConfigItemType
@NotNull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
CustomFieldType
getVelocityParameters
in interface CustomFieldType<Map<String,Option>,Option>
getVelocityParameters
in class AbstractCustomFieldType<Map<String,Option>,Option>
issue
- The issue currently in context (Note: this will be null in cases like 'default value')field
- CustomFieldfieldLayoutItem
- FieldLayoutItem
Map
of parameters to add to the velocity context, or an empty Map otherwise (never null)public int compare(@NotNull Map<String,Option> o1, @NotNull Map<String,Option> o2, FieldConfig fieldConfig)
SortableCustomField
compare
in interface SortableCustomField<Map<String,Option>>
o1
- Never nullo2
- Never null
public int compareOption(@Nullable Option option1, @Nullable Option option2)
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter
in interface ProjectImportableCustomField
public Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept
in class AbstractCustomFieldType<Map<String,Option>,Option>
public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareCustomFieldType
getFieldTypeInfo
in interface RestAwareCustomFieldType
fieldTypeInfoContext
- context information for generating the FieldTypeInfo
.
public JsonType getJsonSchema(CustomField customField)
RestAwareCustomFieldType
getJsonSchema
in interface RestAwareCustomFieldType
public FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem)
RestAwareCustomFieldType
getJsonFromIssue
in interface RestAwareCustomFieldType
field
- configuration of the current fieldissue
- 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.
public RestFieldOperationsHandler getRestFieldOperation(CustomField field)
RestCustomFieldTypeOperations
getRestFieldOperation
in interface RestCustomFieldTypeOperations
field
- the Custom Field
public JsonData getJsonDefaultValue(IssueContext issueCtx, CustomField field)
RestCustomFieldTypeOperations
getJsonDefaultValue
in interface RestCustomFieldTypeOperations
issueCtx
- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.field
- the Custom Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |