public interface MediawikiApi
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
|
Delete |
delete(String title,
String reason)
delete the given page for the given reason
|
Edit |
edit(String pagetitle,
String text,
String summary)
Edits a page by setting its text to the supplied value.
|
Edit |
edit(String pageTitle,
String text,
String summary,
boolean minor,
boolean bot,
int sectionNumber,
String sectionTitle,
Calendar basetime)
edit
|
List<Img> |
getAllImagesByTimeStamp(String aistart,
String aiend,
int ailimit)
get all Images by the given time stamps
|
List<P> |
getAllPages(String apfrom,
int aplimit)
getAllPages
|
List<Bl> |
getBacklinks(String pageTitle,
String params,
int limit)
get the backlinks for the given pagetitle
|
Ii |
getImageInfo(String pageTitle)
get the Image Info for the given pageTitle
|
List<Ii> |
getImageInfosForPage(String pageTitle,
int limit)
get the imageInfos for all images on the given page Title
|
List<Im> |
getImagesOnPage(String pageTitle,
int imLimit)
get the Images on the given page
|
List<Iu> |
getImageUsage(String imageTitle,
String params,
int limit)
get the imageusage for the given imageTitle
|
String |
getIsoTimeStamp()
get an ISO time stamp (utility function) FIXME may have to move out of the
main API
|
String |
getPageContent(String pageTitle)
get the page Content for the given page Title
|
String |
getPageHtml(String pageTitle)
get the html rendered version of a page
|
String |
getScriptPath()
get the script Path
|
List<S> |
getSections(String pageTitle)
get the sections for the given pageTitle
|
String |
getSectionText(String pageTitle,
int sectionNumber)
get the content of the given section
|
SiteInfo |
getSiteInfo()
get the general siteinfo
|
String |
getSiteurl() |
String |
getVersion()
get the Version of this Mediawiki
|
void |
init(String siteurl,
String scriptPath)
overrideable method to do pre setup stuff
|
boolean |
isDebug()
get the state of the debug mode
|
boolean |
isLoggedIn()
check whether there is a User logged In
|
boolean |
isThrowExceptionOnError()
are exceptions thrown when an api error code is received?
|
Login |
login(String username,
String password)
login the given user with the given password
See API:Login
|
void |
logout()
Log the current user out See API:Logout
|
String |
normalizeTitle(String title)
normalize the given page title
|
void |
setDebug(boolean pDebug)
set the debug mode
|
void |
setProtectionMarker(String protectionMarker)
set the given protectionMarker for this wiki if a page has this
protectionMarker and edit will not be done
|
void |
setScriptPath(String scriptPath)
set the scriptPath of this Wiki
|
void |
setSiteurl(String siteurl)
set the siteurl
|
void |
setThrowExceptionOnError(boolean throwExceptionOnError)
set to true if exceptions should be thrown when api error codes are
received default is true
|
void |
upload(File file,
String filename,
String pageContent,
String comment)
Uploads an image.
|
void |
upload(Ii ii,
String fileName,
String pageContent)
upload the image described in the given imageinfo
|
String getSiteurl()
void setSiteurl(String siteurl) throws Exception
siteurl
- Exception
- - if the url is not o.k.void setScriptPath(String scriptPath)
scriptPath
- - the scriptPath to setString getScriptPath()
String getVersion() throws Exception
Exception
SiteInfo getSiteInfo() throws Exception
Exception
Ii getImageInfo(String pageTitle) throws Exception
pageTitle
- - the pageTitle to get the ImageInfo forException
void init(String siteurl, String scriptPath) throws Exception
siteurl
- - the url to usescriptPath
- - the script path to useException
Login login(String username, String password) throws Exception
username
- password
- Exception
boolean isLoggedIn()
void logout() throws Exception
Exception
String getPageContent(String pageTitle) throws Exception
pageTitle
- Exception
String getPageHtml(String pageTitle) throws Exception
pageTitle
- Exception
List<Im> getImagesOnPage(String pageTitle, int imLimit) throws Exception
pageTitle
- imLimit
- Exception
String getSectionText(String pageTitle, int sectionNumber) throws Exception
pageTitle
- sectionNumber
- Exception
Delete delete(String title, String reason) throws Exception
title
- reason
- Exception
Edit edit(String pagetitle, String text, String summary) throws Exception
text
- the text of the pagepagetitle
- the title of the pagesummary
- the edit summary. Summaries longer than 200 characters are
truncated server-side.Exception
- - if the edit failsgetPageContent(java.lang.String)
Edit edit(String pageTitle, String text, String summary, boolean minor, boolean bot, int sectionNumber, String sectionTitle, Calendar basetime) throws Exception
pageTitle
- text
- summary
- minor
- - true if this is a minor editbot
- whether to mark the edit as a bot edit (ignored if one does not
have the necessary permissions)sectionNumber
- the section to edit. Use -1 to specify a new section and -2 to
disable section editing.sectionTitle
- the title of a new sectionbasetime
- the timestamp of the revision on which text is based,
used to check for edit conflicts. null disables this.Exception
getPageContent(java.lang.String)
void upload(File file, String filename, String pageContent, String comment) throws Exception
file
- the image filefilename
- the target file name (may contain File)pageContent
- the contents of the image description page, set to "" if
overwriting an existing filecomment
- an upload summary (defaults to contents, use "" to not
specify one)Exception
- - if the upload failsvoid upload(Ii ii, String fileName, String pageContent) throws Exception
ii
- fileName
- pageContent
- the contents of the image description page, set to "" if
overwriting an existing fileException
List<P> getAllPages(String apfrom, int aplimit) throws Exception
apfrom
- - may be null or emptyaplimit
- Exception
List<Img> getAllImagesByTimeStamp(String aistart, String aiend, int ailimit) throws Exception
aistart
- - start time stampaiend
- - end time stampailimit
- - how many images to getException
List<S> getSections(String pageTitle) throws Exception
pageTitle
- Exception
void setProtectionMarker(String protectionMarker)
protectionMarker
- Edit copyToWiki(MediawikiApi targetWiki, String pageTitle, String summary) throws Exception
targetWiki
- - the other wiki (could use a different API implementation ...)pageTitle
- - the title of the page to copysummary
- - the summary to useException
boolean isThrowExceptionOnError()
void setThrowExceptionOnError(boolean throwExceptionOnError)
throwExceptionOnError
- the throwExceptionOnError to setString getIsoTimeStamp()
void setDebug(boolean pDebug)
pDebug
- boolean isDebug()
String normalizeTitle(String title) throws Exception
title
- - a raw page titleException
List<Bl> getBacklinks(String pageTitle, String params, int limit) throws Exception
pagetitle
- params
- - extra paramsException
List<Iu> getImageUsage(String imageTitle, String params, int limit) throws Exception
imageTitle
- params
- - extra paramsException
Copyright © 2018 BITPlan GmbH. All rights reserved.