Chapter 22

Creating a Functional Site


CONTENTS

In Chapter 21, "Creating a Dynamic Site," you learned how to generate and store data. If you're encouraging users to input data, and you're thinking carefully about how to store that data, eventually you will want to do something with all the information. This chapter focuses on methods in which you can creatively manipulate your data with a set of tools. To create a functional site, you need to know what is available in the world of Web languages and development application programs. You also need to know a little about how those languages and programs work so that you can choose the tools that will best suit your needs. Additionally, you need to know what kinds of programs and applications are currently under development because any of them might affect the future of your intranet. After reading this chapter, you should have a good understanding of the tools and techniques necessary to manipulate both the static and dynamic data of your intranet effectively.

Manipulating Data

Proper handling of the data generated by and input into your intranet requires that you work (or at least familiarize yourself) with the programming languages available to your system and with other applications that are especially useful for Web development.

Shell Scripts

If your server uses a UNIX operating system, you can manipulate its functions with the shell. A shell is like a series of operating system command-line instructions put into a single file for execution all at once. This is known as batch processing and is similar to a DOS .BAT file. Of the many examples of shells, the more popular include Bourne, C, BASH, POSIX (Windows NT), and Korn. If you are unsure which shell is installed on your UNIX server, refer to your original documentation or ask your system administrator.

Tip
In order to effectively use shell scripts, you must know which shell you are using. Type the following line and press Enter:
echo $RANDOM
The Bourne shell will return a blank line. The C shell will return the following:
RANDOM: Undefined variable
Both the Korn shell and BASH return a random number. To further discern between the Korn shell and BASH, type help. BASH will return a list of command descriptions.

Each shell reads your commands and processes them. Each shell has variables as well as sequence, selection, and repetition structures; the shell itself is not UNIX. Many shells are built on one another, so after you learn the commands for one, the others will be easier to learn. Shell scripts are the simplest programs to write; they are text files containing scripting commands that will-when executed-transmit data. Listing 22.1 shows a simple shell script. One common use of shell scripts is to allow a system administrator to schedule unattended reboots or shutdowns of an operating system. Other types of functions also can be performed with shell scripts. You can, for example, write a script that lists the process information for a user who is logging into the system. Knowing which user is currently logged on to your intranet lets you dynamically serve data to him based on his user profile. In the case of department-specific data, you could group the users and present data-such as news items-differently to the marketing department than to the research and development team. The intelligent delivery of information quickly becomes important when you're dealing with large amounts of data. Shell scripts are quick and dirty. You are somewhat limited, however, to the commands that are allowed by the shell (for example, you can't use programming methods such as abstract data types).


Listing 22.1. A simple shell script.

echo Content-type: text/plain echo echo "CGI/1.2 (POSIX shell, args.sh) report:" echo echo $# "args:" echo $1 $2 $3 $4 $5 $6 $7 $8 echo echo environment variables: echo REQUEST_METHOD: $REQUEST_METHOD echo SCRIPT_NAME: $SCRIPT_NAME echo QUERY_STRING: $QUERY_STRING echo PATH_INFO: $PATH_INFO echo PATH_TRANSLATED: $PATH_TRANSLATED if $REQUEST_METHOD = "POST" then echo CONTENT_TYPE: $CONTENT_TYPE echo CONTENT_FILE: $CONTENT_FILE echo CONTENT_LENGTH: $CONTENT_LENGTH echo echo ---- begin content ---- cat echo echo ----- end content ----- echo fi echo -- end of report -

In building your intranet, you will need to be aware of which shell or shells are on your server, as well as which shells you would like to add. In doing so, consider how much time you can dedicate to learning the language of a shell. Also consider what types of functions you want a shell to perform. You can find charts and tables offering information about the commands available for different shells online. You can find Usenet newsgroups revolving around particular shells, and you can always do a search through your Web browser. Adding the acronym "FAQ" to your searches is often helpful; for example, you might do a search for KORN shell FAQ. FAQ stands for "Frequently Asked Questions." Each newsgroup on Usenet has a FAQ.

