1 package org.tigris.scarab.services.email; 2 3 56 57 import java.io.OutputStream ; 58 import java.io.Writer ; 59 import org.apache.fulcrum.TurbineServices; 60 import org.apache.fulcrum.ServiceException; 61 import org.apache.velocity.context.Context; 62 63 80 public abstract class VelocityEmail 81 { 82 88 protected static VelocityEmailService getService() 89 { 90 return (VelocityEmailService)TurbineServices 91 .getInstance().getService(EmailService.SERVICE_NAME); 92 } 93 94 105 public static String handleRequest(Context context, String template) 106 throws Exception 107 { 108 return getService().handleRequest(context, template); 109 } 110 111 115 public String handleRequest(Context context, String template, 116 String charset, String encoding) 117 throws Exception 118 { 119 return getService().handleRequest(context, template, charset, 120 encoding); 121 } 122 123 137 public static void handleRequest(Context context, String template, 138 OutputStream out) 139 throws Exception 140 { 141 getService().handleRequest(context, template, out); 142 } 143 144 160 public static void handleRequest(Context context, String template, 161 OutputStream out, String charset, 162 String encoding) 163 throws Exception 164 { 165 getService().handleRequest(context, template, out, charset, encoding); 166 } 167 168 172 public static void handleRequest(Context context, String filename, 173 Writer writer) 174 throws ServiceException 175 { 176 getService().handleRequest(context, filename, writer, null); 177 } 178 179 183 public static void handleRequest(Context context, String filename, 184 Writer writer, String encoding) 185 throws ServiceException 186 { 187 getService().handleRequest(context, filename, writer, encoding); 188 } 189 } 190 | Popular Tags |