|
Clearspace API (2.5.29) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.widget.BaseWidget
public abstract class BaseWidget
An abstract implementation of the Widget interface this class provides subclasses with built in support for
processing a freemarker template and internationalization. It is recommended that all Widgets extend this
base class, rather than implementing the Widget interface directly.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.jivesoftware.community.widget.Widget |
|---|
Widget.ContainerSize |
| Field Summary | |
|---|---|
static String |
ERROR_TEMPLATE_FILE
|
static String |
FEATURE_DISABLED_FILE
|
protected com.jivesoftware.community.web.struts.JiveFreemarkerManager |
freemarkerManager
|
protected com.jivesoftware.community.license.ClearspaceLicenseManager |
licenseManager
|
| Constructor Summary | |
|---|---|
BaseWidget()
|
|
| Method Summary | |
|---|---|
protected void |
addError(Map<String,Object> properties,
String localizedString)
|
protected String |
applyFreemarkerTemplate(com.jivesoftware.community.widget.WidgetContext widgetContext,
Widget.ContainerSize size,
String templateName)
Processes the specified template file and returns a String containing the content of the template file. |
String |
getCssClass()
Returns a custom css class for the widget, or null if a custom css class does not exist. |
String |
getCustomTitle()
Returns a custom title that will override the default title when the widget is rendered, or null if a custom title does not exist. |
String |
getFeedURL()
Returns the location of a feed for this widget or null if no feed exists. |
long |
getID()
Gets the internal id of the widget |
protected String |
getLocalizedString(String key,
com.jivesoftware.community.widget.WidgetContext widgetContext)
|
boolean |
isEnabled(com.jivesoftware.community.widget.WidgetContext widgetContext)
Gives widgets the ability to determine whether or not the widget should be available for end users / administrators to add in a specific widget context. |
protected boolean |
isModuleAvailable(String name,
com.jivesoftware.community.widget.WidgetContext widgetContext)
|
boolean |
isPropertyEnabled(com.jivesoftware.community.widget.WidgetContext widgetContext,
String propName)
Gives widgets the ability to determine whether or not a specific property should be available during editing of the widget by end users / administrators. |
protected Map<String,Object> |
loadProperties(com.jivesoftware.community.widget.WidgetContext widgetContext,
Widget.ContainerSize size)
Responsible for parsing the request URL and adding the necessary parameters to the freemarker context. |
protected static String |
processFreemarkerTemplate(freemarker.template.Configuration config,
freemarker.template.SimpleHash model,
String templateName,
Locale locale,
TimeZone timeZone)
Processes the specified template file and returns a String containing the content of the template file. |
void |
setCustomTitle(String customTitle)
Sets a custom title that will override the default title when the widget is rendered. |
void |
setFreemarkerManager(com.jivesoftware.community.web.struts.JiveFreemarkerManager mgr)
|
void |
setID(long ID)
Sets the internal id of the widget |
void |
setLicenseManager(com.jivesoftware.community.license.ClearspaceLicenseManager licenseManager)
|
protected String |
stripHTMLTags(String html)
|
| 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.widget.Widget |
|---|
getDescription, getTitle, render |
| Field Detail |
|---|
public static final String FEATURE_DISABLED_FILE
public static final String ERROR_TEMPLATE_FILE
protected com.jivesoftware.community.web.struts.JiveFreemarkerManager freemarkerManager
protected com.jivesoftware.community.license.ClearspaceLicenseManager licenseManager
| Constructor Detail |
|---|
public BaseWidget()
| Method Detail |
|---|
public void setFreemarkerManager(com.jivesoftware.community.web.struts.JiveFreemarkerManager mgr)
public void setLicenseManager(com.jivesoftware.community.license.ClearspaceLicenseManager licenseManager)
public final long getID()
Widget
getID in interface Widgetpublic final void setID(long ID)
Widget
setID in interface WidgetID - the internal id of the widgetpublic final String getCustomTitle()
Widget
getCustomTitle in interface Widgetpublic final void setCustomTitle(String customTitle)
Widget
setCustomTitle in interface WidgetcustomTitle - a custom title that will override the default title when the widget is rendered.public String getCssClass()
Widget
getCssClass in interface Widgetpublic String getFeedURL()
Widget
getFeedURL in interface Widgetpublic boolean isEnabled(com.jivesoftware.community.widget.WidgetContext widgetContext)
Widget
isEnabled in interface WidgetwidgetContext - the context the widget would be rendered in
public boolean isPropertyEnabled(com.jivesoftware.community.widget.WidgetContext widgetContext,
String propName)
Widget
isPropertyEnabled in interface WidgetwidgetContext - the context the widget would be rendered inpropName - the property to enable for editing
protected String applyFreemarkerTemplate(com.jivesoftware.community.widget.WidgetContext widgetContext,
Widget.ContainerSize size,
String templateName)
widgetContext - the widget context used to render this widgetsize - the ContainerSize to rendertemplateName - name of the template
protected static String processFreemarkerTemplate(freemarker.template.Configuration config,
freemarker.template.SimpleHash model,
String templateName,
Locale locale,
TimeZone timeZone)
config - the freemarker configurationmodel - used for the freemarker contexttemplateName - name of the templatelocale - the locale of the template or null for the default localetimeZone - the timeZone of the template or null for the default timezone
protected Map<String,Object> loadProperties(com.jivesoftware.community.widget.WidgetContext widgetContext,
Widget.ContainerSize size)
widgetContext - the widget context used to render the widgetsize - the ContainerSize to render
protected boolean isModuleAvailable(String name,
com.jivesoftware.community.widget.WidgetContext widgetContext)
protected String getLocalizedString(String key,
com.jivesoftware.community.widget.WidgetContext widgetContext)
protected String stripHTMLTags(String html)
protected void addError(Map<String,Object> properties,
String localizedString)
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||