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 aFieldConfigSchemedetermines theClauseContextspecified by it, taking into account what is visible to the searcherUsergetFieldConfigSchemeFromContext(QueryContext queryContext, CustomField customField) Finds the most specificFieldConfigSchemeassociated with aCustomFieldthat is viewable from the givenQueryContext.booleanisConfigSchemeVisibleUnderContext(QueryContext queryContext, FieldConfigScheme fieldConfigScheme) Checks if theFieldConfigSchemeis 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 theFieldConfigSchemeis visible under the givenQueryContext- Parameters:
queryContext- theQueryContextof the search and user.fieldConfigScheme- the scheme to to check is visible- Returns:
- true if the
FieldConfigSchemeis visible under theQueryContext, false otherwise.
-
getFieldConfigSchemeFromContext
public FieldConfigScheme getFieldConfigSchemeFromContext(QueryContext queryContext, CustomField customField) Finds the most specificFieldConfigSchemeassociated with aCustomFieldthat 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 visibleFieldConfigSchemefor.customField- The custom field to retreiveFieldConfigSchemes from.- Returns:
- The most specific
FieldConfigSchemeon tehCustomFieldthat is visible to theQueryContext, null if noFieldConfigSchemeis visible.
-
getContextForConfigScheme
public ClauseContext getContextForConfigScheme(ApplicationUser searcher, FieldConfigScheme fieldConfigScheme) Given aFieldConfigSchemedetermines theClauseContextspecified by it, taking into account what is visible to the searcherUser- Parameters:
searcher- the user theClauseContextis generated forfieldConfigScheme- the config scheme theClauseContextis generated for- Returns:
- a clause context that is defined by the
FieldConfigSchemeand searchers visibility
-