com.jalios.jcmsplugin.smiley
Class SmileyWikiPolicyFilter

java.lang.Object
  extended by com.jalios.jcms.policy.AbstractPolicyFilter
      extended by com.jalios.jcms.policy.BasicWikiPolicyFilter
          extended by com.jalios.jcmsplugin.smiley.SmileyWikiPolicyFilter
All Implemented Interfaces:
PluginComponent, PolicyFilter, WikiPolicyFilter, JPropertiesListener, Comparable

public class SmileyWikiPolicyFilter
extends BasicWikiPolicyFilter
implements JPropertiesListener, WikiPolicyFilter, PluginComponent


Field Summary
static String REVISION
           
 
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
order
 
Constructor Summary
SmileyWikiPolicyFilter()
           
 
Method Summary
 String beforeRendering(String text, Locale userLocale, WikiRenderingHints hints)
          Convert all emoticons in the given text to smileys.
 String getEmoticonIcon(String emoticon)
          Retrieves the relative smiley's icon path of an emoticon.
 String getEmoticonLabel(String emoticon, String lang)
          Retrieves the I18N label to use for an emoticon.
 List getEmoticonList()
          Retrieves a list of all emoticons managed by this wiki policy filter.
 String getEmoticonName(String emoticon)
          Retrieve the internal name of an emoticon.
static SmileyWikiPolicyFilter getInstance()
          Retrieves the instance of SmileyWikiPolicyFilter being used to perform emoticon to smiley conversion.
 boolean init(Plugin plugin)
          Initialize the component with the given plugin configuration
 void propertiesChange(JProperties properties)
           
protected  void reloadProperties()
          Load smiley plugin properties and update internal variable used by this wiki policy filter for emoticon to smiley conversion.
 
Methods inherited from class com.jalios.jcms.policy.BasicWikiPolicyFilter
afterRendering
 
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter
compareTo, equals, getOrder, setOrder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jalios.jcms.policy.WikiPolicyFilter
afterRendering
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Constructor Detail

SmileyWikiPolicyFilter

public SmileyWikiPolicyFilter()
Method Detail

getInstance

public static SmileyWikiPolicyFilter getInstance()
Retrieves the instance of SmileyWikiPolicyFilter being used to perform emoticon to smiley conversion.

Returns:
current instance being used or null if not available

reloadProperties

protected void reloadProperties()
Load smiley plugin properties and update internal variable used by this wiki policy filter for emoticon to smiley conversion.


getEmoticonList

public List getEmoticonList()
Retrieves a list of all emoticons managed by this wiki policy filter.

Returns:
a List of String, each string is a emoticon e.g [ ":)", ":D" ]

getEmoticonName

public String getEmoticonName(String emoticon)
Retrieve the internal name of an emoticon.

Parameters:
emoticon - an emoticon, e.g. : ":)"
Returns:
the internal name under which the specified emoticon is referenced, e.g. : "smile"

getEmoticonIcon

public String getEmoticonIcon(String emoticon)
Retrieves the relative smiley's icon path of an emoticon.

Parameters:
emoticon - an emoticon, e.g. : ":)"
Returns:
the relative path of the smiley icon , e.g. : "smile"

getEmoticonLabel

public String getEmoticonLabel(String emoticon,
                               String lang)
Retrieves the I18N label to use for an emoticon.

Parameters:
emoticon - an emoticon, e.g. : ":)"
lang - an ISO-639 code in which to retrieve the label
Returns:
a I18N label, e.g : "Smiling"

init

public boolean init(Plugin plugin)
Description copied from interface: PluginComponent
Initialize the component with the given plugin configuration

Specified by:
init in interface PluginComponent
Overrides:
init in class BasicWikiPolicyFilter
Parameters:
plugin - the calling plugin
Returns:
true if the conponent has been correctly initialized.
Since:
jcms-5.7.1
See Also:
PluginComponent.init(Plugin)

propertiesChange

public void propertiesChange(JProperties properties)
Specified by:
propertiesChange in interface JPropertiesListener
See Also:
JPropertiesListener.propertiesChange(JProperties)

beforeRendering

public String beforeRendering(String text,
                              Locale userLocale,
                              WikiRenderingHints hints)
Convert all emoticons in the given text to smileys.

Specified by:
beforeRendering in interface WikiPolicyFilter
Overrides:
beforeRendering in class BasicWikiPolicyFilter
Parameters:
text - the text to be rendered.
userLocale - an optionnal Locale of the user for which the text will be generated
hints - the rendering options to use.
Returns:
the text.
See Also:
WikiPolicyFilter.beforeRendering(String, Locale, WikiRenderingHints)


Copyright © 2001-2007 Jalios SA. All Rights Reserved.