public abstract class MediaWikiApiImpl extends Object implements MediawikiApi
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOGGER
Logging may be enabled by setting debug to true
|
protected String |
protectionMarker
protection Marker - if this shows in page edits are suppressed and logged with a warning
|
protected boolean |
throwExceptionOnError
set to true if exceptions should be thrown on Error
|
| Constructor and Description |
|---|
MediaWikiApiImpl() |
| Modifier and Type | Method and Description |
|---|---|
Edit |
copyToWiki(MediawikiApi targetWiki,
String pageTitle,
String summary)
copy the page for a given title from this wiki to the given target Wiki
uses https://www.mediawiki.org/wiki/API:Edit FIXME - make this an API
interface function FIXME - create a multi title version
|
protected String |
decode(String html)
decode the given html markup
|
protected String |
encode(String param)
request parameter encoding
|
Api |
fromXML(String xml)
return Api from the given xml
|
String |
getProtectionMarker() |
abstract SiteInfo |
getSiteInfo()
get the general siteinfo
|
String |
getVersion()
get the Version of this wiki
|
protected void |
handleError(Api api) |
protected void |
handleError(Error error)
handle the given api error
|
protected void |
handleError(String errMsg)
handle the given error Message according to the exception setting
|
boolean |
isThrowExceptionOnError()
are exceptions thrown when an api error code is received?
|
String |
normalizeTitle(String title)
normalize the given page title
|
void |
setProtectionMarker(String protectionMarker)
set the given protectionMarker for this wiki if a page has this
protectionMarker and edit will not be done
|
void |
setThrowExceptionOnError(boolean throwExceptionOnError)
set to true if exceptions should be thrown when api error codes are
received default is true
|
void |
setVersion(String version)
set the version via API
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, edit, edit, getAllImagesByTimeStamp, getAllPages, getBacklinks, getImageInfo, getImageInfosForPage, getImagesOnPage, getImageUsage, getIsoTimeStamp, getPageContent, getPageHtml, getScriptPath, getSections, getSectionText, getSiteurl, init, isDebug, isLoggedIn, login, logout, setDebug, setScriptPath, setSiteurl, upload, uploadprotected static Logger LOGGER
protected boolean throwExceptionOnError
protected String protectionMarker
public boolean isThrowExceptionOnError()
MediawikiApiisThrowExceptionOnError in interface MediawikiApipublic void setThrowExceptionOnError(boolean throwExceptionOnError)
MediawikiApisetThrowExceptionOnError in interface MediawikiApithrowExceptionOnError - the throwExceptionOnError to setpublic String getProtectionMarker()
public void setProtectionMarker(String protectionMarker)
MediawikiApisetProtectionMarker in interface MediawikiApiprotectionMarker - the protectionMarker to setprotected void handleError(String errMsg) throws Exception
errMsg - Exceptionprotected void handleError(Error error) throws Exception
error - Exceptionprotected void handleError(Api api) throws Exception
api - Exceptionpublic Api fromXML(String xml) throws Exception
xml - - the xml go unmarshalExceptionpublic abstract SiteInfo getSiteInfo() throws Exception
MediawikiApigetSiteInfo in interface MediawikiApiExceptionpublic Edit copyToWiki(MediawikiApi targetWiki, String pageTitle, String summary) throws Exception
copyToWiki in interface MediawikiApitargetWiki - - the other wiki (could use a different API implementation ...)pageTitle - - the title of the page to copysummary - - the summary to useExceptionpublic String getVersion() throws Exception
getVersion in interface MediawikiApiExceptionpublic void setVersion(String version)
version - protected String encode(String param) throws Exception
param - Exceptionprotected String decode(String html) throws Exception
html - Exceptionpublic String normalizeTitle(String title) throws Exception
normalizeTitle in interface MediawikiApititle - ExceptionCopyright © 2018 BITPlan GmbH. All rights reserved.