Extension:External Data(外部数据)
发行状态: 稳定版 |
|
|---|---|
| 实现 | 解析器函数, 特殊页面 |
| 描述 | |
| 作者 | Yaron Koren, Alexander Mashin 以及其他 |
| 最新版本 | 3.6 (2026年1月) |
| 兼容性政策 | master分支维持向后兼容。 |
| MediaWiki | 1.40+ |
| 数据库更改 | 是 |
|
|
| License | GNU General Public License 2.0 or later |
| 下載 | 參見:下载和安装 |
| 示例 | 包含从外部 CSV 文件获取的信息的页面 |
| 前往translatewiki.net翻譯External Data扩展 | |
| 問題 | 开启的任务 · 报告错误 |
External Data 扩展支持 MediaWiki 页面从多种来源中检索、过滤和格式化结构化数据。 这些来源包括:外部 URL、SOAP 服务、常规维基页面、上传文件、本地服务器文件、数据库、LDAP 目录和本地程序输出。
该扩展定义了下列的 parser functions:
- 数据检索和处理函数,用于设置本地变量,然后显示或存储这些变量:
- #external_value - displays the value of any such variable.
- #for_external_table - cycles through all the values retrieved for a set of variables, displaying the same "container" text for each one.
- #display_external_table - cycles through all the values retrieved for a set of variables, displaying each "row" using a template.
- #format_external_table - 只有当 Cargo 已安装时,函数可用。 Formats the retrieved external data the same way as #cargo_query.
- In the Legacy mode the extension also defines data retrieval functions, which set local variables available with wikipage scope that can later be displayed using the above functions:
- #get_external_data - retrieves data from various sources, thus replacing any of the below parser functions, and assigns it to variables that can be accessed on the page.
- #get_web_data - retrieves CSV, GFF, JSON, YAML, XML, HTML, ini, or free-form data from a URL and assigns it to variables that can be accessed on the page.
- #get_soap_data - retrieves data from a URL via the SOAP protocol.
- #get_file_data - retrieves data from a file on the local server, in the same formats as #get_web_data.
- #get_db_data - retrieves data from a database.
- #get_ldap_data - retrieves data from an LDAP server.
- #get_program_data - retrieves data returned by a program run server-side.
- #get_inline_data - parses data passed to it, in the same formats as #get_web_data.
- and also #clear_external_data that erases the current set of retrieved data or only some variables.
It also defines a Lua function mw.ext.externalData.getExternalData that retrieves data and returns it as Lua table.
In the Legacy mode, the following additional Lua functions are also defined (there is one-to-one correspondence between parser functions retrieving data and Lua functions evident from their names):
mw.ext.externalData.getWebDatamw.ext.externalData.getFileDatamw.ext.externalData.getDbDatamw.ext.externalData.getSoapDatamw.ext.externalData.getLdapDatamw.ext.externalData.getProgramDatamw.ext.externalData.getInlineData
In tag emulation mode, the wiki site administrator can define additional parser tags.
This version of the External Data extension requires MediaWiki 1.39.4+.
Click through the pages in the navigation bar above to learn more about External Data, how it works, how to use it, and how to install it.
| 此扩展在以下wiki农场/托管网站和/或软件包中提供: |
- Stable extensions/zh
- Parser function extensions/zh
- Special page extensions/zh
- Pages using deprecated NoteTA template
- LoadExtensionSchemaUpdates extensions/zh
- ParserFirstCallInit extensions/zh
- ScribuntoExternalLibraries extensions/zh
- SoftwareInfo extensions/zh
- GPL licensed extensions/zh
- All extensions/zh
- Extensions included in BlueSpice/zh
- Extensions included in Canasta/zh
- Extensions included in Miraheze/zh
- Extensions included in MyWikis/zh
- Extensions included in ProWiki/zh
- Extensions included in semantic::core/zh
- Data extraction extensions/zh
- Remote content extensions/zh
- File system content extensions/zh
- Extensions in Wikimedia version control/zh
