Manual:Extension/BlueSpiceDiscovery/Main navigation/Language support and Reference:ContentTransfer: Difference between pages

(Difference between pages)
(Changed categories.)
 
No edit summary
Tag: 2017 source edit
 
Line 1: Line 1:
{{BSExtensionInfobox
|desc=Copies new or existing wiki pages into a different wiki. (v3.2 and up)
|status=stable
|developer=HalloWelt
|type=BlueSpice
|edition=BlueSpice Farm (deactivated)
|compatible=BlueSpice
|category=Quality Assurance
|license=GPL v3
|active=No
}}
Users with the appropriate authorization can copy up to 200 pages per transfer from a wiki to the same namespace of a target wiki. This extension usually requires BlueSpice Farm.


== Support for the user language settings ==
Depending on the settings selected on the ContentTransfer special page, the following files are copied:
If you want the link labels in the main navigation to match the language a user has set under their ''Preferences'', you need to provide a separate message page for each menu item. These message pages need to reside in the namespace ''MediaWiki''.


In the following example, we create a menu item called ''Quality assurance.'' A user who specified German (de) or formal German (de-formal in their preferences, should see the label ''Qualitätssicherung'' instead.
*the selected wiki pages
*the related category pages
*the book page associated with wiki pages
*the templates associated with wiki pages
*attached files


'''To create the labels in EN, DE and DE-formal:'''
==Technical information==
{{Messagebox|boxtype=important|Note text=The extension is deactivated by default and must first be activated in 060-ContentTransfer under settings.d - or in the LocalSettings.custom.php in the installation folder (not just in a single farm instance):


#'''Create'''  the page ''MediaWiki:QA'' and add the text for the English label (''Quality assurance'').Save the page.
#'''Create'''  the page ''MediaWiki:QA''/''de'' and add the text for the German label (''Qualitätssicherung'').Save the page.
#'''Create''' a link on the page ''MediaWiki:Sidebar'':  <code>**About_quality_assurance|QA</code>  This creates a link in the main navigation to the page ''About quality assurance'' and displays the label that is located in the different language message pages. To test the languages, go to ''Preferences > User Profile'' in your user profile menu. In the section ''Internationalisation'', set the language from English to German or vice versa and save the setting. The language of the menu item now displays in the correct language.


==<span class="mw-headline">Navigation in multilingual wikis</span>==
wfLoadExtension ('ContentTransfer');}}
{{Messagebox|boxtype=important|Note text=These instructions do not apply in a farm environment or in separate language wikis. These instructions are used for maintaining languages via sub-pages.}}


If you have content in multiple languages, you want that users with English language preference settings not only see the corresponding menu labels. They should also be directed to the English page when they click on a menu item. Users with German language settings should see the German content after clicking on the German menu link. In this case, you also have to create separate link targets in addition to the language labels.
===<span class="mw-headline" id="Konfiguration" style="box-sizing: inherit;">Configuration</span>===
The following information is necessary to transfer content between two wiki instances:


In the previous section, we already created the labels when a user switches languages. Now we also have to create different link targets for these pages. If the main language is English and the page is called ''About quality assurance,'' the translations can be located in subpages. For example, the German version is located under ''About quality assurance/de''.
'''<source-instance-name>'''


'''To create the link targets to the language pages:'''
Name of the source wiki. This is the directory name from <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);">/opt/mediawiki/w/_sf_instances/</code> .


#'''Create''' the page ''MediaWiki:QA-url'' and add the link to the English page ''About quality assurance''. The link is entered without brackets, in plain text. Save the page.
'''<target-instance-descriptive-name>'''
#'''Create''' the page ''MediaWiki:QA''-url/''de'' and add the text for the German page (''About quality assurance''/de). The link is entered without brackets, in plain text. Save the page.


In the link to the ''Quality assurance'' page, change the link from
Descriptive name of the target wiki. This is usually the same as <target-instance-name>, but can be chosen freely to better describe the instance. Does not allow spaces.


<code>**About_quality_assurance|QA</code>
'''<target-instance-name>'''


to
Name of the target wiki. This is the directory name from <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);">/opt/mediawiki/w/_sf_instances/</code> <span>. It can be extracted from the url of the wiki instance.</span>


<code>**QA-url|QA</code>
'''<target-instance-label>'''


