public class DefaultCustomFieldService extends Object implements CustomFieldService
Modifier and Type | Field and Description |
---|---|
static String |
GLOBAL_CONTEXT_TEXT |
Constructor and Description |
---|
DefaultCustomFieldService(GlobalPermissionManager permissionManager,
CustomFieldManager customFieldManager,
PermissionSchemeManager permissionSchemeManager,
IssueSecuritySchemeManager issueSecuritySchemeManager,
CustomFieldValidator customFieldValidator,
I18nHelper.BeanFactory i18nFactory,
ProjectManager projectManager,
CustomFieldContextConfigHelper customFieldContextConfigHelper,
ReindexMessageManager reindexMessageManager,
ConstantsManager constantManager,
FieldScreenManager fieldScreenManager,
LocaleManager localeManager,
TranslationManager translationManager,
ManagedConfigurationItemService managedConfigurationItemService) |
Modifier and Type | Method and Description |
---|---|
ServiceOutcomeImpl<List<Long>> |
addToScreenTabs(ApplicationUser user,
Long customFieldId,
List<Long> tabIds)
Adds a custom field with the given id to selected tabs.
|
ServiceOutcome<CustomField> |
create(CreateValidationResult createValidationResult)
Creates a custom field using a
CreateValidationResult as parameter. |
ServiceOutcomeImpl<List<CustomField>> |
findCustomFields(ApplicationUser user,
String searchString,
List<String> types,
List<String> projects,
List<String> screens,
String sortOrder,
String sortColumn,
Long lastValueUpdate)
Returns filtered list of customfields
|
ServiceOutcome<CustomField> |
getCustomFieldForEditConfig(ApplicationUser user,
String fieldId)
Return the custom field if the passed user has permission to edit its configuration.
|
Iterable<CustomFieldType<?,?>> |
getCustomFieldTypesForUser(ApplicationUser user)
Return the
CustomFieldType s that the passed user can use to create a new CustomField . |
CustomFieldSearcher |
getDefaultSearcher(CustomFieldType<?,?> type)
Return the default
CustomFieldSearcher for the passed CustomFieldType . |
ServiceOutcomeImpl<List<Long>> |
removeFromScreenTabs(ApplicationUser user,
Long customFieldId,
List<Long> tabIds)
Removes a custom field with the given id from selected tabs.
|
void |
updateTranslation(JiraServiceContext jiraServiceContext,
Long customFieldId,
String name,
String description,
String localeString)
Sets the current a translation for a custom field.
|
ServiceOutcome<CreateValidationResult> |
validateCreate(ApplicationUser user,
CustomFieldDefinition customFieldDefinition)
Validates that the custom field with the provided data can be created.
|
void |
validateDelete(JiraServiceContext jiraServiceContext,
Long customFieldId)
Validates that the custom field with the provided id can be deleted.
|
void |
validateTranslation(JiraServiceContext jiraServiceContext,
Long customFieldId,
String name,
String description,
String locale)
Validates that the parameters to set a translation for a custom field are valid
|
void |
validateUpdate(JiraServiceContext jiraServiceContext,
Long customFieldId,
String name,
String description,
String searcherKey)
Validates that the custom field with the provided id can be updated.
|
public static final String GLOBAL_CONTEXT_TEXT
public DefaultCustomFieldService(GlobalPermissionManager permissionManager, CustomFieldManager customFieldManager, PermissionSchemeManager permissionSchemeManager, IssueSecuritySchemeManager issueSecuritySchemeManager, CustomFieldValidator customFieldValidator, I18nHelper.BeanFactory i18nFactory, ProjectManager projectManager, CustomFieldContextConfigHelper customFieldContextConfigHelper, ReindexMessageManager reindexMessageManager, ConstantsManager constantManager, FieldScreenManager fieldScreenManager, LocaleManager localeManager, TranslationManager translationManager, ManagedConfigurationItemService managedConfigurationItemService)
public ServiceOutcome<CustomField> getCustomFieldForEditConfig(@Nullable ApplicationUser user, String fieldId)
CustomFieldService
getCustomFieldForEditConfig
in interface CustomFieldService
user
- the user to check.fieldId
- the field to search for.@Nonnull public Iterable<CustomFieldType<?,?>> getCustomFieldTypesForUser(ApplicationUser user)
CustomFieldService
CustomFieldType
s that the passed user can use to create a new CustomField
.
A CustomFieldType
can be hidden if the passed user either does not have permission to see it or when
the type is locked and not meant to be created by users.
getCustomFieldTypesForUser
in interface CustomFieldService
user
- the user to check against.CustomFieldType
s that the passed user can use to create a CustomField
.@Nullable public CustomFieldSearcher getDefaultSearcher(@Nonnull CustomFieldType<?,?> type)
CustomFieldService
CustomFieldSearcher
for the passed CustomFieldType
. The default searcher can
be null if there is no searcher associated with the type.getDefaultSearcher
in interface CustomFieldService
type
- the CustomFieldType
to query.CustomFieldType
. Can be null if the type has no associated
searcher.public void validateDelete(JiraServiceContext jiraServiceContext, Long customFieldId)
CustomFieldService
validateDelete
in interface CustomFieldService
jiraServiceContext
- containing the User
who is performing the change and
the ErrorCollection
that will contain any errors
in calling the methodcustomFieldId
- the custom field id of the custom field about to be deleted.public void validateUpdate(JiraServiceContext jiraServiceContext, Long customFieldId, String name, String description, String searcherKey)
CustomFieldService
validateUpdate
in interface CustomFieldService
jiraServiceContext
- containing the User
who is performing the change and
the ErrorCollection
that will contain any errors
in calling the methodcustomFieldId
- the custom field id of the customfield about to be updatedname
- the updated name of the customfielddescription
- the description of the customfieldsearcherKey
- the customfield searcher that should be usedpublic void validateTranslation(JiraServiceContext jiraServiceContext, Long customFieldId, String name, String description, String locale)
CustomFieldService
validateTranslation
in interface CustomFieldService
jiraServiceContext
- containing the User
who is performing the change and
the ErrorCollection
that will contain any errors
in calling the methodcustomFieldId
- the custom field id of the customfield about to be updatedname
- the updated name of the customfielddescription
- the description of the customfieldlocale
- the locale of the translationpublic void updateTranslation(JiraServiceContext jiraServiceContext, Long customFieldId, String name, String description, String localeString)
CustomFieldService
updateTranslation
in interface CustomFieldService
jiraServiceContext
- containing the User
who is performing the change and
the ErrorCollection
that will contain any errors
in calling the methodcustomFieldId
- the custom field id of the customfield about to be updatedname
- the updated name of the customfielddescription
- the description of the customfieldlocaleString
- the locale of the translationpublic ServiceOutcome<CreateValidationResult> validateCreate(ApplicationUser user, CustomFieldDefinition customFieldDefinition)
CustomFieldService
CustomFieldDefinition
. The result of this operation is
CreateValidationResult
which after validation will contain all necessery data to create
a custom field (including user)validateCreate
in interface CustomFieldService
user
- - the user who is performing the validationcustomFieldDefinition
- - custom field datapublic ServiceOutcome<CustomField> create(CreateValidationResult createValidationResult)
CustomFieldService
CreateValidationResult
as parameter.
CreateValidationResult is an output of createValidation method which should be executed before executing create.create
in interface CustomFieldService
createValidationResult
- - data needed to create custom field, containing user.public ServiceOutcomeImpl<List<Long>> addToScreenTabs(ApplicationUser user, Long customFieldId, List<Long> tabIds)
CustomFieldService
addToScreenTabs
in interface CustomFieldService
user
- user who performs the changecustomFieldId
- id of custom fieldtabIds
- list of tab's id's to which we want to add custom fieldpublic ServiceOutcomeImpl<List<Long>> removeFromScreenTabs(ApplicationUser user, Long customFieldId, List<Long> tabIds)
CustomFieldService
removeFromScreenTabs
in interface CustomFieldService
user
- user who performs the changecustomFieldId
- id of custom fieldtabIds
- list of tab's ids from which we want to remove custom fieldpublic ServiceOutcomeImpl<List<CustomField>> findCustomFields(ApplicationUser user, @Nullable String searchString, @Nullable List<String> types, @Nullable List<String> projects, @Nullable List<String> screens, @Nullable String sortOrder, @Nullable String sortColumn, @Nullable Long lastValueUpdate)
searchString
- Field name partial matchtypes
- Custom field type keys for filteringprojects
- Project IDs for filteringscreens
- Screen IDs for filteringsortOrder
- Sorting order: ascending or descendingsortColumn
- Column to sort by: lastValueUpdate or IssuesWithValuelastValueUpdate
- Date for filteringCopyright © 2002-2022 Atlassian. All Rights Reserved.