public abstract class LicensedBaseMacro
extends com.atlassian.renderer.v2.macro.BaseMacro
BaseMacro which checks for a valid
license being installed before continuing with normal execution of the macro.
Implementors of this class should put their usual macro code in the
executeVerified(Map, String, RenderContext) method instead of the
usual execute(Map, String, RenderContext) method. This is called if
the license is verified to be valid.
| Constructor and Description |
|---|
LicensedBaseMacro() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract de.schlichtherle.license.LicenseManager |
createLicenseManager()
This method is called to initially create the license manager.
|
String |
execute(Map params,
String body,
com.atlassian.renderer.RenderContext ctx) |
protected String |
executeUnverified(Map<String,String> params,
String body,
com.atlassian.renderer.RenderContext ctx,
Exception e)
This method is executed when verification fails.
|
protected abstract String |
executeVerified(Map<String,String> params,
String body,
com.atlassian.renderer.RenderContext ctx)
Executed if the current license is verified - that is, the macro can
execute successfully.
|
protected de.schlichtherle.license.LicenseManager |
getLicenseManager() |
getTokenType, getWysiwygBodyType, isInline, suppressMacroRenderingDuringWysiwyg, suppressSurroundingTagDuringWysiwygRenderingpublic final String execute(Map params, String body, com.atlassian.renderer.RenderContext ctx) throws com.atlassian.renderer.v2.macro.MacroException
com.atlassian.renderer.v2.macro.MacroExceptionprotected String executeUnverified(Map<String,String> params, String body, com.atlassian.renderer.RenderContext ctx, Exception e) throws com.atlassian.renderer.v2.macro.MacroException
The default behaviour is to simply display the exception error message in a highlighted box.
params - The macro parameters.body - The macro body text.ctx - The render context.e - The exception thrown when verifying.com.atlassian.renderer.v2.macro.MacroException - if there is a problem while rendering the macro.protected abstract String executeVerified(Map<String,String> params, String body, com.atlassian.renderer.RenderContext ctx) throws com.atlassian.renderer.v2.macro.MacroException
params - The macro parameters.body - The macro body.ctx - The render context.com.atlassian.renderer.v2.macro.MacroException - if there is a problem while executing the macro.protected de.schlichtherle.license.LicenseManager getLicenseManager()
protected abstract de.schlichtherle.license.LicenseManager createLicenseManager()
getLicenseManager() instead of this method, for performance
reasons.Copyright © 2013 ServiceRocket. All rights reserved.