public abstract class LicensedConfluenceMacro
extends org.randombits.support.confluence.ConfluenceMacro
ConfluenceMacro 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(MacroInfo) method instead of the usual
execute(MacroInfo) method. This is called if the license is verified
to be valid.
| Constructor and Description |
|---|
LicensedConfluenceMacro(org.randombits.support.core.env.EnvironmentAssistant environmentAssistant,
com.atlassian.confluence.xhtml.api.XhtmlContent xhtmlContent,
org.randombits.support.core.text.I18NAssistant i18nAssistant) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract de.schlichtherle.license.LicenseManager |
createLicenseManager()
This method is called to create the license manager.
|
protected String |
execute(org.randombits.support.confluence.MacroInfo info) |
protected String |
executeUnverified(org.randombits.support.confluence.MacroInfo info,
Exception e)
This method is executed when verification fails.
|
protected abstract String |
executeVerified(org.randombits.support.confluence.MacroInfo info)
This method is called when the plugin has its license successfully
verified - that is, the macro can be used.
|
protected de.schlichtherle.license.LicenseManager |
getLicenseManager()
Provides the license manager for this macro.
|
closeMacroInfo, createMacroInfo, execute, getEnvironmentAssistant, getXhtmlContentpublic LicensedConfluenceMacro(org.randombits.support.core.env.EnvironmentAssistant environmentAssistant,
com.atlassian.confluence.xhtml.api.XhtmlContent xhtmlContent,
org.randombits.support.core.text.I18NAssistant i18nAssistant)
protected final String execute(org.randombits.support.confluence.MacroInfo info) throws com.atlassian.confluence.macro.MacroExecutionException
execute in class org.randombits.support.confluence.ConfluenceMacrocom.atlassian.confluence.macro.MacroExecutionExceptionprotected String executeUnverified(org.randombits.support.confluence.MacroInfo info, Exception e) throws com.atlassian.confluence.macro.MacroExecutionException
The default behaviour is to simply display the exception error message in a highlighted box.
info - The macro info.e - The exception thrown when verifying.com.atlassian.renderer.v2.macro.MacroException - if there is a problem while rendering the macro.com.atlassian.confluence.macro.MacroExecutionExceptionprotected abstract String executeVerified(org.randombits.support.confluence.MacroInfo info) throws com.atlassian.confluence.macro.MacroExecutionException
info - The macro info.com.atlassian.renderer.v2.macro.MacroException - if there is a problem while executing the macro.com.atlassian.confluence.macro.MacroExecutionExceptionprotected de.schlichtherle.license.LicenseManager getLicenseManager()
createLicenseManager() method, purely for performance
reasons.protected abstract de.schlichtherle.license.LicenseManager createLicenseManager()
getLicenseManager() instead of this method, for performance
reasons.Copyright © 2013 ServiceRocket. All rights reserved.