1 package org.apache.fulcrum.template; 2 3 56 57 import java.io.OutputStream ; 58 import java.io.Writer ; 59 import org.apache.fulcrum.ServiceException; 60 import org.apache.fulcrum.TurbineServices; 61 import org.apache.fulcrum.template.TemplateContext; 62 63 70 public abstract class TurbineTemplate 71 { 72 78 protected static TemplateService getService() 79 { 80 return (TemplateService)TurbineServices 81 .getInstance().getService(TemplateService.SERVICE_NAME); 82 } 83 84 public static final void registerTemplateEngineService(TemplateEngineService service) 85 { 86 getService().registerTemplateEngineService(service); 87 } 88 89 public static final String [] translateTemplatePaths(String [] templatePaths) 90 { 91 return getService().translateTemplatePaths(templatePaths); 92 } 93 94 public static final boolean templateExists(String template, String [] templatePaths) 95 { 96 return getService().templateExists(template, templatePaths); 97 } 98 99 public static final String handleRequest(TemplateContext context, String template) 100 throws ServiceException 101 { 102 return getService().handleRequest(context, template); 103 } 104 105 public static final void handleRequest(TemplateContext context, 106 String template, 107 OutputStream outputStream) 108 throws ServiceException 109 { 110 getService().handleRequest(context, template, outputStream); 111 } 112 113 public static final void handleRequest(TemplateContext context, 114 String template, 115 Writer writer) 116 throws ServiceException 117 { 118 getService().handleRequest(context, template, writer); 119 } 120 121 public static final TemplateContext getTemplateContext() 122 { 123 return getService().getTemplateContext(); 124 } 125 126 public static final boolean templateExists(String template) 127 { 128 return getService().templateExists(template); 129 } 130 } 131 | Popular Tags |