de.speexx.pebble.decorator
Class EmoticonConfigurator

java.lang.Object
  extended byde.speexx.pebble.decorator.EmoticonConfigurator

public abstract class EmoticonConfigurator
extends java.lang.Object

The default configurator uses a configuration file in the root directory of the blog called "emoticon.conf". The config file comes in XML with the following structure: (italic fields are optional)

 <emoticon-decorator>
     <entries xml:base='http://www.speexx.de/icons/'>
         <entry>
             <emoticon-regex>\:\-\)</emoticon-regex>
             <image-url>simple-smily.png</image-url>
             <attribute name='alt' value='[SMILY]' />
             <attribute name='title' value='Smily' />
             <attribute name='width' value='12' />
             <attribute name='height' value='12' />
             <!-- more 'attribute' elements -->
         </entry>
         <!-- more 'entry' elements -->
     </entries>
     <!-- more 'entries' elements -->
 </emoticon-decorator>
 

The <image-url> element definies the URL (relative or absolut) to the image. The URL may be relative to the xml:base-attribute.

<emoticon-regex> definies the pattern of the emoticon character sequence in the content.

The attribute element contains all other possible elements of the emoticon image replacement.

It is possible to define mor than one <entries> parts in an configuration file.

Author:
Sascha Kohlmann

Nested Class Summary
static class EmoticonConfigurator.ConfigHandler
          Base handler for Emoticon configs.
 
Field Summary
static java.lang.String CONFIG
          The name of the config file.
 
Constructor Summary
protected EmoticonConfigurator()
          Use factory method.
 
Method Summary
 java.util.List load(pebble.blog.Blog blog)
          Loads the configuration of the emoticons and returns them in a Collection of Emoticons.
static EmoticonConfigurator newInstance()
          Returns a new EmoticonConfigurator instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG

public static final java.lang.String CONFIG
The name of the config file.

See Also:
Constant Field Values
Constructor Detail

EmoticonConfigurator

protected EmoticonConfigurator()
Use factory method.

Method Detail

newInstance

public static EmoticonConfigurator newInstance()
Returns a new EmoticonConfigurator instance.

Returns:
a new EmoticonConfigurator instance.

load

public java.util.List load(pebble.blog.Blog blog)
Loads the configuration of the emoticons and returns them in a Collection of Emoticons.

Parameters:
blog - the blo to get the configuration for.
Returns:
a Collection of Emoticons.


Copyright © 2005 . All Rights Reserved.