com.atlassian.confluence.util.breadcrumbs
Class DefaultBreadcrumbGenerator

java.lang.Object
  extended by com.atlassian.confluence.util.breadcrumbs.DefaultBreadcrumbGenerator
All Implemented Interfaces:
BreadcrumbGenerator

public class DefaultBreadcrumbGenerator
extends java.lang.Object
implements BreadcrumbGenerator


Constructor Summary
DefaultBreadcrumbGenerator(ThemeManager themeManager)
           
 
Method Summary
 Breadcrumb getAdvancedBreadcrumb(Space space)
          Returns the advanced breadcrumb in a space.
 Breadcrumb getBlogCollectorBreadcrumb(Space space)
           
 Breadcrumb getContentActionBreadcrumb(com.opensymphony.xwork.Action action, Space space, AbstractPage page, DisplayableLabel label)
          Returns an appropriate breadcrumb for the given action, space, page and label.
 Breadcrumb getContentBreadcrumb(Space space, AbstractPage page)
          Returns an appropriate breadcrumb for a page or blogpost
 Breadcrumb getContentCollectorBreadcrumb(Space space, java.lang.Class contentClass)
          Returns an appropriate collector page breadcrumb to represent content at the root level of a space conforming to the new space information architecture.
 Breadcrumb getContentDetailActionBreadcrumb(com.opensymphony.xwork.Action action, Space space, AbstractPage page)
          Breadcrumb for the "detail" pages of a Page/Blog, like Info, Attachments or History.
 java.util.List<Breadcrumb> getFilteredBreadcrumbTrail(ConfluenceActionSupport action, javax.servlet.http.HttpServletRequest request)
          Returns the breadcrumb trail after filtering.
 java.util.List<Breadcrumb> getFilteredBreadcrumbTrail(Space space, Breadcrumb breadcrumb)
          Returns the breadcrumb trail after filtering.
 Breadcrumb getSpaceAdminBreadcrumb(com.opensymphony.xwork.Action action, Space space)
          Returns the breadcrumb for a space admin action in a space.
 Breadcrumb getSpaceOperationsBreadcrumb(Space space)
          Returns the space operations breadcrumb (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBreadcrumbGenerator

public DefaultBreadcrumbGenerator(ThemeManager themeManager)
Method Detail

getFilteredBreadcrumbTrail

public java.util.List<Breadcrumb> getFilteredBreadcrumbTrail(ConfluenceActionSupport action,
                                                             javax.servlet.http.HttpServletRequest request)
Description copied from interface: BreadcrumbGenerator
Returns the breadcrumb trail after filtering. Since the new header (published in Confluence 5.0), we filter out the Dashboard from the breadcrumbs. We also filter out the last breadcrumb in the trail (usually the page name), unless the breadcrumb's filterTrailingBreadcrumb method returns false.

Specified by:
getFilteredBreadcrumbTrail in interface BreadcrumbGenerator
Parameters:
action - the action to build breadcrumbs for
request - the request to build breadcrumbs for
Returns:
the filtered trail of breadcrumbs

getFilteredBreadcrumbTrail

public java.util.List<Breadcrumb> getFilteredBreadcrumbTrail(Space space,
                                                             Breadcrumb breadcrumb)
Description copied from interface: BreadcrumbGenerator
Returns the breadcrumb trail after filtering. This method should be used when a breadcrumb is generated independently of an action - E.g. when showing the new location of a page in the move page dialog.

Specified by:
getFilteredBreadcrumbTrail in interface BreadcrumbGenerator
Parameters:
space - the space in which the breadcrumb belongs, or null when this is not applicable
breadcrumb - the breadcrumb to retrieve a filtered trail for
Returns:
the filtered trail of breadcrumbs

getContentActionBreadcrumb

public Breadcrumb getContentActionBreadcrumb(com.opensymphony.xwork.Action action,
                                             Space space,
                                             AbstractPage page,
                                             DisplayableLabel label)
Description copied from interface: BreadcrumbGenerator
Returns an appropriate breadcrumb for the given action, space, page and label.

Specified by:
getContentActionBreadcrumb in interface BreadcrumbGenerator
Parameters:
action - the action to retrieve the breadcrumb for
space - the space to retrieve the breadcrumb for, can be null for global labels
page - the page to retrieve the breadcrumb for, can be null when retrieving breadcrumb for a label
label - the label to retrieve the breadcrumb for, can be null when retrieving breadcrumb for a page
Returns:
the appropriate content breadcrumb for the given action, space, page and label.

getContentBreadcrumb

public Breadcrumb getContentBreadcrumb(Space space,
                                       AbstractPage page)
Description copied from interface: BreadcrumbGenerator
Returns an appropriate breadcrumb for a page or blogpost

Specified by:
getContentBreadcrumb in interface BreadcrumbGenerator
Parameters:
space - the space to retrieve the breadcrumb for
page - the page or blogpost to retrieve the breadcrumb for
Returns:
the breadcrumb for the content

getContentCollectorBreadcrumb

public Breadcrumb getContentCollectorBreadcrumb(Space space,
                                                java.lang.Class contentClass)
Description copied from interface: BreadcrumbGenerator
Returns an appropriate collector page breadcrumb to represent content at the root level of a space conforming to the new space information architecture. This should only be used for retrieving a breadcrumb for content creation at the root level of a space - once the content exists, the breadcrumb for that content should be used instead.

Specified by:
getContentCollectorBreadcrumb in interface BreadcrumbGenerator
Parameters:
space - the space to retrieve a collector breadcrumb for.
contentClass - the type of content to retrieve a collector breadcrumb for.
Returns:
the breadcrumb for an appropriate collector page, or null when there is nothing applicable.

getSpaceAdminBreadcrumb

public Breadcrumb getSpaceAdminBreadcrumb(com.opensymphony.xwork.Action action,
                                          Space space)
Description copied from interface: BreadcrumbGenerator
Returns the breadcrumb for a space admin action in a space.

Specified by:
getSpaceAdminBreadcrumb in interface BreadcrumbGenerator
Parameters:
action - the action to retrieve a space admin breadcrumb for.
space - the space to retrieve a space admin breadcrumb for.
Returns:
a space admin breadcrumb.

getSpaceOperationsBreadcrumb

public Breadcrumb getSpaceOperationsBreadcrumb(Space space)
Description copied from interface: BreadcrumbGenerator
Returns the space operations breadcrumb (i.e. Browse Space for spaces that don't conform to the new space information architecture) in a space.

Specified by:
getSpaceOperationsBreadcrumb in interface BreadcrumbGenerator
Parameters:
space - the space to retrieve a space operations breadcrumb for.
Returns:
a space operations breadcrumb.

getAdvancedBreadcrumb

public Breadcrumb getAdvancedBreadcrumb(Space space)
Description copied from interface: BreadcrumbGenerator
Returns the advanced breadcrumb in a space. This falls back to the Browse Space breadcrumb for spaces that don't conform to the new space information architecture. This is the same fallback as for Space Operations, but we shouldn't run into a scenario where both breadcrumbs are requested.

Specified by:
getAdvancedBreadcrumb in interface BreadcrumbGenerator
Parameters:
space - the space to retrieve an advanced breadcrumb for.
Returns:
the advanced breadcrumb

getBlogCollectorBreadcrumb

public Breadcrumb getBlogCollectorBreadcrumb(Space space)
Specified by:
getBlogCollectorBreadcrumb in interface BreadcrumbGenerator

getContentDetailActionBreadcrumb

public Breadcrumb getContentDetailActionBreadcrumb(com.opensymphony.xwork.Action action,
                                                   Space space,
                                                   AbstractPage page)
Breadcrumb for the "detail" pages of a Page/Blog, like Info, Attachments or History. It displays "Collector > Parent > Page Name".

This breadcrumb is not to be used for actions on content itself, like ViewPageAction, which should use getContentActionBreadcrumb(Action, Space, AbstractPage, DisplayableLabel).

Specified by:
getContentDetailActionBreadcrumb in interface BreadcrumbGenerator
Parameters:
action - the action to retrieve the breadcrumb for
space - the space to retrieve the breadcrumb for
page - the page to retrieve the breadcrumb for
Returns:
the breadcrumb for the Content Details.


Copyright © 2003-2014 Atlassian. All Rights Reserved.