This achieves the language switch for the target pages (QA-url) and for the label of the menu item.
The display name for the target wiki. It can contain empty spaces. This information is optional and can be commented out.


Depending on the language settings of the user, the user is now directly directed to the correct language version.
'''<servername>'''


{{Box Links-en|Topic1=[[Manual:Extension/BlueSpiceInterwikiLinks|Connecting the language versions of pages in different wikis]]}}
Server-url
[[Category:Multilingualism]]
 
'''<<span class="mw-lingo-term" data-lingo-term-id="fabcaa97871555b68aa095335975e613" data-hasqtip="2" style="box-sizing: inherit; border-bottom: 1px dotted rgb(187, 187, 255); cursor: default;">bot</span>-username-provided>'''
[[File:Reference:contentTransfer-bot-settings.png|thumb|Bot user settings|link=Special:FilePath/Reference:contentTransfer-bot-settings.png]]
A user name in the form of  <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);"><username>@<id></code>.
 
The bot user has to be generated from <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);">Special:BotPasswords</code>  in the target wiki. After you click "Create", a page for selecting the bot rights is shown. Activate the following settings:
 
*High-volume editing
*Edit existing pages
*Edit protected pages
*Create, edit and move pages,
*Upload new files
*Upload, replace and move files
 
'''<<span class="mw-lingo-term" data-lingo-term-id="fabcaa97871555b68aa095335975e613" data-hasqtip="3" style="box-sizing: inherit; border-bottom: 1px dotted rgb(187, 187, 255); cursor: default;">bot</span>-password-provided>'''
 
The password is created in the wiki and needs to be used in the settings below.
 
With all this info, open <code style="box-sizing: inherit; font-family: monospace, Courier; font-size: 13.5px; padding: 1px 4px; color: black; background-color: rgb(249, 249, 249); border-radius: 2px; border: 1px solid rgb(221, 221, 221);">/opt/mediawiki/w/_sf_instances/<source-instance-name>/LocalSettings.custom.php</code> .
 
Add the following info:
<span class="nv" style="box-sizing: inherit;">$wgContentTransferTargets</span><span class="p" style="box-sizing: inherit;">[</span><span class="s1" style="box-sizing: inherit;">'<target-instance-descriptive-name>'</span><span class="p" style="box-sizing: inherit;">]</span> <span class="o" style="box-sizing: inherit;">=</span> <span class="p" style="box-sizing: inherit;">[</span>
    <span class="s2" style="box-sizing: inherit;">"url"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="s2" style="box-sizing: inherit;">"<span class="mw-lingo-term" data-lingo-term-id="5e056c500a1c4b6a7110b50d807bade5" data-hasqtip="4" style="box-sizing: inherit; border-bottom: 1px dotted rgb(187, 187, 255); cursor: default;">https</span>://<servername>/<target-instance-name>/api.php"</span><span class="p" style="box-sizing: inherit;">,</span>
    <span class="s2" style="box-sizing: inherit;">"user"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="s2" style="box-sizing: inherit;">"<<span class="mw-lingo-term" data-lingo-term-id="fabcaa97871555b68aa095335975e613" data-hasqtip="5" style="box-sizing: inherit; border-bottom: 1px dotted rgb(187, 187, 255); cursor: default;">bot</span>-username-provided>"</span><span class="p" style="box-sizing: inherit;">,</span>
    <span class="s2" style="box-sizing: inherit;">"password"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="s2" style="box-sizing: inherit;">"<<span class="mw-lingo-term" data-lingo-term-id="fabcaa97871555b68aa095335975e613" data-hasqtip="6" style="box-sizing: inherit; border-bottom: 1px dotted rgb(187, 187, 255); cursor: default;">bot</span>-password-provided>"</span><span class="p" style="box-sizing: inherit;">,</span>
    <span class="s2" style="box-sizing: inherit;">"draftNamespace"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="s2" style="box-sizing: inherit;">"Draft"</span><span class="p" style="box-sizing: inherit;">,</span>
    <span class="s2" style="box-sizing: inherit;">"pushToDraft"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="k" style="box-sizing: inherit;">true</span><span class="p" style="box-sizing: inherit;">,</span>
    <span class="s2" style="box-sizing: inherit;">"displayText"</span> <span class="o" style="box-sizing: inherit;">=></span> <span class="s2" style="box-sizing: inherit;">"<target-instance-label>"</span><span class="p" style="box-sizing: inherit;">,</span>
<span class="p" style="box-sizing: inherit;">];</span>
If ContentTransfer is used without the extension [[:de:Referenz:MergeArticles|MergeArticles]], the information about drafts has to be deactivated in the settings block:
# "draftNamespace" => "Draft",
"pushToDraft" => false,
Example:
$wgContentTransferTargets['MeinWiki'] = [
    "url" => "<nowiki>http://172.16.200.23/MeinWikiName/api.php</nowiki>",
    "user" => "Snow@Schneewittchen",
    "password" => "uuicqdv9mubfrepbpqu1bvsl5957cpa9",
  #  "draftNamespace" => "Draft",
    "pushToDraft" => false,
    "displayText" => "Mein Wiki",
];
{{Messagebox|boxtype=note|Note text=To conclude the confguration, you need to run update.php}}
 
 
To provide a selection of possible users who can transfer pages, the following syntax is required:<syntaxhighlight lang="text">
$wgContentTransferTargets = [ 'privatewikiname' => [
    "url" => "http://target/api.php", // URL to the target wiki's API endpoint
    "users" => [
        [
            "user" => "Uname1@bot", // Bot username
            "password" => "dvauaeersp02ds6s8n88bbrsj3asuuk", // Bot password
        ],
        [
            "user" => "Uname2@bot", // Bot username
            "password" => "dvauaeersp02ds6s8n88bbrsj3asuuk", // Bot password
        ]
    ],
    "draftNamespace" => "Draft", // Name for the NS to be used as draft ("Draft" is automatically created by "MergeArticles" ext)
    "pushToDraft" => true // Whether to push to draft. If false will push directly to target pages
] ];
</syntaxhighlight>The result is a selection of user accounts for executing the transfer:
[[File:Reference:contenttransfer-multipleusers.png|alt=Multiple transfer users|center|thumb|350x350px|Multiple transfer users]]
 
