You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2000/08/03 12:38:13 UTC

C2: Sitemap-extension: New configuration scheme for components

Hello,

according to the sitemap draft, the following configuration possibility is desired:

	<map:serializer name="wap" mime-type="text/vnd.wap.wml" src="org.apache.cocoon.serialization.XMLSerializer"> 
	    	<doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
		<doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
    		<encoding>UTF-8</encoding>
	</map:serializer>

The current sitemap creates an org.apache.avalon.Configuration object which gets a value of the first node inside the map:serializer node, in this example doctype-public. The other nodes are not reachable.

I changed the sitemap.xsl so that an org.apache.avalon.Configuration object is created which is constructed similar to the Configuration objects of the general components of the cocoon.xconf:
A root Configuration object is created which gets all attributes of the map:serializer node.
For each child of map:serializer a new sub-configuration object is created.

If this is an acceptable solution, here is the diff:
Index: sitemap.xsl
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
retrieving revision 1.1.2.18
diff -r1.1.2.18 sitemap.xsl
475a496,513
> 
>       <xsl:if test="$ns">
>         confBuilder.startPrefixMapping("","<xsl:value-of select="namespace-uri(.)"/>"); 
>       </xsl:if>
> 	  <!-- Create root configuration -->	  
>       attr.clear();  
>       <xsl:for-each select="attribute::*[name(.)!=$qname]">
>         attr.addAttribute ("", 
> 						   "<xsl:value-of select="local-name(.)"/>", 
> 						   "<xsl:value-of select="name(.)"/>", 
> 						   "CDATA", 
> 						   "<xsl:value-of select="."/>"); 
>       </xsl:for-each>
> 
>  	  confBuilder.startElement ("", 
> 	  							"<xsl:value-of select="translate(@name, '- ', '__')"/>",
> 	                            "<xsl:value-of select="translate(@name, '- ', '__')"/>", attr); 
> 
483a522,528
> 	  <!-- end root configuration -->
> 	  confBuilder.endElement ("",
> 	  						  "<xsl:value-of select="translate(@name, '- ', '__')"/>",
> 	                          "<xsl:value-of select="translate(@name, '- ', '__')"/>"); 
>       <xsl:if test="$ns">
>         confBuilder.endPrefixMapping(""); 
>       </xsl:if>


Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================

------------------------------------------------------------------------------------------
...this mail was scanned for viruses by mailserver...

C2: Bug in ResourcePipeline.java - Serializer mimeType setting

Posted by Carsten Ziegeler <cz...@sundn.de>.
Hello,

the process() method of the ResourcePipeline class has a bug regarding the mimeType handling of the serializer.

Here is the diff:

Index: ResourcePipeline.java
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ResourcePipeline.java,v
retrieving revision 1.1.2.11
diff -r1.1.2.11 ResourcePipeline.java
155,156c159,161
<             if (serializerMimeType != null)
<                     environment.setContentType (readerMimeType); 
---
>             if (serializerMimeType != null) {
>                     environment.setContentType (serializerMimeType); 
>             }

Together with my other patch from today, the mimeType handling of the serializer works according to the sitemap draft (if I understood it right....)

Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================

------------------------------------------------------------------------------------------
...this mail was scanned for viruses by mailserver...