com.atlassian.jira.jql.context
Class FieldConfigSchemeClauseContextUtil

java.lang.Object
  extended by com.atlassian.jira.jql.context.FieldConfigSchemeClauseContextUtil

@InjectableComponent
public class FieldConfigSchemeClauseContextUtil
extends Object

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
FieldConfigSchemeClauseContextUtil(IssueTypeSchemeManager issueTypeSchemeManager, ConstantsManager constantsManager, PermissionManager permissionManager, ProjectFactory projectFactory)
           
 
Method Summary
 ClauseContext getContextForConfigScheme(com.atlassian.crowd.embedded.api.User searcher, FieldConfigScheme fieldConfigScheme)
          Given a FieldConfigScheme determines the ClauseContext specified by it, taking into account what is visible to the searcher User
 FieldConfigScheme getFieldConfigSchemeFromContext(QueryContext queryContext, CustomField customField)
          Finds the most specific FieldConfigScheme associated with a CustomField that is viewable from the given QueryContext.
 boolean isConfigSchemeVisibleUnderContext(QueryContext queryContext, FieldConfigScheme fieldConfigScheme)
          Checks if the FieldConfigScheme is visible under the given QueryContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldConfigSchemeClauseContextUtil

public FieldConfigSchemeClauseContextUtil(IssueTypeSchemeManager issueTypeSchemeManager,
                                          ConstantsManager constantsManager,
                                          PermissionManager permissionManager,
                                          ProjectFactory projectFactory)
Method Detail

isConfigSchemeVisibleUnderContext

public boolean isConfigSchemeVisibleUnderContext(QueryContext queryContext,
                                                 FieldConfigScheme fieldConfigScheme)
Checks if the FieldConfigScheme is visible under the given QueryContext

Parameters:
queryContext - the QueryContext of the search and user.
fieldConfigScheme - the scheme to to check is visible
Returns:
true if the FieldConfigScheme is visible under the QueryContext, false otherwise.

getFieldConfigSchemeFromContext

public FieldConfigScheme getFieldConfigSchemeFromContext(QueryContext queryContext,
                                                         CustomField customField)
Finds the most specific FieldConfigScheme associated with a CustomField that is viewable from the given QueryContext. 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 visible FieldConfigScheme for.
customField - The custom field to retreive FieldConfigSchemes from.
Returns:
The most specific FieldConfigScheme on teh CustomField that is visible to the QueryContext, null if no FieldConfigScheme is visible.

getContextForConfigScheme

public ClauseContext getContextForConfigScheme(com.atlassian.crowd.embedded.api.User searcher,
                                               FieldConfigScheme fieldConfigScheme)
Given a FieldConfigScheme determines the ClauseContext specified by it, taking into account what is visible to the searcher User

Parameters:
searcher - the user the ClauseContext is generated for
fieldConfigScheme - the config scheme the ClauseContext is generated for
Returns:
a clause context that is defined by the FieldConfigScheme and searchers visibility


Copyright © 2002-2014 Atlassian. All Rights Reserved.