=== Additional settings: ===
<span class="nv" style="box-sizing: inherit;">$wgContentTransferIgnoreInsecureSSL</span> <span class="o" style="box-sizing: inherit;">=</span> <span class="k" style="box-sizing: inherit;">false</span><span class="p" style="box-sizing: inherit;">;</span> <span class="c1" style="box-sizing: inherit;">// Ignore invalid SSL certificates (for test systems)</span>
<span class="nv" style="box-sizing: inherit;">$wgContentTransferPageLimit</span> <span class="o" style="box-sizing: inherit;">=</span> <span class="mi" style="box-sizing: inherit;">200</span><span class="p" style="box-sizing: inherit;">;</span> <span class="c1" style="box-sizing: inherit;">// Max number of pages to be allowed at one</span>
<span class="nv" style="box-sizing: inherit;">$wgContentTransferOnlyContentNamespaces</span> <span class="o" style="box-sizing: inherit;">=</span> <span class="k" style="box-sizing: inherit;">true</span><span class="p" style="box-sizing: inherit;">;</span> <span class="c1" style="box-sizing: inherit;">// Only allow content namespaces to be selected in filters</span>
<span class="nv" style="box-sizing: inherit;">$wgContentTransferAllowTalkNamespaces</span> <span class="o" style="box-sizing: inherit;">=</span> <span class="k" style="box-sizing: inherit;">false</span><span class="p" style="box-sizing: inherit;">;</span> <span class="c1" style="box-sizing: inherit;">// Allow talk namespaces to be selected in filters</span>
 
===<span class="mw-headline" id="Anforderungen" style="box-sizing: inherit;">Anforderungen</span>===
ContentTransfer requires [[:de:Referenz:BlueSpiceFoundation|BlueSpiceFoundation]]. Pages that already exist in the target wiki, can be merged using the extension [[:de:Referenz:MergeArticles|MergeArticles]].
[[Category:Extension]]

Revision as of 14:28, 19 January 2022

Extension: ContentTransfer

all extensions

Overview
Description: Copies new or existing wiki pages into a different wiki. (v3.2 and up)
State: stable Dependency: BlueSpice
Developer: HalloWelt License: GPL v3
Type: BlueSpice Category: Quality Assurance
Edition: BlueSpice Farm (deactivated) Version: 4.1+


