com.atlassian.greenhopper.service.context
Interface ContextService

All Known Implementing Classes:
ContextServiceImpl

public interface ContextService

Provides access to context objects stored by GreenHopper.


Nested Class Summary
static interface ContextService.Locator
           
 
Field Summary
static java.lang.String SERVICE
          Service identifier to be used for dependency injection.
 
Method Summary
 java.util.Set<ContextInfo> getAllContexts(com.opensymphony.user.User user, ProjectConfiguration projectConfiguration)
          Get all contexts a given user has access to.
 Context2 getById(com.opensymphony.user.User user, XProject xproject, java.lang.String id, boolean fallbackToDefault)
          Get a context by name.
 ContextInfo getInfoForContext(Context2 context)
          Get the info object for a given context.
 Context2 getSelectedContext(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, UserBoardSettings settings)
          Get the selected context for a given view.
 void removeContext(ProjectConfiguration projectConfiguration, Context context)
          Removes a context object.
 void setSelectedContext(com.opensymphony.user.User user, XProject xproject, ViewDefinition view, Context2 context, UserBoardSettings settings)
          Set a context as the selected context for a given view.
 void updateShareAndUserLists(ProjectConfiguration projectConfiguration, Context context)
          Updates the user and shared state of a context.
 

Field Detail

SERVICE

static final java.lang.String SERVICE
Service identifier to be used for dependency injection.

See Also:
Constant Field Values
Method Detail

getById

Context2 getById(com.opensymphony.user.User user,
                 XProject xproject,
                 java.lang.String id,
                 boolean fallbackToDefault)
Get a context by name.

Parameters:
fallbackToDefault - if true then the default context is returned if a context with that id could not be located.
Returns:
the context or null if not found, or the default context in case fallbackToDefault is true

getSelectedContext

Context2 getSelectedContext(com.opensymphony.user.User user,
                            XProject xproject,
                            ViewDefinition view,
                            UserBoardSettings settings)
Get the selected context for a given view. Falls back to default context if not set/unavailable

Parameters:
user - the user to get the context for
Returns:
a context object

setSelectedContext

void setSelectedContext(com.opensymphony.user.User user,
                        XProject xproject,
                        ViewDefinition view,
                        Context2 context,
                        UserBoardSettings settings)
Set a context as the selected context for a given view.


getAllContexts

java.util.Set<ContextInfo> getAllContexts(com.opensymphony.user.User user,
                                          ProjectConfiguration projectConfiguration)
Get all contexts a given user has access to.


getInfoForContext

ContextInfo getInfoForContext(Context2 context)
Get the info object for a given context.


updateShareAndUserLists

void updateShareAndUserLists(ProjectConfiguration projectConfiguration,
                             Context context)
Updates the user and shared state of a context. Call this after updating a context


removeContext

void removeContext(ProjectConfiguration projectConfiguration,
                   Context context)
Removes a context object.



Copyright © 2007-2011 Atlassian. All Rights Reserved.