After you are familiar with your server's shells, you may want to write scripts yourself. When you're designing scripts to be used for your intranet, you might use the language of your shell, or you might choose another scripting language. It is crucial that your scripts be robust and secure, because they will be exposed to a multitude of users every day. Writing your scripts to elegantly handle errors and deliver clear, concise, user-friendly error messages will educate the user as to the cause of the error and show him how to avoid the error in the future. Likewise, error messages provide invaluable information for the site administrator and developers, which will allow easier debugging of scripts. There is nothing more frustrating for a user than to have the Web browser return a page that says

HTTP: Web Server unable to handle request (37x938), have a nice day!

You're probably wondering how the client's browser submits all this data to the server, seeing as how there are so many different hardware and software platforms. The Common Gateway Interface (CGI) handles all cross-platform communications.

The CGI works by handling information requests and returning appropriate documents or creating documents generated by a script, translating incoming messages into a standard format that the Web server can parse. A gateway is necessary when the two languages communicating have no native method of communication. Gateways belong to a class of software known as "middleware." Middleware is a blanket term for any distributed software that supports the interaction of clients (in this case, the Web browser) and servers (for example, the HTTP server). It is important to note that middleware, and thus the CGI, does not include the software that processes the actual request or service; that is the script's job. Middleware does not support the user interface; that is the browser's job. The simplest gateway is a repeater that takes a message and repeats it: it solves distance problems but cannot translate. Aside from the Common Gateway Interface (CGI), the most common gateway you will come across is a mail gateway.

CGI is a standard that defines the format of data being passed from client to server. CGI scripts, many of which are written in Perl (you learn about Perl later in this chapter), are especially useful for the Web because they can return a variety of documents to the client. A script or program that uses the CGI to move data between the client and the server is often referred to as a CGI. Through complicated programming, CGIs can transmit images and audio clips. However, they excel in both performance and ease of programming when they are returning simple character data-for example, a page of HTML. It is important to note that CGIs are server-intensive. Many CGIs executing on one machine can bog down performance.

One prerequisite for this dynamic exchange is that the client (the one "asking") must know what type of document the host (the one "giving") is sending so that it can be presented in the appropriate usable format, perhaps as an HTML file.

Currently, the CGI is the most popular way to create dynamic HTML documents. The CGI can use almost any scripting language, but again, Perl is the most common. Other languages used to write CGIs include C, C++, Visual Basic, and even Java. CGI programs are independent processes; they go into action every time your server receives a request from a client (the Web browser). An excellent site on the Web for learning about the CGI is

http://inwfdux1.rug.ac.be/cgi/primer.html

You do not have to be an expert programmer or have a Ph.D. in computer science to manipulate data with scripts. What you do need, however, is knowledge about the languages with which functional Web-compatible scripts can be written and some good instruction. If you already have some knowledge about scripting and want to learn more, then you might refer to online tutorials for additional guidance. You can find a UNIX and C Shell tutorial, for example, at

http://www.eng.hawaii.edu/Courses/C.unix/page-09.html

Perl

In this section, you will take a more in-depth look at one of the most popular scripting languages for the Web, one that is considered to go hand-in-hand with CGI: Perl (which stands for Practical Extraction and Report Language). Perl was developed by Larry Wall, who originally wanted to write a language with which to manipulate data gathered from Usenet newsgroups into reports (hence the name). His idea caught on, and Perl is now a key language for manipulating data from the Internet. Currently, Web developers use Perl to write CGI scripts that run on Web servers.

Perl, which is an interpreted language, is slow in comparison to a compiled language such as C/C++. An interpreter performs the operations implied by the source program. Unlike interpreted languages, compiled languages such as C++ use a compiler, which is a program that reads a set of commands written in one language-the source language-and translates it into a binary executable that can be used only by the target platform. You cannot reverse this process. Once compiled, an executable cannot be translated back into source code. Therefore, remember to archive all your source code in a safe place if you'll want to alter the executable in the future. Perl always exists as a text file, making it easy and quick to modify. A compiled program written in C exists on the server as a machine language executable, which is unreadable to most humans. To make a change to a compiled program, you must have access to the source code. After you modify the source code, you must recompile to generate the new executable. Compiled programs may sound like too much trouble, but the performance gains can sometimes far outweigh the overhead required for compiling the executable. Use a compiled program when the functionality isn't going to change, or the CGI will be used frequently.

