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.BaseMacro
Convenience class that provides default values for macros which retrieve
content from somewhere else in Confluence.
- Since:
- 2.9
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AuthorParameterParameter to handle the creator/author of the content.protected final ContentTypeParameterParameter to handle content type filtering.static final StringDefault value for amaxResultsparameter.static final StringDefault value for aspaceKeyparameter.protected final LabelParameterParameter to handle label filtering.protected final MaxResultsParameterParameter to handle the maximum number of results.protected SearchManagerSearchManagerinstance for handling queries based on parameter values.protected final SearchSortParameterParameter that describes the type of sort to perform on the content.protected final SpaceKeyParameterParameter to handle space key filtering.Fields inherited from interface com.atlassian.renderer.v2.macro.Macro
RAW_PARAMS_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringSubclasses must override macro-specific functionality in this method.final StringThis 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, suppressSurroundingTagDuringWysiwygRenderingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.renderer.v2.macro.Macro
getBodyRenderMode, hasBody
-
Field Details
-
DEFAULT_MAX_RESULTS
Default value for amaxResultsparameter.- See Also:
-
DEFAULT_SPACE_KEY
Default value for aspaceKeyparameter.- See Also:
-
labelParam
Parameter to handle label filtering. -
contentTypeParam
Parameter to handle content type filtering. -
spaceKeyParam
Parameter to handle space key filtering. -
authorParam
Parameter to handle the creator/author of the content. -
maxResultsParam
Parameter to handle the maximum number of results. -
sortParam
Parameter that describes the type of sort to perform on the content. -
searchManager
SearchManagerinstance for handling queries based on parameter values.
-
-
Constructor Details
-
ContentFilteringMacro
public ContentFilteringMacro()
-
-
Method Details
-
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
Injector forSearchManager.- Parameters:
searchManager- theSearchManagerto inject
-