cziegeler 2004/05/03 02:14:01
Modified: tools/src/anttasks SitemapTask.java
src/java/org/apache/cocoon/serialization HTMLSerializer.java
Log:
Add another sample: configurable serializer
Revision Changes Path
1.7 +11 -1 cocoon-2.1/tools/src/anttasks/SitemapTask.java
Index: SitemapTask.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/tools/src/anttasks/SitemapTask.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SitemapTask.java 3 May 2004 09:00:28 -0000 1.6
+++ SitemapTask.java 3 May 2004 09:14:01 -0000 1.7
@@ -57,6 +57,8 @@
public static final String LOGGER_TAG =
"cocoon.sitemap.component.logger";
/** The label for views (optional) */
public static final String LABEL_TAG = "cocoon.sitemap.component.label";
+ /** The mime type for serializers and readers (optional) */
+ public static final String MIMETYPE_TAG =
"cocoon.sitemap.component.mimetype";
/** If this tag is specified, the component is not added to the sitemap
(optional) */
public static final String HIDDEN_TAG = "cocoon.sitemap.component.hide";
/** If this tag is specified no documentation is generated (optional) */
@@ -316,12 +318,20 @@
// test for label
this.addAttribute(node, LABEL_TAG, "label", null);
+ // pooling?
if (
this.javaClass.isA("org.apache.avalon.excalibur.pool.Poolable") ) {
// TODO - Think about default values
this.addAttribute(node, POOL_MIN_TAG, "pool-min", null);
this.addAttribute(node, POOL_MAX_TAG, "pool-max", null);
this.addAttribute(node, POOL_GROW_TAG, "pool-grow", null);
}
+
+ // mime-type
+ if (
this.javaClass.isA("org.apache.cocoon.sitemap.SitemapOutputComponent") ) {
+ this.addAttribute(node, MIMETYPE_TAG, "mime-type", null);
+ }
+
+ // append node
parent.appendChild(node);
newLine(parent);
1.3 +16 -1
cocoon-2.1/src/java/org/apache/cocoon/serialization/HTMLSerializer.java
Index: HTMLSerializer.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/serialization/HTMLSerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTMLSerializer.java 5 Mar 2004 13:02:58 -0000 1.2
+++ HTMLSerializer.java 3 May 2004 09:14:01 -0000 1.3
@@ -25,6 +25,21 @@
import java.io.OutputStream;
/**
+ * @cocoon.sitemap.component.documentation
+ * The html serializer serializes sax events into an html document.
+ *
+ * @cocoon.sitemap.component.name html
+ * @cocoon.sitemap.component.mimetype text/html
+ * @cocoon.sitemap.component.logger sitemap.serializer.html
+ *
+ * @cocoon.sitemap.component.pooling.min 4
+ * @cocoon.sitemap.component.pooling.max 32
+ * @cocoon.sitemap.component.pooling.grow 4
+ * @cocoon.sitemap.component.configuration
+ * <doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
+ * <doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
+ *
+ *
* @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a>
* @version CVS $Id$
*/