|
||||||||||
| 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
com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType
com.atlassian.jira.issue.customfields.impl.CascadingSelectCFType
public class CascadingSelectCFType
Cascading Select Custom Field Type allows for multiple dependent select lists.
CustomFieldParams The key in the CustomFieldParams object 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
| Field Summary | |
|---|---|
static PersistenceFieldType |
CASCADE_VALUE_TYPE
|
static String |
CHILD_KEY
|
static String |
PARENT_KEY
|
| Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiSettableCFType |
|---|
customFieldValuePersister, genericConfigManager, optionsManager |
| Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
|---|
DEFAULT_VALUE_TYPE |
| Constructor Summary | |
|---|---|
CascadingSelectCFType(OptionsManager optionsManager,
CustomFieldValuePersister customFieldValuePersister,
GenericConfigManager genericConfigManager)
|
|
| Method Summary | |
|---|---|
int |
compare(Object o1,
Object o2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
int |
compareOption(Option option1,
Option option2)
|
void |
createValue(CustomField field,
Issue issue,
Object value)
Create a cascading select-list instance for an issue. |
String |
getChangelogValue(CustomField field,
Object value)
Returns a values to be stored in the change log, example is the id of the changed item. |
List |
getConfigurationItemTypes()
Returns a List of FieldConfigItemType objects. |
Object |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
Set |
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 |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type. |
Object |
getSingularObjectFromString(String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(Object optionObject)
Returns the String representation of a single value within the CustomFieldType. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
Object |
getValueFromCustomFieldParams(CustomFieldParams relevantParams)
Retrieves the Object representing the CustomField value instance from the CustomFieldParams of Strings. |
Object |
getValueFromIssue(CustomField field,
Issue issue)
Retrieves the Object representing the current CustomField value for the given issue. |
Map |
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). |
void |
removeValue(CustomField field,
Issue issue,
Option option)
|
void |
setDefaultValue(FieldConfig fieldConfig,
Object value)
Sets the default value for a Custom Field |
void |
updateValue(CustomField field,
Issue issue,
Object value)
|
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.AbstractMultiSettableCFType |
|---|
getOptions, remove |
| 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.MultipleCustomFieldType |
|---|
getOptions |
| Methods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
|---|
availableForBulkEdit, getChangelogString, getDescription, getDescriptor, getKey, getName, getRelatedIndexers, init, isRenderable, remove, 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)
| Method Detail |
|---|
public void validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
CustomFieldTypeCustomFieldParams 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 CustomFieldTyperelevantParams - parameter object of StringserrorCollectionToAddTo - errorCollection to which any erros should be added (never null)config - FieldConfig
public void createValue(CustomField field,
Issue issue,
Object value)
createValue in interface CustomFieldTypevalue - Must be a CustomFieldParams, or the method has no effect.
public void updateValue(CustomField field,
Issue issue,
Object value)
updateValue in interface CustomFieldType
public void removeValue(CustomField field,
Issue issue,
Option option)
removeValue in interface MultipleSettableCustomFieldType
public Object getValueFromIssue(CustomField field,
Issue issue)
CustomFieldTypeCustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams) for more detailed notes.
getValueFromIssue in interface CustomFieldTypefield - 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, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)CustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams)
public Object getValueFromCustomFieldParams(CustomFieldParams relevantParams)
throws FieldValidationException
CustomFieldTypeCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)) and Object returned from CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue).
getValueFromCustomFieldParams in interface CustomFieldTyperelevantParams - 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, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
FieldValidationException - if the String value fails to convert into ObjectsCustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object),
CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object),
CustomFieldType.getValueFromIssue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue)public Object getStringValueFromCustomFieldParams(CustomFieldParams parameters)
CustomFieldType
getStringValueFromCustomFieldParams in interface CustomFieldTypeparameters - - CustomFieldParams containing String values
public Object getDefaultValue(FieldConfig fieldConfig)
CustomFieldTypeCustomFieldType.getValueFromCustomFieldParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams) for more detailed notes.
getDefaultValue in interface CustomFieldTypefieldConfig - CustomField for default value
CustomFieldType.createValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object), CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, java.lang.Object)
public void setDefaultValue(FieldConfig fieldConfig,
Object value)
CustomFieldType
setDefaultValue in interface CustomFieldTypefieldConfig - CustomField for which the default is being storedvalue - Transport Object representing the value instance of the CustomField
public String getChangelogValue(CustomField field,
Object value)
CustomFieldType
getChangelogValue in interface CustomFieldTypefield - CustomField that the value belongs tovalue - Transport Object representing the value instance of the CustomField
public Set getIssueIdsWithValue(CustomField field,
Option option)
getIssueIdsWithValue in interface MultipleSettableCustomFieldTypefield - option -
public String getStringFromSingularObject(Object optionObject)
CustomFieldTypeString representation of a single value within the CustomFieldType. This is the value that
will 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 CustomFieldParams
getStringFromSingularObject in interface CustomFieldTypeoptionObject - the object
public Object getSingularObjectFromString(String string)
throws FieldValidationException
CustomFieldType
getSingularObjectFromString in interface CustomFieldTypestring - the String
FieldValidationException - if the string is an invalid representation of the Object.public List getConfigurationItemTypes()
CustomFieldTypeFieldConfigItemType objects.
This opens up possibilties for configurable custom fields
getConfigurationItemTypes in interface CustomFieldTypegetConfigurationItemTypes in class AbstractCustomFieldTypeFieldConfigItemType
public Map getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
CustomFieldType
getVelocityParameters in interface CustomFieldTypegetVelocityParameters in class AbstractCustomFieldTypeissue - 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(Object o1,
Object o2,
FieldConfig fieldConfig)
SortableCustomField
compare in interface SortableCustomFieldo1 - Never nullo2 - Never null
public int compareOption(Option option1,
Option option2)
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter in interface ProjectImportableCustomField
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||