com.atlassian.confluence.themes
Class GlobalHelper

java.lang.Object
  extended by com.atlassian.confluence.themes.GlobalHelper
All Implemented Interfaces:
ThemeHelper
Direct Known Subclasses:
AttachmentHelper, MailHelper, PageHelper

public class GlobalHelper
extends java.lang.Object
implements ThemeHelper


Constructor Summary
GlobalHelper()
           
GlobalHelper(ConfluenceActionSupport action)
           
 
Method Summary
 ConfluenceActionSupport getAction()
           
 java.util.List<Breadcrumb> getBreadcrumbs()
          Returns a list of breadcrumbs ending with the current action.
 java.lang.String getDomainName()
           
 java.util.List<Breadcrumb> getEllipsisCrumbs(java.util.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()
           
 java.lang.String getSiteTitle()
           
 Space getSpace()
           
 java.lang.String getSpaceKey()
           
 java.lang.String getSpaceName()
           
 java.lang.String getSpaceType()
           
 java.lang.String getText(java.lang.String property)
           
 java.lang.String getText(java.lang.String property, java.lang.Object[] args)
           
 com.atlassian.renderer.WikiStyleRenderer getWikiStyleRenderer()
           
 java.lang.String renderConfluenceMacro(java.lang.String wikiCall)
           
 java.lang.String renderConfluenceMacro(java.lang.String messageFormatString, java.lang.String... args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlobalHelper

public GlobalHelper()

GlobalHelper

public GlobalHelper(ConfluenceActionSupport action)
Method Detail

getText

public java.lang.String getText(java.lang.String property)
Specified by:
getText in interface ThemeHelper

getText

public java.lang.String getText(java.lang.String property,
                                java.lang.Object[] args)

getAction

public ConfluenceActionSupport getAction()
Specified by:
getAction in interface ThemeHelper

getDomainName

public java.lang.String getDomainName()
Specified by:
getDomainName in interface ThemeHelper

getSiteTitle

public java.lang.String getSiteTitle()

getSpace

public Space getSpace()

getSpaceKey

public java.lang.String getSpaceKey()
Specified by:
getSpaceKey in interface ThemeHelper

getSpaceName

public java.lang.String getSpaceName()
Specified by:
getSpaceName in interface ThemeHelper

getSpaceType

public java.lang.String getSpaceType()

getPage

public AbstractPage getPage()

getWikiStyleRenderer

public com.atlassian.renderer.WikiStyleRenderer getWikiStyleRenderer()

renderConfluenceMacro

public java.lang.String renderConfluenceMacro(java.lang.String wikiCall)
Specified by:
renderConfluenceMacro in interface ThemeHelper

renderConfluenceMacro

public java.lang.String renderConfluenceMacro(java.lang.String messageFormatString,
                                              java.lang.String... args)

getLabel

public DisplayableLabel getLabel()

getBreadcrumbs

public java.util.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) :

  1. Action class - hardcoded class test, least scalable
  2. Action package - hardcoded string test, scalable but only reliable if classes in correct location
  3. Action interface - existing interfaces can be used, but adding interfaces just for this is ugly (ask CM)
  4. 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.
  5. 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 java.util.List<Breadcrumb> getEllipsisCrumbs(java.util.List<Breadcrumb> trail)
Returns the subset of the breadcrumbs which should be hidden under an ellipsis:



Copyright © 2003-2014 Atlassian. All Rights Reserved.