Another advantage of Perl is its ability to cross platforms. A Perl script can usually run on UNIX, Windows NT, Apple Mac, or other operating systems with equal success. Although this cross-platform capability is generally true, some machine- and OS-specific Perl libraries do exist.

A thorough knowledge of Perl is advantageous for intranet developers. Although the popularity of various scripting languages (especially when the Internet is concerned) is always fluctuating, you can rest assured that a Perl community will exist on the Web for quite a while. Four different Usenet newsgroups are dedicated to discussing its intricacies, and you can find a well-maintained Perl home page at

http://www.perl.com/perl/index.html

If you choose Perl as your CGI scripting language, be sure to check out cgi-lib.pl, the definitive CGI library for Perl, at

http://www.bio.cam.ac.uk/cgi-lib/

In addition, a number of specialty Perl tutorials are available online. Do a Web search to find one that best suits your needs.

The basic concept of Perl is similar to that of the shell programs. Like a shell script, a Perl script is a listing of Perl statements and definitions gathered into a text file. Listing 22.2 provides an example of what a simple Perl program looks like. For an output of this listing, visit

http://www.wavelength.com/cgi-bin/envs.pl

Listing 22.2. A simple Perl script that shows environment variables.

print"Content-type: text/html\n\n"; print"<pre>"; foreach (keys(%ENV)) { print "<BR>"; print ("$_\t$ENV{$_}"); } print "</PRE>";

Once you get the hang of writing Perl, you can use it to write scripts for the functions of your intranet. Forms are a common, yet powerful, example of a function that you can implement with Perl. Listing 22.3 shows a sample form written in Perl. For an output of this script, visit

http://www.wavelength.com/cgi-bin/testform.pl

Listing 22.3. Writing forms with Perl.

#!/perl -w- # -*- Perl -*- # Author: M.Baird (baird@id1.com) # Copyright (c) 1996 by Matthew J. Baird #?Error Messages $ErrorNoContent[0] = "Error: No Message Content"; $ErrorNoContent[1] = "All the message fields were blank."; &main; # Purpose: The main function of the program sub main { if($ENV{'CONTENT_LENGTH'}) { &GetInputFields; if(!&VerifyInputFields) { exit(0); } &FillOutForm; } else { # Argument to SendHeadOfDocument is the title &SendHeadOfDocument("Test Form"); . &SendForm; } } #?SendHeadOfDocument($title) # # Purpose: This sends a header back to the browser in preparation to display # some kind of response to what the server did. sub SendHeadOfDocument { local( $title # The title of the response document ) = @_; print("Content-type: text/html\n\n"); print("<head><title>$title</title></head>\n"); print("<body>\n"); } sub SendForm { print("<BODY>\n"); print("This is a test of a PERL form.<br>\n"); print("<pre>\n"); print("<hr>\n"); print("<H1>Test Form</H2>\n"); print("<FORM ACTION"); print("=\"http://www.wavelength.com/cgi-bin/testform.pl\" METHOD=\"POST\">\n"); print("<p>\n"); # User info print("<b>Print your name:</b>\n"); print("<pre>\n"); print("First:\t"); print("<INPUT TYPE = \"text\" NAME = \"First\" SIZE = 30>\n"); print("Middle:\t"); print("<INPUT TYPE = \"text\" NAME = \"Middle\" SIZE = 30>\n"); print("Last:\t"); print("<INPUT TYPE = \"text\" NAME = \"Last\" SIZE = 30>\t"); print("</pre>\n"); print("<HR>\n"); print("<INPUT TYPE=\"submit\" VALUE=\"Test Form\"></FORM></pre>\n"); } #?GetInputFields(void) # # Purpose: Gets and sets all the fields sent from the browser to the server sub GetInputFields { local( $i, $length, $input, @input, $field, $value ); $length = $ENV{CONTENT_LENGTH}; $input = getc; for($i=2;$i<=$length;$i++) { $input .= getc; } @input=split(m|&|, $input); for($i=0; $i<=$#input;$i++) { $input[$i] =~ s|\+| |g; $input[$i] =~ s|%(..)|pack("c", hex($1))|ge; ($field, $value) = split(m|=|, $input[$i]); # Stop people from using subshells to execute commands $value =~ s/~!/ ~!/g; # $InputField{$field} = $value; } # continue to process information here. }

