cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: Producer and esql
Date Sat, 25 Nov 2000 12:00:59 GMT
"Mustapha Dada" <dada@iskv.de> wrote:
>the following producer works correctly :
>
>URL is        :   http://localhost/xy.xml?producer=dummy2
>
>I use here SQL Processor .
>
>Producer is :
>
>
>public class DummyProducer
>   extends AbstractProducer
>   implements Status
>{
>
>     String entity = request.getPrameter("entity") ;
>     String database = request.getPrameter("database") ;
>
>     String dummy =
>                               "<?xml version=\"1.0\"?>"
>                              +"<?cocoon-process type=\"sql\"?>"
>
>                                ...
>
>                            +"<connectiondefs>"
>                            +"<connection name=\"foo_connection\">"
>                            +"<driver>...DB2...Driver</driver>"
>                            +"<dburl>jdbc.db2:http://localhost/"
>                            +database     // will be determine dynamicly
>through a HTML FORM
>                            +"</dburl>"
>                            +"<username>Administrator</username>"
>                            +"<password>password</password>"
>                            +"</connection>"
>                            +"</connectiondefs>"
>
>                            +"<query connection=\"foo_connection\">"
>                            +"select * from  "
>                            +entity  //  will be determine dynamicly
>through a HTML FORM
>                            +"</query>"
>
>
>
>     public Reader getStream(HttpServletRequest request)
>     throws IOException
>   {
>     return new StringReader(dummy);
>   }
>
>   public String getPath(HttpServletRequest request) {
>     return "";
>   }
>
>   public String getStatus() {
>     return "Dummy Producer";
>   }
>}
>
>in this variant everything work correctly , that mean , i can often
>choose - dynamicly -
>any "database" or "entity" through my HTML FORM , cocoon retrieve the
>right Data
>without to entry a new dummy.xml  in my URL  :
>http://localhost/dummy.xml?producer=dummy2
>
>#############################################################################################
>
>But when i use esql , the following not work correctely :

That's because XSP is not compatible with dynamic producers (the page would 
have to be recompiled each time which is really slow). You can use

Producer -> SQL Processor (deprecated)
XSP -> SQL processor (deprecated)
or XSP page including esql (recommended)

but not Dynamic Producer -> XSP.



_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


Mime
View raw message