You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Barzilai Spinak <ba...@internet.com.uy> on 2003/10/17 08:44:08 UTC

[Woody] woody.js (show) woody2.js (showForm) et al

Sylvain, or whoever can clarify this:

Recenlty there was an addition of woody2.js for flowscript handlinf of 
Woody.
It looks like woody2.js  is a "new version" of woody.js  (deprecating 
the latter). Or is it just an "addition"?

Forms used to have a show method. Now in woody2.js they have a showForm 
method. But the old show
allowed a "validator function" parameter and the new showForm just 
accepts a bizData.
As a side note, the comment block for showForm says:

 * This uses some additionnal propertied on the form object :
 * - "locale" : the form locale (default locale is used if not set)
 * - "validator" : additional validation function. This function receives
 *   the form object as parameter and should return a boolean indicating
 *   if the form handling is finished (true) or if the form should be
 *   redisplayed again (false)

but it's not clear to me how to assign a validator to the form from 
flowscript.

The binding bean sample:
in Cocoon 2.1 uses  <wd:button> for row adding/deleting
Cocoon 2.1.1 and 2.1.2 use <wd:action> but it seems like it's already 
deprecated and
it mentions we should use  <wd:repeater-action> instead.
This is all good and great but there's zero documentation on how to do it!

Woody looks very powerful and with a great future but at the same time 
it looks like a big pile
of XML tags that you can put together nested within each other in 
undocumented ways, while new ones
keep appearing and others are deprecated.i

Maybe I'm part of my own problem because I hate coding by copying and 
pasting undocumented examples
and changing things here and there until "It Works"(tm)  but not being 
quite sure why or how. I prefer having
a whole vision and understanding of concepts and tools/syntax, etc. and 
how to put them together.
Right now, the best Woody documentation there is, is the one at the Wiki 
pages which is several eons old
and just shows a lot of disperesed concepts and bits but not the wires 
that make them work with each other.

I don't want to sound like I'm complaining, because I'm very thankful to 
the Cocoon developers for such a fine
project and community. I'd even like to contribute to Woody but right 
now it's like trying to grab a giant,
wobbling piece of gelatin.






TODAS LAS FORMAS DE ACCESO     TODOS LOS SERVICIOS
--------------------------------------------------
ADSL Todas las velocidades - Accesos por Modem 56K
E-mail con Antivirus / Antispam / Alias / Forwards
Desarrollos a medida - Redes - Intranets/Extranets 
--------------------------------------------------
http://www.internet.com.uy          Tel. 707.42.52


Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Barzilai Spinak wrote:

> Sylvain, or whoever can clarify this:
>
> Recenlty there was an addition of woody2.js for flowscript handlinf of 
> Woody.
> It looks like woody2.js  is a "new version" of woody.js  (deprecating 
> the latter). Or is it just an "addition"?


Exactly. This a new version which is a cleanup of the previous one and 
provides a form.showForm() method similar to cocoon.sendPageAndWait(), 
i.e. with the possibility to send data to the view.

> Forms used to have a show method. Now in woody2.js they have a 
> showForm method. But the old show
> allowed a "validator function" parameter and the new showForm just 
> accepts a bizData.
> As a side note, the comment block for showForm says:
>
> * This uses some additionnal propertied on the form object :
> * - "locale" : the form locale (default locale is used if not set)
> * - "validator" : additional validation function. This function receives
> *   the form object as parameter and should return a boolean indicating
> *   if the form handling is finished (true) or if the form should be
> *   redisplayed again (false)
>
> but it's not clear to me how to assign a validator to the form from 
> flowscript. 


The locale and validator are now a property of the form.

form.validator = function(form) {
  if (some additional test) {
    return true; // valid
  } else {
    return false; // invalid
  }
}

But... this is still work in progress, and adding the event handling 
stuff made me consider that this additional flowscript-level validator 
was kind of hacky solution to what could be done in the form itself.

As for the locale, I consider that the current locale management in 
Cocoon is messy: we need to pass the locale around everywhere and each 
component defines its own way to get it. We should use 
environment-adapters so that we can simply use request.getLocale(). But 
that's another story (I'm preparing a RT on environment adapters).

> The binding bean sample:
> in Cocoon 2.1 uses  <wd:button> for row adding/deleting
> Cocoon 2.1.1 and 2.1.2 use <wd:action> but it seems like it's already 
> deprecated and
> it mentions we should use  <wd:repeater-action> instead. 


<wd:action> is still there, and <wd:repeater-action> are specialized 
actions with built-in action handlers that modify a repeater.

