Extending techexplorer via Add-ins

The techexplorer add-in architecture


The feature described is only available in the Professional Edition of techexplorer.

An add-in is a C or C++ software module that can be added to techexplorer to extend techexplorer's ability to process and display various types of data. Users can install add-ins without the need to modify or update techexplorer. Each add-in maintains, processes and/or displays instances of add-in specific data embedded in techexplorer documents. Furthermore, Java applets can use techexplorer as a bridge for harnessing add-in functionality.

From the perspective of a developer, an add-in is an object that supports a specific MIME type and allows the object to interact with techexplorer, HTML elements and Java/JavaScript. In what follows we provide an overview of how techexplorer locates add-ins and then describe the life cycle of an add-in module. We then introduce the techexplorer Evaluation add-in API and describe the \evalLink control sequence for invoking add-in functionality from techexplorer documents.

Installing add-ins

On Microsoft Windows 98/95/NT, the techexplorer add-in modules can reside in the IBM techexplorer Hypermedia Browser\Addin subdirectory of the techexplorer documentation directory or in the techexplorer\bin subdirectory of the web browser Plugins folder. For some installations, the full path of the techexplorer add-in repository might be

C:\Program Files\IBM techexplorer Hypermedia Browser\Addin
C:\Program Files\Netscape\Communicator\Program\Plugins\techexplorer\bin

When techexplorer is loaded, it searches the add-ins repository for all files whose name begins with TA and ends with .dll. techexplorer then retrieves the MIME types each add-in handles and other descriptive information. If multiple add-ins handle the same MIME type, the last add-in examined handles the MIME type.

The life cycle of a techexplorer add-in

Unlike stand-alone applications, the life cycle of a techexplorer add-in is dictated by techexplorer, just as Netscape plug-ins are under the control of the web browser. The life cycle of an add-in is

  1. A user activates add-in specific data embedded in a techexplorer page or a Java applet requests that an add-in handle a particular piece of data.
  2. techexplorer identifies an appropriate add-in to process and/or display the data.
  3. techexplorer loads the add-in if needed (initialization).
  4. techexplorer creates a new instance of the data and passes the instance data to the add-in (instance creation).
  5. The add-in processes and/or displays the data.
  6. When the user leaves the page or a Java applet no longer requires the add-in, techexplorer notifies the add-in and destroys the instance (instance destruction).
  7. If there are no other active instances, techexplorer unloads the add-in (shutdown).

The Evaluation add-in API

The add-in API requires an add-in to include methods for the basic processes of initialization/shutdown and instance creation/destruction. In the context of processing or displaying data, an add-in may provide methods for the techexplorer Evaluation API. The Evaluation API is used for transmitting application-specific data from a techexplorer document or Java applet to an add-in.

This version of the techexplorer Java API does not manage multiple instances of add-in data originating from Java applets. Java applets can only initialize, shutdown and request that data be processed by a particular add-in. The add-in will not be able to identify which applet generated the request. See the section detailing the bridge between Java and techexplorer add-ins for more information.

Using techexplorer Evaluation add-ins

Use the \evalLink control sequence for transporting an object from a techexplorer document into another application via the Evaluation add-in API.

\evalLink{description}{mimeType}{applicationInput}{textToDisplay}

For example, we can use the following control sequence to invoke the Simple add-in example shipped with the professional edition of techexplorer. The Simple add-in can display in a pop-up window either embedded text or the contents of a URL.

\evalLink{Simple add-in: fetch URL}{application/x-simple-url}{http://www.ibm.com/index.html}{here}

Examples

Here is an embedded techexplorer instance that uses the Simple add-in to fetch and display the HTML source of the main IBM web site. Try it!

<P>IBM techexplorer Hypermedia Browser not installed! Please visit the <A HREF="http://www.software.ibm.com/techexplorer/">techexplorer home page</A> for more information.

Problems?

If nothing happened you are either not connected to the Internet or are still waiting for the document to be retrieved. The Simple add-in will display the HTML source for http://www.ibm.com/index.html once it has received the data. Be patient!

As another example, enter text in the HTML input area below to view your text string displayed by the Simple add-in. <P>IBM techexplorer Hypermedia Browser not installed! Please visit the <A HREF="http://www.software.ibm.com/techexplorer/">techexplorer home page</A> for more information.&nbsp;

Enter an input string:

For each of the preceding examples, the mimeType is used to both identify a particular add-in and its functionality. In the case of the embedded techexplorer instance, the mimeType is application/x-simple-url. This tells the simple add-in that the applicationInput parameter is a URL. In the case of the JavaScript enabled HTML form, the mimeType is specified as application/x-simple-string indicating that the applicationInput is to be displayed as raw text.

You can use the DocumentExplorer add-in to examine the techexplorer document structure. Just include the following control sequence in your document:

\evalLink{IBM techexplorer Document Explorer Add-In}{application/x-document-explorer-string} {}{Press here for a DocumentExplorer test}

Here is an embedded techexplorer instance that uses the DocumentExplorer add-in to display the document structure. Try it!

<P>IBM techexplorer Hypermedia Browser not installed! Please visit the <A HREF="http://www.software.ibm.com/techexplorer/">techexplorer home page</A> for more information.




Click here to to view the previous section. Click here to to view the next section.

IBM techexplorer Hypermedia Browser is a trademark of the IBM Corporation. Send comments and questions to techexpl@us.ibm.com.