Paloma Gomez wrote:
Hi all,

I want to create custom usecases to manipulate a database.
I've found a Cocoon sample which I'd like to adapt for this purpose:

http://cocoon.zones.apache.org/demos/21branch/samples/blocks/forms/sql

I don't know how to use DB binding with the CForm support of the
usecase framework, but what you could do is access a OR-mapping
layer (JDO / hibernate) from the usecase handler class. IMO this
would be the cleanest solution at the moment, if you want to use
the usecase framework.


This sample uses two *.js files to manipulate the database and I am trying
to work out a way to make them fit with the Lenya 1.4 usecase framework.
After reading the documentation on the lenya 1.4 usecase framework and
studying how the lenya cforms module and this Cocoon sample work,
I'm not sure if it is feasible approach.

The usecase framework is rather designed to manipulate Lenya documents,
not for custom DB access. This might change in the future, but at the
moment it might be easier to use CForms directly.


There would be three different usecases: list, edit and delete. The first
usecase I'm trying to implement is List.

My problem is that I need to pass the data retrieved from the database
to a jx template, and looking at the file usecases.js I think there is no way
to do this- I might be wrong, though. As I've read in the documentation that
some special complex usecases might require a custom flowscript, I'd like
to confirm that this one falls into this category.

I'm not sure - that depends on the flexibility of the CForms support of
the usecase framework. Maybe Thorsten knows more.

I would also like to know how to implement usecases outside the
usecase framework. I've seen in  $LENYA/webapp/lenya/usecase.xmap that
there
is a distinction between registered and unregistered usecases. Is
there some documentation on this?

Registering a usecase just means to add an entry to cocoon.xconf
(preferrably using an xpatch file), denoting that a usecase should
be handled by the usecase framework. If you don't register a usecase,
you can add specific pipelines in your publication's sitemap
(just match the lenya.usecase request parameter).

HTH,
-- Andreas


--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


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

Reply via email to