Archive

Archive for the ‘OpenLaszlo’ Category

OpenLaszlo and symlinks

Written on January 20th 2010, 15:01 by sYnie

I develop OpenLaszlo apps on different OL versions. But as I usually need the code to be the same, I use symlinks (symbolic links / soft links) to my apps within the tomcat server of OpenLaszlo. This leads to problems with non-lzx-files. Tomcat just doesn’t recognize other files.
There are some Sites out there, that point out a solution to this. But every time I install a new version of OpenLaszlo, I search for a minimum of 30 minutes until I found it. I think I’ve already bookmarked it, but it’s lost in thousands of OL bookmarks.
However, I thought to blog this solution. So I won’t need to search anymore in the future ;-)

So if you’re facing problems with symlinks using OpenLaszlo, just edit this file:
/path/to/openlaszlo/Server/tomcat-5.0.24/conf/LPS/localhost/lps.xml

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="../../lps-x.x.x" path="/lps-x.x.x">
...
</Context>

And apply the following changes:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="../../lps-x.x.x" path="/lps-x.x.x" allowLinking="true">
...
</Context>

That’s it.
Thanks again to the OL Forums (source)

OpenLaszlo 4.4 Released

Written on July 3rd 2009, 18:07 by sYnie

I think I’m a little bit late with blogging about it, but I thought to share the latest news from Laszlo Systems with you. They just released OpenLaszlo 4.4 with a lot of improvements. This is a short quote:

We are pleased to announce that OpenLaszlo 4.4 is available now. You can download it from the OpenLaszlo Download page. It is the recommended platform for all application development for the SWF8, SWF9, and DHTML runtimes. OpenLaszlo 4.4 is another major release, with almost 180 bugs fixed since OpenLaszlo 4.3. The majority of bug fixes in this release are specific to the DHTML runtime; however, general improvements to all runtimes have also been added and we strongly recommend that you take advantage of them by upgrading.

(http://weblog.openlaszlo.org/archives/2009/06/openlaszlo-44-released/)

I’m really looking forward to trying it. To be honest I still use OL 4.1.1 cause I’ve had no time yet to migrate to 4.2.0. However, I should do it before I have to migrate my applications to another higher version.

Visualslider in productive usage

Written on June 18th 2009, 17:06 by sYnie

While watching for some referer statistics on synie.net, I stumbled across a thread in the OL forums. Here it is:
http://forum.openlaszlo.org/showthread.php?t=13698

LaSlow writes about using my visualslider for a product show case. Just visit this site to see it in action:
http://www.smartcard24.com/
It’s hot, isn’t it? ;-)
I had to reload the website multiple times in order to see it, instead of an advertisement. But it looks great. It’s nice to see what people do with my code snippets. Just recently I got an e-mail from LaSlow with the extended code. It was you, wasn’t it? I’ll try to prepare it for upload during the next 2 weeks.

So, in any case – if you did some improvements to some of my code snippets, feel free to send them to me. I’ll publish them here.

Thanks to LaSlow for sharing the link.

Sockets/IRC using Flash/Openlaszlo without server side proxy

Written on January 22nd 2009, 02:01 by sYnie

some weeks ago I’ve been playing around with the possibility of flash of using sockets. I tried to connect to various services, but unless there is any crossdomain.xml on the server it is just impossible. Well, there is a way to use a server side proxy to create such connections, as it’s allowed to open sockets from the flash client to the same domain, but this isn’t always the best solution. For example if you want to connect to an IRC server, you will be limited to a few connections. Besides that, not everybody has the possibility to run a proxy server for such services.
After some hours of experiments, I got a solution. It’s not very nice and it’s questionable whether this could ever be used in productive environments – but it’s pretty nice to play with ;-)

In this example I used OpenLaszlo to do the flash part – but it can be easily reproduced with actionscript. Furthermore I decided to explain it with an IRC network and as for that (to keep it simple) I used a library to do the protocol stuff. But you can extend this to any service, that uses network connections.
It’s pretty simple:

  • First we create a Java Applet, which does all the socket stuff
  • This Applet will be signed to be able to open connections outside of its sandbox
  • Then the Flash Client will be designed
  • And after all that, a small set of Javascript Functions are needed to make them communicate

This is the example. It’s quick’n'dirty, but it works. You have to accept the Certificate. If you don’t the network connections won’t work.

Keep on reading for examples …
Read more…

OpenLaszlo and Full Screen / Kiosk Mode

Written on November 12th 2008, 17:11 by sYnie

I read about OpenLaszlo and full screen mode at the Laszlo forums. So I thought to publish a very small demo of how to create a solo app, that uses this feature. Here is a demo:

It’s pretty easy, as you can access the AS objects directly with OpenLaszlo:

