com.atlassian.confluence.plugins.macros.dashboard
Class DashboardMacroSupport

java.lang.Object
  extended by com.atlassian.confluence.plugins.macros.dashboard.DashboardMacroSupport

public class DashboardMacroSupport
extends java.lang.Object

This support class provides common functionality used by the macros that are used on the dashboard.


Constructor Summary
DashboardMacroSupport()
           
 
Method Summary
 java.util.List<Space> getAllViewableSpaces()
           
 DateFormatter getDateFormatter()
           
 java.util.List<Space> getFavouriteSpaces()
           
 java.util.List<Space> getNewSpaces()
           
 java.util.Set<Space> getPermittedSpaces()
          Deprecated. use getPermittedSpacesBuilder instead
 ListBuilder<Space> getPermittedSpacesBuilder()
          Get an ListBuilder of all spaces the current user can see.
 javax.servlet.http.HttpServletRequest getRequest()
          There are three possible cases here - You are within an HTTP request thread, in which case the request will be retrieved from a ThreadLocal You are an AJAX call in which case the request will be retrieved from a WebContextFactory.
 java.lang.String getRequestParameter(java.lang.String key)
           
protected  java.lang.String getSelectedTeamLabelName()
           
 java.lang.String getSpacesSelectedTab()
           
 java.util.List<Space> getTeamSpaces()
           
protected  UserInterfaceState getUserInterfaceState()
           
 java.util.List<java.lang.String> getViewableTeamLabels()
           
protected  java.lang.String sanitiseSelectedSpacesTab(java.lang.String spacesSelectedTab)
          four cases to sanitise on "new" tab when there are no new spaces "my" tab when there are no favourite spaces "team" tab when there are no teams
 void setLabelManager(LabelManager labelManager)
           
 void setLocaleManager(LocaleManager localeManager)
           
 void setSpaceManager(SpaceManager spaceManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DashboardMacroSupport

public DashboardMacroSupport()
Method Detail

getFavouriteSpaces

public java.util.List<Space> getFavouriteSpaces()

getDateFormatter

public DateFormatter getDateFormatter()

getNewSpaces

public java.util.List<Space> getNewSpaces()

getTeamSpaces

public java.util.List<Space> getTeamSpaces()

getPermittedSpaces

public java.util.Set<Space> getPermittedSpaces()
Deprecated. use getPermittedSpacesBuilder instead

Get a set of all spaces the current user can see.


getPermittedSpacesBuilder

public ListBuilder<Space> getPermittedSpacesBuilder()
Get an ListBuilder of all spaces the current user can see.


getSelectedTeamLabelName

protected java.lang.String getSelectedTeamLabelName()

getViewableTeamLabels

public java.util.List<java.lang.String> getViewableTeamLabels()

getUserInterfaceState

protected UserInterfaceState getUserInterfaceState()

getSpacesSelectedTab

public java.lang.String getSpacesSelectedTab()

sanitiseSelectedSpacesTab

protected java.lang.String sanitiseSelectedSpacesTab(java.lang.String spacesSelectedTab)
four cases to sanitise on

Parameters:
spacesSelectedTab - currently selected tab
Returns:
spacesSelectedTab if the tab contains spaces, return the tab, else return "all"

getRequestParameter

public java.lang.String getRequestParameter(java.lang.String key)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
There are three possible cases here -
  1. You are within an HTTP request thread, in which case the request will be retrieved from a ThreadLocal
  2. You are an AJAX call in which case the request will be retrieved from a WebContextFactory.
  3. You are not a 'web related' thread (e.g. a Long running task) in which case null will be returned.

Returns:
The HttpServletRequest associated with the current thread.

getAllViewableSpaces

public java.util.List<Space> getAllViewableSpaces()

setLabelManager

public void setLabelManager(LabelManager labelManager)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

setLocaleManager

public void setLocaleManager(LocaleManager localeManager)


Copyright © 2003-2011 Atlassian. All Rights Reserved.