General Interface is an open source project hosted by the Dojo Foundation

Deploying the Custom Add-in

In this step you'll make the project available as an add-in:

  • Copy the project to the Addins folder.
  • Modify the add-in configuration file, which includes such data as add-in name space, file locations, and so on. Add-in Configuration File Definitions describes the values in the configuration file.
  • Enable your add-in for testing and test the add-in.
  • Make your add-in available for general use.

To make the add-in available:

  1. Close General Interface Builder and the myAddin project.
  2. In the file system, copy the myAddin project from workspace/JSXAPPS/myAddin to the addins directory in your workspace directory. For example, workspace/addins/myAddin.

To modify the configuration file:

  1. Open the add-in configuration file workspace/addins/myAddin/config.xml* in an editor.
    The add-in configuration file is different from the project configuration file. Modify the configuration file only in the copy of the add-in within the addins directory, not the original project.
  2. Select and delete the existing text.
  3. Copy and paste this code into config.xml:
    <?xml version="1.0" ?>
    <data jsxid="jsxroot">
      <record jsxid="id" type="string">my.example</record>
      <record jsxid="name" type="string">My Example Addin</record>
      <record jsxid="description" type="string">ExampleAddin v1.0</record>
      <record jsxid="long_description" type="string">This is an addin that
        integrates with the IDE by extending the properties editor palette</record>
      <record jsxid="addin" type="string">my.example.ADDIN</record>
      <record jsxid="version" type="string">1.0</record>
      <record jsxid="jsxversion" type="string">3.4</record>
      <record jsxid="classpath" type="string">js/:my.example.*</record>
    
      <record jsxid="includes" type="array">
        <record jsxid="0" type="map">
          <record jsxid="load" type="number">1</record>
          <record jsxid="type" type="string">script</record>
          <record jsxid="src" type="string">js/my/package.js</record>
        </record>
      </record>
    </data>
  4. Save and close the file.

These are the values in the add-in configuration file.

jsxid Value Description
"id" Add-in namespace
"name" Displays in the Name column on the Add-ins panel of the Project Settings dialog (Project > Project Settings)
"description" Displays in the Description column on the Add-ins panel of the Project Settings dialog (Project > Project Settings)
"long_description" Displays in a tooltip when hovering over the add-in on the Add-ins panel of the Project Settings dialog (Project > Project Settings)
"addin" Add-in ID in the form of packagename.ADDIN
"classpath" Path to the add-in classes
"load" If set to 1, the JavaScript file specified in jsxid="src" is automatically loaded at runtime
"type" Type of file to load, such as script for a JavaScript file
"src" JavaScript file that initializes the add-in and registers the catalog file with General Interface Builder

To enable myAddin for testing:

  1. Create a new project (Project > New Project) for testing myAddin.
  2. Enable the myAddin add-in for the test project:
    1. Choose Project > Project Settings > Add-ins.
    2. Click the On checkbox next to My Example Addin to enable it.
    3. Click the Save button.
    4. Click OK at the Restart prompt to restart General Interface Builder.

To test myAddin:

  1. Expand the Addins > My Example Addin folders in the Component Libraries palette.
  2. Drag and drop the new Container prototype from the Component Libraries palette into the Live Component view of the work area.
  3. Drop a component other than Widget onto Container. The action is vetoed and this message appears in the System Log palette: The child object could not be accepted, because it is not of type container or widget.
  4. Drag and drop the new Widget prototype from the Component Libraries palette onto the Container in the work area. The Container accepts the Widget.
  5. Delete Container and Widget.
  6. Try adding a Widget to a different type of container, such as Dialog or Layout. The action is vetoed and this message appears in the System Log palette: Widgets can only be added to containers. You must first add a container before adding a widget.
  7. Select each of the Container and Widget components in the work area and confirm that the properties in the Properties Editor palette display correctly.

To make myAddin available for general use:

  1. Deploy the applications that use the add-in to a web server as described in the "Posting Application Files" section in the General Interface Developer Guide.
  2. Copy the myAddin folder to the addins folder on the same web server as the deployed application. The addins folder must be at the same level as the JSXAPPS folder to be available at runtime.
  3. Test the deployed projects that use the myAddin add-in to be sure everything is working as expected.

This completes the tutorial. For an example of a full-featured add-in, see the General Interface Charting add-in located in GI_HOME/JSX/addins/charting.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.