> This is all good and great but there's zero documentation on how to do 
> it! 


Yep. I know this is not the answer you will like to here but although 
functionnal, Woody is an unstable block, and using it means living on 
the bleeding edge.

> Woody looks very powerful and with a great future but at the same time 
> it looks like a big pile
> of XML tags that you can put together nested within each other in 
> undocumented ways, while new ones
> keep appearing and others are deprecated.
>
> Maybe I'm part of my own problem because I hate coding by copying and 
> pasting undocumented examples
> and changing things here and there until "It Works"(tm)  but not being 
> quite sure why or how. I prefer having
> a whole vision and understanding of concepts and tools/syntax, etc. 
> and how to put them together.
> Right now, the best Woody documentation there is, is the one at the 
> Wiki pages which is several eons old
> and just shows a lot of disperesed concepts and bits but not the wires 
> that make them work with each other.


Well, don't forget that this is a collective work based on voluntary 
contributions. If you have good writing abilities, don't hesitate to 
contribute some docs.

I know that what I added to woody is not documented but I just _added_ 
to what existed and the corresponding docs written by Bruno are still 
valid, although incomplete. BTW, I consider that Bruno did an very good 
job by writing the current docs.

> I don't want to sound like I'm complaining, because I'm very thankful 
> to the Cocoon developers for such a fine
> project and community. I'd even like to contribute to Woody but right 
> now it's like trying to grab a giant,
> wobbling piece of gelatin.


