On 10.06.2004 08:00, Derek Hohls wrote:

Does Cocoon ship with samples that show how
to access a database from a class... if not,
where we would find such?

I guess not, but these samples would depend heavily on the persistence framework. And, yes, OJB block comes with database access samples. If you do th access in the flow script or in Java is up to you, I prefer the latter.


At the end the pseudo code looks like:

form = instantiateForm(definitionURI);
data = getData();
form.load(data);
form.showForm(sitemapURI);
form.save(data);
storeData(data);
showResult();

So you can separata the database access completely from the flowscript. No need for generating flowscript on the fly.

Joerg

Couldn't I just generate the flow with the TextSerializer?

H�? I don't understand. Why generating flow with TextSerializer?

I think SQLTransformer or ESQL-Logicsheet will be your friend:

Yes that is good, but if I want to generate a flow.js from a DB? Surely I need to out put to a text format, which .js is.


So for example in my flow.js:

var $0 = [
   //these values from db
   { key: "$1", value: "$2" },
];

Where $0-2 are results of DB query.

Sorry I'm sure I'm totally missing the point here ;(

Don't generate the flow script, but access the values from a class that accesses the database.


Joerg


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



Reply via email to