<canvas>
<script>
Stage.scaleMode = "noScale";
Stage.align = "TL";
function toggleFullScreen() {
if (Stage["displayState"] == "normal") {
Stage["displayState"] = "fullScreen";
} else {
Stage["displayState"] = "normal";
}
}
</script>
<button text="Toggle Fullscreen" onclick="toggleFullScreen()" x="${parent.width/2-this.width/2}" y="${parent.height/2-this.height/2}"/>
</canvas>

Deploy it as a solo app and integrate it into your website like this:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0" width="200" height="200">
<param name="allowFullScreen" value="true" />
<param name="movie" value="fullscreen.swf" />
<embed src="fullscreen.swf" allowFullScreen="true" width="200" height="200" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

There it is. Your very own full screen app ;-)
There are some restrictions (like for keyboard input) and I haven’t tried to use it in a server deployment, yet. So feel free to experiment …

This method is outdated. With 4.4 there’s a built-in method. Have a look at:
http://openfuture.rajubitter.com/2009/07/01/openlaszlo-44-released-video-components-improved-full-screen-support-for-swfx/

Slideshow with OpenLaszlo as a “Widget”

Written on October 8th 2008, 20:10 by sYnie

Hey,

I want to introduce you the previous posted Slideshow created with OpenLaszlo, but this time, you can use it without any knowledge of OpenLaszlo. Just download it and use a simple HTML-embed object, to tell the SWF, which pictures you want to use. This is an Example:


(enlarge)

You can also use your mouse to navigate between the pictures and to start/stop the autmatical slide show.

The code which I used to embed it is:

<object width="400" height="300">
<param name="movie" value="visualslider/visualslider.swf">
<embed src="visualslider/visualslider.swf?vspic1=res/1.jpg&vspic1w=300&vspic1h=200&vspic2=res/2.jpg&vspic2w=300&vspic2h=200&vspic3=res/3.jpg&vspic3w=300&vspic3h=200&vspic4=res/4.jpg&vspic4w=300&vspic4h=200&vspic5=res/5.jpg&vspic5w=300&vspic5h=200&vspic6=res/6.jpg&vspic6w=300&vspic6h=200&vspic7=res/7.jpg&vspic7w=300&vspic7h=200" width="500" height="300">
</embed>
</object>

It’s quite simple. You just have to include the SWF file into your HTML document and give it some parameters about which pictures you want to use in the slideshow.
This is the URL to the SWF file I used:

visualslider/visualslider.swf?vspic1=res/1.jpg&vspic1w=300&vspic1h=200&vspic2=res/2.jpg&vspic2w=300&vspic2h=200&vspic3=res/3.jpg&vspic3w=300&vspic3h=200&vspic4=res/4.jpg&vspic4w=300&vspic4h=200&vspic5=res/5.jpg&vspic5w=300&vspic5h=200&vspic6=res/6.jpg&vspic6w=300&vspic6h=200&vspic7=res/7.jpg&vspic7w=300&vspic7h=200

  • “visualslider/visualslider.swf” is the place, where visualslider.swf is located.
  • “?vspic1=” is the parameter to tell the SWF, which picture (”res/1.jpg”) to use.
  • “&vspic1w=” to define the width (”300″).
  • “&vspic1h=” to define the height (”200″).
  • After that, I pass the next parameter for the second picture (”&vspic2=”), and so on.
  • You can also define “&vsms=” to tell the SWF, how fast it should change the picture. Default is set to 5000.

The SWF: visualslider.tar (2009-07-06)
The sourcecode: main.lzx (2009-07-06), visualslider.lzx (2009-07-06) (GPL’ed)
Click here to see the fully documented Visualslider component.
I hope it’s useful for you.

Slideshow for OpenLaszlo

Written on July 5th 2008, 19:07 by sYnie

I had to create a Presentation some days ago. As we needed a little slideshow of pictures, within that presentation, I decided to create a little Sliteshow with OpenLaszlo. Maybe it’s useful for you, so you can use it under the terms of the GPL.

Here is a little Example, created with “Visualslider”:
Visualslider.swf

And this one ist quite the same, but with Slides sliding “circles”:
Visualslider_c.swf

You can click on the Slides, to navigate through them. Also you can use the cursor keys, to do the same. With the key “t” you can toggle between automatical sliding and manual sliding.

And here is the source code:
visualslider.lzx (2009-07-06)

A little Documentation:

<visualslider>

  • Description:
    The container view
  • Attributes:
    currentslide – (readonly) returns the selected slide
    slideduration – the time in ms for the slide-animation
    circular – boolean for circular-sliding
    timerms – the time in ms for automatical sliding
    istimerstarted – (readonly) returns a boolean whether automatical sliding is started or not
  • Methods:
    slideUp() – select next slide
    slideDown() – select previous slide
    slideTo(n) – select the nth slide
    startTimer() – start automatical sliding
    stopTimer() – stop automatical sliding