Database Interface

If you choose to use Perl as a means for incorporating dynamic functions into your intranet, you might want to take advantage of Database Interface (DBI). DBI is a database interface for Perl, an extension that allows it to access databases, including relational databases. Generally, when people talk about databases these days, they are referring to relational databases. The DBI is just a library that gives the programmer a set of instructions he or she can use to access a database programmatically. A number of available libraries enable Perl to do complex math, graphics, and other extended operations; the DBI is simply another one of these libraries for database access.

Besides Perl and its extensions, you can use many other languages for writing scripts. If you want to write a script in a particular language, you should check on that language's capacity to function on the Web. Likewise, if you have work written in a language that's not as Web-compatible as you would like, consider rewriting it in a language like Perl. For a language to be used on the Web, it must be able to accept data via the STDIN and write to the STDOUT (C/C++-centric terms). CGIs were originally written on UNIX machines, which use the CGI. Calling this type of program a "CGI" is actually a misnomer because it isn't a type of program; rather, it's a format to receive data over the Internet.

Structured Query Language (SQL)

For writing scripts, you might also research other languages, such as the Structured Query Language, known as SQL. The disadvantage of SQL is that it is not a language that you can use to write CGIs directly. A CGI can use SQL, however, to query data out of a database and return that data in the form of a Web page. SQL talks strictly to databases.

SQL is a comprehensive database language; it has statements for data definition, query, and update. It is both a Data Definition Language (DDL) and a Data Manipulation Language (DML). You can embed SQL in Perl, C, or whatever language you're using for your CGIs.

Originally, SQL was called SEQUEL (for Structured English Query Language) and was designed and implemented at IBM Research as the interface for an experimental relational database system called System R. Currently, the ANSI standard is SQL2. Following are the query and results of an SQL call using the Oracle RDBMS:

SELECT   BDATE, ADDRESS
FROM     EMPLOYEE
WHERE    FNAME = 'Matthew' AND MINIT = 'J' AND LNAME = 'Baird'

The words in bold are SQL reserved words. The SELECT keyword precedes an attribute list, which is a list of attribute names whose values are to be retrieved by the query. The FROM keyword specifies a table list, which is a list of the relation (table) names required to process the query. The WHERE clause is a conditional (Boolean) search expression that identifies the tuples (a fancy word for row) to be retrieved by the query. Inside the WHERE clause you can use ANDs, ORs, and other conditional modifiers. This particular query retrieves the birthdate and address of the employee whose name is Matthew J. Baird. This query results in the following table with one row of data:
BDATE ADDRESS 01/28/72 123 Fore St. Washington DC

Listing 22.4 is the skeleton of a CGI written in C that would submit an SQL query to the RDBMS.


Listing 22.4. A form that accesses a database using SQL.

int main ( int argc, char * argv[] ) { CString method = getRequestMethod(); cout << "Content-type: text/html\n\n" << endl; if ( method != "POST" ) { report_error(POST_ONLY); } else { SQLStatement = " SELECT BDATE, ADDRESS FROM EMPLOYEE WHERE FNAME = 'Matthew' AND MINIT = 'J' AND LNAME = 'Baird'"; } return(0); }

If you are interested in learning more about SQL, you can find information about it on the browse page at

http://heasarc.gsfc.nasa.gov/docs/xray/lx_user_guide/node46.html

Additionally, the site http://www.creditunions.com/callahan/cusearch/ shows a form accessing a database back end to deliver over 250 megabytes of data via the WWW. The WWW-RDBMS interface CGI was written in C++ and uses Microsoft Access as the RDBMS. Access is an excellent and inexpensive RDBMS for the end-user, but it doesn't have nearly the performance of the Oracle RDBMS. This CGI's excellent performance, considering the large amount of data, is partly attributable to the proper design of the database, as well as the efficient coding of the CGI.

