Hi there!
This is my first time working with Cocoon. I am running:
+------------------+
|-> SuSe Linux 8.2 |
|-> ANT 1.5.4 |
|-> Tomcat 4.1.27 |
|-> Cocoon 2.1.2 |
+------------------+
I try to understand the _personalized gallery_ described in
"Cocoon: Building XML Applications" (Langham/Ziegler).
I followed the example, *BUT* apparently I am missing something important,
*BECAUSE* all my browser displays is the "image not found" icon (broken
image).
1.) pipeline in sitemap.xmap
<map:pipeline>
<map:match pattern="mygallery">
<map:generate src="gallery" type="imagedirectory"/>
<map:transform src="mygallery.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:serialize type="html"/>
</map:match>
<!-- Gallery Images -->
<map:match pattern="gallery/**">
<map:read src="context://gallery/{1}"/>
</map:match>
</map:pipeline>
2.) xsl file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dir="http://apache.org/cocoon/directory/2.0">
<xsl:param name="color"/>
<xsl:template match="/">
<html>
<body>
<xsl:choose>
<xsl:when test="$color=''">
<xsl:attribute name="bgcolor">#FFFFFF</xsl:attribute>
</xsl:when>
<xsl:when test="$color='red'">
<xsl:attribute name="bgcolor">#FF0000</xsl:attribute>
</xsl:when>
<xsl:when test="$color='black'">
<xsl:attribute name="bgcolor">#000000</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="bgcolor">
<xsl:text>#</xsl:text><xsl:value-of select="$color"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<center><h1>MyGallery</h1></center>
<xsl:for-each select="dir:directory/dir:file">
<img src="{/dir:directory/@name}/[EMAIL PROTECTED]"
width="100" height="100"/>  
</xsl:for-each>
<br/>
<a href="mygallery?color=red">I want red</a><br/>
<a href="mygallery?color=black">I want black</a><br/>
<a href="mygallery?color=AAAAAA">I want grey</a><br/>
<a href="mygallery">I want white</a><br/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
3.) HTML-Code
The data, which is sent to my browser, contains the following code:
<html xmlns:dir="http://apache.org/cocoon/directory/2.0">
<body bgcolor="#FFFFFF">
<center>
<h1>MyGallery</h1>
</center>
<img height="100" width="100" src="gallery/pic1.jpg">
<img height="100" width="100" src="gallery/pic2.jpg">
<img height="100" width="100" src="gallery/pic3.jpg">
<br>
<a href="mygallery?color=red">I want red</a>
<br>
<a href="mygallery?color=black">I want black</a>
<br>
<a href="mygallery?color=AAAAAA">I want grey</a>
<br>
<a href="mygallery">I want white</a>
<br>
</body>
</html>
4.) path to directory
- When I view the source code, the paths to the images seem to be correct.
The pictures are located within "gallery", which is a subdirectory to my
cocoon context: cocoon/gallery/*.jpg
- If I save this data as HTML file within the cocoon context, I can point
my browser at this file and every image is displayed.
- If I try to "View Image" from within my browser, Cocoon generates a
"resource not found" message, which states that there is *no* local
sitemap.xmap in directory "gallery". Did I miss something here?
org.apache.cocoon.ResourceNotFoundException: Resource not found.:
org.apache.excalibur.source.SourceNotFoundException:
file:/{localpath}/cocoon/gallery/sitemap.xmap doesn't exist.
5.) cocoon error logs
- sitemap.log: is polluted with infos:
[sitemap] (/cocoon/gallery/pic1.jpg) Thread-34/HandleErrorsNode:
Processing handle-errors at
file:/{localpath}/cocoon/sitemap.xmap:741:24
- handled-errors.log: is polluted with errors:
[sitemap.handled-errors] (/cocoon/gallery/pic1.jpg)
Thread-34/PipelineNode: Resource not found.
The entries in these error logs should tell me something, but I can't
figure out what it means. Can someone please give me a hint?
Thank you in advance!
Regards,
Nele.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]