You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ni...@apache.org on 2002/06/01 16:41:17 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/notification Notifier.java
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 <a href="mailto:nicolaken@supereva.it">Nicola Ken Barozzi</a> Aisa
* @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @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 <code>null</code>.
*/
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 <code>Notifying</code> object
+ * @param outputStream The output stream the notification is written to
+ * This could be <code>null</code>.
+ */
+ 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