Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 62286 invoked from network); 30 Nov 2003 12:22:50 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 30 Nov 2003 12:22:50 -0000 Received: (qmail 42765 invoked by uid 500); 30 Nov 2003 12:22:40 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 42734 invoked by uid 500); 30 Nov 2003 12:22:39 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 42721 invoked from network); 30 Nov 2003 12:22:39 -0000 Received: from unknown (HELO paris.dvs1.informatik.tu-darmstadt.de) (130.83.27.43) by daedalus.apache.org with SMTP; 30 Nov 2003 12:22:39 -0000 Received: from informatik.tu-darmstadt.de (IP-213157027235.dialin.heagmedianet.de [213.157.27.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by paris.dvs1.informatik.tu-darmstadt.de (Postfix) with ESMTP id 878E4FE43 for ; Sun, 30 Nov 2003 13:22:38 +0100 (MET) Message-ID: <3FC9E10C.6000908@informatik.tu-darmstadt.de> Date: Sun, 30 Nov 2003 13:22:36 +0100 From: Christian Haul User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031105 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: How to show files from database / DatabaseReader problem References: <1070155231.3fc945dfc9b73@desitka.sh.cvut.cz> <3FC9C76D.506@gmx.de> In-Reply-To: <3FC9C76D.506@gmx.de> X-Enigmail-Version: 0.81.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Joerg Heinicke wrote: > On 30.11.2003 02:20, O.Vobejda@sh.cvut.cz wrote: > >> Hi, >> >> I have a big problem with Database reader. I'd like to make a common >> stuff - in the database I are stored binary files (table structure >> looks: (id, content, filename, mimetype) and I'd like to map url >> "file/234" on the accordant file. Remind, that in the database can be >> stored everything possible stuff (images, documents etc.). >> >> I tried to use databasereader. All works ok, until I'd like to change >> mime-type to appropriate mime-type stored in the database. For this >> purpose should be used parameter "content-type". But it doesn't work >> and doesn't return regular value from database. It just returns that >> string, I inserted with parameter. It is correct? If so, how can I >> solve my problem? I tried this solution: >> >> Usual select: "select content, mimetype from files where id=123 and >> status=1" >> >> Using databasereader: >> >> >> >> >> >> >> Please have a look at the javadocs. content-type sets a fixed mimetype for the generated data while type-column specifies the column that stores the mimetype. So change it to BTW the upload sample in the databases block demos this usage. >> >> >> >> But that doesn't work. So how to solve that? Or do you know some >> alternative ways? > > > If you have a look at the source code > http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/databases/java/org/apache/cocoon/reading/DatabaseReader.java?annotate=1.4#400 > > you will see that the mime-type is not taken from database, but the > parameter value itself, i.e. 'mimetype'. If that's useful or not - I > don't know. Maybe you can patch the databasereader. No need to -- that has already been done :-) Chris. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org