Previous Topic

Next Topic

Locate topic in Contents

Building New Plug-In

A ready to use plug-in is an RPM package. In this section we describe the final step of a new plug-in development - building a plug-in RPM.

After you have prepared modules and all the necessary files for a new plug-in, it is necessary to place these files into a special directory. The correct subdirectories structure and naming is important for successful plug-in build. Please, carefully follow the directories structure and general naming conventions described below. As an example, we'll take a Dummy Online Payment plug-in directories structure. The Dummy Online Payment plug-in sample is in the SDK directory samples/plugins/hspc-plugin-pp-op-dummy/ so you can copy it and rename folders and files in a way you need. In addition, you will need to edit some files. We describe this procedure step-by-step. Let us assume that a new plug-in name is myplugin.

  1. First of all, to build a plug-in, you need a version file. This text file contains a few strings that specify the Parallels Business Automation - Standard version a plug-in is built for. A version number is used in an output RPM package name. Thus, for a plug-in compatibility, a plug-in version does not matter, but the build script requires it. The Parallels Business Automation - Standard version must be specified in a special format. To know out the version of Parallels Business Automation - Standard you use, log in to Provider Control Center and click Support on the left menu. The Build ID will be shown in the right frame in the format Build ID <version>-<release>. In the version file, specify the version in the following way:

    File contents, the example

    Description

    HSPC_VERSION=3.3.1

    Specify the Parallels Business Automation - Standard version shown at the Support screen before hyphen.

    HSPC_RELEASE=00.114

    Specify the Parallels Business Automation - Standard release shown at the Support screen after hyphen.

    HSPC_TAGNAME="3.3 Service Pack 1"

    This is a required parameter for the build script, but its value does not matter. Type some phrase in quotation marks. For example, 3.3 With New Plug-In, or My Package, or anything else. Do not leave it empty.

    Important: The version file must be placed into a folder above a plug-in directory. For example:

    D:/

    plug-in build/version

    hspc-plugin-pp-op-myplugin/

  2. A plug-in directories structure should be the following:

    Plug-In Directory Structure

    We've took the Dummy Online Payment plug-in structure as an example and renamed the plug-in directory.

    The i18n directory includes the plug-in localization strings in XML files. In our example, i18n contains directories for languages officially supported in Parallels Business Automation - Standard. You can create as many custom language packs as you need. Remove the directories you do not need and add the ones you need. But in any case, there must be at least one directory for the language you use in Parallels Business Automation - Standard as a default one. Directories under i18n must be named exactly as ISO 2-letter country codes.

    The lib directory contains the plug-in middle tier and presentation modules.

    The template directory contains HTML help topics for the plug-in. Place help topics by language directories, like in i18n.

    The upgrade directory is used to build upgrades, if you need to upgrade a plug-in, create a directory named by an upgrade version and place the upgrade scripts here and run the build script. If you just build a plug-in with no upgrades, leave the upgrade directory empty. But do not remove the upgrade directory thinking that it is redundant - it is required by the build script.

  3. Now, an important step. You need to edit some files in the plug-in directory and specify an actual plug-in name in all files where it is needed. Please, be very attentive:
    1. Edit the spec file. All plug-in name entries must be replaced with your plug-in name, in our example, myplugin.
    2. Check and edit in the same way ALL the Makefile files in ALL subdirectories under the plug-in directory.
  4. Download the rpmbuild utility compatible with OS you use and install it at your computer.
  5. Run the build.sh script from the directory it is located.

Please send us your feedback on this help page