Download the source code for this article
here
The HSP & EzStor Framework for writing "Browser Apps"
There are situations where it is very desirable to be able to ship an entire website, including ASP pages, to people for viewing in the Internet Explorer (IE) webbrowser offline without any webserver involved. Besides offline website viewing, there are other types of presentations that are ideally viewed in the IE browser. Think of product catalogs, company profiles, travel brochures, etc. These can be made to be interactive with the use of ASP pages, and can seamlessly link to pages on the Internet. We call these "Browser Apps" - self-contained ASP/HTML programs that run entirely in the Internet Explorer webbrowser.
HSP
HTML Scripting Pages, or HSP, is a plug-in DLL for IE. It is what is known as an "asynchronous pluggable protocol". IE uses pluggable protocols to retrieve its content. By default, IE uses the HTTP pluggable protocol to retrieve web content. HSP not only reads local content files, but also runs ASP files. It does this using the Microsoft Active Scripting technology. HSP runs either VBScript or JScript in ASP files. HSP is essentially an ASP webserver in a DLL.
You specify a pluggable protocol in the first part of the URL. For example, here is a HTTP URL:
http://www.microsoft.com
If we have an ASP page stored in a local folder named foo, you could run and display it in IE by typing this URL in the address bar:
x-hsp://c:/foo/mypage.asp
You can specify any local file that can be displayed by IE, such as HTML, Flash, ActiveX or Microsoft Office documents.
EzStor Content files
Any HTML presentation will consist of many ASP/HTML/graphic files. It is impractical to ship all of these files individually. That's why we created a way to pack all content files into a single file, much like a WinZip file. HSP knows how to read EzStor files, so you only need to ship two files to be able to view a website, or web application - the HSP DLL and your EzStor content file (also called HSP files). With the built-in security features of EzStor, you can actually prevent an HSP application from being run without a password or a machine license. Additionally, your source code can be securely encrypted in the EzStor file so it is safe from being pirated (this is a great feature for Flash content protection).
To load a page stored in an EzStor (HSP) file, you specify both the HSP filename and the internal filename. For example, if your HSP file is named sample.hsp and the internal page is cust_table.asp, here is what the URL would look like:
x-hsp://c:/myfolder/sample.hsp/cust_table.asp
As you can see, HSP URLs follow the same syntax as HTTP URLs. You just append the path to the internal file to the path to the HSP file. Here's a screenshot of the real thing in the IE address bar:
One of the cool things about using HSP files is that relative hyperlinks are preserved. As web programmers know, this is very important and prevents having to code complete URL paths in every hyperlink. It also allows you to easily create a directory structure to logically group your files. For example, to keep all graphic files separately in a "graphics" folder, as shown below.
You would reference a graphic file using a relative path in an IMG tag just as you would for a regular website. For example, cust_table.asp would reference search.gif like this:
<img src="graphics/search.gif">
© Copyright 2003 EzTools Software