Hi cocooners,
I´d like to give a real-life scenario using flowscripts.
We are currently in the end phase of developing the base of an 
enterprise system used for ordering/invoicing/crm tasks.
All of this is done in cocoon using the flowscript and Jakarta OJB, Axis 
   and torque.

We decided to use the flowscript since its *the* way of creating web 
based, data-intensive business systems. In theese scenarios the focus 
are at error handling and usability. The gui is of course important but 
not in the "flashy" sence, but rather that its possible to work with the 
system for a whole work-day.

Model: OJB
View: XSP´s
Controller: flowscript

The Model:
Trying the axis wsdl2java tools to connect to SOAP services was as easy 
as stealing candy from a child, not a single problem.
This inspired us to look for a similar approach when using a local dbms 
for the other data. After some looking around we found OJB to be 
perfect. We modified the Ant tasks that reads db metadata and creates a 
file called repository.xml that is the database schema. The next ant 
task is to create beans for each table in the repository.xml file. This 
is done by velocity templates. Finally an "Operations" interface is 
created by hand. This interface class is then used by the flowscript.
Its incredible easy to modify the database, we just run our ant build 
that rebuilds all our beans. Using axis we can also wrap our 
"Operations" interface as a web service for future integration.

The views:
We created a sort of language for page definition that abstracted html 
in xsp´s and this allows hard core coders to create pages that
are graphically pleasing. The concept of xsp as the source of the pages 
is perfectly fine, since it allows for some rendering logic to be 
applied. For example disabling buttons and parts of a page.
All data is provided in a java.util.Hashmap sent from the flowscript.

The controller:
This is of course the flowscript.
In here we program the flow-logic and call the Model(Operations 
interface) for retrieving / updating / creating data.
We´ve devided some common functions such as showing error messages and 
delete confirms into "functions.js".

To summarize:
Using flowscript, xsp and OJB is the *perfect* match for creating 
web-based enterprise systems

Since this is the dev list, i also have som dev questions:
I have problems putting things in a session variable from the flowscript 
using this syntax: cocoon.session["user_id"] = user.getUser_id();


Does anyone have any idea´s?

I will soon send a little patch for jpath.xsl that fixes for-each 
functionality that we use.


/Per-Olof Norén





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

Reply via email to