public class Mediawiki extends MediaWikiApiImpl implements MediawikiApi
LOGGER, protectionMarker, throwExceptionOnError| Constructor and Description |
|---|
Mediawiki() |
| Modifier and Type | Method and Description |
|---|---|
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
|
General |
getGeneral()
get the siteinfo
|
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 wiki
|
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
|
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
|
void |
setDebug(boolean pDebug)
set the debug mode
|
void |
setScriptPath(String scriptPath)
set the scriptPath of this Wiki
|
void |
setSiteurl(String siteurl)
set the siteurl
|
void |
upload(File file,
String filename,
String contents,
String reason)
Uploads an image.
|
void |
upload(Ii ii,
String fileName,
String pageContent)
upload the image described in the given imageinfo
|
copyToWiki, decode, encode, fromXML, getProtectionMarker, handleError, handleError, handleError, isThrowExceptionOnError, normalizeTitle, setProtectionMarker, setThrowExceptionOnError, setVersionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopyToWiki, isThrowExceptionOnError, normalizeTitle, setProtectionMarker, setThrowExceptionOnErrorpublic String getSiteurl()
getSiteurl in interface MediawikiApipublic void setSiteurl(String siteurl) throws Exception
MediawikiApisetSiteurl in interface MediawikiApiException - - if the url is not o.k.public String getScriptPath()
MediawikiApigetScriptPath in interface MediawikiApipublic void setScriptPath(String scriptPath)
MediawikiApisetScriptPath in interface MediawikiApiscriptPath - the scriptPath to setpublic void init(String siteurl, String scriptPath) throws Exception
MediawikiApiinit in interface MediawikiApisiteurl - - the url to usescriptPath - - the script path to useExceptionpublic String getVersion() throws Exception
MediaWikiApiImplgetVersion in interface MediawikiApigetVersion in class MediaWikiApiImplExceptionpublic Login login(String username, String password) throws Exception
MediawikiApilogin in interface MediawikiApiExceptionpublic boolean isLoggedIn()
MediawikiApiisLoggedIn in interface MediawikiApipublic String getPageContent(String pageTitle) throws Exception
MediawikiApigetPageContent in interface MediawikiApiExceptionpublic String getPageHtml(String pageTitle) throws Exception
MediawikiApigetPageHtml in interface MediawikiApiExceptionpublic String getSectionText(String pageTitle, int sectionNumber) throws Exception
MediawikiApigetSectionText in interface MediawikiApiExceptionpublic void logout()
throws Exception
MediawikiApilogout in interface MediawikiApiExceptionpublic Edit edit(String pageTitle, String text, String summary) throws Exception
MediawikiApiedit in interface MediawikiApipageTitle - the title of the pagetext - the text of the pagesummary - the edit summary. Summaries longer than 200 characters are
truncated server-side.Exception - - if the edit failsMediawikiApi.getPageContent(java.lang.String)public Edit edit(String pageTitle, String text, String summary, boolean minor, boolean bot, int sectionNumber, String sectionTitle, Calendar basetime) throws Exception
MediawikiApiedit in interface MediawikiApiminor - - 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.ExceptionMediawikiApi.getPageContent(java.lang.String)public String getIsoTimeStamp()
MediawikiApigetIsoTimeStamp in interface MediawikiApipublic void setDebug(boolean pDebug)
MediawikiApisetDebug in interface MediawikiApipublic boolean isDebug()
MediawikiApiisDebug in interface MediawikiApipublic void upload(File file, String filename, String contents, String reason) throws Exception
MediawikiApiupload in interface MediawikiApifile - the image filefilename - the target file name (may contain File)contents - the contents of the image description page, set to "" if
overwriting an existing filereason - an upload summary (defaults to contents, use "" to not
specify one)Exception - - if the upload failspublic List<P> getAllPages(String apfrom, int aplimit) throws Exception
MediawikiApigetAllPages in interface MediawikiApiapfrom - - may be null or emptyExceptionpublic List<S> getSections(String pageTitle) throws Exception
MediawikiApigetSections in interface MediawikiApiExceptionpublic Ii getImageInfo(String pageTitle) throws Exception
MediawikiApigetImageInfo in interface MediawikiApipageTitle - - the pageTitle to get the ImageInfo forExceptionpublic void upload(Ii ii, String fileName, String pageContent) throws Exception
MediawikiApiupload in interface MediawikiApipageContent - the contents of the image description page, set to "" if
overwriting an existing fileExceptionpublic SiteInfo getSiteInfo() throws Exception
MediawikiApigetSiteInfo in interface MediawikiApigetSiteInfo in class MediaWikiApiImplExceptionpublic Delete delete(String title, String reason) throws Exception
MediawikiApidelete in interface MediawikiApiExceptionpublic List<Img> getAllImagesByTimeStamp(String aistart, String aiend, int ailimit)
MediawikiApigetAllImagesByTimeStamp in interface MediawikiApiaistart - - start time stampaiend - - end time stampailimit - - how many images to getpublic List<Bl> getBacklinks(String pageTitle, String params, int limit) throws Exception
MediawikiApigetBacklinks in interface MediawikiApiparams - - extra paramsExceptionpublic List<Iu> getImageUsage(String imageTitle, String params, int limit) throws Exception
MediawikiApigetImageUsage in interface MediawikiApiparams - - extra paramsExceptionpublic List<Im> getImagesOnPage(String pageTitle, int imLimit) throws Exception
MediawikiApigetImagesOnPage in interface MediawikiApiExceptionpublic List<Ii> getImageInfosForPage(String pageTitle, int limit) throws Exception
MediawikiApigetImageInfosForPage in interface MediawikiApiExceptionCopyright © 2018 BITPlan GmbH. All rights reserved.