public class MovePage extends MWAction
To allow your bot to move articles in your MediaWiki add the following line to your MediaWiki's
LocalSettings.php:
$wgEnableWriteAPI = true; $wgGroupPermissions['bot']['move'] = true; $wgGroupPermissions['bot']['movefile'] = true; // optional $wgGroupPermissions['bot']['move-subpages'] = true; // optional $wgGroupPermissions['bot']['move-rootuserpages'] = true; // optional
Move an article with
String oldtitle = ... String newtitle = ... String reason = ... Boolean withsubpages = ... Boolean noredirect = ... MediaWikiBot bot = ... bot.performAction(new MovePage(bot, oldtitle, newtitle, reason, withsubpages, noredirect));
| Constructor and Description |
|---|
MovePage(MediaWikiBot bot,
String oldtitle,
String newtitle,
String reason,
boolean withsubpages,
boolean noredirect)
Constructs a new
MovePage action. |
| Modifier and Type | Method and Description |
|---|---|
HttpAction |
getNextMessage() |
String |
processReturningText(String s,
HttpAction hm)
Deals with the MediaWiki API's response by parsing the provided text.
|
createNsString, evaluateXpath, getErrorElement, getRootElement, getRootElementWithError, hasMoreMessages, isSelfExecuter, processAllReturningText, setExceptionHandler, setHasMoreMessagespublic MovePage(MediaWikiBot bot, String oldtitle, String newtitle, String reason, boolean withsubpages, boolean noredirect)
MovePage action.bot - the MediaWikiBotoldtitle - title to movenewtitle - new titlereason - reason why to movewithsubpages - if TRUE also move the subpagesnoredirect - if TRUE create no redirectspublic String processReturningText(String s, HttpAction hm)
processReturningText in interface ReturningTextprocessReturningText in class MWActions - the answer to the most recently generated MediaWiki API requesthm - the requestor messagepublic HttpAction getNextMessage()
Copyright © 2013. All Rights Reserved.