Configuring Your Web Server and Setting Up Web Pages for WinFrame Web Computing

In this section, we’ll talk about configuring the Web server and setting up your Web pages for launching applications. You start with a Web server such as Microsoft Internet Information Server or the equivalent for WinFrame Web computing. Your Web server can be running on the same machine as the WinFrame application server, or you can run your Web server on another local machine or a remote machine. For security or performance reasons, you might decide to install the Web server and the WinFrame application server on separate machines.

WinFrame Web Computing has been tested for compatibility with Microsoft Internet Information Server, Netscape Communications Server, Netscape FastTrack Server, and Apache Web server for UNIX. Because the WinFrame application launching capability uses standard HTML features, the WinFrame functionality will work with almost any Web server software.

WinFrame Web computing works with a number of Web server applications.

Two steps are required to configure your Web server for application launching: you must register the ICA MIME type with the server, and you need to create and add ICA hot links to your HTML pages. The next section discusses how to register the ICA MIME type. After I explain a few concepts about ALE, I’ll tell you how to create ICA-launchable applications and how to add hot links to these applications to your HTML Web pages.

Registering the ICA MIME type First you need to register the ICA MIME type with the server. Procedures for doing this vary according to the particular Web server used. Refer to the section entitled “Installing the WinFrame Client for Web Computing” later in this chapter for information on how to set up ICA MIME support for your Web server software, or consult the documentation that’s provided with your Web server.

For more information about setting up a supported Web server, see the documentation shipped with your version of WinFrame.

Application launching and embedding Before you learn about adding hot links to Web pages, you need to understand the basics of ALE. When a user connects to a Web page with an ICA-enabled browser and clicks on an application hot link, the user actually launches the application from a WinFrame server running in the background. ALE enables users to run applications remotely from a Web page via its launching and embedding capabilities.

Most browsers available today support application launching; however, only Microsoft Internet Explorer version 3.0 or greater and Netscape Navigator version 2.0 or greater support application embedding. If you use Internet Explorer, Microsoft ActiveX control technology will be used to display the embedded application. Netscape Navigator uses a plug-in to access and execute embedded HTML documents.

How hot links work When a user clicks on an ICA hot link, the Web server sends an ICA file to the user’s Web browser. The ICA-enabled browser recognizes the ICA file extension and invokes the WinFrame client helper application, a very small ICA client, to handle the ICA file. The ICA file contains information that tells the client which WinFrame server to connect to and which application to launch on the server.

Hot links are embedded on the Web page.

Creating an ICA file Before you can create an ICA file and sub-sequent hot links, you must first install the application to be launched on the WinFrame server. After installing the hot-linked application, you use the Application Configuration utility found on the WinFrame server to write the ICA file. You can also use the ICA Editor, which runs on either Windows 95 or Windows NT 4.0, to create the ICA file. The following information is included in the ICA file:

ICA files help define hot links.

Creating ICA-launchable applications Hot links allow you to launch an application from a Web page. You can create your own hot links with a hyperlink to a valid ICA file located in a public HTML directory on a Web server, as shown here:

<A HREF=“word.ica">Microsoft Word</A>

When this ICA hot link is clicked by a user, it downloads the file WORD.ICA to the client machine and runs the WinFrame Client for Web Computing program ICA32.EXE (for 32-bit systems), using WORD.ICA to define the connection parameters.

To embed a working hot link on a Web page, you must create two files on your Web server: an HTML document and an ICA file. The HTML document is, of course, the actual Web page that contains the hot link. The ICA file contains the information that the WinFrame Client for Web Computing helper application needs to locate the Win-Frame server and launch the application. The ICA file is referenced in your HTML document just like an image or another Web page would be referenced, using the <A HREF> tag.

Here’s some sample HTML code with an ICA-launchable hot link for an HTML page. The Citrix-specific fields are shown in boldface type:

<HTML>
<HEAD>
   <TITLE>NORTHWIND TRADERS ONLINE INTRANET</TITLE>
</HEAD>
<BODY>
<CENTER>
<IMG SRC=”head.gif” ALIGN=CENTER VSPACE=2 BORDER=0><BR>
<IMG SRC=”light.gif” ALIGN=CENTER HEIGHT=200 BORDER=0>
</CENTER>
<H1 ALIGN=CENTER>NorthWind Traders Employee Intranet
</H1>
<H2 ALIGN=CENTER>Company News</H2>
<font size=2>As a member of the Northwind Traders
outside sales team, you can now log in and update
your customer records – remotely – wherever you are,
whenever you wish.</font>
<P>
<!--NOTE: The ICA file below starts the database
application. It is accessed via a hyperlink just like
any other file. -->
   <CENTER>
   <A HREF=”customer.ica”><IMG SRC=”database.gif”
   BORDER=0 VSPACE=6></A>
