From: <bri...@us...> - 2003-07-08 19:48:48
|
Update of /cvsroot/webmacro/webmacro/src/org/webmacro/util In directory sc8-pr-cvs1:/tmp/cvs-serv7814/src/org/webmacro/util Modified Files: WMEval.java Removed Files: Atomizer.java Log Message: Eliminate FastWriter from public interface; use Template.write(OutputStream) instead Index: WMEval.java =================================================================== RCS file: /cvsroot/webmacro/webmacro/src/org/webmacro/util/WMEval.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** WMEval.java 12 Jun 2003 00:47:48 -0000 1.12 --- WMEval.java 8 Jul 2003 19:48:45 -0000 1.13 *************** *** 73,77 **** private OutputStream out = System.out; private Context context; - private boolean useWebContext = false; /** * If an output file is not specified as an argument, it --- 73,76 ---- *************** *** 219,227 **** public void eval (Context context, Template rule, OutputStream out, String encoding) throws Exception { ! FastWriter w; ! w = context.getBroker().getFastWriter(out, encoding); ! context.put("FastWriter", w); // allow template writers to access the output stream! ! rule.write(w, context); ! w.flush(); } --- 218,223 ---- public void eval (Context context, Template rule, OutputStream out, String encoding) throws Exception { ! // context.put("FastWriter", w); // allow template writers to access the output stream! ! rule.write(out, encoding, context); } *************** *** 231,235 **** * is written out as well. * @param templateName The name of the template. ! * @param output An optional output. * @return The output from the evaluated template */ --- 227,231 ---- * is written out as well. * @param templateName The name of the template. ! * @param out An optional output stream. * @return The output from the evaluated template */ *************** *** 237,241 **** { Template t = wm.getTemplate(templateName); ! String val = t.evaluate(context).toString(); if (out != null) { --- 233,237 ---- { Template t = wm.getTemplate(templateName); ! String val = t.getString(context); if (out != null) { *************** *** 266,271 **** * so you can write out to the stream. * @param templateName The name of the template. ! * @param response The servlet response object and its output stream ! * @return The output from the evaluated template */ public void eval (String templateName, HttpServletRequest req, --- 262,266 ---- * so you can write out to the stream. * @param templateName The name of the template. ! * @param resp The servlet response object and its output stream */ public void eval (String templateName, HttpServletRequest req, *************** *** 275,290 **** { context = wm.getWebContext(req, resp); ! String encoding = (String) wm.getConfig(WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding == null) { encoding = resp.getCharacterEncoding(); } - FastWriter w = context.getBroker().getFastWriter(out, encoding); Template t = wm.getTemplate(templateName); ! context.put("FastWriter", w); // allow template writers to access the output stream! ! t.write(w, context); ! resp.setContentLength(w.size()); ! w.writeTo(resp.getOutputStream()); ! w.flush(); } catch (Exception e) --- 270,281 ---- { context = wm.getWebContext(req, resp); ! String encoding = wm.getConfig(WMConstants.TEMPLATE_OUTPUT_ENCODING); if (encoding == null) { encoding = resp.getCharacterEncoding(); } Template t = wm.getTemplate(templateName); ! // context.put("FastWriter", w); // allow template writers to access the output stream! ! t.write(resp.getOutputStream(), encoding, context); } catch (Exception e) *************** *** 301,305 **** public String eval (Context context, Template rule) throws Exception { ! return rule.evaluate(context).toString(); } --- 292,296 ---- public String eval (Context context, Template rule) throws Exception { ! return rule.getString(context); } *************** *** 318,322 **** { Template rule = wm.getTemplate(templateResourceFile); ! String value = rule.evaluate(context).toString(); // output the file if (outputFileName == null) --- 309,313 ---- { Template rule = wm.getTemplate(templateResourceFile); ! String value = rule.getString(context); // output the file if (outputFileName == null) --- Atomizer.java DELETED --- |