File: README.xmlrpc

package info (click to toggle)
xchm 2%3A1.23-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,180 kB
  • sloc: cpp: 4,260; sh: 3,704; makefile: 96; sed: 16
file content (55 lines) | stat: -rw-r--r-- 1,501 bytes parent folder | download | duplicates (11)
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
XmlRpc interface documentation

XmlRpc support enables 3rd party applications to issue load, change page, and 
close instructions to xCHM.

In order to make use of the XmlRpc support in xCHM you must configure with the
--enable-xmlrpc flag. You must also have the XmlRpc++ (0.7 or higher) library 
installed on your system. You can aquire this library at:
	http://xmlrpcpp.sourceforge.net/


Calls
param 1
0 - Shuts down xCHM

1 - Loads a chmfile specified by param 2, and an optional contextID as param 3

2 - Loads a specified contextID within the file as param 2

Results
0 - The request was not completed, this indicates a failure in the command. For
    example if the call (1,file,id) is made with a valid file, but invalid id
    the correct file will be loaded but the id will not be. Thus it will report
    that the request was not completed.

1 - The request was completed successfully.


Notes:

File paths are relative to the xCHM executable, thus full path names are  the 
recommended method for opening files via XmlRpc.

Example using Python:

Launch xCHM with the XmlRpc server activated
xchm --with-xmlrpc=port

Launch python
>>> import xmlrpclib

# establish connection to xCHM XmlRpc server
>>> s = xmlrpclib.Server('http://localhost:port')

# tell xCHM to open /path/to/sch/file.chm
>>> s.xCHM(1,'/path/to/chm/file.chm')
1 # success
#tell xCHM to load the contextID from the current file.
>>> s.xCHM(2,1234)
0 # failure
>>> s.xCHM(2,1235)
1 # success
# close xCHM
>>> s.xCHM(0)
1