cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luigi Bai <...@focalpoint.com>
Subject Re: Problem with showing pictures from eXist database
Date Wed, 01 Sep 2004 14:54:48 GMT
Christian Mayrhuber wrote:

> On Friday 13 August 2004 14:24, Eelke Toonstra wrote:
> 
>>I have a problem with showing images from the eXist database in Cocoon.
>>When I want to show an image in my browser, for example
>>http://localhost:8080/exist/xmldb/db/images/test.jpg it doesn't show a
>>picture but the small icon indicating there's no picture.XML files from
>>the database work without any problems.
>>
>>The sitemap.xmap contains:
>>
>><map:match pattern="xmldb/db/images/**.jpg">
>>	<map:read src="xmldb:exist:///db/images/{1}.jpg" mime-type="text/jpg"/>
>></map:match>
>>
>><map:match pattern="**.jpg">
>>	<map:read mime-type="image/pjpeg" src="{1}.jpg"/>
>></map:match>
>>
>>I tried it for gif images as well, but the same problem occurs.
>>
>>When I don't use the database it works fine e.g.:
>>
>><map:match pattern="xmldb/db/images/**.jpg">
>>	<map:read src="images/test.jpg" mime-type="image/jpg"/>
>></map:match>
>>
>>What could be the problem?
>>
>>More in general, is it a good idea to keep the pictures with the XML files
>>in the same database?
>>
>>Thanks in advance
>>
>>eXist 1.0
>>Cocoon 2.0
>>Java 1.4
>>Jetty 4.1
>>Windows XP
> 
> 
> You are accessing exist trough the cocoon source resolving mechanism, that
> would require a ExistSource implementation speaking the xmldb:exist://
> protocol.
> There is no ExistSource implementation available.
> There exists a XMLDBTransformer and a XQueryGenerator to perform various
> queries to the exist database.
> 
> If you want to read binary content from the exist database you have to use
> the webdav source of your eXist installation.
> 
> To test if webdav is working point your browser to:
> http://MY_EXIST_HOST:8080/exist/webdav/db/images/MYIMAGE.jpg
> 
> In your sitemap use:
> 
> <map:match pattern="xmldb/db/images/**.jpg">
> 	<map:read src="webdav://localhost:8080/db/images/{1}.jpg" 
> mime-type="text/jpg"/>
> </map:match>
> 
> or
> 
> <map:match pattern="xmldb/db/images/**.jpg">
> 	<map:read src="http://localhost:8080/db/images/{1}.jpg" 
> mime-type="text/jpg"/>
> </map:match>
> 
> I hope this helps.
> 

He may instead be running into the issue described here (with patch):
http://issues.apache.org/bugzilla/show_bug.cgi?id=30924

With this patch, reading BinaryResources from an XMLDB (such as eXist) 
should now work.

Eelke, you may confirm that you were getting ClassCastExceptions in your 
error.log when attempting to access "xmldb/db/images/**jpg" patterns?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message