info.bliki.api
Class MediaWikiComm

java.lang.Object
  extended by info.bliki.api.MediaWikiComm

public class MediaWikiComm
extends java.lang.Object

Sources adopted from the article Add Java extensions to your wiki with permission from Randall Scarberry.

Author:
R. Scarberry

Nested Class Summary
static class MediaWikiComm.ConcurrentEditException
          Special case of IOException to be thrown when saving data to the server fails because another user saved data.
 
Constructor Summary
MediaWikiComm(java.lang.String pageURL, java.lang.String[] cookiePairs)
          Constructor
 
Method Summary
 info.bliki.api.MediaWikiComm.EditFormData loadEditFormData(java.lang.String title)
          Method which loads downloads the data from the wiki page.
 boolean login(java.lang.String user, java.lang.String password, boolean remember)
          Log-in
 boolean logout()
           
 void saveData(java.lang.String title, java.lang.String newEditText)
          Saves data back to the wiki page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaWikiComm

public MediaWikiComm(java.lang.String pageURL,
                     java.lang.String[] cookiePairs)
Constructor

Parameters:
pageURL - the page URL
cookiePairs - cookies to be included in every server request
Method Detail

loadEditFormData

public info.bliki.api.MediaWikiComm.EditFormData loadEditFormData(java.lang.String title)
                                                           throws java.io.IOException
Method which loads downloads the data from the wiki page.

Returns:
an instance of EditFormData, which encapsulates the important elements of the page's editform.
Throws:
java.io.IOException

saveData

public void saveData(java.lang.String title,
                     java.lang.String newEditText)
              throws java.io.IOException
Saves data back to the wiki page.

Parameters:
settings - an array of ClusteringDemoSettings object, which are converted into a block of XML and embedded on the page.
Throws:
java.io.IOException

login

public boolean login(java.lang.String user,
                     java.lang.String password,
                     boolean remember)
              throws UnexpectedAnswerException,
                     MethodException
Log-in

Parameters:
loginUrl -
actionUrl -
user -
password -
remember -
Returns:
true is the login succeeds
Throws:
UnexpectedAnswerException
MethodException

logout

public boolean logout()
               throws UnexpectedAnswerException,
                      MethodException
Throws:
UnexpectedAnswerException
MethodException


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.