When you're considering what languages to use to write scripts, you should build on your knowledge; use what you already know as your starting point. As you develop your intranet, you will learn more about how to move your data from point A to point B using both current and future languages.

Transmitting Functionality

As you probably already know, corporate use of the Internet has grown rapidly in the past few years. With that growth has come a demand for applications and databases that both internal and external intranet users can access easily and securely. Most corporations want to link employees, customers, and vendors together into a custom online network, while not risking the exposure of private information. At the same time, you want to keep your intranet safe from corrupt data that might be accidentally or intentionally sent to your site.

Tip
The Internet can provide an authoritative source of information for customers, but be cautious of the numerous informational pages available. Finding information on an IBM product at the IBM Internet site is more likely to be right than at "Joe's IBM Information Page o' Fun."

Fortunately, some application developers have taken on the task of providing the means by which corporations and organizations can build intranets that are secure and functional, as well as flexible to developing Web technology. These developers have handled their task by creating what could be considered a new genre of application programming, which is the subject of this section. In earlier chapters of this book, you learned about some of the increasingly sophisticated e-mail and discussion groups that you can include on your intranet. As the application technology develops, anticipate that you will be able to provide your intranet users with the ability to communicate designs for product plans, documents, and schedules, both functionally and securely. Electronic forms will automate even the most bureaucratic of processes, including the filing of purchase orders, health insurance claims, and order forms. Production tools such as spreadsheets and drawing and mapping programs will be made available in less cumbersome file formats, allowing for quick and safe exchange.

As the WWW has increased in popularity, it has become increasingly more TV-like. Just look at the growth of animated pages, more of which appear on the WWW every day. Some users think that the Web will develop into a media-rich forum that might surpass television in its capacities. For this to happen, Web developers will be concentrating on creating tools that will make sites more interactive and animated. The following sections focus on the types of Web applications and application resources that already are available and on how to incorporate them into an intranet.

Java

Java: A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language.
-from "The Java Language: A White Paper," Sun Microsystems, Inc.

By now, you've most certainly heard about Java. Despite its trendy name, Java is truly a complete programming language-one that you should take seriously if you want to build a functional intranet. What's unique about the Java programming language is that it is both interpreted and compiled. In fact, it's as close to a compiled program as you can get without its being platform-dependent. Java works on any platform, be it Windows NT, Apple Macintosh, or others that have Java interpreters. The Java interpreter is generally part of your browser.

From the programming side, Java is object-oriented, like C++, and is virtually impossible to program using any other methodology (that is, it is procedural). Although it has been termed such, Java is not necessarily "the language for non-programmers." Much debate has ensued about the possibility of individuals without technical backgrounds learning Java's ins and outs. If you aren't enthusiastic about the idea of learning Java, be assured by the fact that Java's developer, Sun Microsystems, is willing to help you and everyone else in the learning process. To see a well-designed and helpful tutorial, visit

http://www.sun.com/sunsoft/Products/Developer-products/java/Workshop/index.html

Among the many things that differentiate Java from other programming languages is that the term "Java" is not an acronym. The original name of Java was "OAK," named after the large tree outside the developer's window. The Java moniker was given to make it a more "hip" and thus more marketable product. And, not surprisingly, the name was picked by the developers during a coffee break. You might be surprised to learn, however, that Java's origins are not rooted in the World Wide Web. The conception of Java came to one of its founders, Bill Joy, in the late 1970s-long before the Internet began to resemble its present self.

Java was supposed to be instrumental in the making of smart appliances, and it is still being touted as such. It also may be the language of choice for set-top boxes. Set-top boxes are often thought of as the next progression of the Web. A piece of hardware (the box) will sit on top of your TV set and will let you access information, movies, and games through your TV over the Internet.

