You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by Paloma Gomez <pa...@gmail.com> on 2006/05/15 19:34:04 UTC

Custom flowscript and Usecase framework

Hi all,

I'd like to create a custom usecase to show the user data retrieved
from a database and a form. I already have a js file with the code
needed  to access the database and I'm trying to find a way of
invoking it within the usecase processing.

After reading the usecase framework documentation, I have come to the
conclusion that the only way currently available for adding custom
flowscript to the usecase processing is to implement its view as a
form (with cforms).

However, looking at usecases already implemented I've noticed that
some of them use jx templates which load js files in their <head>
section. I'd like to confirm if this javascript code is executed on
the client side (so the objects and functions created with it are not
accesible from the jx tags).

I know my question is pretty basic but I'm new to Cocoon Flow and I
just want to make sure I'm getting it right.

Thanks,

Paloma

-- 
Paloma Gomez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Custom flowscript and Usecase framework

Posted by so...@apache.org.
On 5/15/06, Paloma Gomez <pa...@gmail.com> wrote:
> I'd like to create a custom usecase to show the user data retrieved
> from a database and a form. I already have a js file with the code
> needed  to access the database and I'm trying to find a way of
> invoking it within the usecase processing.
>
> After reading the usecase framework documentation, I have come to the
> conclusion that the only way currently available for adding custom
> flowscript to the usecase processing is to implement its view as a
> form (with cforms).
>
> However, looking at usecases already implemented I've noticed that
> some of them use jx templates which load js files in their <head>
> section. I'd like to confirm if this javascript code is executed on
> the client side (so the objects and functions created with it are not
> accesible from the jx tags).
>
> I know my question is pretty basic but I'm new to Cocoon Flow and I
> just want to make sure I'm getting it right.

See if this helps:
http://solprovider.com/lenya/flowprocess

JX is only needed for the return page sent with cocoon.sendPage().
Forms shown with form.showForm() can read and write to the form model,
and continuation allows validation.

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Custom flowscript and Usecase framework

Posted by Paloma Gomez <pa...@gmail.com>.
Hi,

Thanks for your answers, I understand things better now.

I'll do as Andreas suggested and migrate my code from flowscript to java.

Regards,

Paloma

--Paloma Gomez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Custom flowscript and Usecase framework

Posted by Andreas Hartmann <an...@apache.org>.
Paloma Gomez wrote:
> Hi all,
> 
> I'd like to create a custom usecase to show the user data retrieved
> from a database and a form. I already have a js file with the code
> needed  to access the database and I'm trying to find a way of
> invoking it within the usecase processing.
> 
> After reading the usecase framework documentation, I have come to the
> conclusion that the only way currently available for adding custom
> flowscript to the usecase processing is to implement its view as a
> form (with cforms).

Currently, the usecase framework doesn't support custom flowscripts.
It is kept as simple as possible, and one compromise was to disallow
custom flowscripts.

I'd suggest to migrate the server-side Javascript to Java and access
it from the usecase handler class. The maintainability of your codebase
will certainly benefit from a Java-only approach.


> However, looking at usecases already implemented I've noticed that
> some of them use jx templates which load js files in their <head>
> section. I'd like to confirm if this javascript code is executed on
> the client side (so the objects and functions created with it are not
> accesible from the jx tags).

You are right, this is client-side javascript.

-- Andreas

-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org