CX Notes

Problems with APIs


Linking Web Services and Component Extensions together

The work needs to be done at 3 levels:

  1. CX Description Format: a platform independent description of the functionality provided by the Component Extension, in order for the Host Implementation to appropriately handle the characteristics of the functionality and the content handled by the Component Extension; such description will be done using XML;
  2. CX "protocol": a platform independent XML-based protocol, to allow communication between the Host Implementation and the Compenent Extension;
  3. a platform independent API, for functionality that should stay platform dependent and therefore undefined, such as a graphics API.

1. CX Description Format

Current situation:

Browser side:

NPN_GetValue(myPlugin, NPPVpluginWindowBool, &returnValue);
NPN_GetValue(myPlugin, NPPVpluginTransparentBool, &returnValue);
char * mime = NP_GetMIMEDescription();

This could be replaced and extended by the CX Description file:

<?xml version='1.0'>
<cx:description xmlns:cx=''>

  <!-- specific information about the CX and its (optional?) location -->
  <cx:location>file://localhost/Program Files/Graphics/MyCX.dll</cx:location>

  <!-- list of supported MIME types -->


  <!-- list of file extensions -->


  <cx:shortDescription>Scalable Vector Graphics<cx:shortDescription>
   SVG blabla, ... See also

  <!-- list of supported namespaces -->


  <!-- list of supported features -->

  <cx:feature uri='' />
  <cx:feature uri='' />
  <cx:feature uri='' />

  <!-- list of properties and their values -->

  <!-- the CX is not windowless -->
  <cx:property uri='http:/'>
  <!-- the CX does want transparency -->
  <cx:property uri='http:/'>

The browser can then read the CXDL instead of having to call functions. The CXDL file can be extended as necessary to include more informations.

2. CX operations

Invoking the find and Replace function of the browser from the plug-in:

myBrowserExtensionFind("plug-in", "component extension");

This could be changed into the following description file:

<?xml version='1.0'?>
<definitions xmlns='http:/'>
    <xsd:element name='messageIn'>
      <xsd:element name='find' type='xsd:string'/>
      <xsd:element name='replace' type='xsd:string'/>
    <xsd:element name='messageOut'>
      <xsd:element name='occurence' type='xsd:nonNegativeInteger'/>
    <interface name='Browser'>
      <operation name='findAndReplace'>
	<input element='messageIn'/>
	<output element='messageOut'/>
      <soap:protocol transport='' />
      <soap:address location='windowsSocket:5005'/>

The code can now be generated according to the WSDL description. Thus, myBrowserExtensionFind becomes a function call on the CX side that is transformed into a WS call in order to dialog with the HI. The goal would be to define the set of operations to promote interoperability between HIs, including the type of parameters, return values, and the extensibility constraints. Technics such as required could be used to facilitate the extensibility constraints. needs to be defined. Advantages are:

  1. language independent: The WSDL processor can generate whatever "language of the Day", etc.;
  2. extensible: the findAndReplace messages can be extended.
  3. versioning: findAndReplace cannot conflict with pre-existing definitions. Vendors can define their own findAndReplace message if they wish (as long as they put it in their own namespace.

WSDL definitions MUST be available on both sides, so that HI and CX can invoke each other functionalities.

3. Low level API

Functions like NPN_MemAlloc, NPN_MemFree, or other graphic low-level functions shouldn't be addressed or should be language specific (DOM-like).

Philippe Le Hégaret
Last modified: Tue Feb 3 12:11:12 EST 2004