As Java developed as a language, it became increasingly clear that it would be a key resource for developing Web application programs. Java programs produce applets, a cute term for an application that can be embedded within another application. You can include an applet in an HTML document to provide interactive, executable content on a Web page. To learn more about applets, how they work, and how you can include them on your intranet, go to EarthWeb's Gamelan page at http://www.gamelan.com.

Java applets are becoming popular, but they do have limitations. Applets are currently being used to produce high-end, glitzy graphics, sound, animation, and text formatting. Beware of poorly written or functionally useless "crapplets" that eat up bandwidth and take time to download. An applet on a home page, for instance, can flash as soon as mail arrives. You could use Java to write complex software packages such as relational database management systems or word processors. File input and output are generally restricted on applets, which means that a Java applet you view on someone's home page cannot read, write, delete, rename, or create a file on your local system. When you're running a local applet, however, the Web browser may relax many of these restrictions because local applets are deemed more trustworthy than network applets. You can alter browsers to allow intermediate applet security policies. This capability is of great interest if you're on an intranet because you could write an applet viewer that would place fewer restrictions on applets loaded from the intranet than those loaded from the Internet.

JavaScript

Whether or not you decide to learn Java, you'll no doubt deal with it at some point if you want to incorporate online applications into your intranet. But you might find yourself first working with a spin-off of Java called JavaScript. (Listing 22.5 shows a sample JavaScript in action.) JavaScript has a similar structure to Java, but the comparison ends here. Designed to handle events within an HTML screen, JavaScript can manipulate the appearance of the browser. JavaScripts can change the look of frames and windows. For example, you've probably seen those messages that run like LED displays in the bottom scroll bar of your browser. Those messages are examples of what JavaScript can do. Like Java, JavaScripts are also platform independent, but they can act only on objects within the browser window. Think of JavaScript as an HTML enhancement language: it is entirely a scripting language and therefore cannot create objects like the Java language.


Listing 22.5. JavaScript in action.

<!--JavaScript Code--> <SCRIPT LANGUAGE="JavaScript"> function scrollit_r2l(seed) { var c1 = "Wow, this javascript sure is easy!"; var c2 = "And it lets me add lots of functionality to my intranet."; var c4 = "Can anyone learn how to use it?"; var c5 = "Pretty much. Remember to check the on-line tutorial."; var msg=c1+c2+c4+c5; var out = " "; var c = 1; if (seed > 100) { seed--; var cmd="scrollit_r2l(" + seed + ")"; timerTwo=window.setTimeout(cmd,100); } else if (seed <= 100 && seed > 0) { for (c=0 ; c < seed ; c++) { out+=" "; } out+=msg; seed--; var cmd="scrollit_r2l(" + seed + ")"; window.status=out; timerTwo=window.setTimeout(cmd,100); } else if (seed <= 0) { if (-seed < msg.length) { out+=msg.substring(-seed,msg.length); seed--; var cmd="scrollit_r2l(" + seed + ")"; window.status=out; timerTwo=window.setTimeout(cmd,100); } else { window.status=" "; timerTwo=window.setTimeout("scrollit_r2l(100)",75); } } } <!-- End of JavaScript code --> </SCRIPT>

JavaScript is easy to learn even if you are not a programmer, and it functions superbly as a CGI substitute for performing simple calculations traditionally managed by CGIs. JavaScript, as opposed to CGIs, moves the processing from the server to the client. Having 1,000 users request a page with JavaScript on it is a lot less server-intensive than having 1,000 users submit the same CGI. JavaScript can enhance the capabilities of Web forms, for example, by triggering immediate feedback to the user, eliminating the need for a network roundabout. You can return results without having to submit a form back to the server and then wait for a response. JavaScript works well in conjunction with forms because you can use it to check the validity of inputs (for example, make a mask on a telephone number (xxx) xxx-xxxx) before the infor-mation is submitted to the CGI.

Many Web developers claim that JavaScript will replace CGI scripts. Microsoft has responded to the Java craze by developing Visual Basic Script (VBScript), which functions in much the same way as JavaScript. You can anticipate that JavaScript and similar scripting tools will be at the forefront of Web development in the future.

