|
||||||||||
| 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<Set<Label>,Label>
com.atlassian.jira.issue.customfields.impl.LabelsCFType
public class LabelsCFType
Labels Custom field
Set of LabelsLabelLabelManager.setLabels(com.atlassian.crowd.embedded.api.User, Long, Long, java.util.Set, boolean, boolean)
| Nested Class Summary | |
|---|---|
static interface |
LabelsCFType.Visitor<T>
|
| Nested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
|---|
AbstractCustomFieldType.VisitorBase<X> |
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.jira.imports.project.parser.CustomFieldValueParser |
|---|
CUSTOM_FIELD_VALUE_ENTITY_NAME |
| Fields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType |
|---|
DEFAULT_VALUE_TYPE |
| Constructor Summary | |
|---|---|
LabelsCFType(JiraAuthenticationContext authenticationContext,
IssueManager issueManager,
GenericConfigManager genericConfigManager,
LabelUtil labelUtil,
LabelManager labelManager,
ProjectImportLabelFieldParser projectImportableCustomFieldParser,
JiraBaseUrls jiraBaseUrls)
|
|
| Method Summary | |
|---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor)
|
int |
compare(Set<Label> customFieldObjectValue1,
Set<Label> customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects. |
void |
createValue(CustomField field,
Issue issue,
Set<Label> value)
Save the value for this Custom Field in a particular issue to the database. |
String |
getChangelogValue(CustomField field,
Set<Label> value)
Returns a values to be stored in the change log, example is the id of the changed item. |
Set<Label> |
getDefaultValue(FieldConfig fieldConfig)
Retrieves the Object representing the default CustomField value for the Custom Field. |
String |
getEntityName()
The table name of the ofbiz entity (read database table) in which the custom field values for this custom field type are persisted |
EntityRepresentation |
getEntityRepresentation(ExternalCustomFieldValue customFieldValue)
Gets an EntityRepresentation that contains the correct attributes based on the populated fields in the provided custom field value. |
FieldTypeInfo |
getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field. |
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. |
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. |
Label |
getSingularObjectFromString(String string)
Returns a Singular Object, given the string value as passed by the presentation tier. |
String |
getStringFromSingularObject(Label singularObject)
Returns the String representation of a single value within the CustomFieldType. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams. |
Set<Label> |
getValueFromCustomFieldParams(CustomFieldParams customFieldParams)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings. |
Set<Label> |
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). |
ExternalCustomFieldValue |
parse(Map attributes)
Parses the custom field value data from the backup XML. |
Set<Long> |
remove(CustomField field)
Performs additional tasks when an entire CustomField of this type is being removed CustomField.remove(). |
void |
setDefaultValue(FieldConfig fieldConfig,
Set<Label> value)
Sets the default value for a Custom Field |
void |
updateValue(CustomField field,
Issue issue,
Set<Label> value)
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. |
boolean |
valuesEqual(Set<Label> oldLabels,
Set<Label> newLabels)
Used to compare 2 field values and work out whether a change item should be generated |
| Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType |
|---|
assertObjectImplementsType, availableForBulkEdit, getChangelogString, getConfigurationItemTypes, getDescription, getDescriptor, getI18nBean, getKey, getName, getRelatedIndexers, getVelocityParameters, init, isRenderable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LabelsCFType(JiraAuthenticationContext authenticationContext,
IssueManager issueManager,
GenericConfigManager genericConfigManager,
LabelUtil labelUtil,
LabelManager labelManager,
ProjectImportLabelFieldParser projectImportableCustomFieldParser,
JiraBaseUrls jiraBaseUrls)
| Method Detail |
|---|
@NotNull
public Map<String,Object> getVelocityParameters(Issue issue,
CustomField field,
FieldLayoutItem fieldLayoutItem)
CustomFieldType
getVelocityParameters in interface CustomFieldType<Set<Label>,Label>getVelocityParameters in class AbstractCustomFieldType<Set<Label>,Label>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 Set<Label> getValueFromIssue(CustomField field,
Issue issue)
CustomFieldType
getValueFromIssue in interface CustomFieldType<Set<Label>,Label>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 Set<Label> getDefaultValue(FieldConfig fieldConfig)
CustomFieldType
getDefaultValue in interface CustomFieldType<Set<Label>,Label>fieldConfig - CustomField for default value
public void setDefaultValue(FieldConfig fieldConfig,
Set<Label> value)
CustomFieldType
setDefaultValue in interface CustomFieldType<Set<Label>,Label>fieldConfig - CustomField for which the default is being storedvalue - Transport Object representing the value instance of the CustomField
public String getChangelogValue(CustomField field,
Set<Label> value)
CustomFieldType
getChangelogValue in interface CustomFieldType<Set<Label>,Label>field - CustomField that the value belongs tovalue - Transport Object representing the value instance of the CustomField
public String getStringFromSingularObject(Label singularObject)
CustomFieldTypeString 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<Set<Label>,Label>singularObject - the object
public Label getSingularObjectFromString(String string)
throws FieldValidationException
CustomFieldType
getSingularObjectFromString in interface CustomFieldType<Set<Label>,Label>string - the String
FieldValidationException - if the string is an invalid representation of the Object.public Set<Long> remove(CustomField field)
CustomFieldTypeCustomField.remove().
This includes removal of values & options.
remove in interface CustomFieldType<Set<Label>,Label>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 affected
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 CustomFieldType<Set<Label>,Label>relevantParams - parameter object of StringserrorCollectionToAddTo - errorCollection to which any erros should be added (never null)config - FieldConfig
public void createValue(CustomField field,
Issue issue,
Set<Label> value)
CustomFieldType
createValue in interface CustomFieldType<Set<Label>,Label>field - CustomField for which the value is being storedissue - The Issue to be stored against.value - Transport Object representing the value instance of the CustomField.
public void updateValue(CustomField field,
Issue issue,
Set<Label> value)
CustomFieldType
updateValue in interface CustomFieldType<Set<Label>,Label>field - CustomField for which the value is being storedissue - The Issue to be stored against.value - Transport Object representing the value instance of the CustomField.
public Set<Label> getValueFromCustomFieldParams(CustomFieldParams customFieldParams)
throws FieldValidationException
CustomFieldType
getValueFromCustomFieldParams in interface CustomFieldType<Set<Label>,Label>customFieldParams - 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<Set<Label>,Label>parameters - - CustomFieldParams containing String values
public int compare(@NotNull
Set<Label> customFieldObjectValue1,
@NotNull
Set<Label> customFieldObjectValue2,
FieldConfig fieldConfig)
SortableCustomField
compare in interface SortableCustomField<Set<Label>>customFieldObjectValue1 - Never nullcustomFieldObjectValue2 - Never null
public String getEntityName()
ProjectImportableCustomFieldParser
getEntityName in interface ProjectImportableCustomFieldParser
public ExternalCustomFieldValue parse(Map attributes)
throws ParseException
CustomFieldValueParser
parse in interface CustomFieldValueParserattributes - is a map of key value pairs that represent the attributes of an ExternalCustomFieldValue. The following
attributes are required, otherwise a ParseException will be thrown:ParseException - if the required fields are not found in the attributes mappublic EntityRepresentation getEntityRepresentation(ExternalCustomFieldValue customFieldValue)
CustomFieldValueParser
getEntityRepresentation in interface CustomFieldValueParsercustomFieldValue - contains the populated fields that will end up in the EntityRepresentations map
public ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomField
getProjectImporter in interface ProjectImportableCustomField
public boolean valuesEqual(Set<Label> oldLabels,
Set<Label> newLabels)
CustomFieldType
valuesEqual in interface CustomFieldType<Set<Label>,Label>valuesEqual in class AbstractCustomFieldType<Set<Label>,Label>oldLabels - current valuenewLabels - new value
public Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept in class AbstractCustomFieldType<Set<Label>,Label>public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareCustomFieldType
getFieldTypeInfo in interface RestAwareCustomFieldTypefieldTypeInfoContext - 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 RestAwareCustomFieldTypefield - 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 RestCustomFieldTypeOperationsfield - the Custom Field
public JsonData getJsonDefaultValue(IssueContext issueCtx,
CustomField field)
RestCustomFieldTypeOperations
getJsonDefaultValue in interface RestCustomFieldTypeOperationsissueCtx - 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 | |||||||||