<visualsliderview>

  • Description:
    A slider-view. Must be placed in <visualslider>
  • Attributes:
    originalwidth – the 100%-width of the view
    originalheight – the 100%-height of the view
    currentslide – (readonly) returns a boolean whether this visualsliderview is selected or not
    shadow – boolean to display a shadow under the visualsliderview
    factor – (readonly) returns a scale-factor with reference to originalwidth and originalheight (useful to scale subviews)
    slidenumber – (readonly) returns the number of the slider
  • Events:
    onstop – Fires when the animation is finished
    onstart – Fires when the animation is started

Here you can find the zipped source code of the example. This may be helpful to create your own slideshow:
visualslider.tar (2009-07-06)

OpenLaszlo + Red5 = Voice chat

Written on May 9th 2008, 03:05 by sYnie

I have been working a long time with OpenLaszlo and Red5. As my commercial projects take months over moths to be developed, the last two days I just did something really basic. A small voice chat using OpenLaszlo and Red5. It’s for a freetime project and it’s planned to be integrated into Joomla. So maybe I will release this little app as a Joomla extention, later.
But now, I just want to show you, what you can do with OpenLaszlo and Red5 in a really short time:
Click here to visit the voice chat.

Features are so far:

  • Voice chat
  • Text chat
  • User management
  • Hardware selection
  • Nice look and feel
  • And so on …

Let me know, what you think about it. I hope I can show you the application integrated into Joomla as soon as possible.

AESCryptLz strikes back ;-)

Written on April 4th 2008, 13:04 by sYnie

My last post about AESCryptLz got real good feedback. As I’m trying out a lot of different encryption algorithms, there is the next one. But this is only a pre-version of the upcoming pack of AESCryptLz. It doesn’t include an example for Java and it’s not really commented. But you can use it anyway, because it’s doing its job.

To be done:

  • Java backend example
  • Better documentation
  • Implementation of MD5 checksums to provide encoding via password
  • Bug fixes (?)

The new Version of AESCryptLz is based on the set of JavaScript functions developed by Chris Veness and it’s released under the LGPL. Thanks a lot to him, for his great work.

In detail, it uses the AES/CTR algorithm without padding. The class generates encrypted byte-arrays and also needs byte-arrays to decrypt them. I’m not using HEX-Strings anymore, because it’s much faster, when I’m doing this calculations without any converting. As I’m using Red5 for the backend, it’s really easy to send and get byte-arrays. But I’ll explain how, next week.
Also I’ve implemented a way to encrypt using LzIdle. So you can use it to en-/decrypt things in backgrund. The used vector is stored in the first 8 bytes of the generated byte-array. The following bytes are the encrypted text. So it also needs the used vector in the first 8 byte, if you want to decrypt a byte-array, generated by other algorythms.

Here are the files:

I think I am on a good way with this class. It’s faster and much smaller than the last one.
So stay tuned for any updates.

AESCryptLz: OpenLaszlo & AES encryption

Written on March 19th 2008, 19:03 by sYnie

Some days ago, I started to search for a usefull code-snipet to de- and encrypt files or strings in OpenLaszlo. Everything I found were some posts about hash creation. So I started to search for JavaScript solutions to port them to OpenLaszlo. Mixing this with some hash creation algorithms and an own class to handle all those functions is compiled together to “AESCryptLz”. It can be used to de- and encrypt everything you want.
The used algorithm de-/encrypts via AES/ECB without Padding. You can de-/encrypt with a 128 bit key only. To do so, you can either use a 128 bit hex string or an ASCII string as “password”. If you use the ASCII key, then AESCryptLz will generate a MD5 hash out of it, to use it as a 128 bit hex key. All the encrypted data will be returned as a hex string. Also the data you, want to encrypt, needs to be a hex string.
Sounds a bit confusing, but it’s explained at the top of the source code.

To create this little set of classes, I ported a JavaScript library created by Eugene Styer. He allowed me to use his source code under the GPL. Thanks a lot!
I also used an OpenLaszlo class, ported by Userfriendly and former developed by Paul Johnston, released under the BSD licence. Thanks a lot, you too.

I created an own class, modified the mentioned classes and linked them all together. So you can use it under the GPL. Here you can find a little example that makes use of AESCryptLz.

The Sourcecode:

The first one is the AESCryptLz source code. The second one is the code of the shown example. And the third one is a little, quick and dirty Java source code, that shows, how to handle AESCryptLz-encrypted data. This may be usefull for a Java backend.

I’m looking forward to your feedback.

Kind regards,
Mario

Ps.: To see if it works, try to decode the following message, using the example application with the ASCII key “synie”:

1e af f3 90 83 02 50 90 a4 9c bc bc 7e 05 d3 78 50 79 ac aa 0f 0d ad 28 98 a7 46 13 b1 49 d7 e2 b9 d1 d9 c7 7a f0 01 0e 88 0d 95 a3 7f b2 52 92 2f 9e 5b 61 e7 67 8a 93 19 d0 5c c0 0c 78 64 e3 e0 f2 4c 4f b5 64 e9 d8 43 89 9d 8e fb 07 d8 e7 b8 ea 07 49 69 fd a7 b3 8d c3 8b 04 19 92 7a be