As explained in the Working with Lucy add-ons guide, the Lucy front-ends read an XML file to determine which add-ons must be loaded.

As such, customizing the used add-ons comes down to altering this XML file. This allows you to:

  • Include a subset of the default Lucy add-ons without any changes to their configuration files, and exclude the unwanted add-ons to keep the application lean and usable.

  • Include some of the default Lucy add-ons but alter the configuration file

  • Include some extensions of the default Lucy add-ons, possibly with a modified configuration file

  • Include your own add-ons

If you want to customize the addons.xml file, it is recommended not to change that XML file directly. If you modified the original XML directly, you would have to re-apply those changes each time you upgrade to a new version.

The recommended way to use a custom XML file is:

  1. Create your own addons.xml file

  2. Let it include the default addons.xml file by using the <include> tag

  3. Use the <exclude> tag to remove unwanted add-ons

  4. Override entries to customize configuration files

  5. Override entries to replace the standard add-on with a custom extension

  6. Add entries for your own add-ons.

Creating a custom addons.xml file

The following example XML file illustrated all possible customizations:

<?xml version="1.0" encoding="UTF-8"?>
<addonConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:noNamespaceSchemaLocation="addons.xsd">
  <addons>

    <!--
      Include all the add-ons of the standard Lucy as-is.

      If you would use the map centric version, you would include
      samples/frontend/mapcentric/map_centric_addons.xml instead.
      -->
    <include>lucy/addons.xml</include>

    <!--
      Use the <exclude/> tag to remove some of the included add-ons.
      For example, the following entry excludes the TLcyLookAndFeelAddOn.
      It copies the class name for the TLcyLookAndFeelAddOn from the original file,
      and adds the <exclude/> tag.
      You can copy the whole entry including priority and name, but the class name
      is sufficient.
      -->
    <addon>
      <class>com.luciad.lucy.addons.lookandfeel.TLcyLookAndFeelAddOn</class>
      <exclude/>
    </addon>

    <!--
      Adjust the config file of one of the default addons by re-adding the entry
      but altering the contents of the <configFile> element.
      For example, the following entry alters the config file of the TLcyDefaultDecodersAddOn
      -->
    <addon>
      <priority>data_producer</priority>
      <name>Default Formats</name>
      <class>com.luciad.lucy.addons.decoders.TLcyDefaultDecodersAddOn</class>
      <configFile>path/to/custom/config/file.cfg</configFile>
    </addon>

    <!--
      Plug in an extension of one of the default addons.
      This will ensure that the default addon is not plugged in, but this one instead.
      There is no need to manually exclude the default addon.

      If needed, you can also modify the config file by altering the contents of
      the <configFile> element.

      For example, the following entry replaces the TLcyDrawingAddOn and plugs in the
      CustomDrawingAddOn instead (assuming CustomDrawingAddOn extends TLcyDrawingAddOn).
      -->
    <addon>
      <priority>data_producer</priority>
      <name>Custom drawing add-on</name>
      <class>com.my.organization.addons.drawing.CustomDrawingAddOn</class>
      <configFile>lucy/drawing/TLcyDrawingAddOn.cfg</configFile>
    </addon>

    <!--
      Add your own ad-ons by adding them to the file
      -->
    <addon>
      <name>My own add-on</name>
      <class>com.my.organization.addons.MyOwnAddOn</class>
      <configFile>path/to/myOwnAddOn/config/file.cfg</configFile>
    </addon>
  </addons>
</addonConfiguration>

See How to customize the configuration file of a standard Lucy add-on for more details about using custom configuration files.

Using your custom addons.xml file

Once you have your custom addons.xml file, you need to tell Lucy to use it:

  • If you run TLcyMain.main or MapCentricFrontendMain.main directly, you need to specify the following program argument:

    -addons path/to/custom_addons.xml
  • If you have your own main method that calls the main method in TLcyMain:

    TLcyMain.main(new String[]{"-addons", "path/to/custom_addons.xml"});

    or the main method in MapCentricFrontendMain:

    MapCentricFrontendMain.main(new String[]{"-addons", "path/to/custom_addons.xml"});
  • If you run the Lucy.bat or Lucy.sh file:

    Lucy.bat -addons path/to/custom_addons.xml

    This also works for LucyMapCentric.bat and LucyMapCentric.sh.