public class MultiUserCFType extends AbstractMultiCFType<ApplicationUser> implements UserCFNotificationTypeAware, ProjectImportableCustomField, UserField, SortableCustomField<String>, RestAwareCustomFieldType, RestCustomFieldTypeOperations, ExportableCustomFieldType
Multiple User Type allows selection of multiple users. For single User select use UserCFType
CollectionApplicationUserString of user name| Modifier and Type | Class and Description |
|---|---|
static interface |
MultiUserCFType.Visitor<T> |
AbstractCustomFieldType.VisitorBase<X>customFieldValuePersister, genericConfigManagerDEFAULT_VALUE_TYPE, RESOURCE_PREVIEW| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
Object |
accept(AbstractCustomFieldType.VisitorBase visitor) |
int |
compare(String customFieldObjectValue1,
String customFieldObjectValue2,
FieldConfig fieldConfig)
Compares the two custom field objects.
|
protected ApplicationUser |
convertDbValueToType(Object string)
Converts a given db value to Single form of Transport Object
|
protected Object |
convertTypeToDbValue(ApplicationUser value)
Converts a given underlying type to its db storage value.
|
String |
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.
|
String |
getChangelogValue(CustomField field,
Collection<ApplicationUser> values)
Returns a string representation of the value if not null.
|
List<FieldConfigItemType> |
getConfigurationItemTypes()
Returns a List of
FieldConfigItemType objects. |
protected PersistenceFieldType |
getDatabaseType()
Type of database field needed to store this field.
|
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.
|
NonNullCustomFieldProvider |
getNonNullCustomFieldProvider()
Returns an instance of
NonNullCustomFieldProvider that Jira will use to optimize indexing performance. |
ProjectCustomFieldImporter |
getProjectImporter()
Returns the object that will perform the actual project import functions for the custom field type.
|
List<FieldIndexer> |
getRelatedIndexers(CustomField customField)
Returns a list of indexers that will be used for the field.
|
FieldExportParts |
getRepresentationFromIssue(Issue issue,
CustomFieldExportContext context)
Generates a multi-column representation of a set of multiple users
|
RestFieldOperationsHandler |
getRestFieldOperation(CustomField field)
Returns the RestFieldOperationsHandler for this field.
|
ApplicationUser |
getSingularObjectFromString(String s)
Returns a Singular Object, given the string value as passed by the presentation tier.
|
String |
getStringFromSingularObject(ApplicationUser o)
Returns the
String representation of a single value within the CustomFieldType. |
Object |
getStringValueFromCustomFieldParams(CustomFieldParams parameters)
Return the String value object from the CustomFieldParams.
|
protected Comparator<ApplicationUser> |
getTypeComparator()
Returns a comparator for underlying type of this custom field.
|
Collection<ApplicationUser> |
getValueFromCustomFieldParams(CustomFieldParams parameters)
Retrieves the Transport Object representing the CustomField value instance from the CustomFieldParams of Strings.
|
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).
|
void |
updateValue(CustomField customField,
Issue issue,
Collection<ApplicationUser> value)
Update a multi-select value for an issue.
|
void |
validateFromParams(CustomFieldParams relevantParams,
ErrorCollection errorCollectionToAddTo,
FieldConfig config)
Ensures that the
CustomFieldParams of Strings is a valid representation of the Custom Field values. |
convertDbObjectToTypes, convertTypesToDbObjects, createValue, getDefaultValue, getValueFromIssue, getValueFromIssue, remove, setDefaultValueassertObjectImplementsType, availableForBulkEdit, getDescription, getDescriptor, getI18nBean, getKey, getName, getVelocityParameters, init, isRenderable, valuesEqualclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetValueFromIssuegetCloneOptionConfiguration, getCloneValue, getNonnullCustomFieldProvider, isUserInputRequiredForMovepublic 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)
protected Comparator<ApplicationUser> getTypeComparator()
AbstractMultiCFTypegetTypeComparator in class AbstractMultiCFType<ApplicationUser>public void updateValue(CustomField customField, Issue issue, Collection<ApplicationUser> value)
AbstractMultiCFTypeupdateValue in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>updateValue in class AbstractMultiCFType<ApplicationUser>customField - CustomField for which the value is being storedissue - The Issue.value - Transport Object representing the value instance of the CustomField.CustomFieldType.updateValue(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.Issue, Object)public String getChangelogValue(CustomField field, Collection<ApplicationUser> values)
AbstractMultiCFTypegetChangelogValue in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>getChangelogValue in class AbstractMultiCFType<ApplicationUser>field - not usedvalues - value to create a change log forpublic String getChangelogString(CustomField field, Collection<ApplicationUser> value)
CustomFieldTypegetChangelogString in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>getChangelogString in class AbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser>field - CustomField that the value belongs tovalue - Transport Object representing the value instance of the CustomFieldpublic Collection<ApplicationUser> getValueFromCustomFieldParams(CustomFieldParams parameters) throws FieldValidationException
CustomFieldTypegetValueFromCustomFieldParams in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>parameters - 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)
CustomFieldTypegetStringValueFromCustomFieldParams in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>parameters - - CustomFieldParams containing String valuespublic 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<Collection<ApplicationUser>,ApplicationUser>relevantParams - parameter object of StringserrorCollectionToAddTo - errorCollection to which any errors should be added (never null)config - FieldConfigpublic String getStringFromSingularObject(ApplicationUser o)
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 MapgetStringFromSingularObject in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>o - the objectpublic ApplicationUser getSingularObjectFromString(String s) throws FieldValidationException
CustomFieldTypegetSingularObjectFromString in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>s - the StringFieldValidationException - if the string is an invalid representation of the Object.@Nonnull protected PersistenceFieldType getDatabaseType()
AbstractMultiCFTypegetDatabaseType in class AbstractMultiCFType<ApplicationUser>PersistenceFieldType types.public List<FieldIndexer> getRelatedIndexers(CustomField customField)
CustomFieldTypegetRelatedIndexers in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>getRelatedIndexers in class AbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser>customField - the custom field to get the related indexers of.FieldIndexer objects. Null if no related indexers.protected Object convertTypeToDbValue(ApplicationUser value)
AbstractMultiCFTypePersistenceFieldType returned by AbstractMultiCFType.getDatabaseType()convertTypeToDbValue in class AbstractMultiCFType<ApplicationUser>value - Single form of Transport Objectprotected ApplicationUser convertDbValueToType(Object string)
AbstractMultiCFTypeconvertDbValueToType in class AbstractMultiCFType<ApplicationUser>string - db representation as returned by AbstractMultiCFType.convertTypeToDbValue(Object)@Nonnull public Map<String,Object> getVelocityParameters(Issue issue, CustomField field, FieldLayoutItem fieldLayoutItem)
CustomFieldTypeThe values are added to the context for all velocity views (edit, search, view, xml)
getVelocityParameters in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>getVelocityParameters in class AbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser>issue - The issue currently in context (Note: this will be null in cases like 'default value')field - CustomFieldfieldLayoutItem - FieldLayoutItemMap of parameters to add to the velocity context, or an empty Map otherwise (never null)public FieldExportParts getRepresentationFromIssue(Issue issue, CustomFieldExportContext context)
getRepresentationFromIssue in interface ExportableCustomFieldTypeissue - to get the representation forcontext - which contains information such as the i18nHelper and fieldpublic ProjectCustomFieldImporter getProjectImporter()
ProjectImportableCustomFieldgetProjectImporter in interface ProjectImportableCustomFieldpublic NonNullCustomFieldProvider getNonNullCustomFieldProvider()
CustomFieldTypeNonNullCustomFieldProvider that Jira will use to optimize indexing performance.getNonNullCustomFieldProvider in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>public int compare(@Nonnull String customFieldObjectValue1, @Nonnull String customFieldObjectValue2, FieldConfig fieldConfig)
SortableCustomFieldcompare in interface SortableCustomField<String>customFieldObjectValue1 - Never nullcustomFieldObjectValue2 - Never null@Nonnull public List<FieldConfigItemType> getConfigurationItemTypes()
CustomFieldTypeFieldConfigItemType objects. Can not be immutable.
This opens up possibilities for configurable custom fields.getConfigurationItemTypes in interface CustomFieldType<Collection<ApplicationUser>,ApplicationUser>getConfigurationItemTypes in class AbstractCustomFieldType<Collection<ApplicationUser>,ApplicationUser>FieldConfigItemTypepublic Object accept(AbstractCustomFieldType.VisitorBase visitor)
accept in class AbstractMultiCFType<ApplicationUser>public FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
RestAwareCustomFieldTypegetFieldTypeInfo in interface RestAwareCustomFieldTypefieldTypeInfoContext - context information for generating the FieldTypeInfo.public JsonType getJsonSchema(CustomField customField)
RestAwareCustomFieldTypegetJsonSchema in interface RestAwareCustomFieldTypepublic FieldJsonRepresentation getJsonFromIssue(CustomField field, Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem)
RestAwareCustomFieldTypegetJsonFromIssue 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)
RestCustomFieldTypeOperationsgetRestFieldOperation in interface RestCustomFieldTypeOperationsfield - the Custom Fieldpublic JsonData getJsonDefaultValue(IssueContext issueCtx, CustomField field)
RestCustomFieldTypeOperationsgetJsonDefaultValue 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 FieldCopyright © 2002-2022 Atlassian. All Rights Reserved.