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

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.

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 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?

No documentation that I could find (didn't look in the wiki though). Have a look lower in usecase.xmap and see:

      <!-- {publication-id}/{area}/{uri}-->
      <map:match pattern="*/*/**">

        <!-- mount publication-specific usecase sitemap -->
        <map:match type="usecase" pattern="*">
<map:act src="fallback://usecase-{1}.xmap" type="resource-exists"> <map:mount check-reload="true" reload-method="synchron" src="{fallback://usecase-{../1}.xmap}" uri-prefix="{../../1}"/>
          </map:act>
        </map:match>

        <!-- Mount separate usecase sitemap if it exists. -->
        <map:match type="usecase" pattern="*">
<map:act src="usecases/{1}/usecase-{1}.xmap" type="resource-exists"> <map:mount check-reload="true" reload-method="synchron" src="usecases/{../1}/usecase-{../1}.xmap" uri-prefix=""/>
          </map:act>
        </map:match>

iirc a request param/value of lenya.usecase=myusecase will first try to mount your usecase-myusecase.xmap file, it that doesn't exist, then it tries to mount usecases/myusecase/usecase-myusecase.xmap sitemap.

hth,
--Doug


Thanks,

Paloma

--
Paloma Gomez

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


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

Reply via email to