| 1 | Sitelist {#sitelist} |
| 2 | ======== |
| 3 | |
| 4 | This document describes the XML format used to represent information about external sites known to a MediaWiki installation. This information about external sites is used to allow "inter-wiki" links, cross-language navigation, as well as close integration via direct access to the other site's web API or even directly to their database. |
| 5 | |
| 6 | Lists of external sites can be imported and exported using the *importSites.php* and *exportSites.php* scripts. In the database, external sites are described by the `sites` and `site_ids` tables. |
| 7 | |
| 8 | The formal specification of the format used by *importSites.php* and *exportSites.php* can be found in the *sitelist-1.0.xsd* file. Below is an example and a brief description of what the individual XML elements and attributes mean: |
| 9 | |
| 10 | ```xml |
| 11 | <sites version="1.0"> |
| 12 | <site> |
| 13 | <globalid>acme.com</globalid> |
| 14 | <localid type="interwiki">acme</localid> |
| 15 | <group>Vendor</group> |
| 16 | <path type="link">http://acme.com/</path> |
| 17 | <source>meta.wikimedia.org</source> |
| 18 | </site> |
| 19 | <site type="mediawiki"> |
| 20 | <globalid>de.wikidik.example</globalid> |
| 21 | <localid type="equivalent">de</localid> |
| 22 | <group>Dictionary</group> |
| 23 | <forward/> |
| 24 | <path type="page_path">http://acme.com/</path> |
| 25 | </site> |
| 26 | </sites> |
| 27 | ``` |
| 28 | |
| 29 | |
| 30 | The XML elements are used as follows: |
| 31 | |
| 32 | - `sites`: The root element, containing a set of site tags. May have a `version` attribute with the value `1.0`. |
| 33 | - `site`: A site entry, representing an external website. May have a `type` attribute with one of the following values: |
| 34 | + `unknown`: (default) any website |
| 35 | + `mediawiki`: A MediaWiki site |
| 36 | - `globalid`: A unique identifier for the site. For a given site, the same unique global ID must be used across all wikis in a wiki farm (aka wiki family). |
| 37 | - `localid`: An identifier for the site, for use on the local wiki. Multiple local IDs may be assigned to a given site. The same local ID can be used to refer to different sites by different wikis on the same farm/family. The `localid` element may have a type attribute with one of the following values: |
| 38 | + `interwiki`: Used as an "interwiki" link prefix, for creating cross-wiki links. |
| 39 | + `equivalent`: Used as a "language" link prefix, for cross-linking equivalent content in different languages. |
| 40 | - `group`: The site group (e.g. wiki family) the site belongs to. |
| 41 | - `path`: A URL template for accessing resources on the site. Several paths may be defined for a given site, for accessing different kinds of resources, identified by the `type` attribute, using one of the following values: |
| 42 | + `link`: Generic URL template, often the document root. |
| 43 | + `page_path`: (for `mediawiki` sites) URL template for wiki pages (corresponds to the target wiki's `$wgArticlePath` setting) |
| 44 | + `file_path`: (for `mediawiki` sites) URL pattern for application entry points and resources (corresponds to the target wiki's `$wgScriptPath` setting). |
| 45 | - `forward`: Whether using a prefix defined by a `localid` tag in the URL will cause the request to be redirected to the corresponding page on the target wiki (currently unused). E.g. whether <http://wiki.acme.com/wiki/foo:Buzz> should be forwarded to <http://wiki.foo.com/read/Buzz>. (CAVEAT: not yet implement, can be specified but has no effect) |