Java applets & Revlets

Jan Schenkel janschenkel at yahoo.com
Fri Sep 25 01:10:46 EDT 2009


Hi Jerry,

Bear in mind that the brand-new revlet system isn't even finished yet. It is still in alpha, and there's still plenty of functionality to add before the shipping date. Hence, few people are going to take a dive deep enough to hit these sort of questions. But I'll give it a shot.

Not yet implemented, but scheduled for the release version, is the ability to interact between the revlet and the containing web page via JavaScript; as Java applets can do the same thing, you could setup JavaScript as the go-between messaging system between revlet and applet. 
But there's no way to try this just yet as the mothership's engineers still have to finish that.

What you can do, however, is use socket communication. Your Java applet can open a ServerSocket on an agreed-upon port, and the revlet can open a socket to this port and read from it or write to it. You wouldn't need anything extra and can start experimenting today.
The tricky part in this scenario is the browser security model: both Java and the RevWebEngine place their in-browser parts in a sandbox where they can't do any harm (such as reading/writing files, opening sockets, connectiong to databases,...)
And the user has to explicitly allow them out of this sandbox environment - via a security permission dislog box that sternly warns you to only do this if you really trust whoever wrote this code.

Best of luck,

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


--- On Thu, 9/24/09, Jerry Balzano <gjbalzano at ucsd.edu> wrote:

> From: Jerry Balzano <gjbalzano at ucsd.edu>
> Subject: Re: Java applets & Revlets
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Date: Thursday, September 24, 2009, 9:32 AM
> Hi all,
> 
> Although this list is usually pretty responsive to
> questions, I sent the email almost 48 hours ago and haven't
> raised a single reply.  If I'm just asking foolish
> questions, perhaps someone could gently tell me why, and
> suggest what I might do (instead) to address the issue I
> raise.
> 
> Thanks,
> Jerry B
> 
> On Sep 22, 2009, at 2:13 PM, Jerry Balzano wrote:
> 
> > I hope this isn't too bizarre a request.
> > 
> > I want a Revlet to be able to control which of several
> (pre-made) Java
> > applets a user sees.  How would one do
> this?  Is it possible to embed
> > a Java applet inside a Revlet?
> > 
> > I was looking through previous messages to see if this
> question had
> > been asked previously and I learned (a little) about a
> stack property
> > called the revletParams, but I don't know how or if it
> would apply
> > here.  For example, would one stick the whole
> string
> > <applet code="org.nlogo.window.Applet"
> >     
>    archive="NetLogoLite.jar"
> >         width="460"
> height="280">
> >   <param name="DefaultModel"
> >         
> value="Tag.nlogo">
> > </applet>
> > inside the revletParams?  (And then what?)
> > 
> > Sorry for the painfully naive nature of these
> questions, but this is
> > all untrodden ground for me.
> > 
> > Thanks,
> > Jerry Balzano
> 


      



More information about the use-livecode mailing list