Package com.atlassian.confluence.macro
Class ContentFilteringMacro
- java.lang.Object
-
- com.atlassian.renderer.v2.macro.BaseMacro
-
- com.atlassian.confluence.macro.ContentFilteringMacro
-
- All Implemented Interfaces:
com.atlassian.renderer.v2.macro.Macro
public abstract class ContentFilteringMacro extends com.atlassian.renderer.v2.macro.BaseMacroConvenience class that provides default values for macros which retrieve content from somewhere else in Confluence.- Since:
- 2.9
-
-
Field Summary
Fields Modifier and Type Field Description protected AuthorParameterauthorParamParameter to handle the creator/author of the content.protected ContentTypeParametercontentTypeParamParameter to handle content type filtering.static StringDEFAULT_MAX_RESULTSDefault value for amaxResultsparameter.static StringDEFAULT_SPACE_KEYDefault value for aspaceKeyparameter.protected LabelParameterlabelParamParameter to handle label filtering.protected MaxResultsParametermaxResultsParamParameter to handle the maximum number of results.protected SearchManagersearchManagerSearchManagerinstance for handling queries based on parameter values.protected SearchSortParametersortParamParameter that describes the type of sort to perform on the content.protected SpaceKeyParameterspaceKeyParamParameter to handle space key filtering.
-
Constructor Summary
Constructors Constructor Description ContentFilteringMacro()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Stringexecute(MacroExecutionContext ctx)Subclasses must override macro-specific functionality in this method.Stringexecute(Map params, String body, com.atlassian.renderer.RenderContext renderContext)This implementation is final to ensure that subclasses are provided with a validMacroExecutionContext.voidsetSearchManager(SearchManager searchManager)Injector forSearchManager.-
Methods inherited from class com.atlassian.renderer.v2.macro.BaseMacro
getTokenType, getWysiwygBodyType, isInline, suppressMacroRenderingDuringWysiwyg, suppressSurroundingTagDuringWysiwygRendering
-
-
-
-
Field Detail
-
DEFAULT_MAX_RESULTS
public static final String DEFAULT_MAX_RESULTS
Default value for amaxResultsparameter.- See Also:
- Constant Field Values
-
DEFAULT_SPACE_KEY
public static final String DEFAULT_SPACE_KEY
Default value for aspaceKeyparameter.- See Also:
- Constant Field Values
-
labelParam
protected final LabelParameter labelParam
Parameter to handle label filtering.
-
contentTypeParam
protected final ContentTypeParameter contentTypeParam
Parameter to handle content type filtering.
-
spaceKeyParam
protected final SpaceKeyParameter spaceKeyParam
Parameter to handle space key filtering.
-
authorParam
protected final AuthorParameter authorParam
Parameter to handle the creator/author of the content.
-
maxResultsParam
protected final MaxResultsParameter maxResultsParam
Parameter to handle the maximum number of results.
-
sortParam
protected final SearchSortParameter sortParam
Parameter that describes the type of sort to perform on the content.
-
searchManager
protected SearchManager searchManager
SearchManagerinstance for handling queries based on parameter values.
-
-
Method Detail
-
execute
public final String execute(Map params, String body, com.atlassian.renderer.RenderContext renderContext) throws com.atlassian.renderer.v2.macro.MacroException
This implementation is final to ensure that subclasses are provided with a validMacroExecutionContext.- Parameters:
params- the macro parametersbody- the macro bodyrenderContext- theRenderContextprovided to the macro- Returns:
- the processed wiki or HTML for displaying
- Throws:
com.atlassian.renderer.v2.macro.MacroException- if the macro fails to execute
-
execute
protected abstract String execute(MacroExecutionContext ctx) throws com.atlassian.renderer.v2.macro.MacroException
Subclasses must override macro-specific functionality in this method.- Parameters:
ctx- theMacroExecutionContextfor this invocation- Returns:
- the processed wiki or HTML for displaying
- Throws:
com.atlassian.renderer.v2.macro.MacroException- if the macro fails to execute
-
setSearchManager
public void setSearchManager(SearchManager searchManager)
Injector forSearchManager.- Parameters:
searchManager- theSearchManagerto inject
-
-