{quote} Maybe tonight I'll implement such concept to see if it works well. {quote} I've just finished implementing a test filter which I called SmileFilter, although it's more an imageFilter since it can be that generic. It has become quite simple to add new smiles to snipsnap, no need for writting any code at all, not even restart to the container. I still haven't commited it to the SVN project, not put it in my blog - maybe tomorrow or so - so here's the code: {code} /** * Image Filter for SnipSnap Blog/Wiki * * Copyright 2006-2007 Paulo Abrantes (pabrantes@pabrantes.net) * * --LICENSE NOTICE-- * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * --LICENSE NOTICE-- * */ package org.snipsnap.pabrantes.filter; import java.sql.Timestamp; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.radeox.filter.Filter; import org.radeox.filter.context.FilterContext; import org.radeox.filter.regex.RegexFilter; import org.radeox.filter.regex.RegexReplaceFilter; import org.snipsnap.snip.Snip; import org.snipsnap.snip.SnipSpace; import org.snipsnap.snip.SnipSpaceFactory; public class SmileFilter extends RegexReplaceFilter implements Filter { private static Log log = LogFactory.getLog(SmileFilter.class); private Snip snip; private Timestamp lastModificationDate; public SmileFilter() { super(); loadSnip(); } private void loadSnip() { SnipSpace space = SnipSpaceFactory.getInstance(); this.snip = space.load("smileyRepository"); if(snip==null) { log.warn("It seems the snip is invalid, maybe it still has to be created!"); } } private void loadSmiles() { clearRegex(); this.lastModificationDate = snip.getMTime(); String content = snip.getContent(); String[] smiles=content.split("\\\r\\\n\\\r\\\n"); for(int i=0;i"); } } @Override public String filter(String arg0, FilterContext arg1) { if(snip==null) { loadSnip(); } if(snip.getMTime()!=lastModificationDate) { loadSmiles(); } return super.filter(arg0, arg1); } } {code} For me, the cool thing is the following piece of code: {code} if(snip.getMTime()!=lastModificationDate) { loadSmiles(); } {code} This gives you hot deploy feature. While filtering if a change on your smileyRepository snip is detected the entire repository content will be reloaded (maybe I should do an incremental load) The only boring thing is the creation of the smileyRepository, since you have to upload images and write the code. Oh and by the way, the syntax is the following: __REGEX__=imageName.png\\ ~~BLANK_LINE~~\\ __REGEX2__=imageName2.png\\ imageName.png will be attached to smileyRepository snip. Also remember the 1st field is a regex, so for example to match :-) it won't be :-) but actually :-\\\).