Adams Basic Package > Adams View > Adams View > Customizing Adams View > Authoring Plugins > Section 2: The search path algorithm for plugin discovery

Section 2: The search path algorithm for plugin discovery

There is a definite manner in which a product/vertical (such as View, Car, and Engine) searches for a plugin, when the plugin load command is issued by the user. The method in which a product searches a given plugin is termed here as the search path algorithm.
The following section, describes the locations in which a plugin will be searched. The search order will be exactly as mentioned below. Note that the plugin files (Plugin xml, view GUI, view dll and solver dll) that we discussed in the earlier sections need to reside in any one of these locations, in order for the plugin to be discoverable. The directory structure in which the files should reside in a location is described in the next section.
1. MDI_USER_PLUGIN_DIR
This environment variable contains a list of colon separated (semi-colon separated on windows) directories, set by the user. Each individual directory in this path will be searched for the plugin.
2. Private location for the product
The private location is specific to verticals and is not applicable to View. The set of environment variables that define the private location for a product are as follows,
 
Product
Private environment variable
Adams Car
MDI_ACAR_PRIVATE_DIR
Adams Engine (FEV)
MDI_AENG_PRIVATE_DIR
Adams Rail (VI Grade)
MDI_RAIL_PRIVATE_DIR
Adams Aircraft (VI Grade)
MDI_AIR_PRIVATE_DIR
Adams Driveline
MDI_ADRV_PRIVATE_DIR
3. Site location
The site location is specific to verticals and is not applicable to View. This location is defined by an environment variable which has the format MDI_<product_name>_SITE, where product_name is the product under consideration. The environment variable is set to the desired location/locations by the user in the form of a colon separated (semi-colon separated on windows) list of directories. The site environment variable for individual products is listed below,
 
Product
Old private environment variable
Adams Car
MDI_ACAR_SITE
Adams Engine (FEV)
MDI_AENGINE_SITE
Adams Rail (VI Grade)
MDI_ARAIL_SITE
Adams Aircraft (VI Grade)
MDI_AIRCRAFT_SITE
Adams Driveline
MDI_ADRIVELINE_SITE
For a given product, the list of directories in the corresponding environment variable will be checked for the existence of a plugin.
4. Installation path
The environment variable $topdir is set to the installation path of the Adams product. The platform specific sub-directory (win32, hpux11 etc.) as applicable, will be searched for in the plugin directory, if present in the installation path. Note that the environment variable $MDI_CPU is set to the appropriate platform. So essentially, the location $topdir/plugin/$MDI_CPU will be searched for the existence of the specified plugin.
5. Library path
On different platforms, the library path is specified using different environment variables. The list of the library path environment variable on individual platforms is as specified below,
 
Platform
Library Path Environment variable
Windows
PATH
Linux
LD_LIBRARY_PATH
This variable contains a colon/semi-colon separated list of directories. Individual directories will be searched for during the plugin load operation.
6. Current working directory
The current working directory is the last location which will be searched for the existence of the plugin.