forked from clearscene/opendias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI
820 lines (783 loc) · 27.9 KB
/
API
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
<?xml version='1.0' encoding='utf-8'?>
<API>
<version>20130206001</version>
<GeneralHelp>
<Section type='request'>
<title>Request method</title>
<body>Any of the API calls can be make invoked by making an HTTP POST request to the "/opendias/dynamic" entry point, over the port that the application is running on. Usually this would be done via an AJAX call on a webpage, but could just as easily be make from any application. eg, this is a call to invoke a new scanning operation from bash.</body>
<example><![CDATA[telnet localhost 8988 <<__endjob
POST /opendias/dynamic HTTP/1.1
Host: localhost:8988
User-Agent: Mozilla/5.0
Accept: application/xml, text/xml, */*
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Cookie: role=2; realname=Test User; o_session_id=2dcd2815-34a0-4d24-b392-c49ee5718b60
X-Requested-With: XMLHttpRequest
Referer: http://localhost:8988/opendias/acquire.html
Content-Length: 100
Pragma: no-cache
Cache-Control: no-cache
action=doScan&deviceid=test%3A0&format=Grey+Scale&pages=1&&resolution=300&ocr=-&pagelength=100
__endjob]]></example>
</Section>
<Section type='authentication'>
<title>Authentication</title>
<body>After login (see 'checkLogin' API call), openDias will return a session id (o_session_id) via a cookie. This cookie must be returned with each request to the server in order for privileges to be used.</body>
</Section>
<Section type='response'>
<title>Responses</title>
<body>--- some text here ---</body>
</Section>
<Section type='error'>
<title>Error Response</title>
<body>Any of the API calls could return an error message. Fontends should check for this error and take appropriate action.</body>
<example><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<error /> - a message describing the problem
</Response>]]></example>
</Section>
<Section type='fields'>
<title>Field Mappings</title>
<body> <![CDATA[<h4>Scan Status</h4>
<table>
<tr><th>status id</th><th>code constant</th><th>supporting data will contain</th></tr>
<tr><td>0</td><td>SCAN_IDLE</td><td> </td></tr>
<tr><td>1</td><td>SCAN_INTERNAL_ERROR</td><td> </td></tr>
<tr><td>2</td><td>SCAN_DB_WORKING</td><td> </td></tr>
<tr><td>3</td><td>SCAN_DB_ERROR</td><td>DB error code</td></tr>
<tr><td>4</td><td>SCAN_WAITING_ON_SCANNER</td><td> </td></tr>
<tr><td>5</td><td>SCAN_ERRO_FROM_SCANNER</td><td>SANE error code</td></tr>
<tr><td>6</td><td>SCAN_SCANNING</td><td>Current progress</td></tr>
<tr><td>7</td><td>SCAN_WAITING_ON_NEW_PAGE</td><td>Waiting for page [x]</td></tr>
<tr><td>8</td><td>SCAN_TIMEOUT_WAITING_ON_NEW_PAGE</td><td> </td></tr>
<tr><td>9</td><td>SCAN_CONVERTING_FORMAT</td><td> </td></tr>
<tr><td>10</td><td>SCAN_ERROR_CONVERTING_FORMAT</td><td>FreeImage error code</td></tr>
<tr><td>11</td><td>SCAN_PERFORMING_OCR</td><td> </td></tr>
<tr><td>12</td><td>SCAN_ERROR_PERFORMING_OCR</td><td>xxxxxx error code</td></tr>
<tr><td>13</td><td>SCAN_SANE_BUSY</td><td>used to be FIXING_SKEW</td></tr>
<tr><td>14</td><td>SCAN_RESERVED_1</td><td> </td></tr>
<tr><td>15</td><td>SCAN_RESERVED_2</td><td> </td></tr>
<tr><td>16</td><td>SCAN_FINISHED</td><td>id of the saved doc</td></tr>
<table>
<h4>Document Types</h4>
<table>
<tr><th>type id</th><th>Document Type</th></tr>
<tr><td>1</td><td>ODF Document</td></tr>
<tr><td>2</td><td>Scanned Document</td></tr>
<tr><td>3</td><td>PDF Document</td></tr>
<tr><td>4</td><td>Imported Image</td></tr>
</table>
<h4>OCR language</h4>
<table>
<tr><th>ocr</th><th>Language</th></tr>
<tr><td>eng</td><td>International English</td></tr>
<tr><td>deu</td><td>German</td></tr>
<tr><td>fra</td><td>French</td></tr>
<tr><td>spa</td><td>Spanish</td></tr>
<tr><td>ita</td><td>Italian</td></tr>
<tr><td>nld</td><td>Dutch</td></tr>
<tr><td>por</td><td>Brasilian Portuguese</td></tr>
<tr><td>vie</td><td>Vietnamese</td></tr>
</table>
<h4>Sorting Fields</h4>
<table>
<tr><th>field id</th><th>Field</th></tr>
<tr><td>0</td><td>docid</td></tr>
<tr><td>1</td><td>title</td></tr>
<tr><td>2</td><td>doc type</td></tr>
<tr><td>3</td><td>date</td></tr>
</table> ]]> </body>
</Section>
</GeneralHelp>
<ApiSpec>
<ApiCall>
<call_name>getScanningProgress</call_name>
<calls_method>pageRender::getScanningProgress()</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: getScanningProgress()</caller>
</KnownCallers>
<purpose>Read the state of an asynchronous scan.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>Fixed string 'getScanningProgress'</value>
</Input>
<Input>
<name>scanprogressid</name>
<value>The uuid of the scanning process (as returned by 'doScan')</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<ScanningProgress>
status* - the current action being done by the system
value - representation of how far along the action being done, is.
</ScanningProgress>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>nextPageReady</call_name>
<calls_method>pageRender::nextPageReady()</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Signal to the application that the user has correctly placed the next page for scanning.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'nextPageReady'</value>
</Input>
<Input>
<name>scanprogressid</name>
<value>The uuid of the scanning process (as returned by 'doScan')</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<NextPageReady>
result - indication if the next page command was accepted, currently a fixed string 'ok'
</NextPageReady>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>getScannerList</call_name>
<calls_method>pageRender::getScannerList()</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Get a list of scanners that the application can use.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'getScannerList'</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<ScannerList cached='true'> -- optional param, present if data is returned from the cache
<Devices>
<Device>
<Formats>
format - the format that a scan can be performed in. currently only fixed string 'grey scale'
...
</Formats>
type - sane text that describes the scanning device (eg 'flat bed')
vendor - sane text that names the scanning device
model - sane text that names the scanning device
host - text representation of the location of the scanner
name - the machine id for the scanning device
</Device>
...
</Devices>
</ScannerList>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>getScannerDetails</call_name>
<calls_method>pageRender::getScannerDetails()</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Get the available attributes for a given scanner.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'getScannerDetails'</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<ScannerDetails>
<Resolution>
default - the default resolution
min - the minimum resolution allowed by the scanning device
max - the maximum resolution allowed by the scanning device
</Resolution>
<OCRLanguages>
lang - the ocr language key
...
</OCRLanguages>
phash - indicator if 'find similar' is available
</ScannerDetails>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>doScan</call_name>
<calls_method>pageRender::doScan()</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Starts a scanning process.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string "doScan",</value>
</Input>
<Input>
<name>deviceid</name>
<value>The sane device id, as provided by getScannerList - Response.ScannerList.Devices.Device.name</value>
</Input>
<Input>
<name>format</name>
<value>The format to use for scanning, one of getScanningList - Response.ScanningList.Devices.Device.Formats.format</value>
</Input>
<Input>
<name>pages</name>
<value>The number of pages that make up the document,</value>
</Input>
<Input>
<name>resolution</name>
<value>The resolution to set the scanner to, between Response.ScannerList.Devices.Device.min and Response.ScannerList.Devices.Device.max,</value>
</Input>
<Input>
<name>ocr</name>
<value>Flag to indicate if an OCR process should be performed and in what language,</value>
</Input>
<Input>
<name>pagelength</name>
<value>The length of the page to scan, Percent, in relation to the maximum available by the scanner.</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
</Response>
</DoScan>
scanuuid - The application uniq id for the scanning process.
</DoScan>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>docFilter</call_name>
<calls_method>pageRender::docFilter</calls_method>
<KnownCallers>
<caller>openDias.filter.js :: anonymous()</caller>
</KnownCallers>
<purpose>Get a list of documents that fit a specific set of criteria</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'docFilter'</value>
</Input>
<Input>
<name>subaction</name>
<value>Get all details or just the count of matching docs ['count','fullList']</value>
</Input>
<Input>
<name>textSearch</name>
<value>Text that a document must match (title or ocr text)</value>
</Input>
<Input>
<name>isActionRequired</name>
<value>If 'true' return only records that are marked as 'action required'.</value>
</Input>
<Input>
<name>startDate</name>
<value>The first date that a document could fit into</value>
</Input>
<Input>
<name>endDate</name>
<value>The last date that a document could fit into</value>
</Input>
<Input>
<name>tags</name>
<value>Comma delimetered list of tagnames.</value>
</Input>
<Input>
<name>page</name>
<value>The number of 'range' offsets to apply before the first returned row.</value>
</Input>
<Input>
<name>range</name>
<value>The number of records to return in a single request.</value>
</Input>
<Input>
<name>sortfield*</name>
<value>Order the results by column</value>
</Input>
<Input>
<name>sortorder</name>
<value>present results in ascending/descending order ['0','1']</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<DocFilter>
count - The count of matching documents
page - The requested page
<Results>
docid - the document id of a found document
actionrequired - indicator flag
title - the user defined title of the found document
type* - the style of document
date - the user defined date of the found document
</Results>
</DocFilter>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>getAudio</call_name>
<calls_method>[stump - not currently implemented]</calls_method>
<KnownCallers>
<caller>openDias.loadDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Get the web accessible filename that contains the read OCR</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'getAudio'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<Audio>
filename - the filename that contains the audio of the selected doc
</Audio>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>getDocDetail</call_name>
<calls_method>docEditor::getDocDetail</calls_method>
<KnownCallers>
<caller>openDias.loadDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Get all the current information about a document</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'getDocDetail'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<DocDetail>
docid - the docid of the selected doc
title - the user defined title of the selected doc (a default text is provided if NULL)
extractedText - the OCR text of the selected doc
docDate - the user defined date of the selected doc
scanDate - the date that the document was added to the application.
type* - the style of document
pages - the number of pages used by the document
actionrequired - indication if the document has been flagged as requiring an action
hardcopyKept - indication if the original document has been retained
x - the number of horizontal pixel required by the document
y - the number of lines required by the document
<Taqs>
tag - the name of the assigned tag
...
</Tags>
<DocLinks>
<doc>
targetDocid - the docid of the linked doc
targetTitle - the user defined title of the linked doc (a default text is provided if NULL)
</doc>
...
</DocLinks>
</DocDetail>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>updateDocDetails</call_name>
<calls_method>docEditor::updateDocDetails</calls_method>
<KnownCallers>
<caller>openDias.saveDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Update a documents field with a specific value.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'updateDocDetails'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
<Input>
<name>kkey</name>
<value>the name of the field that is being updated ['ocrtext','title','docDate','actionrequired','hardcopyKept']</value>
</Input>
<Input>
<name>vvalue</name>
<value>the new value to set the field to</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<UpdateDocDetails>
status - indication of the update process - currently a static string 'OK'
</UpdateDocDetails>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>moveTag</call_name>
<calls_method>docEditor::updateTagLinkage</calls_method>
<KnownCallers>
<caller>openDias.saveDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Updates links between documents n tags, and document n documents</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'moveTag'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
<Input>
<name>tag</name>
<value>the tag that is being (un)linked</value>
</Input>
<Input>
<name>subaction</name>
<value>flag to indicate if the tag should be added or removed ['addTag','removeTag','addDoc','removeDoc']</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<MoveTag>
status - indication of the update process - currently a static string 'OK'
</MoveTag>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>deleteDoc</call_name>
<calls_method>docEditor::doDelete</calls_method>
<KnownCallers>
<caller>openDias.saveDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Removes a document from the database and scanned images store.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'deleteDoc'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<DeleteDoc>
status - indication of the update process - currently a static string 'OK'
</DeleteDoc>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>regenerateThumb</call_name>
<calls_method>import_doc::extractThumbnail</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Creates a thumbnail of PDF documents (some PDFs imported with earlier version of openDias did not have a thumbnail created for them at import time)</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'regenerateThumb'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<RegenerateThumb>
status - indication of the update process - currently a static string 'OK'
</RegenerateThumb>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>checkLogin</call_name>
<calls_method>pageRender::checkLogin</calls_method>
<KnownCallers>
<caller>openDias.userdetails.js :: loginbutton</caller>
</KnownCallers>
<purpose>Checks login details and assigns the user role to the session, on success</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'checkLogin'</value>
</Input>
<Input>
<name>username</name>
<value>The username to login with</value>
</Input>
<Input>
<name>password</name>
<value>The usernames password</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<Login>
result - Was login successful ['OK','FAIL']
message - User message when result was 'FAIL'
retry_throttle - The number of seconds that must pass before a further login attempt will be accepted.
</Login>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>logout</call_name>
<calls_method>pageRender::doLogin</calls_method>
<KnownCallers>
<caller>openDias.userdetails.js :: logoutbutton</caller>
</KnownCallers>
<purpose>Removes any user specific information from the session</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'logout'</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<Logout>
result - Was login successful ['OK','FAIL']
</Logout>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>updateUser</call_name>
<calls_method>pageRender::updateUser</calls_method>
<KnownCallers>
<caller>openDias.accessControls.js :: anonymous()</caller>
</KnownCallers>
<purpose>Update a user with new details</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'updateUser'</value>
</Input>
<Input>
<name>username</name>
<value>the username to update or the fixed string '[current]'</value>
</Input>
<Input>
<name>realname</name>
<value>(optional) The new realname of the updated user</value>
</Input>
<Input>
<name>password</name>
<value>(optional) The new password of the updated user</value>
</Input>
<Input>
<name>role</name>
<value>(optional) The new role of the updated user (not available for '[current]')</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<UpdateUser>
result - Was login successful ['OK','FAIL']
</UpdateUser>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>createUser</call_name>
<calls_method>pageRender::createUser</calls_method>
<KnownCallers>
<caller>openDias.accessControls.js :: anonymous()</caller>
</KnownCallers>
<purpose>Create a new user</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'createUser'</value>
</Input>
<Input>
<name>username</name>
<value>the username to create</value>
</Input>
<Input>
<name>realname</name>
<value>The new realname of the user</value>
</Input>
<Input>
<name>password</name>
<value>The new password of the user</value>
</Input>
<Input>
<name>role</name>
<value>The new role of the user</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<CreateUser>
result - Was login successful ['OK','FAIL']
</CreateUser>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>deleteUser</call_name>
<calls_method>pageRender::deleteUser</calls_method>
<KnownCallers>
<caller>openDias.accessControls.js :: anonymous()</caller>
</KnownCallers>
<purpose>Remove the user from the system</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'deleteUser'</value>
</Input>
<Input>
<name>username</name>
<value>the username to delete</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<DeleteUser>
result - Was login successful ['OK','FAIL']
</DeleteUser>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>getUserList</call_name>
<calls_method>pageRender::getUserList</calls_method>
<KnownCallers>
<caller>openDias.accessControls.js :: anonymous()</caller>
</KnownCallers>
<purpose>Provides a list of configured users on the system.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'getUserList'</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<GetUserList>
<Users>
<User>
username - the users user-id
realname - the users chosen 'display name'
last_access - the date the user last logged on
role - the users assigned role
</User>
</Users>
</GetUserList>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>checkForSimilar</call_name>
<calls_method>pageRender::checkForSimilar</calls_method>
<KnownCallers>
<caller>openDias.loadDetails.js :: anonymous()</caller>
</KnownCallers>
<purpose>Find other documents that 'look' the same as this one.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'checkForSimilar'</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[<?xml version='1.0' encoding='utf-8'?>
<Response>
<CheckForSimilar>
<Docs>
<Doc>
docid - the id of the matching doc
distance - how confident is the match [1 .. 100] lower the better
title - the title of a similar doc
<Taqs>
tag - the name of the assigned tag
...
</Tags>
</Doc>
...
</Docs>
</CheckForSimilar>
</Response>]]></example>
</ApiCall>
<ApiCall>
<call_name>tagsAutoComplete</call_name>
<calls_method>pageRender::tagsAutoComplete</calls_method>
<KnownCallers>
<caller>openDias.loadDetails.js :: autocomplete function()</caller>
</KnownCallers>
<purpose>Complete a tagname from the start of the name.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'tagsAutoComplete'</value>
</Input>
<Input>
<name>startsWith</name>
<value>the beginning of the tags to return.</value>
</Input>
<Input>
<name>docid</name>
<value>the documents id</value>
</Input>
</Inputs>
<example type='result'><![CDATA[{"results":[
{"tag":"%s"},
...
]}]]></example>
</ApiCall>
<ApiCall>
<call_name>titleAutoComplete</call_name>
<calls_method>pageRender::titleAutoComplete</calls_method>
<KnownCallers>
<caller>openDias.loadDetails.js :: autocomplete function()</caller>
</KnownCallers>
<purpose>Complete a title from the start of the name.</purpose>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'titleAutoComplete'</value>
</Input>
<Input>
<name>startsWith</name>
<value>the beginning of the titles to return.</value>
</Input>
<Input>
<name>notLinkedTo</name>
<value>(optional) Do not return document with this docid, or documents linked to this docid</value>
</Input>
</Inputs>
<example type='result'><![CDATA[{"results":[
{"docid":"%s","title":"%s"},
...
]}]]></example>
</ApiCall>
<ApiCall>
<call_name>uploadfile</call_name>
<calls_method>import_doc::uploadfile</calls_method>
<KnownCallers>
<caller>openDias.acquire.js :: anonymous()</caller>
</KnownCallers>
<purpose>Uploads a file, determines its type and includes PDF, ODF and JPEG docs into the document store.</purpose>
<encoding>The form submitting this request should not be an AJAX request, but instead a form submission with encoding of enctype="multipart/form-data"</encoding>
<Inputs>
<Input>
<name>action</name>
<value>fixed string 'uploadfile'</value>
</Input>
<Input>
<name>uploadfile</name>
<value>(of type 'file') the filename/data of the file being imported</value>
</Input>
</Inputs>
<encoding>An HTML page which redirect the user to the imported doc detail page.</encoding>
</ApiCall>
</ApiSpec>
</API>