You're not totally wrong. That's the price to pay for using features 
added very recently.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-10-17 at 14:46, Sylvain Wallez wrote:
<snip/>
> 
> >Carlos and Bernardo said the presentation was the best that can
> happen us right now. They said me you used a diferent approach in the
> flows as the one used in the examples. Of course both works.
> >
> 
> Do you mean the use of the RequestMethodSelector to choose between 
> <map:call function> or <map:call continuation>? This idea comes from 
> Bruno's examples using the WoodyAction and I found it very convenient as 
> it both avoids the weird look of kont/* URLs and the temptation for the 
> user to bookmark a continuation.

I use the GET/POST approach because I try to follow ReSTy principles:
GET retrieves a resource, POST triggers a process to modify it. Based on
those same principles I would also put the continuationid in the URL,
because it then identifies that continuation as a different resource.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Sylvain Wallez dijo:
> Antonio Gallardo wrote:
>
>>Sylvain Wallez dijo:
>>
>>
>>>Yep. And posts like Barzilai's one make me wonder if we should stop
>>> development in the 2.1 repo and move it over to 2.2 into a new
>>> "cforms" (Cocoon forms) block. Note that this doesn't prevent to
>>> backport this block to 2.1 before an official 2.2 release if we
>>> consider that it has reached some level of stability (including docs).
>>>
>>>
>>
>>-1. I think woody need to get improved even faster than the current
>> trend in the current release too. 2.2 is far away and since it will be
>> at a stable level this would slowdown the development of woody. :-(
>>
>>If someone wants to work with a "non-moving target" then there is 2.1.x
>>
>
> I guess you misunderstood what I was saying, as you're stating more or
> less my thoughts (if I understand correctly): what I'm suggesting is to
> move the development to the 2.2 repository, but make updates to the 2.1
> repository when we consider to have reached a stable milestone on the
> *cforms block*, and not the entire Cocoon repository.

Hi Sylvain,

I cleary understand what you had in mind. Please note woody is still
marked as an alpha block. So we are free to make any changes without
worrying about back compatibility or similars. This is a fact.

If we right now move to 2.2, I bet the woody development will slowdown for
2 reasons:

1) Woody testers (as me) will not currently move to 2.2 until it will
reach some stable milestone. This is not because I don't want to support
2.2 development, but because I need to end a project.

> This would avoid people working with the 2.1 branch to be too much
> disturbed by this moving target. The 2.1 branch will only have steps
> corresponding to the milestones of the continuous development occuring
> in the 2.2 repo.

OK. Check the pro and cons. Suppose you made another incompatibility
change to cforms. So later you will move it to woody. I don't think this
is a good idea. I think the pain must be fast and as soon as posible.

In my lazy mind, if I see there is a future change that will break all my
work, then I think: Why to continue, if at the end I will need to rework
all this stuff? So this is not too smart to just delays changes from repo
2.2 to 2.1. This is why I prefer to get the changes right now and work
with this.

As I posted before, for people that does not want a "moving target" then
they can use any of the release or any fixed CVS version. But soon or
later they will move to 2.2. For example: if they choose to use some nice
features of Cocoon 2.2. What will be there: Woody forms does not exist at
all, se then?

By my own experience working with the moving target means:

Monitor the cocoon-cvs:
To see if a posted change is important to you. For example: If there are
just a website update (typo fixing), then this will not affect you current
development. You don't need to run all updating procedure for this type of
cvs posts.

When an interesting cvs update happens:

1- Backup your project and update Cocoon CVS.
2- See if the changes on the CVS have a direct impact in your application.
For example: if you are working with woody, so check the changes related
to woody tags, etc.
3-Build the new cocoon and import your project.
4-Test if your project works with the new version.
5-If the project does not work, try to fix it.
6-If after fixing there are other problems (example: a Cocoon internal):
   6.a) Inform in the mail list about the problem
   6.b) go back to the backup copy of the project
   6.c) stay tunned to see if in the CVS is a fix of the error.

I learned to work in this way. I do this every 1 to 7 days. It depends of
the level and importance of changes to my current work. I do this for 2
types of applications that use diferents blocks config. Maybe this is
additional work and I am crazy. I know. But I love to see and use every
new features and bug fix in Cocoon.

I hope this explain my view point.

Best Regards,

Antonio Gallardo

>>I was working in druid - http://druid.sf.net/ for get the boring O/R
>> mapping done by a Druid generator.
>>
>
> This thing is very interesting as, although DB and O/R mappings are not
> Cocoon's concern, having a full working template in Cocoon greatly helps
>  people to build complex apps.

You are right, but I do this to show people that there is a faster and
easier road to build database-oriented web applications with Cocoon.

Cocoon is also a moving target it self:

1-Web publishing framework
2-Webapp framework.

And I am pointing to:

3- RAD webapp framework.

When I started with Cocoon it was just an publishing framework. My project
was a database oriented project and I choosed Cocoon as my flagship to do
the job done. Somepeople told me:

"Looks this guy! Choosed an web publishing framework to build a database
application! It must be crazy enough!"

So I am now trying to see an RAD webapp framework in Cocoon. This is the
next level for me. Here is where Druid and OJB go into the play. And this
is why I am writing about Druid and OJB. Woody is just a piece of all the
cake.

Best Regards,

Antonio Gallardo



Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Antonio Gallardo wrote:

>Sylvain Wallez dijo:
>  
>
>>Yep. And posts like Barzilai's one make me wonder if we should stop
>>development in the 2.1 repo and move it over to 2.2 into a new "cforms"
>>(Cocoon forms) block. Note that this doesn't prevent to backport this
>>block to 2.1 before an official 2.2 release if we consider that it has
>>reached some level of stability (including docs).
>>    
>>
>
>-1. I think woody need to get improved even faster than the current trend
>in the current release too. 2.2 is far away and since it will be at a
>stable level this would slowdown the development of woody. :-(
>
>If someone wants to work with a "non-moving target" then there is 2.1.x
>

I guess you misunderstood what I was saying, as you're stating more or 
less my thoughts (if I understand correctly): what I'm suggesting is to 
move the development to the 2.2 repository, but make updates to the 2.1 
repository when we consider to have reached a stable milestone on the 
*cforms block*, and not the entire Cocoon repository.

This would avoid people working with the 2.1 branch to be too much 
disturbed by this moving target. The 2.1 branch will only have steps 
corresponding to the milestones of the continuous development occuring 
in the 2.2 repo.

<snip/>

>I was working in druid - http://druid.sf.net/ for get the boring O/R mapping done by a Druid generator.
>

This thing is very interesting as, although DB and O/R mappings are not 
Cocoon's concern, having a full working template in Cocoon greatly helps 
people to build complex apps.

>Carlos and Bernardo said the presentation was the best that can happen us right now. They said me you used a diferent approach in the flows as the one used in the examples. Of course both works.
>

Do you mean the use of the RequestMethodSelector to choose between 
<map:call function> or <map:call continuation>? This idea comes from 
Bruno's examples using the WoodyAction and I found it very convenient as 
it both avoids the weird look of kont/* URLs and the temptation for the 
user to bookmark a continuation.

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Ugo Cei dijo:
> Antonio Gallardo wrote:
>> Sylvain Wallez dijo:
>>>Yep. And posts like Barzilai's one make me wonder if we should stop
>>> development in the 2.1 repo and move it over to 2.2 into a new
>>> "cforms" (Cocoon forms) block. Note that this doesn't prevent to
>>> backport this block to 2.1 before an official 2.2 release if we
>>> consider that it has reached some level of stability (including docs).
>> -1. I think woody need to get improved even faster than the current
>> trend in the current release too. 2.2 is far away and since it will be
>> at a stable level this would slowdown the development of woody. :-(
>
> Antonio, I agree with you here. Besides, we have no blocks in 2.2 now.
>
> I've already started using Woody in all new developments since in its
> current form it's already better than {XML,JX}Forms (besides lacking the
>
>   possibility of populating a selection list from a collection
> instantiated in the flow, but I'm working on it).
>
> I also resolved to document all the additions and bugfixes I commit, and
>  write unit tests for them too. The latter is giving me more troubles
> than I thought, however :-(.

Great! To be honest: I cannot write test at all :-(, so your help here is
very welcome!

I hope we will have a very stable woody whith many cool features when 2.2
will be released!

Same as you, we are also working with woody and of course we will post and
document any enhancement and bugfixed we did. I think this is a nice
approach.

Best Regards,

Antonio Gallardo.




Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Ugo Cei <u....@cbim.it>.
Antonio Gallardo wrote:
> Sylvain Wallez dijo:
>>Yep. And posts like Barzilai's one make me wonder if we should stop
>>development in the 2.1 repo and move it over to 2.2 into a new "cforms"
>>(Cocoon forms) block. Note that this doesn't prevent to backport this
>>block to 2.1 before an official 2.2 release if we consider that it has
>>reached some level of stability (including docs).
> -1. I think woody need to get improved even faster than the current trend
> in the current release too. 2.2 is far away and since it will be at a
> stable level this would slowdown the development of woody. :-(

Antonio, I agree with you here. Besides, we have no blocks in 2.2 now.

I've already started using Woody in all new developments since in its 
current form it's already better than {XML,JX}Forms (besides lacking the 
  possibility of populating a selection list from a collection 
instantiated in the flow, but I'm working on it).

I also resolved to document all the additions and bugfixes I commit, and 
write unit tests for them too. The latter is giving me more troubles 
than I thought, however :-(.

	Ugo


-- 
Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail: u.cei@cbim.it


Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by leo leonid <te...@leonid.de>.
On Oct 17, 2003, at 12:39 PM, Antonio Gallardo wrote:

> Sylvain Wallez dijo:
>> Yep. And posts like Barzilai's one make me wonder if we should stop
>> development in the 2.1 repo and move it over to 2.2 into a new 
>> "cforms"
>> (Cocoon forms) block. Note that this doesn't prevent to backport this
>> block to 2.1 before an official 2.2 release if we consider that it has
>> reached some level of stability (including docs).
>
> -1. I think woody need to get improved even faster than the current 
> trend
> in the current release too. 2.2 is far away and since it will be at a
> stable level this would slowdown the development of woody. :-(
>

I totaly agree with the above..
O.K.,  Cocoon evolves and is in permanent state of flux, which is quite 
natural, but it mustn't turn into a permanent teleology, I feel more 
and more discouraged to use these new features of the long awaited 
v.2.1. When 2.0 was out and 2.1 just started everyone was looking 
forward to have a xml-form framework. Now we have 3 of it, but only few 
people use it, because there is too much hope again - for v.2.2.

/leo


GT Videos

Posted by Stefano Mazzocchi <st...@apache.org>.
On Friday, Oct 17, 2003, at 12:39 Europe/Rome, Antonio Gallardo wrote:

> I am sure many people that could not go to Ghent (as me) is very happy 
> for
> the effort that Stefano did doing the AVI's. It is really great to see
> what there happens, see all the presentations and get a better feel of
> what there was.

Glad you liked it.

> BTW, I burned a CD's with all the Ghent stuff and give a copy to Carlos
> and another to Bernardo. ;)
>
> I hope Stefano will post the 2 part of the downhall. Because it end to
> soon. I think we miss the end of the event. :(

? that's everything there is!

> Anyway, the AVI's was a great idea! Thanks again, Stefano! :-D

You are welcome.

--
Stefano.


Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Sylvain Wallez dijo:
> Yep. And posts like Barzilai's one make me wonder if we should stop
> development in the 2.1 repo and move it over to 2.2 into a new "cforms"
> (Cocoon forms) block. Note that this doesn't prevent to backport this
> block to 2.1 before an official 2.2 release if we consider that it has
> reached some level of stability (including docs).

-1. I think woody need to get improved even faster than the current trend
in the current release too. 2.2 is far away and since it will be at a
stable level this would slowdown the development of woody. :-(

If someone wants to work with a "non-moving target" then there is 2.1.x

As you posted before this is the price of using too newer blocks. A year
ago Carsten convince me to use the CVS version, I use it since them while
developing applications. Sometimes it is hard, but it is part of the fun
called "bug hunting". ;-D

I cannot forgot the end of the last year when there was a nasty bug with
session-fw that almost make me got crazy. I was too newbie, but happyly
the bug was hunted and the cvs version was fixed. I think maybe Carsten
remember this too? ;-)



>
>>If you wish to know about the lastest of the woody and get a better
>> overview of what woody is and how you can use it. I think apart of wiki
>> there is a very nice presentation (BTW, made by Sylvain at GT2003). I
>> rather want to call it: "Learn Woody in 45 mins."
>>
>
> I'm glad you liked it :-)

:-D

Really, I was not be directly involved in Woody. Just looking here and
there sometimes what Carlos and Bernardo discovered in woody. They are the
"woody gurus" here. ;-D

I was working in druid - http://druid.sf.net/ for get the boring O/R
mapping done by a Druid generator. Carlos and Bernardo said the
presentation was the best that can happen us right now. They said me you
used a diferent approach in the flows as the one used in the examples. Of
course both works.

They already done too much forms that will be glued by Flow with the OJB
code generated by druid.

If this all works... I think the Cocoon comunity will have a really RAD
for database oriented webapp ! I hope it will work, if not we will be
killed by our customers! lol.

I am sure many people that could not go to Ghent (as me) is very happy for
the effort that Stefano did doing the AVI's. It is really great to see
what there happens, see all the presentations and get a better feel of
what there was.

BTW, I burned a CD's with all the Ghent stuff and give a copy to Carlos
and another to Bernardo. ;)

I hope Stefano will post the 2 part of the downhall. Because it end to
soon. I think we miss the end of the event. :(

Anyway, the AVI's was a great idea! Thanks again, Stefano! :-D

Best Regards,

Antonio Gallardo



Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Antonio Gallardo wrote:

>Barzilai Spinak dijo:
>  
>
>>Right now, the best Woody documentation there is, is the one at the Wiki
>> pages which is several eons old
>>and just shows a lot of disperesed concepts and bits but not the wires
>>that make them work with each other.
>>    
>>
>
>Hi Barzilai:
>
>First, your name is not very common in this part of the planet :-D It is
>hungarian?
>
>Now to the things:
>
>I understand the kind of problems you have. Woody is still a work in
>progress but very dynamic and at the current stage, stable and maybe many
>things will not change any more. But please, don't take this for sure.
>Maybe woody will change in the near future, but not much.
>
>A recent proposal is change of the name to Cocoon forms. But I think this
>change will be just for the next 2.2 version of Cocoon.
>  
>

Yep. And posts like Barzilai's one make me wonder if we should stop 
development in the 2.1 repo and move it over to 2.2 into a new "cforms" 
(Cocoon forms) block. Note that this doesn't prevent to backport this 
block to 2.1 before an official 2.2 release if we consider that it has 
reached some level of stability (including docs).

>If you wish to know about the lastest of the woody and get a better
>overview of what woody is and how you can use it. I think apart of wiki
>there is a very nice presentation (BTW, made by Sylvain at GT2003). I
>rather want to call it: "Learn Woody in 45 mins."
>

I'm glad you liked it :-)

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance  -  http://www.orixo.com



Re: [Woody] woody.js (show) woody2.js (showForm) et al

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Barzilai Spinak dijo:
> Right now, the best Woody documentation there is, is the one at the Wiki
>  pages which is several eons old
> and just shows a lot of disperesed concepts and bits but not the wires
> that make them work with each other.

Hi Barzilai:

First, your name is not very common in this part of the planet :-D It is
hungarian?

Now to the things:

I understand the kind of problems you have. Woody is still a work in
progress but very dynamic and at the current stage, stable and maybe many
things will not change any more. But please, don't take this for sure.
Maybe woody will change in the near future, but not much.

A recent proposal is change of the name to Cocoon forms. But I think this
change will be just for the next 2.2 version of Cocoon.

If you wish to know about the lastest of the woody and get a better
overview of what woody is and how you can use it. I think apart of wiki
there is a very nice presentation (BTW, made by Sylvain at GT2003). I
rather want to call it: "Learn Woody in 45 mins."

http://apache.datahost.com.ar/cocoon/events/gt2003/videos/13-woody-flowscript.avi

Before viewing the video I also recommend you to download the presentation:
http://apache.datahost.com.ar/cocoon/events/gt2003/presentations/13-woody-flowscript.pdf

Best Regards,

Antonio Gallardo