Extension:External Data/Configuration

External Data configuration settings consist of two parts: configuration for data sources and a few other settings.

Data sources
Most of the extension settings regulate calls to  parser functions (or the corresponding Lua functions), configuring so called data sources. There are at least two data sources relevant to any parser function call; a more specific data source overriding a more universal one; and the last containing global fallback settings.

Settings for the data sources are stored in the associative array. Its keys are names of data sources and values are arrays containing settings for the data source.

The relevant data sources for the data retrieval parser functions (and their Lua analogues) and the relevant settings are:

Remember that  can replace any of the   parser functions, as well as   can replace any of the   Lua functions.

Any parameter of  can be omitted, provided it is set in the corresponding   array. The obvious exception is the parameter used as the key to : ,  ,  ,  ,  ,   and   (see below).

If  is used, the parameter   can replace ,  ,  ,  ,   and  , provided that the corresponding   contains all the settings necessary to choose and initialise the proper connector. cannot be used with any other  parser function.

Any configuration setting can include wildcards surrounded by dollar signs, like this:. These wildcards will be substituted from additional parameters to. The additional parameters should be declared as required or receive a default value in, e.g.:. It is important that a validator is set up for these parameters:.

This mechanism allows formation of shell commands used by server-side programs.

Another possible application is obscure data sources defined by the wiki admin, the very nature of which is hidden from wiki user. Example of such a source: Is such an obscure source is defined, the following wikitext will show the SVG code for Israeli flag:

The default value for  is:

Other settings
Other settings are: For default values of both these variables refer to the file.
 * — show error message, if an internal variable is not set. Note also, that  allows passing a default/fallback value as its second parameter,
 * — a set of rules regulating the choice of class to handle connection to a data source depending on the parser function invoked and its parameters. Injecting a new rule calling a new class extending  allows to add new functionality to this extension,
 * — a set of rules regulating the choice of text parser to convert text, returned by an external service, to variables. Injecting a new rule calling a new class extending  allows to add new functionality to this extension.