|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.issue.customfields.CustomFieldUtils
public class CustomFieldUtils
Field Summary | |
---|---|
static String |
CUSTOM_FIELD_PREFIX
|
static String |
PARAM_REQUIRE_PROJECT_IDS
Deprecated. since v6.2.3 use getParamKeyRequireProjectIds() instead. |
Constructor Summary | |
---|---|
CustomFieldUtils()
|
Method Summary | |
---|---|
static List<org.ofbiz.core.entity.GenericValue> |
buildIssueTypes(ConstantsManager constantsManager,
String[] issueTypes)
|
static List<JiraContextNode> |
buildJiraIssueContexts(boolean global,
Long[] projectCategories,
Long[] projects,
JiraContextTreeManager treeManager)
Deprecated. Use buildJiraIssueContexts(boolean, Long[], com.atlassian.jira.project.ProjectManager) instead. Since v6.4. |
static List<JiraContextNode> |
buildJiraIssueContexts(boolean global,
Long[] projects,
ProjectManager projectManager)
|
static Map<String,Object> |
buildParams(CustomField customField,
FieldConfig config,
Issue issue,
FieldLayoutItem fieldLayoutItem,
Object value,
Map customFieldValuesHolder,
webwork.action.Action action,
Map displayParameters)
|
static List<IssueContext> |
convertToIssueContexts(org.ofbiz.core.entity.GenericValue project,
List<String> issueTypeIds)
Deprecated. Please use convertToIssueContexts(Project, List) . Since v4.0 |
static List<IssueContext> |
convertToIssueContexts(Project project,
List<String> issueTypeIds)
Converts list of issue type ids to IssueContexts . |
static String |
createSearchParam(String customFieldId,
String searchParam)
|
static Long |
getCustomFieldId(String key)
Given a custom field key, return its id or null. |
static String |
getCustomFieldKey(String searchParamKey)
|
static String |
getDateFormat()
Deprecated. Use DateTimeFormatUtils.getDateFormat() instead. Since v5.0. |
static String |
getDateTimeFormat()
Deprecated. Use DateTimeFormatUtils.getDateTimeFormat() instead. Since v5.0. |
protected static I18nHelper |
getI18nBean()
|
static String |
getParamKeyPrefixAtl()
The prefix to be used by Atlassian defined custom field parameter names, so that we could avoid naming conflict between Atlassian parameters and parameters used by third party plugin. |
static String |
getParamKeyRequireProjectIds()
Name of the parameter that indicates whether the list of project id's associated with the current context should be loaded, either from the current issue (when editing value of an issue) or from FieldConfig and its FieldConfigScheme (when setting default value). |
static Collection<Long> |
getProjectIdsForUser(ApplicationUser user,
Collection<Long> projectIds,
PermissionManager permissionManager,
UserFilter userFilter)
If projectIds is not empty, return it. |
static Collection<Long> |
getProjectIdsFromIssueOrFieldConfig(Issue issue,
FieldConfig config,
FieldConfigSchemeManager fieldConfigSchemeManager,
ProjectManager projectManager)
Retrieve the list of project id's from issue or field config, in the following order: If issue is not null and issue.getProjectId() is not null, return a single list with issue.getProjectId()
If config is not null, use it to retrieve the list of project id's associated with the current scheme
Otherwise, return null
|
static Collection<Long> |
getProjectIdsFromProjectOrFieldConfig(Long projectIdFromIssue,
FieldConfig config,
FieldConfigSchemeManager fieldConfigSchemeManager,
ProjectManager projectManager)
Retrieve the list of project id's from issue or field config, in the following order: If issue is not null and issue.getProjectId() is not null, return a single list with issue.getProjectId()
If config is not null, use it to retrieve the list of project id's associated with the current scheme
Otherwise, return null
|
static String |
getSearchParamSuffix(String searchParamKey)
|
static String |
getTimeFormat()
Deprecated. Use DateTimeFormatUtils.getTimeFormat() instead. Since v5.0. |
static boolean |
isCollectionNotEmpty(Collection stringCollection)
|
static boolean |
isShownAndVisible(CustomField customField,
com.atlassian.crowd.embedded.api.User user,
SearchContext searchContext,
FieldVisibilityManager fieldVisibilityManager)
Checks if the custom field is in the search context scope (using OrderableField.isShown(com.atlassian.jira.issue.Issue) )
and visible in all field schemes (using FieldVisibilityManager.isFieldHiddenInAllSchemes(String,SearchContext,User) ) |
static boolean |
isUserHasPermissionToProjects(CustomField customField,
com.atlassian.crowd.embedded.api.User user)
Does the user have permission to at least one project that falls under this custom field. |
static Map<CustomField,Object> |
parseCustomFieldValuesFromActionParams(Map actionParameters,
List<CustomField> customFields)
Parses action parameters (Map of Collections of Strings with |
static String |
prettyPrintOptions(Options options)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CUSTOM_FIELD_PREFIX
@Deprecated public static final String PARAM_REQUIRE_PROJECT_IDS
getParamKeyRequireProjectIds()
instead.#getParamKeyRequireProjectIds()}
,
Constant Field ValuesConstructor Detail |
---|
public CustomFieldUtils()
Method Detail |
---|
public static String getParamKeyPrefixAtl()
public static String getParamKeyRequireProjectIds()
CustomFieldType.getVelocityParameters(com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem)
to inform buildParams(com.atlassian.jira.issue.fields.CustomField, com.atlassian.jira.issue.fields.config.FieldConfig, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, Object, java.util.Map, webwork.action.Action, java.util.Map)
that project id's need to be loadedCustomFieldParams
to inform CustomFieldType.validateFromParams(com.atlassian.jira.issue.customfields.view.CustomFieldParams, com.atlassian.jira.util.ErrorCollection, com.atlassian.jira.issue.fields.config.FieldConfig)
that project id's need to be loaded from field config scheme.
public static String getSearchParamSuffix(String searchParamKey)
public static String getCustomFieldKey(String searchParamKey)
public static String createSearchParam(String customFieldId, String searchParam)
public static Long getCustomFieldId(String key)
key
- eg. "customfield_10000"
public static boolean isCollectionNotEmpty(Collection stringCollection)
public static Map<CustomField,Object> parseCustomFieldValuesFromActionParams(Map actionParameters, List<CustomField> customFields)
actionParameters
- map of action parameterscustomFields
- a list of custom fields
public static List<JiraContextNode> buildJiraIssueContexts(boolean global, Long[] projects, ProjectManager projectManager)
public static List<JiraContextNode> buildJiraIssueContexts(boolean global, Long[] projectCategories, Long[] projects, JiraContextTreeManager treeManager)
buildJiraIssueContexts(boolean, Long[], com.atlassian.jira.project.ProjectManager)
instead. Since v6.4.
public static List<org.ofbiz.core.entity.GenericValue> buildIssueTypes(ConstantsManager constantsManager, String[] issueTypes)
public static List<IssueContext> convertToIssueContexts(org.ofbiz.core.entity.GenericValue project, List<String> issueTypeIds)
convertToIssueContexts(Project, List)
. Since v4.0
IssueContexts
.
project
- project generic valueissueTypeIds
- Type ids as strings, eg. ["3", "4"]
public static List<IssueContext> convertToIssueContexts(Project project, List<String> issueTypeIds)
IssueContexts
.
project
- The project (may be null).issueTypeIds
- Type ids as strings, eg. ["3", "4"]. May be null or empty.
public static boolean isUserHasPermissionToProjects(CustomField customField, com.atlassian.crowd.embedded.api.User user)
customField
- custom fielduser
- user
public static String prettyPrintOptions(Options options)
public static Map<String,Object> buildParams(CustomField customField, FieldConfig config, Issue issue, FieldLayoutItem fieldLayoutItem, Object value, Map customFieldValuesHolder, webwork.action.Action action, Map displayParameters)
public static String getDateFormat()
DateTimeFormatUtils.getDateFormat()
instead. Since v5.0.
ie the format stored in the "jira.date.picker.javascript.format" application property.
public static String getDateTimeFormat()
DateTimeFormatUtils.getDateTimeFormat()
instead. Since v5.0.
ie the format stored in the "jira.date.time.picker.javascript.format" application property.
public static String getTimeFormat()
DateTimeFormatUtils.getTimeFormat()
instead. Since v5.0.
protected static I18nHelper getI18nBean()
public static boolean isShownAndVisible(CustomField customField, com.atlassian.crowd.embedded.api.User user, SearchContext searchContext, FieldVisibilityManager fieldVisibilityManager)
OrderableField.isShown(com.atlassian.jira.issue.Issue)
)
and visible in all field schemes (using FieldVisibilityManager.isFieldHiddenInAllSchemes(String,SearchContext,User)
)
customField
- customfield to check visibility ofuser
- current usersearchContext
- search contextfieldVisibilityManager
- field visibility bean
OrderableField.isShown(com.atlassian.jira.issue.Issue)
,
FieldVisibilityManager.isFieldHiddenInAllSchemes(String,com.atlassian.jira.issue.search.SearchContext,User)
public static Collection<Long> getProjectIdsFromIssueOrFieldConfig(Issue issue, FieldConfig config, FieldConfigSchemeManager fieldConfigSchemeManager, ProjectManager projectManager)
issue
is not null and issue.getProjectId() is not null, return a single list with issue.getProjectId()config
is not null, use it to retrieve the list of project id's associated with the current scheme
public static Collection<Long> getProjectIdsFromProjectOrFieldConfig(Long projectIdFromIssue, FieldConfig config, FieldConfigSchemeManager fieldConfigSchemeManager, ProjectManager projectManager)
issue
is not null and issue.getProjectId() is not null, return a single list with issue.getProjectId()config
is not null, use it to retrieve the list of project id's associated with the current scheme
public static Collection<Long> getProjectIdsForUser(ApplicationUser user, Collection<Long> projectIds, PermissionManager permissionManager, UserFilter userFilter)
projectIds
is not empty, return it.
Otherwise, return the list of project id's that the user
could browse.
If projectIds
is not provided and userFilter
contains no roleIds, the list of browsable project
ids will not be computed. An empty list will be returned instead.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |