1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
Dokujclient is both a command line tool to interact with instances of Dokwiki,
and a Java library for [Dokuwiki xmlrpc interface](https://www.dokuwiki.org/devel:xmlrpc)
which is also compatible with Android.
Currently tested with:
* Elenor of Tsort (dokuwiki-2016-06-26)
* Detritus (dokuwiki-2015-08-10)
* Hrun (dokuwiki-2014-09-29)
* Ponder Stibbons (dokuwiki-2014-05-05)
* Binky (dokuwiki-2013-12-08)
* Weatherwax (dokuwiki-2013-05-10)
* Adora Belle (dokuwiki-2012-10-03)
* Angua (dokuwiki-2012-01-25b)
See the "Compatibility" section for more info
Command line tool
=================
Getting started
---------------
Here's a glimpse of what this tool can do:
dokujclient --user myUser --password myPassword --url http://mywiki/lib/lib/exe/xmlrpc.php getTitle
> myWiki title
dokujclient help
> [(-u|--user) <user>] --url <url> [(-p|--password) <password>] [-h|--help] [--version] [--password-interactive] command
>
> Available commands:
> [...skipped...]
#put user, password, and url, in the config file
vim ~/.dokujclientrc
#get the list of pages of all the wiki
dokujclient getPagelist .
> [...skipped...]
dokujclient appendPage builds:synthesis "Build launched at 12:23 took 3'24"
dokujclient getPage builds:synthesis
> Build launched at 11:12 took 3'19
> Build launched at 12:23 took 3'24
#help command can give information about a given command
dokujclient help putAttachment
> Syntax for putAttachment: [-f|--force] <attachmentId> <localFile>
dokujclient putAttachment some:file.jpg ~/results.jpg
Just make sure that your wiki is configured so that the xmlrpc interface is enabled, and so that your user is allowed to use it (ie: "remote" and "remoteuser" entries in your configuration).
Installation
------------
It may be installed from the packages on debian testing:
sudo apt-get install dokujclient
On other platforms you may:
* Download the [binaries](http://turri.fr/dokujclient).
* Extract it, and add the extracted directoy to your path
* Ensure it's correctly installed, typing e.g.:
dokujclient --version
Config file
-----------
To avoid typing your url, user, and password each time, you may create in your home a .dokujclientrc,
and put some or all of this info in it.
echo "url=http://myhost/mywiki/lib/exe/xmlrpc.php" > ~/.dokujclientrc
echo "user=toto" >> ~/.dokujclientrc
echo "password=myPassword" >> ~/.dokujclientrc
dokuJClient.jar
==========
If you want to build your own application, if you don't want to deal with xmlrpc requests yourself,
or if you don't want to handle the different versions of Dokuwiki, you may use this library.
Getting started
---------------
Everything is done through the DokuJClient: just create one and play with its methods.
Here is a quick example which displays the title of the wiki and the list of its pages:
import dw.xmlrpc.DokuJClient;
import dw.xmlrpc.Page;
public class Main {
public static void main(String[] args) throws Exception{
String url = "http://mywiki/lib/exe/xmlrpc.php";
String user = "myUser";
String pwd = "myPassword";
DokuJClient client = new DokuJClient(url, user, pwd);
System.out.println("Pages in the wiki " + client.getTitle() + " are:");
for(Page page : client.getAllPages()){
System.out.println(page.id());
}
}
}
Make sure to add the jar listed in the Dependencies section below, as well as dokujclient.jar to your classpath.
Also make sure to configure your wiki so that xmlrpc interface is enabled, and so that your user is
allowed to use it (ie: "remote" and "remoteuser" entries in your configuration)
Getting the binaries
--------------------
JAR files are available via [Maven Central](http://repo1.maven.org/maven2/fr/turri/):
```xml
<dependency>
<groupId>fr.turri</groupId>
<artifactId>dokujclient</artifactId>
<version>3.8.0</version>
</dependency>
```
Binaries may alse be [downloaded](http://turri.fr/dokujclient) directly.
To build them from the sources, see below.
Compiling from the command line
-------------------------------
On ubuntu, at the root of the project run:
# You need maven to compiler
sudo apt-get install maven
#Actually build
mvn package
It will generate in the directory `target` a dokujclient-x.y.z-bin.zip which contains
both the .jar and the executable command line tool
Hacking with Eclipse
--------------------
This project uses Maven. To be able [to use Eclipse](http://maven.apache.org/guides/mini/guide-ide-eclipse.html) you should:
# Install Maven
sudo apt-get install maven
# Set the M2_REPO classpath variable
mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
# Generate the Eclipe project files
mvn eclipse:eclipse
To use the Eclipse projet, you need to ensure every dependencies are available.
Just compile once from the command line (see above) to ensure it will be ok.
Documentation
------------
To build documentation you must have doxygen installed. Then, run at the root of the repo:
mvn javadoc:javadoc
To browse the generated docs, point your browser to target/site/apidocs/index.html
You may also directly [browse it](http://turri.fr/dokujclient/doc) online.
Running integration tests
--------------------------
To run the tests you'll need to set up a fake wiki.
Please see src/test/resources/README.md to know how to set it up.
After that, to run the tests, just run, at the root of the repo:
mvn test
You can also run
mvn site
in order to generate a test report and a test coverage report.
Compatibility
=============
dokuJClient aims at providing the same behavior for every supported version of Dokuwiki.
There are however, some discrepancies:
* getAttachmentInfo can't retrieve the page title with Angua (dokuwiki-2012-01-25b). It will set it to the page id instead
* addAcl and delAcl are supported for dokuwiki-2013-12-08 (Binky) or newer
* logoff will always clear the local cookies, but it will clear the server side ones only if you have dokuwiki-2014-05-05 (Ponder Stibbons) or a more recent one
Mailing list
============
The mailing list is oriented toward development and usage of DokuJClient. You can subscribe and unsubscribe from https://www.freelists.org/list/dokujclient
After subscribing, messages can be sent to dokujclient@freelists.org
Donate
======
Dokujclient is a personal open source project started in 2012. I have put hundreds of hours to maintain and enhance it. Donations to Dokujclient will help support bugfix, keeping up to date with the evolutions of Dokuwiki xmlrpc interface, and adding new features. If you have found this tool useful, consider [donating](https://pledgie.com/campaigns/29371), to help for its development.
|