Class MultiUserCFType
java.lang.Object
com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser>
com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType<ApplicationUser>
com.atlassian.jira.issue.customfields.impl.MultiUserCFType
- All Implemented Interfaces:
ProjectImportableCustomField,CustomFieldType<Collection<ApplicationUser>,,ApplicationUser> ExportableCustomFieldType,RestAwareCustomFieldType,RestCustomFieldTypeOperations,UserField,UserCFNotificationTypeAware
- Direct Known Subclasses:
InitialWatchersCFType
public class MultiUserCFType
extends AbstractMultiCFType<ApplicationUser>
implements UserCFNotificationTypeAware, ProjectImportableCustomField, UserField, RestAwareCustomFieldType, RestCustomFieldTypeOperations, ExportableCustomFieldType
Multiple User Type allows selection of multiple users. For single User select use UserCFType
- Transport Object Type
Collection- Singular Object Type
ApplicationUser- Database Storage Type
Stringof user name
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
AbstractCustomFieldType.VisitorBase<X> -
Field Summary
Fields inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
customFieldValuePersister, genericConfigManagerFields inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
DEFAULT_VALUE_TYPE, RESOURCE_PREVIEW -
Constructor Summary
ConstructorsConstructorDescriptionMultiUserCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiUserConverter multiUserConverter, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserSearchService searchService, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls, UserBeanFactory userBeanFactory, GroupManager groupManager, ProjectRoleManager projectRoleManager, SoyTemplateRendererProvider soyTemplateRendererProvider, UserFilterManager userFilterManager, FieldConfigSchemeManager fieldConfigSchemeManager, ProjectManager projectManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected ApplicationUserconvertDbValueToType(Object string) Converts a given db value to Single form of Transport Objectprotected ObjectConverts a given underlying type to its db storage value.getChangelogString(CustomField field, Collection<ApplicationUser> value) Returns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.getChangelogValue(CustomField field, Collection<ApplicationUser> values) Returns a string representation of the value if not null.Returns a List ofFieldConfigItemTypeobjects.protected PersistenceFieldTypeType of database field needed to store this field.getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext) Returns lower level Information about the field.getIndexers(CustomField customField) getJsonDefaultValue(IssueContext issueCtx, CustomField field) Return The default data for this system field.getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, FieldLayoutItem fieldLayoutItem) Return a JsonData representation of the field valuegetJsonSchema(CustomField customField) Return a description of the shape of this field when represented as JSON.Returns an instance ofNonNullCustomFieldProviderthat Jira will use to optimize indexing performance.Returns the object that will perform the actual project import functions for the custom field type.getRepresentationFromIssue(Issue issue, CustomFieldExportContext context) Generates a multi-column representation of a set of multiple usersgetRestFieldOperation(CustomField field) Returns the RestFieldOperationsHandler for this field.Returns a Singular Object, given the string value as passed by the presentation tier.Returns theStringrepresentation of a single value within the CustomFieldType.getStringValueFromCustomFieldParams(CustomFieldParams parameters) Return the String value object from the CustomFieldParams.protected Comparator<ApplicationUser> Returns a comparator for underlying type of this custom field.getValueFromCustomFieldParams(CustomFieldParams parameters) Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.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).voidupdateValue(CustomField customField, Issue issue, Collection<ApplicationUser> value) Update a multi-select value for an issue.voidvalidateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config) Ensures that theCustomFieldParamsof Strings is a valid representation of the Custom Field values.Methods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractMultiCFType
convertDbObjectToTypes, convertTypesToDbObjects, createValue, getDefaultValue, getValueFromIssue, getValueFromIssue, remove, setDefaultValueMethods inherited from class com.atlassian.jira.issue.customfields.impl.AbstractCustomFieldType
assertObjectImplementsType, availableForBulkEdit, getDescription, getDescriptor, getI18nBean, getKey, getName, getVelocityParameters, init, isRenderable, valuesEqualMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.customfields.CustomFieldType
areAllRequiredParametersPresent, getCloneOptionConfiguration, getCloneValue, isUserInputRequiredForMove, requiresAdditionalParamsMethods inherited from interface com.atlassian.jira.notification.type.UserCFNotificationTypeAware
getValueFromIssue
-
Constructor Details
-
MultiUserCFType
public MultiUserCFType(CustomFieldValuePersister customFieldValuePersister, GenericConfigManager genericConfigManager, MultiUserConverter multiUserConverter, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserSearchService searchService, FieldVisibilityManager fieldVisibilityManager, JiraBaseUrls jiraBaseUrls, UserBeanFactory userBeanFactory, GroupManager groupManager, ProjectRoleManager projectRoleManager, SoyTemplateRendererProvider soyTemplateRendererProvider, UserFilterManager userFilterManager, FieldConfigSchemeManager fieldConfigSchemeManager, ProjectManager projectManager, FeatureManager featureManager)
-
-
Method Details
-
getTypeComparator
Description copied from class:AbstractMultiCFTypeReturns a comparator for underlying type of this custom field. Used e.g. for sorting values retrieved from the Database- Specified by:
getTypeComparatorin classAbstractMultiCFType<ApplicationUser>- Returns:
- a comparator, null if can't be compared without extra context
-
updateValue
Description copied from class:AbstractMultiCFTypeUpdate a multi-select value for an issue.- Specified by:
updateValuein interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Overrides:
updateValuein classAbstractMultiCFType<ApplicationUser>- Parameters:
customField-CustomFieldfor which the value is being storedissue- TheIssue.value- Transport Object representing the value instance of the CustomField.- See Also:
-
getChangelogValue
Description copied from class:AbstractMultiCFTypeReturns a string representation of the value if not null.- Specified by:
getChangelogValuein interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Overrides:
getChangelogValuein classAbstractMultiCFType<ApplicationUser>- Parameters:
field- not usedvalues- value to create a change log for- Returns:
- string representaion of value if not null, empty string otherwise
-
getChangelogString
Description copied from interface:CustomFieldTypeReturns a String of representing values to be stored in the change log, an example is the name of a version field that a version id will resolve to within JIRA.- Specified by:
getChangelogStringin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Overrides:
getChangelogStringin classAbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
field- CustomField that the value belongs tovalue- Transport Object representing the value instance of the CustomField- Returns:
- Change log string.
-
getValueFromCustomFieldParams
public Collection<ApplicationUser> getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException Description copied from interface:CustomFieldTypeRetrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.- Specified by:
getValueFromCustomFieldParamsin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
parameters- CustomFieldParams of String objects. Will contain one value for Singular field types.- Returns:
- Transport Object matching the Object parameter of
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) - Throws:
FieldValidationException- if the String value fails to convert into Objects- See Also:
-
getStringValueFromCustomFieldParams
Description copied from interface:CustomFieldTypeReturn the String value object from the CustomFieldParams. The object may be a single String (e.g. TextCFType, List of Strings (e.g. MultiSelectCFType) or CustomFieldParams of Strings (e.g. CascadingSelectCFType). Among other things these values are passed to Velocity for rendering edit screens.- Specified by:
getStringValueFromCustomFieldParamsin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
parameters- - CustomFieldParams containing String values- Returns:
- String value object from the CustomFieldParams
-
validateFromParams
public void validateFromParams(CustomFieldParams relevantParams, ErrorCollection errorCollectionToAddTo, FieldConfig config) Description copied from interface:CustomFieldTypeEnsures that theCustomFieldParamsof Strings is a valid representation of the Custom Field values. Any errors should be added to theErrorCollectionunder the appropriate key as required.- Specified by:
validateFromParamsin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
relevantParams- parameter object of StringserrorCollectionToAddTo- errorCollection to which any errors should be added (never null)config- FieldConfig
-
getStringFromSingularObject
Description copied from interface:CustomFieldTypeReturns theStringrepresentation 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 theCollectionorMap- Specified by:
getStringFromSingularObjectin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
o- the object- Returns:
- String representation of the Object
-
getSingularObjectFromString
Description copied from interface:CustomFieldTypeReturns a Singular Object, given the string value as passed by the presentation tier. Throws FieldValidationException if the string is an invalid representation of the Object.- Specified by:
getSingularObjectFromStringin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
s- the String- Returns:
- singularObject instance
- Throws:
FieldValidationException- if the string is an invalid representation of the Object.
-
getDatabaseType
Description copied from class:AbstractMultiCFTypeType of database field needed to store this field.- Specified by:
getDatabaseTypein classAbstractMultiCFType<ApplicationUser>- Returns:
- One of the predefined
PersistenceFieldTypetypes.
-
getIndexers
- Specified by:
getIndexersin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
customField- the custom field to get the indexers of.- Returns:
- List of instantiated and initialised
FieldIndexerobjects. Return an empty list if none available.
-
convertTypeToDbValue
Description copied from class:AbstractMultiCFTypeConverts a given underlying type to its db storage value. Must be compatable withPersistenceFieldTypereturned byAbstractMultiCFType.getDatabaseType()- Specified by:
convertTypeToDbValuein classAbstractMultiCFType<ApplicationUser>- Parameters:
value- Single form of Transport Object- Returns:
- database representation of given Transport Object.
-
convertDbValueToType
Description copied from class:AbstractMultiCFTypeConverts a given db value to Single form of Transport Object- Specified by:
convertDbValueToTypein classAbstractMultiCFType<ApplicationUser>- Parameters:
string- db representation as returned byAbstractMultiCFType.convertTypeToDbValue(Object)- Returns:
- Single form of Transport Object
-
getVelocityParameters
@Nonnull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem) Description copied from interface:CustomFieldTypeThe custom field may wish to pass parameters to the velocity context beyond the getValueFromIssue methods (eg managers).The values are added to the context for all velocity views (edit, search, view, xml)
- Specified by:
getVelocityParametersin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Overrides:
getVelocityParametersin classAbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Parameters:
issue- The issue currently in context (Note: this will be null in cases like 'default value')field- CustomFieldfieldLayoutItem- FieldLayoutItem- Returns:
- A
Mapof parameters to add to the velocity context, or an empty Map otherwise (never null)
-
getRepresentationFromIssue
Generates a multi-column representation of a set of multiple users- Specified by:
getRepresentationFromIssuein interfaceExportableCustomFieldType- Parameters:
issue- to get the representation forcontext- which contains information such as the i18nHelper and field- Returns:
- CustomFieldCsvRepresentation of the field
-
getProjectImporter
Description copied from interface:ProjectImportableCustomFieldReturns the object that will perform the actual project import functions for the custom field type.- Specified by:
getProjectImporterin interfaceProjectImportableCustomField- Returns:
- the object that will perform the actual project import functions for the custom field type.
-
getNonNullCustomFieldProvider
Description copied from interface:CustomFieldTypeReturns an instance ofNonNullCustomFieldProviderthat Jira will use to optimize indexing performance.- Specified by:
getNonNullCustomFieldProviderin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser>
-
getConfigurationItemTypes
Description copied from interface:CustomFieldTypeReturns a List ofFieldConfigItemTypeobjects. Can not be immutable. This opens up possibilities for configurable custom fields.- Specified by:
getConfigurationItemTypesin interfaceCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Overrides:
getConfigurationItemTypesin classAbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser> - Returns:
- List of
FieldConfigItemType
-
accept
- Overrides:
acceptin classAbstractMultiCFType<ApplicationUser>
-
getFieldTypeInfo
Description copied from interface:RestAwareCustomFieldTypeReturns lower level Information about the field. This information contains allowed values and/or the autocomplete url- Specified by:
getFieldTypeInfoin interfaceRestAwareCustomFieldType- Parameters:
fieldTypeInfoContext- context information for generating theFieldTypeInfo.- Returns:
- Low level information about the field.
-
getJsonSchema
Description copied from interface:RestAwareCustomFieldTypeReturn a description of the shape of this field when represented as JSON.- Specified by:
getJsonSchemain interfaceRestAwareCustomFieldType- Parameters:
customField-
-
getJsonFromIssue
public FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem) Description copied from interface:RestAwareCustomFieldTypeReturn a JsonData representation of the field value- Specified by:
getJsonFromIssuein interfaceRestAwareCustomFieldType- Parameters:
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.- Returns:
- FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.
-
getRestFieldOperation
Description copied from interface:RestCustomFieldTypeOperationsReturns the RestFieldOperationsHandler for this field.- Specified by:
getRestFieldOperationin interfaceRestCustomFieldTypeOperations- Parameters:
field- the Custom Field- Returns:
- the RestFieldOperationsHandler for this field.
-
getJsonDefaultValue
Description copied from interface:RestCustomFieldTypeOperationsReturn The default data for this system field. May be null if there is no default.- Specified by:
getJsonDefaultValuein interfaceRestCustomFieldTypeOperations- Parameters:
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- Returns:
- The default data for this system field.
-