Users with the appropriate authorization can copy up to 200 pages per transfer from a wiki to the same namespace of a target wiki. This extension usually requires BlueSpice Farm.

Depending on the settings selected on the ContentTransfer special page, the following files are copied:

  • the selected wiki pages
  • the related category pages
  • the book page associated with wiki pages
  • the templates associated with wiki pages
  • attached files

Technical information

Important!The extension is deactivated by default and must first be activated in 060-ContentTransfer under settings.d - or in the LocalSettings.custom.php in the installation folder (not just in a single farm instance):


wfLoadExtension ('ContentTransfer');


Configuration

The following information is necessary to transfer content between two wiki instances:

<source-instance-name>

Name of the source wiki. This is the directory name from /opt/mediawiki/w/_sf_instances/ .

<target-instance-descriptive-name>

Descriptive name of the target wiki. This is usually the same as <target-instance-name>, but can be chosen freely to better describe the instance. Does not allow spaces.

<target-instance-name>

Name of the target wiki. This is the directory name from /opt/mediawiki/w/_sf_instances/ . It can be extracted from the url of the wiki instance.

<target-instance-label>

The display name for the target wiki. It can contain empty spaces. This information is optional and can be commented out.

<servername>

Server-url

<bot-username-provided>

A user name in the form of <username>@<id>.

The bot user has to be generated from Special:BotPasswords in the target wiki. After you click "Create", a page for selecting the bot rights is shown. Activate the following settings:

  • High-volume editing
  • Edit existing pages
  • Edit protected pages
  • Create, edit and move pages,
  • Upload new files
  • Upload, replace and move files

<bot-password-provided>

The password is created in the wiki and needs to be used in the settings below.

With all this info, open /opt/mediawiki/w/_sf_instances/<source-instance-name>/LocalSettings.custom.php .

Add the following info:

$wgContentTransferTargets['<target-instance-descriptive-name>'] = [
    "url" => "https://<servername>/<target-instance-name>/api.php",
    "user" => "<bot-username-provided>",
    "password" => "<bot-password-provided>",
    "draftNamespace" => "Draft",
    "pushToDraft" => true,
    "displayText" => "<target-instance-label>",
];

If ContentTransfer is used without the extension MergeArticles, the information about drafts has to be deactivated in the settings block:

# "draftNamespace" => "Draft", 
"pushToDraft" => false,

Example:

$wgContentTransferTargets['MeinWiki'] = [
    "url" => "http://172.16.200.23/MeinWikiName/api.php",
    "user" => "Snow@Schneewittchen",
    "password" => "uuicqdv9mubfrepbpqu1bvsl5957cpa9",
 #  "draftNamespace" => "Draft",
    "pushToDraft" => false,
    "displayText" => "Mein Wiki",
];
Note:To conclude the confguration, you need to run update.php


To provide a selection of possible users who can transfer pages, the following syntax is required:

$wgContentTransferTargets = [ 'privatewikiname' => [
    "url" => "http://target/api.php", // URL to the target wiki's API endpoint
    "users" => [
        [
            "user" => "Uname1@bot", // Bot username
            "password" => "dvauaeersp02ds6s8n88bbrsj3asuuk", // Bot password
        ],
        [
            "user" => "Uname2@bot", // Bot username
            "password" => "dvauaeersp02ds6s8n88bbrsj3asuuk", // Bot password
        ]
    ],
    "draftNamespace" => "Draft", // Name for the NS to be used as draft ("Draft" is automatically created by "MergeArticles" ext)
    "pushToDraft" => true // Whether to push to draft. If false will push directly to target pages
] ];

The result is a selection of user accounts for executing the transfer:

Multiple transfer users
Multiple transfer users

Additional settings:

$wgContentTransferIgnoreInsecureSSL = false; // Ignore invalid SSL certificates (for test systems)
$wgContentTransferPageLimit = 200; // Max number of pages to be allowed at one 
$wgContentTransferOnlyContentNamespaces = true; // Only allow content namespaces to be selected in filters
$wgContentTransferAllowTalkNamespaces = false; // Allow talk namespaces to be selected in filters

Anforderungen

ContentTransfer requires BlueSpiceFoundation. Pages that already exist in the target wiki, can be merged using the extension MergeArticles.




To submit feedback about this documentation, visit our community forum.

Discussions