Difference: DpHipePluginsDeveloperManual (9 vs. 10)

Revision 102011-01-13 - PaulBalm

Line: 1 to 1
 
META TOPICPARENT name="DpHipePlugins"

Plug-in Developer Manual

Line: 153 to 153
 
<-- Compatible with all 6.x releases (all builds from the 6.0 track) -->
6.0.*
Added:
>
>
https://www.mysite.com/registry.xml
 
Line: 164 to 166
  The properties elements specifies a properties file in the plug-in, containing properties that are loaded when the plug-in is started. The plug-in is started at HIPE start-up, unless it is disabled from the GUI. If the custom properties file contains properties that are already defined in the system, they are ignored and a warning is printed.
Added:
>
>
The compatibility information, minVersion, maxVersion, and also the updateURL will be explained later.
 

Adding a license

It is possible to add a license text to a plug-in. All you have to do is add a file called LICENSE.txt to the root-level of the plug-in. This license will be displayed on the License tab of the Plug-in details panel.

Line: 279 to 283
  The newInstance method uses the default constructor. If you need to use a different constructor, use the Class object.
Added:
>
>

Automatic Updates

The plug-in author has two ways to provide the users with updates: It is possible to update the compatibility of plug-ins that users have installed, and it is possible to offer users new versions of plug-ins.

If a plug-in was released before HIPE v6 was released, its plugin.xml should state that it is compatible up to and including HIPE "5.0.*". When the first version (release candidate?) of HIPE v6 comes out, the author should check if the existing version of the plug-in is still compatible with HIPE v6. Normally, this will be the case. If so, the author will want to update the compatibility information in the plug-in on the user's disk, to include compatibility with HIPE v6.

The point of offering new versions of plug-ins is self-evident.

The mechanism to provide this information relies on the plug-in registry, which is an XML file on a web-server. This XML file should contain entries for the available versions of the plug-in, plus the compatibility information of each version. Such a registry file could look as follows:

<?xml version="1.0" encoding="UTF-8"?>

<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:em="http://www.mozilla.org/2004/em-rdf#">

  <!-- This Description includes all the update and compatibility information for a
       single plug-in called "example1". You can list information for multiple plug-ins in
       the same file. -->
  <RDF:Description about="example1">
    <em:updates>
      <RDF:Seq>

        <!-- Each "li" entry is a different version of the same plug-in -->
        <RDF:li>
          <RDF:Description>
            <em:version>2.2</em:version> <!-- This is the version number of the plug-in -->

            <em:minVersion>5.0.1760</em:minVersion>
            <em:maxVersion>6.0.*</em:maxVersion>

           <!-- This is where this version of the plug-in will be downloaded from -->
           <em:updateLink>https://www.mysite.com/example1_2.2.jar</em:updateLink>

          </RDF:Description>
        </RDF:li>

        <RDF:li>
          <RDF:Description>
            <em:version>2.3</em:version>

            <em:minVersion>6.0.1883</em:minVersion>
            <em:maxVersion>6.0.*</em:maxVersion>

           <!-- This is where this version of the plug-in will be downloaded from -->
           <em:updateLink>https://www.mysite.com/example1_2.2.jar</em:updateLink>

          </RDF:Description>
        </RDF:li>

      </RDF:Seq>
    </em:updates>

  </RDF:Description>
</RDF:RDF>

The above example registry file lists two versions of a plug-in called "example1": Version 2.2 and 2.3. Version 2.2 is stated to be compatible with HIPE v5.0 (the user release, not earlier builds) and also all builds of the 6.0 track. Version 2.3 is compatible version HIPE release 6.0 starting RC1 and all succeeding builds.

Should HIPE v7 be released and version 2.3 of the plug-in turns out to be compatible, then the author should update the "maxVersion" of version 2.3 to "7.0.*". HIPE instances that have the plug-in "example1" installed will check the registry file at start-up and update the information if necessary.

If version 2.4 of the plug-in is released, it can also simply be added to the registry. HIPE instances having the plug-in installed will suggest the update to the user, if the version of HIPE is compatible.

The only pending question is how HIPE instances that have the plug-in "example1" installed find the registry. The answer is: Via an "updateLink" reference in the plugin.xml.

 

Examples

For examples, see DpHipePlugins. Any of the plug-ins can be downloaded and inspected using the jar tool or any other zip program. Among examples offered are:

 
This site is powered by the TWiki collaboration platform Powered by Perl