You also can anticipate that Java will be enhanced, supplemented, and sometimes replaced with plug-in modules. If you've ever worked with graphics programs such as Adobe Photoshop or Adobe Illustrator, you're probably familiar with how plug-ins work. Or maybe you already have worked with some browser plug-ins (like Macromedia's Shockwave). Another example of a plug-in is ExCITE's NCompass. The NCompass team created a plug-in that allows OLE controls to work inside Netscape 2.0. This plug-in mimics the functionality of Microsoft's ActiveX.

ActiveX

ActiveX is Microsoft's first attempt to break some ground on the Internet by giving developers the means to create distributed software components based on the Component Object Model (COM). COM can be thought of interchangeably with the term "OLE" (Object Linking and Embedding), because OLE is unified by the inner workings of COM (which handles object creation and local/remote transparency services).

OLE has grown over the last five years and is now a set of interfaces and services for building reusable object-oriented software components.

An intranet developer can embed ActiveX components into an HTML page to be downloaded and run when the page is viewed. A page with an ActiveX object embedded might look like this:

<HTML> <HEAD> <TITLE>Matthew Baird's ActiveX Test Page</TITLE> </HEAD> <BODY> <H1>Matthew Baird's ActiveX Test Page </H1> <OBJECT WIDTH="400" HEIGHT="400" CODEBASE="http://www.wavelength.com/ActiveX/ocx/test.ocx" <EMBED SRC="test.ods" CODE="http://www.wavelength.com/ActiveX/ocx/test.oc Â#Version=4,0,0,0" WIDTH="400" HEIGHT="400"> </OBJECT> </BODY> </HTML>

For further examples, visit the ActiveX gallery at http://www.microsoft.com/activex/gallery/.

Why is ActiveX important to your intranet? ActiveX allows your in-house and/or contract developers to build software components that interface in a common way with other software components. By using the standard OLE interfaces, your development team can create their own specific components that can plug into other teams' components. The development cycle for a large project can be split into small component projects that will integrate seamlessly into the larger project.

As you can well imagine, there are security issues to consider when you download software from the Internet. Microsoft has addressed code security and authenticity via its "code-signing" system. When Internet Explorer hits a page that needs to download component code, the code-signing capability is activated, and Internet Explorer recognizes the authenticity of signed code. Users can give automatic authentication rights to components from recognized sources via a pop-up message box. Obviously, download security is much more of an issue for the Internet, where you don't know who developed the code. However, intranet users will be relieved to know that company-developed code can be digitally signed and automatically installed without any user intervention.

The ActiveX SDK (Software Development Kit) beta 2 is available from Microsoft. It requires Windows 95 or Windows NT 4.0 SUR beta, beta 2 of Internet Explorer 3.0 (http://www.microsoft.com/ie/iedl.htm) or higher, the latest release of the Win32 SDK (dated after May 1996 and available on MSDN Level II), and a compiler (Microsoft Visual C++ 4.1 is the most tested). Actual code listing of ActiveX applications goes beyond the scope of this book, but the SDK includes well-documented sample code developed by Microsoft.

Incorporating applications into your intranet offers you the flexibility needed to run a feature-rich system. Besides the resources discussed in this chapter, other means of transmitting functionality are underway. One example is Netscape's LiveMedia, which transmits real-time audio and other media to the Web. Another quickly developing resource is Virtual Reality Modeling Language (VRML), which promises to be a handy tool for application designers who want to bring more 3-D to the Web. To get a taste of the potential of VRML, visit Worlds Inc.'s AlphaWorld at http://www.worlds.net/alphaworld.

Summary

Data arriving at and leaving your intranet means you need to master the task of manipulating that data. Begin the process by first making sure that you understand your system's programming languages. Familiarizing yourself with the server's shells will soon have you writing your own shell scripts. Remember that compatibility and functionality with the Web are the key components of a fully workable script. Familiarizing yourself with the ways in which the Web transmits (both now and in the future) functionality will help you create a secure, vibrant, and smoothly operational intranet. Don't forget that online resources will help you, too. Not only will you find FAQs and white papers-white papers generally explain the overlying and general technology behind the product, but not enough to clone it-you'll also be able to download tools that will help you achieve your goals.