public abstract class

ContentFilteringMacro

extends BaseMacro
java.lang.Object
   ↳ com.atlassian.renderer.v2.macro.BaseMacro
     ↳ com.atlassian.confluence.macro.ContentFilteringMacro
Known Direct Subclasses

Class Overview

Convenience class that provides default values for macros which retrieve content from somewhere else in Confluence.

Summary

Constants
String DEFAULT_MAX_RESULTS Default value for a maxResults parameter.
String DEFAULT_SPACE_KEY Default value for a spaceKey parameter.
[Expand]
Inherited Constants
From interface com.atlassian.renderer.v2.macro.Macro
Fields
protected final AuthorParameter authorParam Parameter to handle the creator/author of the content.
protected final ContentTypeParameter contentTypeParam Parameter to handle content type filtering.
protected final LabelParameter labelParam Parameter to handle label filtering.
protected final MaxResultsParameter maxResultsParam Parameter to handle the maximum number of results.
protected SearchManager searchManager SearchManager instance for handling queries based on parameter values.
protected final SearchSortParameter sortParam Parameter that describes the type of sort to perform on the content.
protected final SpaceKeyParameter spaceKeyParam Parameter to handle space key filtering.
Public Constructors
ContentFilteringMacro()
Public Methods
final String execute(Map params, String body, RenderContext renderContext)
This implementation is final to ensure that subclasses are provided with a valid MacroExecutionContext.
void setSearchManager(SearchManager searchManager)
Injector for SearchManager.
Protected Methods
abstract String execute(MacroExecutionContext ctx)
Subclasses must override macro-specific functionality in this method.
[Expand]
Inherited Methods
From class com.atlassian.renderer.v2.macro.BaseMacro
From class java.lang.Object
From interface com.atlassian.renderer.v2.macro.Macro

Constants

public static final String DEFAULT_MAX_RESULTS

Default value for a maxResults parameter.

Constant Value: "15"

public static final String DEFAULT_SPACE_KEY

Default value for a spaceKey parameter.

Constant Value: "@self"

Fields

protected final AuthorParameter authorParam

Parameter to handle the creator/author of the content.

protected final ContentTypeParameter contentTypeParam

Parameter to handle content type filtering.

protected final LabelParameter labelParam

Parameter to handle label filtering.

protected final MaxResultsParameter maxResultsParam

Parameter to handle the maximum number of results.

protected SearchManager searchManager

SearchManager instance for handling queries based on parameter values.

protected final SearchSortParameter sortParam

Parameter that describes the type of sort to perform on the content.

protected final SpaceKeyParameter spaceKeyParam

Parameter to handle space key filtering.

Public Constructors

public ContentFilteringMacro ()

Public Methods

public final String execute (Map params, String body, RenderContext renderContext)

This implementation is final to ensure that subclasses are provided with a valid MacroExecutionContext.

Parameters
params the macro parameters
body the macro body
renderContext the RenderContext provided to the macro
Returns
  • the processed wiki or HTML for displaying
Throws
MacroException if the macro fails to execute

public void setSearchManager (SearchManager searchManager)

Injector for SearchManager.

Parameters
searchManager the SearchManager to inject

Protected Methods

protected abstract String execute (MacroExecutionContext ctx)

Subclasses must override macro-specific functionality in this method.

Parameters
ctx the MacroExecutionContext for this invocation
Returns
  • the processed wiki or HTML for displaying
Throws
MacroException if the macro fails to execute