Adding your Droplet to a Web page
Deploying Droplets with Custom Components
Using
Droplets as pop-up Applets
Deploying Applets-only Droplets
Droplets
Client Installation
Droplets
can be served in one of three ways:
As an icon that you can drag off of the Web page and serve as a desktop
application independent of the Web browser;
As an applet that appears as a pop-up window when the Droplet
icon is double-clicked;
As an applet that is embedded within the Web page, and appears
to be a part of that Web page.
The
standard way to deploy Droplets is to combine one pop-up applet icon
beside another icon that can be dragged off the Web page. This gives
users the effect of dragging the application directly out of the application:

If
you allow users to drag icons off of your Web page, you'll want to
include a link through which your end-users can download the Droplets
Client, which will enable their computer to run all Droplet applications.
If you run the Droplet as an applet only, though, your end-users won't
need to download the Client.
"Add
to Web page"
In
order to serve Droplets over your Web site, you'll also have to integrate
them into some of your Web pages. This involves adding Javascripts
tags to the Web pages in which you want the Droplets served. Fortunately,
this is a very simple, one step process with the Droplets "Add
to Webpage" feature. All you need do is the following:
- Create
a DRP file for the application
- Run the
application from your machine
- Select
"Add to Webpage" from the Droplets Menu at the bottom left
of the Droplets GUI
- A pop-up
window will appear with two Javascripts
- Add the
<head> Javascript
to your Web page's header section
- Add the
<body> Javascript
to your Web page's body
You're
done. This will create two things:
The Javascripts
on your Web page should look something like this:
<head>:
<script
language="JavaScript"
src="http://platform.droplets.net/Client/Droplet.js"></script>
<body>:
<script
language="JavaScript"><!--
var
droplet = new DropletObject();
droplet.SetProperty('address',
'www.myHome.com');
droplet.SetProperty('port',
'8194');
droplet.SetProperty('calc',
'My App');
droplet.SetProperty('imageDir',
'http://'www.myhome.com/skins/Skin1');
droplet.SetProperty('imageJar',
'skin1imagejar.zip');
droplet.SetProperty('title',
'the title');
droplet.SetProperty('name',
'the name');
droplet.SetProperty('vars',
'');
droplet.SetProperty('icon',
'false');
droplet.CreateDropIcon(22,22);
droplet.CreateApplet(300,300);
The various
DRP parameters defined in the above Javascript are defined in the table
below:
Name |
Value
Should Be: |
address |
Location
(URL) of the Droplets Server |
port |
Port
on which the Droplets Client and Server will communicate (should be
8194) |
calc |
The
name of your Droplet application on the Server side (the .dll
file) |
imageDir |
The
location of the application skin's params.txt
(and GIFs) |
imageJar |
The
location of your zipped skin directory
structure |
title |
The
title that will appear for the Droplet in application title bar and
on any desktop or Web icons.
|
name |
The
name of the Droplet application on the Client side (the .drp
file) |
vars |
Whatever extra information needs to be sent to the Droplet |
Deploying
Droplets with Custom Components
There
are additional considerations to deploying Droplets if you are deploying
Droplets GUIs that include custom
components that you have written yourself.
You
have three
deployment options for custom components. One of these involves placing
the component on the client-side, while the others retain the thin-client
advantages of Droplets deployments:
- Deploying
as an applet
In this case, you simply place your component's ZIP archive into the
applet's (which is defined within the Web page's <APPLET>
tag). The ZIP archive should be stored in the Web server root, along
with "dropletclient.zip". On the HTML page that contains the
applet, the <APPLET> tab must include the following attribute:
archive="dropletclient.zip,MyCustomComponentArchive.zip"
If you are using the Droplets Javascript tags to
generate the applet, (instead of writing the <APPLET> tag directly),
you should instead add this line after the "droplet.SetProperty"
lines:
droplet.AddArchive('MyCustomComponentArchive.zip');
- Deploying
as a standalone GUI
In this
event you must deliver the AWT component and component adapter into
a zip file to the client machine and place it in the Components folder
of the Droplets Client install (on Windows this is likely to be C:\Program
Files\Droplet\Components). For maximum compatibility with the
various platforms and browser environments in which the client might
be running, the client-side code should be in a ZIP archive rather
than a JAR, and should be compiled with JDK 1.1.x rather than 1.2 or
1.3.
Note: As of the current release, if you use this method to serve
the Droplet as a standalone application you cannot simply select "Add
to Webpage..." from the Droplets Menu and then serve the Droplet
as an applet. This issue will be fixed in the next Droplets SDK release.
- Combined
deployment
The Droplets
API maintains a Custom Component Repository for Droplets Inc customers,
which allows you to serve the component remotely with the rest of your
Droplet application. Contact Droplets
Inc by email for information on adding your custom component to
the repository.
Important
Note: You cannot currently deliver Droplets with custom components
as signed applets.
Serving Droplets as Pop-Up Applets
If you would
instead like to deploy your application as a pop-up Applet accessible
by double-clicking an icon on a Web page, follow the steps outlined above
and then perform the following additional steps:
- Change
"droplet.SetProperty('icon',
'false');" to "droplet.SetProperty('icon',
'true');
- Add a
new line below this one. It should read: "droplet.SetProperty('image',
'MyImageName');"
MyImageName stands
for the name of the image which you want to use as the icon that users
double-click in order to initialize the sub-window applet. It must be
located in your imagedir, as defined in the application's DRP file (and
the Javascript's "imageDir"
property).
- Change
the icon's size by changing the two arguments (height and width in pixels)
to CreateApplet(), for example: "droplet.CreateApplet(35,
35);"
Your Javascript
should now look something like this:
<script
language="JavaScript"><!--
var
droplet = new DropletObject();
droplet.SetProperty('address',
'www.myhome.com');
droplet.SetProperty('port',
'8194');
droplet.SetProperty('calc',
'My App');
droplet.SetProperty('imageDir',
'http://'www.myhome.com/skins/Skin1');
droplet.SetProperty('imageJar',
'skin1imagejar.zip');
droplet.SetProperty('title',
'the title');
droplet.SetProperty('name',
'the name');
droplet.SetProperty('vars',
'');
droplet.SetProperty('icon',
'true');
droplet.SetProperty('image',
'nameOfImage');
droplet.CreateDropIcon(22,22);
droplet.CreateApplet(35,35);
Serving
Droplets as Applets Only
If you do
not want your users to be able to drag the Droplet off of the Web page
and place it onto their desktops, where they can access it as if it were
a local application, simply delete the following line:
droplet.CreateDropIcon(22,22);
Droplets Client Download
If you wish,
you can also include a link which allows users to download the Droplets
Client, thus enabling their machine to run browser-independent Droplets.
Simply include the following link to the Droplets Client download:
<a
href="http://www.droplets.com/download/DropletInstall.exe">Click
Here!</a>
Although
the Client is being served by Droplet, Inc. via www.droplets.com,
this role is entirely invisible to the end-user. To them it appears
that they are downloading the Client from your own site.
Even
if you do not include this link, your users will be prompted to download
the Droplet Client the first time they attempt to drag a Droplet off
of the Web page and onto their desktop.
|