Learn about DokuWiki
Learn about DokuWiki
This is an old revision of the document!
Compatible with DokuWiki
With this plugin users can conveniently communicate with DokuWiki's xmlrpc library. The user can then communicate with and exchange data between the local wiki and a remote wiki. It can access data on any DokuWiki, including the one which you are currently logged into by treating it as a remote. The xmlrpc library exposes many of the back-end elements of the wiki which may be of use in management.
At its simplest you enter the URL of the remote wiki into the
Remote URL text box, you select a query from the
Select query drop-down menu, and you click
Send query. So, for instance, if you select
getAllPages, the result will be a list of all the pages on the remote wiki. Often, however, queries require an id. For these, you enter the id in the
ID textbox. For example, if you enter a paged id, then select
listLinks, a list of all the links for that page, and their types, will be returned.
Send Querybutton for submitting the query.
http://www.example.comand the name of the wiki is
my_wiki, then you would enter
IDtext box. The id must be the complete id that identifies the page on the remote server, in other words, including the namespace. For an optional way to enter an id, see the section on action links below.
Query typesbutton will bring up a listing of query types and their options. Enter these options, in the order listed, separated by commas, in the
Optionstext box. Do not re-enter the
idin this additional list of options.
(option). See the
Query typeslisting for details on how to handle array options for specific queries.
Select querymenu. If you want to use one of those, then enter the complete listing, including the function name into the
Optionsbox. The function name must come first and then, in order listed, the options. They must all be separated by commas, including the function name. For instance:
Timestamps: Some queries require a timestamp as a parameter. Xcom will create the timestamp for you. Enter the date in the
Optionsbox in this format:
yyyy-mm-dd, for instance 2014-05-29.
There are three display views: HTML, Edit, and Code. These are all contained within an “Output” window. When the result of a query is displayed, this window opens and the contents of your query will appear in one of these three views, depending upon the output. More than one view can be open at any one time, so that, for instance, you can be looking at the markup for a page while also viewing it as HTML. You can close and re-open these views using the buttons at the top right of the screen. And you can close the Output window entirely.
Editview enables you to make changes to the markup and save it back to the remote wiki which, as noted above, could be the wiki you are currently logged into. It also enables you to add material to a page by appending.
HTML viewis used to display wiki pages and to display query results that can be conveniently formatted as HTML.
Code viewis preformatted text. It is used for simple plain text responses, error codes, and arrays from queries not in xcom's list of
In the status bar at the bottom of the screen there are command links which enable you to
Clear the contents from each of the three view windows.
Local save button makes it possible to move pages and media from the remote wiki to the local wiki. Enter the id of a remote page or media file into the
ID field and click the
Local save button. If you select a page id, the page and all of its referenced media will be copied to the local server. All will be copied to the correct namespaces, including the page itself. If, instead of a page id,you enter a media id, the media file will also be copied to the correct namespace.
To use this feature you must fill in the local user's xmlrpc user name and password in the text boxes. The local url will be automatically retrieved from the system.
There are several query types which return lists of pages and media with the ids in the first column. Among them are:
dokuwiki.getPagelistwill take a namespace in the
IDfield and return all the pages in that namespace.
wiki.getAllPageswill return all the pages on the remote wiki.
wiki_getAttachmentsreturns media files and behaves exactly as
dokuwiki.getPagelist. It takes a namespace in the ID field and requires a regular expression in the Options field. The regular expression must be placed between hashes and passed in as an array. For instance, if you want to get all PNG images in a namespace, you would enter the following expression in the options field:
dokuwiki.searchbehaves like DokuWiki's Search mechanism. It returns snippets of text with some highlighted matches and links to the pages where the matches occur which. Clicking these links accesses the pages with all their matches highlighted. The search text is entered as a string, e.g.
The ids of the first three query types are
Action links make it possible to act upon lists from either the local or the remote server.
If the results of a query is formatted as a table and the first column is headed
id, the first column is an action link. Clicking one of these can have one of two results:
You can create an initialization file,
xcom.ini, for automatic filling in of the remote site fields in the xcom dashboard. A
sample.xcom.ini is found in the scripts directory. Use of
xcom.ini is not required but it can be convenient. The file structure is based on the php.ini format:
[title] url=http://www.example.com/mywiki/ user=rpcuser pwd=rpcpwd
For each remote wiki that you work with, enter another data block. Only the title is required. The titles of these remote sites will appear in the drop-down menu, and when you select a menu item, the fields with entries will be entered into the remote wiki text boxes. The title entry must be set flush against the left-hand margin, i.e. no spaces between
[title] and margin.
The fact that the fields are optional means that you don't have to fill in the password field (or even user name). But as another security feature, you can move xcom.ini out of the web server's access. For this, there is a configuration option,
inidir, for setting an alternate directory for this file, and this can be anywhere on your server. But the file and its directory must of course be readable to PHP.
inidir: Alternate directory for xcom.ini
textbox_size: Size of Remote URL text box. Size is number of characters wide; this does not affect the number of characters that can be entered into the box. You may need this to adjust for browser layout width
local_url: Local IP address, e.g. http://192.168.0.5/dokuwiki. May be needed in some cases for local saves where the the dokuwiki is accessed by a local alias instead of its IP address. It may also be possible to use 127.0.0.1.