diff --git a/etc/emoticon.xml b/etc/emoticon.xml
new file mode 100644
index 0000000..e23edf2
--- /dev/null
+++ b/etc/emoticon.xml
@@ -0,0 +1,79 @@
+
+
+
+
+ :;
+
+ :)
+ emote/ei_smile.gif
+ Smile!
+
+
+ :(
+ emote/ei_frown.gif
+ frown...
+
+
+ :o
+ :O
+ emote/ei_redface.gif
+ Boy, is my face red!
+
+
+ :D
+ emote/ei_biggrin.gif
+ Grinnin'...
+
+
+ ;)
+ emote/ei_wink.gif
+ Wink wink, nudge nudge
+
+
+ :p
+ :P
+ emote/ei_tongue.gif
+ Bleah!
+
+
+ :cool:
+ emote/ei_cool.gif
+ Cool!
+
+
+ :rolleyes:
+ emote/ei_rolleyes.gif
+ Rolling my eyes
+
+
+ :mad:
+ emote/ei_mad.gif
+ I'm mad!
+
+
+ :eek:
+ emote/ei_eek.gif
+ EEK!
+
+
+ :confused:
+ emote/ei_confused.gif
+ Huh???
+
+
diff --git a/etc/ui-config.xml b/etc/ui-config.xml
index 28357d3..76e12c2 100644
--- a/etc/ui-config.xml
+++ b/etc/ui-config.xml
@@ -25,6 +25,9 @@
WEB-INF/services-config.xml
+
+ WEB-INF/emoticon.xml
+
WEB-INF/scripts
diff --git a/etc/venice-config.xml b/etc/venice-config.xml
index f77b5cf..3b2f45b 100644
--- a/etc/venice-config.xml
+++ b/etc/venice-config.xml
@@ -30,6 +30,9 @@
WEB-INF/services-config.xml
+
+ WEB-INF/emoticon.xml
+
diff --git a/src/com/silverwrist/util/DOMElementHelper.java b/src/com/silverwrist/util/DOMElementHelper.java
index bb787a4..fce632b 100644
--- a/src/com/silverwrist/util/DOMElementHelper.java
+++ b/src/com/silverwrist/util/DOMElementHelper.java
@@ -293,5 +293,3 @@ public final class DOMElementHelper
} // end getAttributeBoolean
} // end DOMElementHelper
-
-
diff --git a/src/com/silverwrist/venice/core/internals/GlobalSiteImpl.java b/src/com/silverwrist/venice/core/internals/GlobalSiteImpl.java
index 6bb9cc5..00f0e1e 100644
--- a/src/com/silverwrist/venice/core/internals/GlobalSiteImpl.java
+++ b/src/com/silverwrist/venice/core/internals/GlobalSiteImpl.java
@@ -143,9 +143,14 @@ public class GlobalSiteImpl implements GlobalSite
// Get the section.
DOMElementHelper config_h = new DOMElementHelper(config);
- Element sect = loader.configGetSubSection(config_h,"database");
+ Element sect = loader.configGetSubSection(config_h,"engine");
DOMElementHelper sect_h = new DOMElementHelper(sect);
+ // Get the name of the emoticons configuration file.
+ String emoticon_config = loader.configGetSubElementText(sect_h,"emoticon-config");
+ if (!(emoticon_config.startsWith("/")))
+ emoticon_config = application_root + emoticon_config;
+
// Get the value.
String s = sect_h.getSubElementText("privileged-addresses");
if (!(StringUtil.isStringEmpty(s)))
@@ -225,6 +230,8 @@ public class GlobalSiteImpl implements GlobalSite
intermediate_map.put(postlink_rewriter.getClass().getName(),postlink_rewriter);
UserNameRewriter username_rewriter = new UserNameRewriter(this);
intermediate_map.put(username_rewriter.getClass().getName(),username_rewriter);
+ EmoticonRewriter emoticon_rewriter = new EmoticonRewriter(emoticon_config);
+ intermediate_map.put(emoticon_rewriter.getClass().getName(),emoticon_rewriter);
// Get the section.
sect = loader.configGetSubSection(config_h,"html-checker");
diff --git a/src/com/silverwrist/venice/htmlcheck/filters/EmoticonRewriter.java b/src/com/silverwrist/venice/htmlcheck/filters/EmoticonRewriter.java
new file mode 100644
index 0000000..132856a
--- /dev/null
+++ b/src/com/silverwrist/venice/htmlcheck/filters/EmoticonRewriter.java
@@ -0,0 +1,111 @@
+/*
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at .
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
+ * language governing rights and limitations under the License.
+ *
+ * The Original Code is the Venice Web Community System.
+ *
+ * The Initial Developer of the Original Code is Eric J. Bowersox ,
+ * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
+ * Copyright (C) 2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
+ *
+ * Contributor(s):
+ */
+package com.silverwrist.venice.htmlcheck.filters;
+
+import java.util.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.htmlcheck.Rewriter;
+import com.silverwrist.venice.htmlcheck.RewriterServices;
+import com.silverwrist.venice.htmlcheck.MarkupData;
+import com.silverwrist.venice.util.XMLLoader;
+
+public class EmoticonRewriter implements Rewriter
+{
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private String m_prefixchars;
+ private Map m_patmap;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ public EmoticonRewriter(String config_file) throws ConfigException
+ {
+ // Load the configuration file.
+ XMLLoader loader = XMLLoader.get();
+ Document config = loader.loadConfigDocument(config_file);
+ Element root = loader.configGetRootElement(config,"emoticon-config");
+
+ // Get the set of prefix characters.
+ m_prefixchars = loader.configGetSubElementText(root,"prefix-chars");
+
+ HashMap tmp = new HashMap();
+
+ // Look for all associated icons.
+ NodeList nl = root.getChildNodes();
+ for (int i=0; i elements
+ Node n2 = nl2.item(i);
+ if ((n2.getNodeType()==Node.ELEMENT_NODE) && n2.getNodeName().equals("pattern"))
+ { // get the element text
+ DOMElementHelper h = new DOMElementHelper((Element)n2);
+ String pattern = h.getElementText();
+ if (m_prefixchars.indexOf(pattern.charAt(0))>=0)
+ tmp.put(pattern,icon_name);
+
+ } // end if
+ // else skip this element
+
+ } // end for
+
+ } // end if
+ // else skip this element
+
+ } // end for
+
+ if (tmp.isEmpty())
+ m_patmap = Collections.EMPTY_MAP;
+ else
+ m_patmap = Collections.unmodifiableMap(tmp);
+
+ } // end constructor
+
+ /*--------------------------------------------------------------------------------
+ * Implementations from interface Rewriter
+ *--------------------------------------------------------------------------------
+ */
+
+ public String getName()
+ {
+ return "emoticon";
+
+ } // end getName
+
+ public MarkupData rewrite(String data, RewriterServices svc)
+ {
+ return null;
+
+ } // end rewrite
+
+} // end class EmoticonRewriter
diff --git a/src/com/silverwrist/venice/ui/config/EmoticonManager.java b/src/com/silverwrist/venice/ui/config/EmoticonManager.java
new file mode 100644
index 0000000..d8bbe96
--- /dev/null
+++ b/src/com/silverwrist/venice/ui/config/EmoticonManager.java
@@ -0,0 +1,109 @@
+/*
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * (the "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at .
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis, WITHOUT
+ * WARRANTY OF ANY KIND, either express or implied. See the License for the specific
+ * language governing rights and limitations under the License.
+ *
+ * The Original Code is the Venice Web Communities System.
+ *
+ * The Initial Developer of the Original Code is Eric J. Bowersox ,
+ * for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
+ * Copyright (C) 2004 Eric J. Bowersox/Silverwrist Design Studios. All Rights Reserved.
+ *
+ * Contributor(s):
+ */
+package com.silverwrist.venice.ui.config;
+
+import java.util.*;
+import org.w3c.dom.*;
+import com.silverwrist.util.*;
+import com.silverwrist.venice.except.*;
+import com.silverwrist.venice.util.XMLLoader;
+
+public class EmoticonManager
+{
+ /*--------------------------------------------------------------------------------
+ * Internal class that contains the icon data.
+ *--------------------------------------------------------------------------------
+ */
+
+ private static class IconDefinition
+ {
+ /*====================================================================
+ * Attributes
+ *====================================================================
+ */
+
+ private int m_width;
+ private int m_height;
+ private boolean m_fixup;
+ private String m_path;
+ private String m_text;
+
+ /*====================================================================
+ * Constructor
+ *====================================================================
+ */
+
+ IconDefinition(Element icon_elt) throws ConfigException
+ {
+ XMLLoader loader = XMLLoader.get();
+ DOMElementHelper h = new DOMElementHelper(icon_elt);
+
+ // Get the icon image data.
+ Element img_elt = loader.configGetSubSection(h,"image");
+ m_width = loader.configGetAttributeInt(img_elt,"width");
+ m_height = loader.configGetAttributeInt(img_elt,"height");
+ DOMElementHelper h2 = new DOMElementHelper(img_elt);
+ m_fixup = h2.getAttributeBoolean("fixup",false).booleanValue();
+ m_path = h2.getElementText();
+
+ // Get the text data.
+ m_text = h.getSubElementText("text");
+
+ } // end constructor
+
+ } // end class IconDefinition
+
+ /*--------------------------------------------------------------------------------
+ * Attributes
+ *--------------------------------------------------------------------------------
+ */
+
+ private Map m_iconmap;
+
+ /*--------------------------------------------------------------------------------
+ * Constructor
+ *--------------------------------------------------------------------------------
+ */
+
+ EmoticonManager(Element config) throws ConfigException
+ {
+ XMLLoader loader = XMLLoader.get();
+ HashMap tmp = new HashMap();
+ NodeList nl = config.getChildNodes();
+ for (int i=0; i