Thanks for this great article. Your suggestions below are excellent. I hope you will file improvement requests in Jira for them!

On 2009-04-06, at 12:39EDT, Tim Dauer wrote:

So far, so good: The necessary changes had been made. But then I encountered a problem, which I solved manually - but I think it could be automatated in the Perl-Script:

3. I changed all the used Color-Keywords (like "black", "white", "green", ...) in the Tag-Descriptions and the setters (setAttribute('fgcolor',...), etc.) to their Hex-Values: black --> 0x0, white --> 0xFFFFFF, and so on. I am pretty sure this could be done by the perl script, but I have no idea about perl... or maybe there is another way?

This is a good point. There are no longer global names for colors, but you can use a string as a color name (so long as it is one of the CSS3 color names). So the script could instead change:

setAttribute('fgcolor', white); // An error, unless you have a local variable, `white`

to:

setAttribute('fgcolor', 'white');

It's a little risky doing this in a Perl script, since it really has no understanding of the program, so it cannot tell whether or not `white` is a local or global reference.

That last Step eliminated all the remaining errors I had before my program started (it killed all the error messages in the debug- window before my inital "Program startet..." Debug-Message appears *Wohoo*).

4. I went through my code updating all the lines of my code that were instantiating self written classes. I added "lz." in front of the first few classes my program encounters. I am pretty sure this work can be done by one of the perl scripts above too - just scan the class for appeareances of the sting "new *" and replace all occurences of "new *" with "new lz.*". Should that do the trick or am I missing side effects?

That should be sufficient. Classes also were moved out of the global namespace and now have to be referenced by `lz.`. This is all to minimize OpenLaszlo clashing with any other Javascript you might want to use. Again, it is hard for the Perl script to make this transformation, because it does not really understand your program. Perhaps it could accumulate additional names to translate from <class> definitions, but it clearly can't change every `new` call, because you may have some Javascript classes that are not defined by LZX.

5. I am using a red5-rtmp-connections (rtmps actually) including NetRemoteCalls. The netremotecall-Class is missing completely in the OL 4.3 and in the OL 4.2 release - too bad. So I am using Sebastian Wagner's Code from an older Mail to the Laszlo-User-Mailing-List ("Re: [Laszlo-user] OL 4.2: NetRemotecalls annihilated?" from Sebastian Wagner send on Feb the 2nd of 2009). Works fine after one tiny little change: in the method "registerMethods" the line "var t = hib;" has to be deleted or commented - it does not do anything (that I could see :) ).

Sebastian and Sarah Allen are the primary contributors for this code. I hope they can comment.

6. I have many calls to servlets in my code. One of the functions I used frequently is the OL 4.0.11 method "dataset.setQueryType(...)". This method is deprecated, but not changed by the perl script - should be easy to change that. It works currently for example for the "setSrc(..)" function of the dataset-class.

Please file a bug!

Reply via email to