Brendan:
Several months ago a former co-worker wrote some perl scripts to
convert WOD's to WOOGNL inline bindings. He no longer does WebObjects
development, and no longer hosts the scripts, but I have made them
available at:
http://handbuiltsoftware.com/downloads/convertToWOOgnl.zip
I'm cross posting this to the webobjects list as well, since with a
little modification, this script could convert WOD's to 5.4 inline
bindings.
I've used the script on several projects, though not in a few months.
I recall it had an issue with <webobject> tags that were nested more
than two or three levels, but in those cases it would still produce a
valid WO, leaving the deep nested tags unconverted from the WOD.
From his original announcement:
> As soon as I started using Eclipse, I pretty much stopped using
> WebObjects Builder and started using the built-in component editor of
> Eclipse. The more I used the built-in component editor, the more I
> got sick of keeping my bindings in a separate file, and so I started
> using WOOgnl to put all my bindings in-line. To me it's much more
> readable, and there are scads of cool little features about it that
> can save you a ton of time. The problem was that I had tons of
> existing code that used the old style of bindings, and after
> converting two or three to WOOgnl format, I was fed up pretty
> quickly. So I bit the bullet and wrote a PERL script to do it for
> me. It took awhile to account for all the outside cases of different
> acceptable syntax, but I've now used the script on hundreds of
> components, and it seems to work quite well. If anyone is
> interested, I've posted the scripts for public consumption.
>
> Of course, there is no warranty implied whatsoever, so please use
> with caution! The first script (convertToWOOgnl) simply takes the
> path to a .wo file and spits out a WOOgnl-ized HTML file to standard
> out. You can then copy this output over the HTML portion of your .wo
> and delete the contents of the .wod portion. The second script
> (convertProjectToWOOgnl), for the truly brave, invokes the first. It
> takes a directory path as an argument, updates the .html of every .wo
> in the directory, and whacks the .wod file. It does nothing to back
> up the directory before-hand, so PLEASE be prudent if you use this
> and make a copy of the directory first, and test your components
> after. The scripts work smashingly for me, but you never know when
> there's an outside case that you missed coding for, so I just want to
> be sure everybody is clear about the implications of using the second
> script. The first is extremely safe, since it only works on one file
> at a time, doesn't modify any files, and simply writes its output to
> the terminal.
- Tobias
On Nov 1, 2007, at 2:25 AM, Brendan Duddridge wrote:
> I prefer not to mix and match. I like the inline binding style
> better. Even with longer bindings. I just put each binding on its
> own line in the HTML. I know that gets messed up when you reformat
> though. It would be really cool to have a quick "convert wod to
> inline" refactor command.
>
>
>
> ____________________________________________________________________
> Brendan Duddridge | CTO | 403-277-5591 x24 | brenda..lickspace.com
>
> ClickSpace Interactive Inc.
> Suite L100, 239 - 10th Ave. SE
> Calgary, AB T2G 0V9
>
> http://www.clickspace.com
>
> On Oct 31, 2007, at 2:22 PM, Guido Neitzer wrote:
>
>> On 31.10.2007, at 13:58, Mike Schrag wrote:
>>
>>>> No, you don't have to delete the wod, it seems to be good enough
>>>> to have it empty.
>>> Are you defecting on me over to 5.4's parser :) ?
>>
>> Nope. I very much prefer the WOOgnl parser for the ability to mix
>> styles. We only worked on that stuff yesterday as we have projects
>> that are not using Wonder.
>>
>> cug
>>
>> --
>> http://www.event-s.net
>>
>>
>
This archive was generated by hypermail 2.0.0 : Thu Nov 01 2007 - 07:10:59 EDT