|
Jive API (3.0.13) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.renderer.BaseMacro
public abstract class BaseMacro
A Base class to be used to create macros.
Name : Used to change the name of the macro. If not used getClass().getShortName() is used.
Description : A description of the macro. No description by default.
Subclasses of this macro can be configured by using annotions:EnableByDefault : Whether this macro is enabled or disabled by default. The default value is true.
SingleTagMacro : Whether this macro is a single tag, or has two tags and body content. The default value is true.
RenderTypes : RenderTypes this macro works for. Default is RenderType.BODY
Name,
Description,
EnableByDefault,
SingleTagMacro,
RenderType| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.jivesoftware.community.renderer.RenderMacro |
|---|
RenderMacro.Type |
| Constructor Summary | |
|---|---|
BaseMacro()
|
|
| Method Summary | |
|---|---|
protected static String |
applyFreemarkerTemplate(freemarker.template.Configuration config,
Map<String,Object> properties,
String templateName)
Processes the specified template file and returns a String containing the content of the template file. |
protected String |
convertToOriginalWikiText(Element element)
|
List< |
getAllowedParameters()
return a list of all parameters allowed by this macro |
protected String |
getDefaultParameterValue(Element element)
|
protected String |
getDefaultParameterValue(Element element,
boolean parseContent)
|
String |
getIcon()
returns the relative path of the icon image. |
List<MacroParameterSet> |
getMacroParameterSets()
Returns a list of all available default parameter implementations, if any |
RenderMacro.Type |
getMacroTag()
returns tag type |
String |
getName()
Returns the name of the macro tag. |
int |
getOrder()
returns the order the macro should be run in. 0 should be "normal" |
Map<String,String> |
getParameters()
Returns the parameters passed into this tag. |
String |
getShortMacroName()
Returns the name of the macro tag Defined by the MacroTagName annotation if defined, otherwise the value of getClass().getShortName() will be used. |
String |
getUrl()
Returns an optional URL for setting this macro's properties or an empty String if none |
protected User |
getUser(RenderContext renderContext)
|
protected void |
handleError(Exception e,
Element element,
String messageKey,
String... params)
|
boolean |
isButton()
Returns true if the macro should be displayed as a button in the toolbar as opposed to the insert menu |
boolean |
isEnabled()
|
protected boolean |
isEnabledByDefault()
Returns the value of the EnableByDefault annotation if it is defined, else true. |
boolean |
isIncludeContainerAsUrlParam()
Should the container id and type be included in the url that is included in the macro's RTE menu item. |
boolean |
isIncludeJiveContentObjectAsUrlParam()
Should the content object id and type be included in the url that is included in the macro's RTE menu item. |
boolean |
isShowInRTE()
Returns true if the macro should be displayed and edited using the RTE editor |
boolean |
isShowSettings()
returns true if the macro's settings should be editable in the RTE |
boolean |
isSingleTagMacro()
Returns the value of the SingleTagMacro annotation if it is defined, other wise true. |
void |
setEnabled(boolean enabled)
|
void |
setParameters(Map<String,String> parameters)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.jivesoftware.community.renderer.RenderMacro |
|---|
execute |
| Constructor Detail |
|---|
public BaseMacro()
| Method Detail |
|---|
public String getShortMacroName()
getShortMacroName in interface RenderMacropublic String getName()
public String getUrl()
getUrl in interface RenderMacropublic boolean isSingleTagMacro()
isSingleTagMacro in interface RenderMacropublic int getOrder()
getOrder in interface RenderMacropublic String getIcon()
RenderMacro
getIcon in interface RenderMacropublic boolean isShowInRTE()
isShowInRTE in interface RenderMacropublic boolean isButton()
RenderMacro
isButton in interface RenderMacropublic boolean isShowSettings()
RenderMacro
isShowSettings in interface RenderMacropublic List<> getAllowedParameters()
getAllowedParameters in interface RenderMacropublic List<MacroParameterSet> getMacroParameterSets()
getMacroParameterSets in interface RenderMacropublic Map<String,String> getParameters()
public void setParameters(Map<String,String> parameters)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public RenderMacro.Type getMacroTag()
getMacroTag in interface RenderMacropublic boolean isIncludeJiveContentObjectAsUrlParam()
RenderMacro
isIncludeJiveContentObjectAsUrlParam in interface RenderMacropublic boolean isIncludeContainerAsUrlParam()
RenderMacro
isIncludeContainerAsUrlParam in interface RenderMacroprotected boolean isEnabledByDefault()
protected String getDefaultParameterValue(Element element,
boolean parseContent)
protected String convertToOriginalWikiText(Element element)
protected String getDefaultParameterValue(Element element)
protected User getUser(RenderContext renderContext)
protected static String applyFreemarkerTemplate(freemarker.template.Configuration config,
Map<String,Object> properties,
String templateName)
config - the freemarker configurationproperties - used for the freemarker contexttemplateName - name of the template
protected void handleError(Exception e,
Element element,
String messageKey,
String... params)
|
Jive Product Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||