</CENTER> <BR> <HR> </BODY> </HTML>

Embedding Windows-based applications into a Web page can prove a challenging or confusing undertaking because of the various methods used by Netscape and Internet Explorer browsers to handle embedded files. For example, 32-bit Internet Explorer works with both ActiveX controls (represented by the HTML <OBJECT> tag) and 32-bit Netscape plug-ins (represented by the HTML <EMBED> tag) to access embedded files. However, 16-bit Internet Explorer works only with 16-bit Netscape plug-ins. Net-scape Navigator 2.0 and 3.0 work only with the plug-ins, while Netscape Communicator stalls when it encounters an <OBJECT> tag. All in all, it might be difficult for you to create Web pages with embedded applications that  work for all of these types of browsers.

The following is a workable example of a script written in Java-Script/JScript to create a Web page that will work with both Net-scape Navigator and Internet Explorer. Copy these lines of code to your Web page where you’d normally put your <OBJECT> and <EMBED> tags. Change the first set of var definitions to specify your ICA file, embedded window height and width, and other information.

<SCRIPT language=”JavaScript”>
<!— Author: Thomas Pierce,
// YOU SHOULD NEED TO CHANGE ONLY THE VARIABLES BELOW.
//
// icaFile: location of the .ICA file for
// both the OBJECT and EMBED.
var icaFile = “/bin/ica/solg.ica”;
// width and height: pixel-size of the
// embedded application.
var width = “440”;
var height = “438”;
// start attribute: if Auto, app fires up upon pageload.
// If Manual, app waits to be clicked by user.
var start = “Auto”;
// border attribute: On/Off, to specify border around
// app window.
var border = “On”;
// Want vertical/horizontal space around the app? Set
// these just like for the <IMG> tag.
var hspace = “2”;
var vspace = “2”;
// Where is the ActiveX CAB file located? It’s probably
// best to leave this set to Citrix:
var cabLoc = “http://www.citrix.com/bin/cab/wfica.cab#
   Version=4,2,274,317";
// Where is the Plug-ins Reference page located? It’s
// probably best to leave this set to Citrix:
var plugRefLoc =
   “http://www.citrix.com/demoroom/plugin.htm”;
// The following is the ActiveX tag:
var activeXHTML = ‘<OBJECT classid=
   “clsid:238f6f83-b8b4-11cf-8771-00a024541ee3”
   data=”’ + icaFile + ‘“ CODEBASE=”’ + cabLoc +
   ‘“ width=’ + width + ‘ height=’ + height +
   ‘ hspace=’ + hspace + ‘ vspace=’ + vspace +
   ‘> <param name=”Start” value=”’ + start +
   ‘“><param name=”Border” value=”’ + border +
   ‘“></OBJECT>’;

// And the Plug-in tag:
var plugInHTML = ‘<EMBED SRC=”’ + icaFile +
   ‘“ pluginspage=”’ + plugRefLoc + ‘“ width=’ +
   width + ‘ height=’ + height + ‘ start=’ + start +
   ‘ border=’ + border + ‘ hspace=’ + hspace +
   ‘ vspace=’ + vspace + ‘>’;

var userAgent = navigator.userAgent;
if (userAgent.indexOf(“Mozilla”) != -1) {
   if (userAgent.indexOf(“MSIE”) != -1) {
       if (userAgent.indexOf(“Windows 3”) > 0) {
           document.write(plugInHTML);
       } else {
           document.write(activeXHTML);
       }
   } else {
       if (userAgent.indexOf(“Win16”) > 0) {
           document.write(plugInHTML);
       } else {
           document.write(plugInHTML);
       }
   }
}
//-->
</SCRIPT>

If you want to include some kind of content for nonembeddable browsers, include the following at the end (after the </SCRIPT> tag):

<NOSCRIPT>
<A HREF="URL of ICA file">
Click here to launch the application!
</A> </NOSCRIPT>

This additional code provides an option for users whose browsers can’t handle an embed—it allows users the choice of launching the application instead.