Package com.atlassian.confluence.themes
Class GlobalHelper
- java.lang.Object
-
- com.atlassian.confluence.themes.GlobalHelper
-
- All Implemented Interfaces:
ThemeHelper
- Direct Known Subclasses:
AttachmentHelper
,PageHelper
public class GlobalHelper extends Object implements ThemeHelper
-
-
Constructor Summary
Constructors Constructor Description GlobalHelper()
GlobalHelper(ConfluenceActionSupport action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfluenceActionSupport
getAction()
List<Breadcrumb>
getBreadcrumbs()
Returns a list of breadcrumbs ending with the current action.String
getDomainName()
List<Breadcrumb>
getEllipsisCrumbs(List<Breadcrumb> trail)
Returns the subset of the breadcrumbs which should be hidden under an ellipsis: The first crumb (e.g.DisplayableLabel
getLabel()
AbstractPage
getPage()
String
getSiteTitle()
Space
getSpace()
String
getSpaceKey()
String
getSpaceName()
String
getSpaceType()
String
getText(String property)
String
getText(String property, Object[] args)
com.atlassian.renderer.WikiStyleRenderer
getWikiStyleRenderer()
String
renderConfluenceMacro(String wikiCall)
String
renderConfluenceMacro(String messageFormatString, String... args)
-
-
-
Constructor Detail
-
GlobalHelper
public GlobalHelper()
-
GlobalHelper
public GlobalHelper(ConfluenceActionSupport action)
-
-
Method Detail
-
getText
public String getText(String property)
- Specified by:
getText
in interfaceThemeHelper
-
getAction
public ConfluenceActionSupport getAction()
- Specified by:
getAction
in interfaceThemeHelper
-
getDomainName
public String getDomainName()
- Specified by:
getDomainName
in interfaceThemeHelper
-
getSiteTitle
public String getSiteTitle()
-
getSpace
public Space getSpace()
-
getSpaceKey
public String getSpaceKey()
- Specified by:
getSpaceKey
in interfaceThemeHelper
-
getSpaceName
public String getSpaceName()
- Specified by:
getSpaceName
in interfaceThemeHelper
-
getSpaceType
public String getSpaceType()
-
getPage
public AbstractPage getPage()
-
getWikiStyleRenderer
public com.atlassian.renderer.WikiStyleRenderer getWikiStyleRenderer()
-
renderConfluenceMacro
public String renderConfluenceMacro(String wikiCall)
- Specified by:
renderConfluenceMacro
in interfaceThemeHelper
-
renderConfluenceMacro
public String renderConfluenceMacro(String messageFormatString, String... args)
-
getLabel
public DisplayableLabel getLabel()
-
getBreadcrumbs
public List<Breadcrumb> getBreadcrumbs()
Returns a list of breadcrumbs ending with the current action.The current action is usually the last breadcrumb, represented by text (rather than a link) which is an i18n version of the action name. The action's parent is determined in one of the following ways (given that there is no other convention for the determination of an action's place in the hierachy) :
- Action class - hardcoded class test, least scalable
- Action package - hardcoded string test, scalable but only reliable if classes in correct location
- Action interface - existing interfaces can be used, but adding interfaces just for this is ugly (ask CM)
- Action URL - from xwork (?) or servlet request URL, this is valid in that the URL hierarchy is the one we expose to the user, so a crumb path that matches it is intuitive.
- Action method - getParentBreadcrumb applied to a concrete or abstract Action gives control to the action itself.
This method is currently a hack due to our ugly action hierarchy. The logic for all this were in the velocity templates and have been centralized in one location, here. It should be cleaned up later on (no dependency on request URL or package name).
- Returns:
- a list of breadcrumbs ending with the current action
-
getEllipsisCrumbs
public List<Breadcrumb> getEllipsisCrumbs(List<Breadcrumb> trail)
Returns the subset of the breadcrumbs which should be hidden under an ellipsis:- The first crumb (e.g. Pages collector) can't be part of it
- The last crumbs, including the page name and the following (e.g. Name and the action) can't be part of it
- Only the path to the page can be ellipsed
- Only when 2+ crumbs can be ellipsed
-
-