by Azam A. Mirza
As part of its strategy to deliver components that enable Microsoft BackOffice as the backbone of Internet technologies, Microsoft has added a high-level component to Internet Information Server (IIS) that delivers cross-platform support, open standards, and a tightly integrated set of tools for delivering dynamic Web content to users.
The Active Platform is an open architecture based on industry standards for creating Web sites and Web-enabled applications for the Internet and intranets. Active Platform provides a means for Web developers to create Web content that can be used across hardware platforms and operating systems.
NOTE: Microsoft's Web site, www.microsoft.com, contains extensive information about Active Platform and other Internet technologies. It is a good idea to periodically visit the site for the latest information about Microsoft tools and products.
The Active Platform leverages such technologies as HTML, scripting mechanisms (such as CGI and Perl), Microsoft Component Object Model (COM), Java support, and the underlying operating system services to deliver dynamic, interactive, and customizable content to client desktops on the Internet and intranets.
NOTE: Java is an Internet object-oriented development language, loosely based on C++, that was developed by Sun Microsystems, Inc.
NOTE: Component Object Model (COM) is the core Microsoft technology for building re-usable, object-oriented components for use in developing applications and server objects. COM is the underlying methodology that controls all Microsoft strategic initiatives.
By providing a high-level platform that sits on top of Internet Information Server (IIS) and the operating system, Microsoft has created a platform that frees the Web developer from worrying about underlying details and operating system idiosyncrasies. Developers can build Web sites that conform to the Active Platform specs and not worry about the hardware platform and operating system that the site will run on. (See Chapter 16, "The BackOffice I-Net Toolbox," for more information.)
Active Platform not only brings uniformity to the server side for Web-enabled applications, it also encompasses the client side with the same open architecture to deliver a cohesive means of displaying content residing on Active Platform servers.
There are three main parts to the Active Platform that make it possible to create, deploy, and use powerful Web-enabled applications for the Internet and intranets. These include the following:
Figure 23.1 shows the relationship between the various Active Platform components. The following sections describe these technologies in more detail.
Active Platform technologies form the basis of the Microsoft Internet initiative.
ActiveX technologies refers to the tools and standards that work as the glue to bring dynamic, interactive content to your Web site. ActiveX technologies are a set of software standards, components, and tools that work on different operating systems and heterogeneous networks to enable the Active Platform. The following are some of the technologies included in the ActiveX standard:
NOTE: For more information about Dynamic HTML, refer to the Microsoft Web site at www.microsoft.com.
NOTE: ActiveX supports two very powerful scripting mechanisms through its ActiveX scripting engine: VBScript and JScript. With these two scripting mechanisms, no special procedure is required to process the code.
NOTE: Internet Information Server 3.0 supports compilation-free execution of server-side scripts.
NOTE: Microsoft Visual Basic 5.0, Control Creation Edition is the first commercial tool available for creating ActiveX controls for incorporation into Web sites.
NOTE: Active Server Pages, discussed later in this chapter, include the Java Virtual Machine for running Java applets and JScript.
NOTE: Visual InterDev is the Web-development tool that providse a single development environment for all Microsoft development toolsñsuch as Visual C++, Visual J++, and Visual Basicñfor creating ActiveX-enabled applications.
TIP: Microsoft Visual Basic 5.0, Control Creation Edition can be used to create data-aware ADO controls.
These ActiveX technologies and tools encompass the entire Active Platform on both the client side and the server side. Some are implemented as stand-alone tools for enhancing the Active Platform environment, while others implement specific functions on the client side and the server side.
The Active Desktop is the client component of the Active Platform environment. The Active Desktop enables the creation of applications that run on the client systems under a multitude of operating systems and hardware platforms.
The Active Desktop provides developers with a means of writing applications to a common interface to ensure the capability to run on multiple operating systems and hardware platforms. Active Desktop includes support for language-independent scripting, dynamic HTML, system services, and ActiveX component technology. The Active Desktop provides the following advantages over proprietary solutions:
The Active Desktop is fully integrated with the Microsoft Windows 95 and Windows NT operating systems. It provides full support and access to the extensive set of APIs available for the Windows operating system environment.
The main delivery mechanism for the Active Desktop is Microsoft Internet Explorer Web browser. Figure 23.2 presents an example of a Web site using ActiveX components and being accessed through the Microsoft Internet Explorer Active Desktop.
The Microsoft Network Web site provides a highly ActiveX-enabled Web experience.
ActiveX controls used as part of the Active Desktop environment provide a powerful way of adding functionality to your Web site.
Internet Information Server 3.0 includes components for enabling your Web site for Active Platform. The component that provides server-side ActiveX functionality is called the Active Server Pages (ASP).
NOTE: Active Server Pages denotes the product that has previously been referred to as the ActiveX Server and code named Denali.
The Active Server Pages is a high-level component that takes advantage of the scaleable, high-performance capabilities of Windows NT Server to provide developers with a rich environment for creating server-side Web applications. Active Server Pages includes full support for Windows NT Server system services, database access, transaction processing, and message queuing.
The following sections provide information about installing Active Server Pages, and using and creating Active Server Pages components and applications.
Active Server Pages are provided as an add-on component to Internet Information Server. To install Active Server Pages, you must have the following software components already in place:
NOTE: Active Server Pages can be downloaded from the Microsoft WWW site at www.microsoft.com.
To install Active Server Pages, perform the following steps:
FIG. 23.7
A summary of installation results is displayed for your review.
TIP: As part of the installation process, additional entries are added to the Microsoft Internet Server program group. The Active Server Pages RoadMap entry is particularly useful. It provides a set of HTML documents that includes samples for Active Server implementation and online documentation.
Once Active Server Pages is installed, you are ready to develop content for your Web site that can take advantage of the Active Server Pages functionality. The following sections describe how you can use ActiveX technology to bring a new level of sophistication and performance to your Web site.
Active Platform and Active Server Pages in particular provide the means for creating truly interactive and multimedia content for your Web site that take advantage of the latest technology in Internet and intranet development. With ActiveX-enabled content, you can create Web sites that provide a truly information-intensive experience for the users. This section discusses some of the tools and techniques you can use to bring the next level of sophistication to your Web presence.
There are several methods Web developers can use to create ActiveX content for their Web sites. ActiveX content created for Active Server Pages can also be referred to as server-side ActiveX applications.
Server-side applications do all processing on the server and free the client system from handling information that it might not be familiar with. All HTML pages displayed on the client browsers are created by the server and sent to the client for display to the user. However, server-side applications do place a high premium on the performance capabilities of the server. A site with a lot of server-side applications can slow down tremendously during high traffic times if the server is not powerful enough to handle it. The following are some of the methods and tools provided for handling server-side ActiveX development:
Microsoft Active Server Pages provides a mechanism for handling scripting functions on Internet Information Server. Through the use of ActiveX scripting, Web developers can create dynamic, interactive Web-based applications that take advantage of the high-performance capabilities of the server machine. Figure 23.8 presents a model of the Active Server Pages scripting mechanisms.
Active Server Pages can host a variety of scripting engines for processing scripting languages.
With server-side ActiveX scripting, developers can write applications that generate dynamic HTML pages based on the requirements and then make the pages available to the client browsers as needed. The client browsers need not support scripting and ActiveX technology. Because the HTML pages are created by the server, they can easily be displayed by any client browser.
Active Server Pages scripts are ASCII text files that are similar to HTML files, but include special directives to identify the scripting commands. An Active Server Pages script file has an extension of .ASP, which identifies it to the server as a script file rather than a simple HTML file.
NOTE: Active Server Pages scripts can contain any combination of text, HTML tags, and script commands.
TIP: You can convert any HTML file to an Active Server Pages script file by renaming it with an .ASP extension. The Active Server Pages will then treat the file as a script file rather than a simple HTML file.
However, to really use the power, functionality, and flexibility of Active Server Scripts, you must extend your HTML file with scripting commands. The default scripting language used by Active Server Pages is the Microsoft Visual Basic Scripting Edition, also referred to as VBScript. However, scripts can be written in any language, such as Perl, REXX, and JScript.
Active Server Pages includes a scripting engine for VBScript that enables it to handle VBScript commands. Because a scripting engine is a Component Object Model (COM) object, other scripting engines can be written that enable Active Server Pages to handle scripts in a particular scripting language.
Since Active Server Pages is just a host for the scripting engine object, multiple scripting engines can be installed on a single server for handling scripts written in various languages. With Active Server Pages, developers can easily switch between different scripting languages within the same script file using special tags. The sample script in Listing 23.1 shows how you can switch between VBScript and JScript code.
<HTML> <SCRIPT LANGUAGE=JScript RUNAT=Server> <JScript code here> <SCRIPT LANGUAGE=VBScript RUNAT=Server> <VBScript code here> </HTML>
As noted, scripting engines extend the functionality of HTML pages by adding additional tags and scripting commands that can be interpreted by the Active Server Pages scripting engine.
NOTE: For a complete scripting language syntax reference, refer to the VBScript or JScript language reference included with the Active Server Pages documentation.
Active Server Pages includes support for COM objects that enable developers to extend its functionality. The VBScript scripting engine previously mentioned is actually a COM object that is hosted by the Active Server Pages. In addition, Active Server Pages provides functionality for some common objects to carry out certain common tasks. These include the following:
Each of these objects provides certain common functionality through a set of events, methods, and properties that is available to all scripts and ActiveX components running in the Active Server Pages object space. To use objects, you must first create an instance of that object through object instantiation. However, since the previously listed objects are a part of Active Server Pages, they do not require object instantiation and are available for use at all times. These objects are discussed in more detail in the following sections.
NOTE: The following sections provide a description of the objects, properties, and methods available to utilize Active Server Pages functionality. For specific programming examples on how to use these objects, please refer to the online product documentation and tutorials.
The Application Object
The Application object is used to share information among all users of a particular ActiveX script application or ActiveX component application. It provides support for the following methods:
NOTE: An Active Server Pages script application refers to all .ASP scripts stored in a particular virtual directory.
NOTE: For specific examples on how to utilize the Application object, refer to the Application object online reference.
The Request Object
The Request object retrieves user responses through client browsers for processing by the Active Server Pages. Some of the tasks that can be performed through the Request object include getting information about the client browser type, getting information submitted through HTML forms, getting information stored in server variables or passed through cookies. The Request object provides the following collections:
NOTE: A cookie is an identification token passed from the client to the server that identifies the path to a particular Web resource, such as an URL, a login name, a property value, and so on.
NOTE: For specific examples on how to use the Request object, refer to the Request object online reference.
The Response Object
A Response object is primarily used to send information back to the client. Typical uses of the response command include sending text and other stream output back to the client or redirecting clients to another URL document on the Web. Response object also supports a buffering mechanism for storing information until processing is complete before a response is sent back to the user. The Response object includes support for the following collections, properties, and methods:
NOTE: For specific examples on how to use the Response object, refer to the Response object online reference.
The Server Object
The Server object provides access to methods and properties of the Web server. The methods and properties include the following:
NOTE: For specific examples on how to use the Server object, refer to the Server object online reference.
The Session Object
A Session object is used to store information about a particular client session. Session objects are valid for an entire client session. Any time a client requests an HTML page from the Active Server Pages, a Session object is automatically created and is discarded when the client session is terminated. Session objects include support for the following methods and properties:
NOTE: For specific examples on how to use the Session object, refer to the Session object online documentation.
Also included with the Active Server Pages is a set of ActiveX components for performing certain frequently accessed operations. Active Server Pages components are actually automation servers and are designed to run on your Web server as part of a Web application. These are server-side componentsñnot user-interface componentsñthat run as a process to extend the functionality of your Web server scripts.
Server components are typically invoked from .ASP script files. However, Active Server Pages components can be invoked from a variety of sources, including ISAPI applications, CGI scripts, executable files, or other Active Server Pages components. Some of the components prepackaged with the Active Server Pages include the following:
These five components perform certain very specific tasks as part of a Web server environment. They are discussed in more detail in the following sections.
NOTE: The following sections provide a description of the components provided by Microsoft as part of Active Server Pages. For specific programming examples on how to use these components, please refer to the online product documentation and tutorials.
Advertisement Rotator Component
The Advertisement Rotator component makes it easy to display advertisements for sponsors and partner Web sites. With an Advertisement Rotator component, you can display advertisements for other companies and provide links to their Web sites.
The Advertisement Rotator component automatically rotates advertisements displayed on a page based on a predetermined schedule. Each time a client accesses a page, a new advertisement is displayed as part of the page.
NOTE: The information about when to display a new advertisement and which advertisement to display is stored in a special file called the Rotator Schedule File.
The Advertisement Rotator component also records the number of times users see a company's advertisement and also records the number of times users click a particular advertisement to jump to an advertiser's Web site. Each jump to an advertiser's Web site is recorded in the Internet Information Server activity logs.
Browser Capabilities Component
The Browser Capabilities component provides the Active Server Pages with information about the capabilities of the client browser. When a browser first makes a connection with a Web server, it sends a user agent HTTP header to the server. The header contains a string that identifies the browser and its version number.
This information is compared to the information stored in a file called the BROWSCAP.INI file. If the header information matches the information in the file, the rest of the information is retrieved from the file. However, if the header information does not match any of the entries in the BROWSCAP.INI file, the default browser properties are used instead.
TIP: The BROWSCAP.INI file includes browser information for the most common browsers. Information about other browsers can be added to the file by editing its contents and adding those entries.
Data Access Object Component
The Data Access Object component uses the ActiveX Data Objects (ADO) to provide access to data stored in a relational database. ADO uses the ODBC mechanism to access the database. The ADO interface is similar to the Database Access Objects (DAO) used by such tools as Visual C++ and Visual Basic. It offers ease of use, high speed, and low memory overhead as benefits.
The main advantage of ADO over DAO is the capability to create data access objects independently. You do not need to go through an object hierarchy to gain access to resources. Each object can be created individually and used by the application. This results in significantly fewer programming steps, lower memory requirements, and higher performance. ADO provides the following enhancements over DAO for building Web-enabled, data-aware applications:
NOTE: For examples of using the Data Access Object component and the ActiveX Data Objects, refer to the samples included with Active Server Pages.
Content Linking Component
The Content Linking component manages a list of URLs so that you can refer to the pages through bookmarks. The Content Linking component can be used to create a table of contents for your Web pages, and previous and next navigational links to Web pages.
The Content Linking component is most useful when you are building Web pages that require navigation through a group of related information pages. For example, discussion forum messages can be threaded using the Content Linking component.
NOTE: For more information on using the Content Linking component, refer to the online component reference documentation.
TextStream Component
The TextStream component is used to provide input and output capabilities for your Web server applications. Applications can read and write to text files stored on the server. The TextStream component uses the VBScript FileSystem object to achieve its functionality. The FileSystem object provides access to the server computer's file system.
NOTE: For more information about the FileSystem object, refer to the online VBScript language reference.
This chapter presents the features available in Microsoft Active Platform initiative and specifically the server-side components included as part of the Microsoft BackOffice suite. For more information on these and related subjects, see the following chapters:
© Copyright, Macmillan Computer Publishing. All rights reserved.