Package com.atlassian.jira.jql.context
Class FieldConfigSchemeClauseContextUtil
java.lang.Object
com.atlassian.jira.jql.context.FieldConfigSchemeClauseContextUtil
A utlitilty class for generating the clause context specified by
a
FieldConfigScheme
, taking
into account what is visible to the searcher.- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionFieldConfigSchemeClauseContextUtil
(IssueTypeSchemeManager issueTypeSchemeManager, ConstantsManager constantsManager, PermissionManager permissionManager, ProjectFactory projectFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetContextForConfigScheme
(ApplicationUser searcher, FieldConfigScheme fieldConfigScheme) Given aFieldConfigScheme
determines theClauseContext
specified by it, taking into account what is visible to the searcherUser
getFieldConfigSchemeFromContext
(QueryContext queryContext, CustomField customField) Finds the most specificFieldConfigScheme
associated with aCustomField
that is viewable from the givenQueryContext
.boolean
isConfigSchemeVisibleUnderContext
(QueryContext queryContext, FieldConfigScheme fieldConfigScheme) Checks if theFieldConfigScheme
is visible under the givenQueryContext
-
Constructor Details
-
FieldConfigSchemeClauseContextUtil
public FieldConfigSchemeClauseContextUtil(IssueTypeSchemeManager issueTypeSchemeManager, ConstantsManager constantsManager, PermissionManager permissionManager, ProjectFactory projectFactory)
-
-
Method Details
-
isConfigSchemeVisibleUnderContext
public boolean isConfigSchemeVisibleUnderContext(QueryContext queryContext, FieldConfigScheme fieldConfigScheme) Checks if theFieldConfigScheme
is visible under the givenQueryContext
- Parameters:
queryContext
- theQueryContext
of the search and user.fieldConfigScheme
- the scheme to to check is visible- Returns:
- true if the
FieldConfigScheme
is visible under theQueryContext
, false otherwise.
-
getFieldConfigSchemeFromContext
public FieldConfigScheme getFieldConfigSchemeFromContext(QueryContext queryContext, CustomField customField) Finds the most specificFieldConfigScheme
associated with aCustomField
that is viewable from the givenQueryContext
. The "Most Specific" means it will always return a FieldConfigScheme with a defined project context if available, otherwise it will return the FieldConfigScheme with the global context (if visible). If no FieldConfigScheme is visible under the QueryContext null is returned.- Parameters:
queryContext
- The QueryContext to find the most specific visibleFieldConfigScheme
for.customField
- The custom field to retreiveFieldConfigScheme
s from.- Returns:
- The most specific
FieldConfigScheme
on tehCustomField
that is visible to theQueryContext
, null if noFieldConfigScheme
is visible.
-
getContextForConfigScheme
public ClauseContext getContextForConfigScheme(ApplicationUser searcher, FieldConfigScheme fieldConfigScheme) Given aFieldConfigScheme
determines theClauseContext
specified by it, taking into account what is visible to the searcherUser
- Parameters:
searcher
- the user theClauseContext
is generated forfieldConfigScheme
- the config scheme theClauseContext
is generated for- Returns:
- a clause context that is defined by the
FieldConfigScheme
and searchers visibility
-