Difference between revisions of "MediaWiki:Architecture of SAR service"
(17 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
Items and properties are core to wikibase. They operate like a very flexible database. The SAR service relies on some information being properly entered. See [[Item:Q102]] for an example. | Items and properties are core to wikibase. They operate like a very flexible database. The SAR service relies on some information being properly entered. See [[Item:Q102]] for an example. | ||
+ | |||
+ | This site hosts many [https://wiki.personaldata.io/wiki/Special:AllPages?from=&to=&namespace=120 items] and [https://wiki.personaldata.io/wiki/Special:AllPages?from=&to=&namespace=122 properties]. Only [https://tinyurl.com/y2n69h8g some are data controllers], though, for which a SAR should be generated. | ||
== Templates == | == Templates == | ||
− | Templates are a MediaWiki system that allow filling text modularly. There is [https://www.mediawiki.org/wiki/Help:Templates extensive documentation] on the MediaWiki docs. | + | Templates are a MediaWiki system that allow filling text modularly. There is [https://www.mediawiki.org/wiki/Help:Templates extensive documentation] on the MediaWiki docs. [https://wiki.personaldata.io/wiki/Special:AllPages?from=&to=&namespace=10 Here] is a full list of pages in the template namespace on this site. |
+ | |||
+ | Templates admit all kinds of parameters, and are extremely flexible in what you can template. For instance, you can template away which template to use! | ||
Note that templates can be used from within gadgets or user scripts (see below) as well as regular pages. | Note that templates can be used from within gadgets or user scripts (see below) as well as regular pages. | ||
+ | |||
+ | This is what we use to build access requests, relying on three templates principally: | ||
+ | * [[Template:Access]] to compose the text of an access request; | ||
+ | * [[Template:AccessFR]] GDPR subject access request in French; | ||
+ | * [[Template:MailtoSwissAccess]] subject access request in French for Swiss data controllers. | ||
+ | * [[Template:Mailto]] to create a Mailto link; | ||
+ | * [[Template:MailtoAccess]] to combine the two. | ||
+ | |||
+ | Note that default view on templates is not always accurate. One needs to look at the content (edit) to know more. | ||
== Gadgets, user scripts and CSS == | == Gadgets, user scripts and CSS == | ||
− | MediaWiki has many extension systems. There is a way to add javascript code or CSS upon page load, and to configure for this to happen independently for each user or site-wide. See [https://www.mediawiki.org/wiki/Extension:Gadgets MediaWiki | + | MediaWiki has many extension systems. There is a way to add javascript code or CSS upon page load, and to configure for this to happen independently for each user or site-wide. See MediaWiki's documentation [https://www.mediawiki.org/wiki/Extension:Gadgets here] and [https://www.mediawiki.org/wiki/Manual:Interface/JavaScript here]. |
+ | |||
+ | * common.js is site-wide javascript, called during any page load and defined on PersonalData.IO at [[MediaWiki:Common.js]] | ||
+ | * gadgets are site-wide javascript, which can be pre-packaged and configured by the admin to be opt-in or opt-out, with users able to change the choice in their preferences page. | ||
+ | * user-scripts are custom javascript, set up by each user separately. It is always located at [[Special:MyPage/common.js]]. | ||
+ | |||
+ | [[MediaWiki:Common.js]] is currently used to: | ||
+ | * enable hyperlinking to specific pages, with specific JS or CSS loaded as well; | ||
+ | * load [[MediaWiki:Gadget-EasyQuery.js]] (it is [https://www.wikidata.org/wiki/MediaWiki:Gadget-EasyQuery.js normally a prepackaged gadget on Wikidata] which helps navigate the items, but had to be slightly adapted to here); | ||
+ | * load the [[MediaWiki:Access.js]] script, which in turn relies on the wiki templates described above (such as [[Template:Access]]), filled with data fetched from particular items; | ||
+ | * load the [[User:Abel/experimental.js]] script, which enables sitewide experimentation and circumvention of access control rules. | ||
+ | |||
+ | == Module == | ||
+ | This relies on the [[Module:Wd]] module, which helps combine retrieve items, properties and values from templates. | ||
+ | |||
+ | == Splitting the work == | ||
+ | Given the many options available, there is some [[splitting the work|trickiness in splitting the work]] between these options. | ||
− | + | == Usage on hestialabs and hestia related sites == | |
− | + | The templating system is reused on sites built by hestia.ai for the constellation of hestialabs projects, in order to pass the templating logic closer to the advocacy point, within the PersonalData.IO sphere. | |
− | |||
− |
Latest revision as of 12:20, 14 July 2022
Items & properties
Items and properties are core to wikibase. They operate like a very flexible database. The SAR service relies on some information being properly entered. See Item:Q102 for an example.
This site hosts many items and properties. Only some are data controllers, though, for which a SAR should be generated.
Templates
Templates are a MediaWiki system that allow filling text modularly. There is extensive documentation on the MediaWiki docs. Here is a full list of pages in the template namespace on this site.
Templates admit all kinds of parameters, and are extremely flexible in what you can template. For instance, you can template away which template to use!
Note that templates can be used from within gadgets or user scripts (see below) as well as regular pages.
This is what we use to build access requests, relying on three templates principally:
- Template:Access to compose the text of an access request;
- Template:AccessFR GDPR subject access request in French;
- Template:MailtoSwissAccess subject access request in French for Swiss data controllers.
- Template:Mailto to create a Mailto link;
- Template:MailtoAccess to combine the two.
Note that default view on templates is not always accurate. One needs to look at the content (edit) to know more.
Gadgets, user scripts and CSS
MediaWiki has many extension systems. There is a way to add javascript code or CSS upon page load, and to configure for this to happen independently for each user or site-wide. See MediaWiki's documentation here and here.
- common.js is site-wide javascript, called during any page load and defined on PersonalData.IO at MediaWiki:Common.js
- gadgets are site-wide javascript, which can be pre-packaged and configured by the admin to be opt-in or opt-out, with users able to change the choice in their preferences page.
- user-scripts are custom javascript, set up by each user separately. It is always located at Special:MyPage/common.js.
MediaWiki:Common.js is currently used to:
- enable hyperlinking to specific pages, with specific JS or CSS loaded as well;
- load MediaWiki:Gadget-EasyQuery.js (it is normally a prepackaged gadget on Wikidata which helps navigate the items, but had to be slightly adapted to here);
- load the MediaWiki:Access.js script, which in turn relies on the wiki templates described above (such as Template:Access), filled with data fetched from particular items;
- load the User:Abel/experimental.js script, which enables sitewide experimentation and circumvention of access control rules.
Module
This relies on the Module:Wd module, which helps combine retrieve items, properties and values from templates.
Splitting the work
Given the many options available, there is some trickiness in splitting the work between these options.
The templating system is reused on sites built by hestia.ai for the constellation of hestialabs projects, in order to pass the templating logic closer to the advocacy point, within the PersonalData.IO sphere.