Last edited 6 months ago
by Anonymous user

Reference:External Data: Difference between revisions

imported>Margit.link-rodrigue
No edit summary
imported>Margit.link-rodrigue
No edit summary
Line 15: Line 15:


==Parser functions==
==Parser functions==
The extension has nine parser functions:
The extension defines the following parser functions:


*'''#get_web_data''' retrieves CSV, GFF, JSON or XML data from a URL and assigns it to variables that can be accessed on the page.
Data retrieval and handling functions, which set local variables and then display or store them:
*'''#get_soap_data''' retrieves data from a URL via the [https://en.wikipedia.org/wiki/SOAP SOAP] protocol.
 
*'''#get_file_data''' retrieves data from a file on the local server, in the same formats as #get_web_data.
* '''external_value''' - displays the value of any such variable.
*'''#get_db_data''' retrieves data from a database.
* '''for_external_table''' - cycles through all the values retrieved for a set of variables, displaying the same "container" text for each one.
*'''#get_ldap_data''' retrieves data from an LDAP server.
* '''display_external_table''' - cycles through all the values retrieved for a set of variables, displaying each "row" using a template.
*'''#external_value''' displays the value of any such variable.
* '''format_external_table''' - available only if Cargo is installed. Formats the retrieved external data the same way as #cargo_query.
*'''#for_external_table''' cycles through all the values retrieved for a set of variables, displaying the same "container" text for each one.
 
*'''#store_external_table''' cycles through a table of values, storing them as semantic data via the [https://www.mediawiki.org/wiki/Extension:Semantic_MediaWiki Semantic MediaWiki] extension, by mimicking a call to SMW's #subobject function for each row.
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:
*'''#display_external_table''' cycles through all the values retrieved for a set of variables, displaying each "row" using a template.
 
*'''#clear_external_data''' erases the current set of retrieved data.
* '''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.
}}
}}
{{wcagCheck
{{wcagCheck
Line 33: Line 42:
|extensionType=backend
|extensionType=backend
}}
}}
{{#embed:https://github.com/wikimedia/mediawiki-extensions-ExternalData/blob/master/README.md|lang=|showLines=}}

Revision as of 14:44, 29 April 2026

Not available:The technical references of exensions are not available in this demo system.