VPWiki API Version 0.5.1
Copyright 2003 August Mueller, Michael P. Wilson
- All keys in structs are case sensitive.
- All strings are passed as utf-8, and not ascii per the xml-rpc update on 6/30/2003: http://xmlrpc.com/spec#update3
- Anywhere you see the word Vector, you can interchange it with "Array" or "List" depending on what language you prefer.
This is the array data type as defined in the xml-rpc spec.
- Anywhere you see the word Hashtable, you can interchange it with "Struct" or "Dictionary" or "Map" depending on what language you prefer.
This is the struct data type as defined in the xml-rpc spec.
pageStruct
a page struct holds the contents of a page.
It's a Hashtable that holds at the minimum, the following entries:
Here is what a python implementation might look like:
pageStruct = { 'key': 'homepad', #string 'page':'Welcome to my personal wiki... etc', #string 'version': 5 #int 'lastModified': 'Thu Aug 21 20:06:38 2003' #date }
A pageStruct may also contain more keys than what are listed.
For example, In the case of VoodooPad 1.1, it's going to send over more values.
Here is what VoodooPad 1.1 sends across:
pageStruct = { 'key': 'homepad', #string 'page':'Welcome to my personal wiki... etc', #string 'version': 5 #int 'lastModified': 'Thu Aug 21 20:06:38 2003' #date 'rulerIsShowing': No #boolean 'title': 'homepad' #string 'data': <rtfd data> #binary/base64 'alias': 'homepad' #alias }Note: the extra entries should really be marked with something like voodoopad_ in front of the key name.
authToken
An authToken is a string that represents the current session. What it looks like is implementation specific.
import xmlrpclib vpwiki = xmlrpclib.Server('http://somewhere.com/some_endpoint.cgi').vpwiki authToken = vpwiki.logon("foo wiki", "scott", "tiger")You would then use the value returned from authToken in the calls to the other methods.
Method Summary | |
java.util.Hashtable |
getAttachment(java.lang.String authToken,
java.lang.String pageName,
java.lang.String attachmentName)
Returns the requested attatchment as a Hashtable. |
java.util.Vector |
getBackLinks(java.lang.String authToken,
java.lang.String pageName)
Get a Vector of the names of pages (as Strings) that point to the page pageName. |
java.util.Hashtable |
getImplementationMetaData(java.lang.String authToken,
java.lang.String metaDataKey)
Get various pieces of data from the server such as... |
java.util.Hashtable |
getPage(java.lang.String authToken,
java.lang.String pageName,
int version)
This method returns a pageStruct as described in the types section. |
java.util.Hashtable |
getPageInfo(java.lang.String authToken,
java.lang.String pageName,
int version)
This method is just like getPage, except the page is not returned in the struct. |
java.util.Vector |
getPageNames(java.lang.String authToken)
Get all the page names in the wiki. |
java.util.Vector |
getRecentChanges(java.lang.String authToken,
Date timestamp)
Get the names of the pages (as Strings in the returning array/vector) that have changed since the timestamp. |
java.util.Hashtable |
getRenderedPage(java.lang.String authToken,
java.lang.String pageName,
java.lang.String representation)
Return the page as something other than wiki text. |
java.util.Vector |
listAttachments(java.lang.String authToken,
java.lang.String pageName)
Returns a list of attatchments assigned to a page. |
boolean |
logoff(java.lang.String authToken)
Close the session and render the authToken useless. |
java.lang.String |
logon(java.lang.String repository,
java.lang.String user,
java.lang.String password)
Open a session for browsing/editing the wiki. |
boolean |
putAttachment(java.lang.String authToken,
java.lang.String pageName,
java.util.Hashtable attatchment)
Place an attachment to the page. |
int |
putPage(java.lang.String authToken,
java.util.Hashtable pageStruct)
Place a page in the repository, with at least the minimum keys described in pageStruct. |
Method Detail |
public java.lang.String logon(java.lang.String repository, java.lang.String user, java.lang.String password) throws XmlRPCException
repository
- the name of the repository to log into for editinguser
- the usernamepassword
- the password for the user
XmlRPCException
- if the login was unsucessful.public boolean logoff(java.lang.String authToken)
authToken
- the opaque authentication token
public java.util.Vector getRecentChanges(java.lang.String authToken, Date timestamp)
authToken
- the opaque authentication tokentimestamp
- the date to start looking forward from for changes.
public java.util.Vector getPageNames(java.lang.String authToken)
authToken
- the opaque authentication token
public java.util.Hashtable getPage(java.lang.String authToken, java.lang.String pageName, int version)
{ 'page':'Welcome to my personal wiki... etc', #string, the contents of the page 'version': 5, #int, the page revision number. 'lastModified': 'Thu Aug 21 20:06:38 2003' #date, the date the page was modified } Recommended but optional for the server to return: { 'lastModifiedBy':'ccgus', #string, the persion/thing that last modified the page }Use of the struct leaves optional client specifict data. (rtfd, alias data, etc.)
authToken
- the opaque authentication tokenpageName
- the name of the page to returnpublic java.util.Hashtable getPageInfo(java.lang.String authToken, java.lang.String pageName, int version)
{ 'version': 5, #int, the page revision number. 'lastModified': 'Thu Aug 21 20:06:38 2003' #date, the date the page was modified } Recommended but optional for the server to return: { 'lastModifiedBy':'ccgus', #string, the persion/thing that last modified the page }Use of the struct leaves optional client specifict data. (rtfd, alias data, etc.)
authToken
- the opaque authentication tokenpageName
- the name of the page to returnpublic int putPage(java.lang.String authToken, java.util.Hashtable pageStruct)
authToken
- the opaque authentication tokenpageStruct
- a Hashtable with the minimum keys and values as required by a pageStruct
public java.util.Vector listAttachments(java.lang.String authToken, java.lang.String pageName)
{ 'name':'Company Stationary.pdf', # string, the name of the attachment 'mimeType', 'application/pdf', # string, the mime type of the attatchment 'fileSize', 121224, # int, the size of the attatchment in bytes 'lastModified', 19980717T14:08:55 # date, the date of the last time the file was modified. }Questions:
authToken
- the opaque authentication tokenpageName
- the name of the page to get the attachment list of.
public java.util.Hashtable getAttachment(java.lang.String authToken, java.lang.String pageName, java.lang.String attachmentName)
{ 'name':'Company Stationary.pdf', # string, the name of the attachment 'mimeType', 'application/pdf', # string, the mime type of the attatchment 'lastModified', 19980717T14:08:55 # date, the date of the last time the file was modified. 'file', [binary data] # base64, the file. }
authToken
- the opaque authentication tokenpageName
- the name of the page to get the attachment fromattachmentName
- the name of the attachment to get.public boolean putAttachment(java.lang.String authToken, java.lang.String pageName, java.util.Hashtable attatchment)
{ 'name':'Company Stationary.pdf', # string, the name of the attachment 'mimeType', 'application/pdf', # string, the mime type of the attatchment 'file', [binary data] # base64, the file. }If the attachment does not already exist on the page, it is created.
authToken
- the opaque authentication tokenpageName
- the name of the page to set the attachment topublic java.util.Vector getBackLinks(java.lang.String authToken, java.lang.String pageName)
authToken
- the opaque authentication tokenpageName
- the name of the page to find links to.public java.util.Hashtable getRenderedPage(java.lang.String authToken, java.lang.String pageName, java.lang.String representation)
{ "content-type":"text/html", 'content': "<html><body>...</body></html>" }If the representation passed is "pdf" then the following would be returned:
{ "content-type":"application/pdf", 'content': [binary encoding for pdf] # passed via xml-rpc as base64 }And so on. The allowable values to pass for the representation would be server dependent, and discovered via the getImplementationMetaData method. Some other ideas for representation tokens would be rss, rtf/rtfd, or a word document.
authToken
- the opaque authentication tokenpageName
- the name of the page to find links to.representation
- the type of data to return
public java.util.Hashtable getImplementationMetaData(java.lang.String authToken, java.lang.String metaDataKey)