1 31 package org.blojsom.plugin.tools; 32 33 import org.apache.velocity.tools.generic.DateTool; 34 import org.blojsom.blog.Blog; 35 import org.blojsom.blog.Entry; 36 import org.blojsom.plugin.Plugin; 37 import org.blojsom.plugin.PluginException; 38 39 import javax.servlet.http.HttpServletRequest ; 40 import javax.servlet.http.HttpServletResponse ; 41 import java.util.Map ; 42 43 50 public class DateToolPlugin implements Plugin { 51 52 private static final String BLOJSOM_PLUGIN_DATE_TOOL = "BLOJSOM_PLUGIN_DATE_TOOL"; 53 54 57 public DateToolPlugin() { 58 } 59 60 66 public void init() throws PluginException { 67 } 68 69 80 public Entry[] process(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Blog blog, Map context, Entry[] entries) throws PluginException { 81 context.put(BLOJSOM_PLUGIN_DATE_TOOL, new DateTool()); 82 83 return entries; 84 } 85 86 92 public void cleanup() throws PluginException { 93 } 94 95 101 public void destroy() throws PluginException { 102 } 103 } | Popular Tags |