cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <reinhard_po...@gmx.net>
Subject RE: flow - database.js - Componentmanager
Date Fri, 20 Jun 2003 16:52:44 GMT
Yes, you are right. The current draft of the FOM does not contain a
database layer.

I see two options:
 
 1.) remove it complety
 2.) add it to the petstore examples (which are based on those JS
functions)

I'm in favour of removing them complety and encapsulate the database
calls in the petstore examples using Java objects. So we can show our
users what we envision as the best way of writing flow apps with
database access.

Reinhard

> -----Original Message-----
> From: Geoff Howard [mailto:cocoon@leverageweb.com] 
> Sent: Friday, June 20, 2003 6:44 PM
> To: cocoon-dev@xml.apache.org
> Subject: Re: flow - database.js - Componentmanager
> 
> 
> um, isn't this database access directly from flow one of the 
> deprecated parts of the API??
> 
> Geoff
> 
> At 11:55 AM 6/20/2003, you wrote:
> >I think i solve it. Check this new Database.js
> >I've changed the original one:
> >----------------------------[ Starts here 
> ]--------------------------- 
> >// // CVS $Id: Database.js,v 1.2 2003/03/20 02:46:32 vgritsenko Exp $
> >//
> >// Prototype Database API
> >//
> >// TBD: Move this Database stuff to its own library outside of flow
> >//
> >
> >defineClass("org.apache.cocoon.components.flow.javascript.Scr
> iptableCon
> >nection");
> >defineClass("org.apache.cocoon.components.flow.javascript.Scr
> iptableResult");
> >
> >Database.componentManager=this.cocoon.componentManager;
> >
> >Database.getConnection = function(selectorValue) {
> >   var selector = 
> >this.componentManager.lookup(Packages.org.apache.avalon.excal
> ibur.datas
> >ource.DataSourceComponent.ROLE
> >+ "Selector");
> >   try {
> >         var ds = selector.select(selectorValue);
> >     return new Database(ds.getConnection());
> >   } finally {
> >         this.componentManager.release(selector);
> >   }
> >}
> >
> >----------------------------[ Ends here ]---------------------------
> >
> >On Fri, 2003-06-20 at 16:25, Nuno Santos wrote:
> > > What i've found is that the flowscript works just fine 
> when i start 
> > > the cocoon engine, but whenever i make any change to the 
> script, it 
> > > just loose the cocoon.componentManager!
> > >
> > >
> > > On Fri, 2003-06-20 at 16:19, Frank Taffelt wrote:
> > > > > I also found this bug in the flow Database.js!
> > > > > It seems that the componentManager is null whenever 
> the script 
> > > > > is reloaded!
> > > >
> > > > Hmm, what do you mean with "script is reloaded"? I 
> didn't find any
> > rational
> > > > reason for this ...
> >--
> >Nuno Santos <nsantos@electroplus.pt>
> 


Mime
View raw message