1 31 package org.blojsom.plugin.common; 32 33 import org.blojsom.blog.Blog; 34 import org.blojsom.blog.Entry; 35 import org.blojsom.plugin.Plugin; 36 import org.blojsom.plugin.PluginException; 37 import org.blojsom.util.BlojsomUtils; 38 39 import javax.servlet.http.HttpServletRequest ; 40 import javax.servlet.http.HttpServletResponse ; 41 import java.util.Map ; 42 43 50 public class StringUtilitiesPlugin implements Plugin { 51 52 private static final String BLOJSOM_PLUGIN_STRING_UTILITIES = "BLOJSOM_PLUGIN_STRING_UTILITIES"; 53 54 57 public StringUtilitiesPlugin() { 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_STRING_UTILITIES, new StringUtilities()); 82 83 return entries; 84 } 85 86 92 public void cleanup() throws PluginException { 93 } 94 95 101 public void destroy() throws PluginException { 102 } 103 104 107 public class StringUtilities { 108 109 112 public StringUtilities() { 113 } 114 115 121 public String escapeString(String input) { 122 return BlojsomUtils.escapeString(input); 123 } 124 } 125 } 126 | Popular Tags |