Return-Path: Delivered-To: apmail-xml-cocoon-cvs-archive@xml.apache.org Received: (qmail 32465 invoked by uid 500); 1 Jun 2002 14:41:18 -0000 Mailing-List: contact cocoon-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: cocoon-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cocoon-cvs@xml.apache.org Received: (qmail 32456 invoked by uid 500); 1 Jun 2002 14:41:18 -0000 Delivered-To: apmail-xml-cocoon2-cvs@apache.org Date: 1 Jun 2002 14:41:17 -0000 Message-ID: <20020601144117.37626.qmail@icarus.apache.org> From: nicolaken@apache.org To: xml-cocoon2-cvs@apache.org Subject: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/notification Notifier.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N nicolaken 2002/06/01 07:41:17 Modified: src/java/org/apache/cocoon/components/notification Notifier.java Log: Added a private method for doing html in code. The public method uses this now. It should be changed to accept templates based on mimetypes, and use the hardcoded html version only as a last resort Revision Changes Path 1.9 +17 -2 xml-cocoon2/src/java/org/apache/cocoon/components/notification/Notifier.java Index: Notifier.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/notification/Notifier.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Notifier.java 31 May 2002 19:00:00 -0000 1.8 +++ Notifier.java 1 Jun 2002 14:41:17 -0000 1.9 @@ -66,7 +66,7 @@ * * @author Nicola Ken Barozzi Aisa * @author Stefano Mazzocchi - * @version CVS $Id: Notifier.java,v 1.8 2002/05/31 19:00:00 nicolaken Exp $ + * @version CVS $Id: Notifier.java,v 1.9 2002/06/01 14:41:17 nicolaken Exp $ */ public class Notifier { @@ -93,6 +93,19 @@ * This could be null. */ public static void notify(Notifying n, OutputStream outputStream, String mimetype) throws IOException { + //(NKB) FIXME should use error page templates, one per mime-type + // currently uses hardcoded html, should be used only as last resort. + notifyHTML(n, outputStream); + } + + /** + * Generate notification information as html. + * The notification is directly written to the OutputStream. + * @param n The Notifying object + * @param outputStream The output stream the notification is written to + * This could be null. + */ + private static void notifyHTML(Notifying n, OutputStream outputStream) throws IOException { StringBuffer sb = new StringBuffer(); @@ -127,7 +140,7 @@ if (outputStream != null) outputStream.write(sb.toString().getBytes()); } - + /** * Generate notification information in XML format. * @deprecated Using a ContentHandler doesn't mean that a mimetype cannot be specified; it could be svg or @@ -196,6 +209,8 @@ ch.endDocument(); } } + + ---------------------------------------------------------------------- In case of troubles, e-mail: webmaster@xml.apache.org To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-cvs-help@xml.apache.org