hi all,

has someone an example howto get an image out of a database (blob)
and display it in html?

I worked finally out how to setup a request to a database.
In the docu (about actions) there is an example but without the
configuration in the sitemap.
Probably somebody can add it to the docu (better by esql or request).

Is there a simplier solution?

in the sitemap.xmap:
    <map:match pattern="heli/test">
     <map:generate type="serverpages" src="docs/samples/heli/test.xsp"/>
     <map:transform type="sql">
       <map:parameter name="use-connection" value="pgsql"/>
     </map:transform>
     <map:transform src="docs/samples/heli/test.xsl"/>
     <map:serialize/>
    </map:match>


-------------test.xsp------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
           language="java"
           xmlns:xsp="http://apache.org/xsp";
                  xmlns:sql="http://apache.org/cocoon/SQL/2.0";
           xmlns:xsp-request="http://apache.org/xsp/request/2.0";>
<html>
        <b>Request method:</b> <xsp-request:get-method/>
        <br/>
        <b>Fruit requested:</b> <xsp-request:get-parameter name="id"/>

<execute-query xmlns="http://apache.org/cocoon/SQL/2.0";>
<query>
   SELECT * FROM test
   WHERE row2 like '%<xsp-request:get-parameter name="id"/>%'
</query>
</execute-query>

</html>

</xsp:page>

-------------test.xsl------------------------------
<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

   <xsl:template match="/*">
        <body>
        <pre>
        <xsl:copy-of select="."/>
        </pre>
        </body>
   </xsl:template>

</xsl:stylesheet>



bye,
heli
-- 
     __ __    __           __    __ __    _    __
    / // /__ / /_ _  __ __/ /_  / // /__ (_)__/ /__ ___ ____ ____ ____
   / _  / -_) /  ' \/ // / __/ / _  / -_) / _  / -_) _ `/ _ `/ -_) __/
  /_//_/\__/_/_/_/_/\_,_/\__/ /_//_/\__/_/\_,_/\__/\_, /\_, /\__/_/
                                                  /___//___/


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to