summaryrefslogtreecommitdiff
path: root/Architecture_and_Design/en-US/Administration_Panel.xml
blob: f02c4e5b79de3aa4ee18505d74312fa92854d789 (plain)
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
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Architecture_and_Design.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Architecture_and_Design-Administration_Panel">
    <title>Administration Panel</title>
    <para>
        The Kolab Groupware administration panel, a web interface to Kolab Groupware available for administrative purposes, will provide the functionality listed in this chapter.
    </para>
    <para>
        The Kolab Groupware Web Administration Panel is split in two parts;
    </para>
    <para>
        <orderedlist>
            <listitem>
                <para>
                    A web client interface,
                </para>

            </listitem>
            <listitem>
                <para>
                    An API backend interface.
                </para>

            </listitem>

        </orderedlist>

    </para>
    <para>
        The web client interface is nothing but a graphical representation of the API backend capabilities, allowing a user to navigate an interface to the administrative tasks the API backend exposes.
    </para>
    <para>
        This design allows other system management and corporate products to trigger Kolab Groupware administration tasks on an equal footing, and without the need to (re-)implement all of the Kolab Groupware logic.
    </para>
    <section id="sect-Architecture_and_Design-Administration_Panel-Configuration">
        <title>Configuration</title>
        <para>
            <itemizedlist>
                <listitem>
                    <para>
                        Configuration of the <xref linkend="form-Architecture_and_Design-Terminology-Kolab_Groupware_Primary_Domain" />
                    </para>

                </listitem>
                <listitem>
                    <para>
                        Configuration of the Kolab Groupware Administration Security Group
                    </para>

                </listitem>
                <listitem>
                    <para>
                        Configuration of Kolab Groupware Delegation Security Groups
                    </para>
                    <para>
                        Including the assignment of privileges delegated to delegation security groups, including;
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    Reset Password
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Disable User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    (Re-)enable User, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Alter user attributes (common name, display name, surname), if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete distribution lists and/or security groups, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete contact lists, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete contacts, if applicable
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Review logfiles, if applicable.
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Create, modify and/or delete domain aliases and/or domains
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Manage domain administrator groups
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </listitem>

            </itemizedlist>

        </para>

    </section>

    <section id="sect-Architecture_and_Design-Administration_Panel-Deployment">
        <title>Deployment</title>
        <para>
            TODO
        </para>

    </section>

    <section id="sect-Architecture_and_Design-Administration_Panel-Web_Administration_Panel_API">
        <title>Web Administration Panel API</title>
        <!--        <para>

<programlisting language="Python">
<xi:include href="http://git.kolab.org/pykolab/plain/kolabd.py" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
        </para>    --> <para>
            The web administration panel comes with an API in order to allow different, third-party interfaces, as well as the Kolab tool-chain to Kolab Groupware, to execute tasks of an administrative nature. The API uses JSON to exchange information with the API client.
        </para>
        <para>
            The calls to the Web API are made to a service handler, for its methods handle the request. A call therefore looks like <emphasis>&lt;service&gt;.&lt;method&gt;</emphasis>, which is a location beneath the base URL for the API.
        </para>
        <para>
            Suppose <ulink url="https://kolab-admin.example.org/api/" /> is the API base URL, then a call to service method <literal>system.authenticate</literal> would be a POST HTTP/1.1 request to <ulink url="https://kolab-admin.example.org/api/system.authenticate" />.
        </para>
        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-HTTP_Method_Convention">
            <title>HTTP Method Convention</title>
            <para>
                Two HTTP methods are used: GET and POST. The GET method is generally(!) used for read-only operations, whereas the POST method is used for write operations.
            </para>
            <para>
                For GET requests, the parameters (the payload) are appended to the URI requested, <ulink url="https://kolab-admin.example.org/api/domain.info?domain=example.org" />.
            </para>
            <note>
                <para>
                    This restricts GET requests to specifying key-value pairs of payload information only, even though a GET parameter key can be specified more then one, creating a list of values.
                </para>

            </note>
            <para>
                Some read-only operations, such as <literal>user.find_by_attributes</literal> require the request to pass along multiple attributes with, potentially, multiple search parameters. These types read-only requests are the exception to the rule of using GET for read-only requests, and use POST instead.
            </para>
            <para>
                For POST requests, the payload is a JSON-encoded dictionary (array) of parameter keys and values. Only strings are allowed as keys. Values for the payload may contain lists, strings, dictionaries (arrays), integers, floats, etc.
            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-Service_and_Method_Naming_Convention">
            <title>Service and Method Naming Convention</title>
            <para>
                In another rule-of-thumb we outline the naming convention for services and methods.
            </para>
            <para>
                Service names consist of an object name either in singular or plural form. The singular form depicts actions are placed against a single instance of an object, such as <literal>object.add</literal>, or at most one result entry is expected, such as <literal>object.find</literal>.
            </para>
            <para>
                The plural form depicts actions that are placed against multiple instances of an object, such as <literal>objects.list</literal> or <literal>objects.search</literal>, or expect zero, one or more result entries to be returned.
            </para>
            <para>
                Method names often imply an action is placed against one or more objects in one request. Certain actions may be confusing though. For these we have the following rules;
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <formalpara id="form-Architecture_and_Design-Service_and_Method_Naming_Convention-Finding_an_object">
                            <title>Finding an object</title>
                            <para>
                                The method <literal>find</literal> is always executed against the service with the singular form of the object name. The target of calling a <literal>find</literal> method is to obtain exactly zero or one instance of an object. The method should fail if the result set contains any number of objects not zero or one.
                            </para>

                        </formalpara>

                    </listitem>
                    <listitem>
                        <formalpara id="form-Architecture_and_Design-Service_and_Method_Naming_Convention-Searching_for_objects">
                            <title>Searching for objects</title>
                            <para>
                                The method <literal>search</literal> is always executed against the service with the plural form of the object name. The target of calling a <literal>search</literal> method is to obtain all matches, if any. The method should return any result set containing zero or more results.
                            </para>

                        </formalpara>

                    </listitem>

                </itemizedlist>

            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-Standard_Response_Layout">
            <title>Standard Response Layout</title>
            <para>
                The standard response layout offers a location for the request status, an error code and the corresponding message, or a result.
            </para>
            <para>
                The status is the first item in the JSON object. It has two possible values: <literal>OK</literal> or <literal>ERROR</literal>. Depending on the status of the request, the rest of the JSON output contains a result (OK) or the error details (ERROR).
            </para>
            <para>
                The response to a successful request looks as follows:
            </para>
            <para>

<screen language="Python">{
    "status": "OK",
    "result": (...)
}</screen>

            </para>
            <para>
                The reponse to a successful request that is expected to return a zero or one item, such as <literal>find</literal> methods, includes a result layout as follows:
            </para>
            <para>

<screen language="Python">{
    "status": "OK",
    "result": {
        (... entry data ...)
    }
}</screen>

            </para>
            <para>
                The reponse to a successful request that is expected to return a list of zero, one or more items, such as <literal>list</literal> and <literal>search</literal> methods, includes a result layout as follows:
            </para>
            <para>

<screen language="Python">{
    "status": "OK",
    "result": {
        "list": (...),
        "count": &lt;integer&gt;
    }
}</screen>

            </para>
            <para>
                A failed result however looks like:
            </para>
            <para>

<screen language="Python">{
    "status": "ERROR",
    "code": &lt;integer&gt;,
    "reason": "&lt;string&gt;"
}</screen>

            </para>

        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domain_Service">
            <title>The <literal>domain</literal> Service</title>
            <para>
                The <literal>domain</literal> service makes available actions against a single domain entity, for example 'add' or 'delete'. For actions against multiple domain entities, such as 'list' and 'search', see <xref linkend="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domains_Service" />.
            </para>
            <section id="sect-Architecture_and_Design-The_domain_Service-domain.add_Method">
                <title><literal>domain.add</literal> Method</title>
                <para>
                    Depending on the technology used, quite the variety of things may need to happen when adding a domain to a Kolab Groupware deployment. This is therefore a responsbility for the API rather then the client.
                </para>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters MUST be specified with the <literal>domain.add</literal> API call:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-domain">
                                <title><literal>domain</literal></title>
                                <para>
                                    The domain name space to be added.
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <para>
                    The following parameters MAY be specified alongside the required parameters:
                </para>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-parent">
                                <title><literal>parent</literal></title>
                                <para>
                                    The domain name space for which the domain name space being created is an alias.
                                </para>

                            </formalpara>
                            <para>
                                If specified, the parent MUST refer to an existing domain name space.
                            </para>
                            <important>
                                <para>
                                    The user adding the domain name space as an alias is required to have administrative privileges over the parent domain name space.
                                </para>

                            </important>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-admin_group_name">
                                <title><literal>admin_group_name</literal></title>
                                <para>
                                    The name of the group that is to be assigned administrative privileges over the domain name space.
                                </para>

                            </formalpara>
                            <para>
                                This parameter is only valid for new domain name spaces added without a parent.
                            </para>
                            <para>
                                The administrative group is searched after the domain name space is added. Should the group not exist, it is created.
                            </para>
                            <remark>What is the search filter for the group search?</remark>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-admin_role_name">
                                <title><literal>admin_role_name</literal></title>
                                <para>
                                    The name of the role that is to be assigned administrative privileges over the domain name space.
                                </para>

                            </formalpara>
                            <para>
                                This parameter is only valid for new domain name spaces added without a parent.
                            </para>
                            <para>
                                The administrative role is searched after the domain name space is added. Should the role not exist, it is created.
                            </para>
                            <remark>What is the search filter for the role search?</remark>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-domain.add_Method-admin_user">
                                <title><literal>admin_user</literal></title>
                                <para>
                                    The name of the admin user that is to be added to the <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_group_name" /> or <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_role_name" />.
                                </para>

                            </formalpara>
                            <para>
                                This parameter is only valid for new domain name spaces added without a parent, that either have the <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_group_name" /> or <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_role_name" /> parameters defined as well.
                            </para>
                            <para>
                                The user is searched for after the domain name space is added and the <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_group_name" /> or <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_role_name" /> have been created. Should the user not exist, it is created.
                            </para>
                            <para>
                                Subsequently, the role named in <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_role_name" /> is attached to the user, or the user is added as a member of the group listed in the <xref linkend="form-Architecture_and_Design-domain.add_Method-admin_group_name" /> parameter.
                            </para>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        <example id="exam-Architecture_and_Design-Example_Client_Implementation-Example_domain.add_API_call_in_Python">
                            <title>Example <literal>domain.add</literal> API call in Python</title>
                            <para>
                                The following is an example of a call to API service method <literal>domain.add</literal>:
                            </para>
                            <para>

<programlisting language="Python">import json
import httplib
import sys

from pykolab import utils

API_HOSTNAME = "kolab-admin.example.org"
API_PORT = "443"
API_SCHEME = "https"
API_BASE = "/api"

username = utils.ask_question("Login")
password = utils.ask_question("Password", password=True)

params = json.dumps({
                'username': username,
                'password': password
            })

if API_SCHEME == "http":
    conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
elif API_SCHEME == "https":
    conn = httplib.HTTPSConnection(API_HOSTNAME, API_PORT)

conn.connect()
conn.request('POST', "%s/system.authenticate" %(API_BASE), params)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)

# Check status here, using response_data['status']

if response_data.has_key('session_token'):
    session_id = response_data['session_token']

headers = { 'X-Session-Token': session_id }

params = json.dumps({
                'domain': utils.ask_question("Domain")
            })

conn.request('POST', "%s/domain.add" %(API_BASE), params, headers)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)</programlisting>

                            </para>

                        </example>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Response">
                    <title>Response</title>
                    <para>

<screen language="Python">{
    "status":"OK"
}</screen>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.add_Method-Server_side_Implementation_Details">
                    <title>Server-side Implementation Details</title>
                    <para>
                        On the server-side, when a domain is added, an entry is added to the default authentication and authorization database, as configured through the setting <literal>auth_mechanism</literal> in the <literal>[kolab]</literal> section of <filename>/etc/kolab/kolab.conf</filename>.
                    </para>

                </formalpara>
                <para>
                    The authentication database technology referred to itself has the necessary settings to determine how a new domain can be added. The related settings for LDAP are <literal>domain_base_dn</literal>, <literal>domain_scope</literal>, <literal>domain_filter</literal>, <literal>domain_name_attribute</literal> (also used for the RDN).
                </para>
                <para>
                    After checking the domain does not already exist (using administrative credentials), the domain is added using the credentials for the logged in user. This is an access control verification step only; the logged in user must have 'add' rights on the domain base distinguished name.
                </para>
                <para>
                    Additional steps when adding a (primary) domain name space is to create the databases and populate the root dn. Below is a snippet of script doing just that for <literal>example.org</literal> against a 389 Directory Server.
                </para>

<programlisting language="Bash">#!/bin/bash

if [ $# -ne 1 ]; then
    read -p "Domain: " domain
else
    domain=$1
fi

domain_db=$(echo ${domain} | sed -e 's/\./_/g')
domain_dn=$(echo ${domain} | sed -e 's/\./,dc=/g')
domain_dn="dc=${domain_dn}"

. ./zzz-settings.sh

(
    echo "dn: associateddomain=${domain},cn=kolab,cn=config"
    echo "associateddomain: ${domain}"
    echo "objectClass: top"
    echo "objectClass: inetdomain"
    echo "objectClass: domainrelatedobject"
    echo "objectClass: organization"
    echo "o: ${domain}"
    echo ""
    echo "dn: cn=${domain_db},cn=ldbm database,cn=plugins,cn=config"
    echo "objectClass: top"
    echo "objectClass: extensibleObject"
    echo "objectClass: nsBackendInstance"
    echo "cn: ${domain_db}"
    echo "nsslapd-suffix: ${domain_dn}"
    echo "nsslapd-cachesize: -1"
    echo "nsslapd-cachememsize: 10485760"
    echo "nsslapd-readonly: off"
    echo "nsslapd-require-index: off"
    echo "nsslapd-directory: /var/lib/dirsrv/slapd-${instance}/db/${domain_db}"
    echo "nsslapd-dncachememsize: 10485760"
    echo ""
    echo "dn: cn=$(echo ${domain_dn} | sed -e 's/,/\\2C/g' -e 's/=/\\3D/g'),cn=mapping tree,cn=config"
    echo "objectClass: top"
    echo "objectClass: extensibleObject"
    echo "objectClass: nsMappingTree"
    echo "nsslapd-state: backend"
    echo "cn: ${domain_dn}"
    echo "nsslapd-backend: ${domain_db}"
    echo ""
    echo "dn: ${domain_dn}"
    echo "dc: $(echo ${domain} | cut -d'.' -f 1)"
    echo "objectClass: top"
    echo "objectClass: domain"
    echo "aci: (targetattr=\"carLicense || description || displayName || facsimileTelephoneNumber || homePhone || homePostalAddress || initials || jpegPhoto || labeledURI || mail || mobile || pager || photo || postOfficeBox || postalAddress || postalCode || preferredDeliveryMethod || preferredLanguage || registeredAddress || roomNumber || secretary || seeAlso || st || street || telephoneNumber || telexNumber || title || userCertificate || userPassword || userSMIMECertificate || x500UniqueIdentifier\")(version 3.0; acl \"Enable self write for common attributes\"; allow (write) userdn=\"ldap:///self\";)"
    echo "aci: (targetattr =\"*\")(version 3.0;acl \"Directory Administrators Group\";allow (all) (groupdn=\"ldap:///cn=Directory Administrators,${domain_dn}\");)"
    echo "aci: (targetattr=\"*\")(version 3.0; acl \"Configuration Administrators Group\"; allow (all) groupdn=\"ldap:///cn=Configuration Administrators,ou=Groups,ou=TopologyManagement,o=NetscapeRoot\";)"
    echo "aci: (targetattr=\"*\")(version 3.0; acl \"Configuration Administrator\"; allow (all) userdn=\"ldap:///uid=admin,ou=Administrators,ou=TopologyManagement,o=NetscapeRoot\";)"
    echo "aci: (targetattr = \"*\")(version 3.0; acl \"SIE Group\"; allow (all) groupdn = \"ldap:///cn=slapd-ldap01,cn=389 Directory Server,cn=Server Group,cn=hosted04.klab.cc,ou=klab.cc,o=NetscapeRoot\";)"
    echo ""
    echo "dn: cn=Directory Administrators,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: groupofuniquenames"
    echo "cn: Directory Administrators"
    echo "uniqueMember: cn=Directory Manager"
    echo ""

    echo "dn: ou=Groups,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalunit"
    echo "ou: Groups"
    echo ""

    echo "dn: ou=People,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalunit"
    echo "ou: People"
    echo ""

    echo "dn: ou=Special Users,${domain_dn}"
    echo "objectClass: top"
    echo "objectClass: organizationalUnit"
    echo "ou: Special Users"
    echo "description: Special Administrative Accounts"
    echo ""

    echo "dn: uid=kolab-service,ou=Special Users,${domain_dn}"
    echo "uid: kolab-service"
    echo "givenName: Kolab"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Service Account"
    echo "cn: Kolab Service Account"
    echo "userPassword: ${kolab_service_pass}"
    echo ""

    echo "dn: uid=cyrus-murder,ou=Special Users,${domain_dn}"
    echo "uid: cyrus-murder"
    echo "givenName: Cyrus"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Murder"
    echo "cn: Cyrus Murder"
    echo "userPassword: ${cyrus_murder_pass}"
    echo ""

    echo "dn: uid=cyrus-admin,ou=Special Users,${domain_dn}"
    echo "uid: cyrus-admin"
    echo "givenName: Cyrus"
    echo "objectClass: top"
    echo "objectClass: person"
    echo "objectClass: inetOrgPerson"
    echo "objectClass: organizationalPerson"
    echo "sn: Administrator"
    echo "cn: Cyrus Administrator"
    echo "userPassword: ${cyrus_admin_pass}"
    echo ""

) | ldapadd -x -h ${ldap_server} -D "cn=Directory Manager" -w "${dirmgr_pass_plain}" -c</programlisting>
                <section id="sect-Architecture_and_Design-domain.add_Method-TODO">
                    <title>TODO</title>
                    <para>
                        The following is a list of things that still need to be designed and/or implemented.
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    Adding an alias for a domain name space, such that "company.nl" can be specified as an alias domain name space for "company.com".
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Designating an "owner" of a domain name space, possibly through nesting (LDAP) or assigning a owner_id (SQL).
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Determining access to a domain name space for any particular set of credentials.
                                </para>
                                <para>
                                    It seems, for LDAP, the server-side getEffectiveRights control is not supported. An alternative may be to probe the root dn for the domain name space using the current session bind credentials, but this may not scale. Exceptions to the probing would need to be established to make sure the known DNs are not subjected to the extensive operation(s) (such as <emphasis>cn=Directory Manager</emphasis>).
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    Once a domain is added, we have to implement access control on top of it.
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </section>


            </section>

            <section id="sect-Architecture_and_Design-The_domain_Service-domain.delete_Method">
                <title><literal>domain.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_domain_Service-domain.edit_Method">
                <title><literal>domain.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domain.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_domains_Service">
            <title>The <literal>domains</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_domains_Service-domains.list_Method">
                <title><literal>domains.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-domains.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_form_value_Service">
            <title>The <literal>form_value</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_form_value_Service-form_value.generate_Method">
                <title><literal>form_value.generate</literal> Method</title>
                <para>
                    This API call allows access to routines that generate attribute values. It accepts data containing the names and values of other attribute values as input, which can be used to generate the new attribute value requested.
                </para>
                <formalpara id="form-Architecture_and_Design-form_value.generate_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The <literal>form_value.generate</literal> API call accepts the following parameters:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.generate_Method-attribute">
                                <title>attribute</title>
                                <para>
                                    The name of the attribute to generate the new value for.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.generate_Method-data">
                                <title>data</title>
                                <para>
                                    An array with key =&gt; value pairs containing the attribute name (key) and attribute value (value) to use to generate the new value for the attribute supplied in <xref linkend="form-Architecture_and_Design-form_value.validate_Method-attribute" />.
                                </para>

                            </formalpara>
                            <para>
                                This parameter is required for certain attributes, such as <literal>cn</literal>, but not for other attributes, such as <literal>userPassword</literal>.
                            </para>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.generate_Method-user_type_id">
                                <title>user_type_id</title>
                                <para>
                                    An optional parameter to indicate to the API that the formation policy for users should be used.
                                </para>

                            </formalpara>
                            <para>
                                Supply an integer indicating the user type to use policies for that user type.
                            </para>
                            <para>
                                Supply a boolean True to use a policy for users, allowing the use of policies not specific to any user type.
                            </para>
                            <para>
                                Supply a boolean False to reject the use of any user policy.
                            </para>
                            <para>
                                The default for this parameter is False.
                            </para>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.generate_Method-group_type_id">
                                <title>group_type_id</title>
                                <para>
                                    An optional parameter to indicate to the API that the formation policy for groups should be used.
                                </para>

                            </formalpara>
                            <para>
                                Supply an integer indicating the group type to use policies for that group type.
                            </para>
                            <para>
                                Supply a boolean True to use a policy for groups, allowing the use of policies not specific to any group type.
                            </para>
                            <para>
                                Supply a boolean False to reject the use of any group policy.
                            </para>
                            <para>
                                The default for this parameter is False.
                            </para>

                        </listitem>

                    </itemizedlist>

                </para>
                <important>
                    <para>
                        The API call does not allow both the <literal>user_type_id</literal> and <literal>group_type_id</literal> to;
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    both be boolean False,
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    both be boolean True,
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    both be an integer reference to each respective type ID.
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </important>
                <formalpara id="form-Architecture_and_Design-form_value.generate_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.generate_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        A client could choose to have a user's password generated by the API.
                    </para>

                </formalpara>
                <example id="exam-Architecture_and_Design-form_value.generate_Method-Generate_the_User_Password_with_the_API">
                    <title>Generate the User Password with the API</title>
                    <para>

<screen language="Python">result = request('POST', 'form_value.generate_userpassword')
print result['userpassword']
</screen>

                    </para>

                </example>
                <formalpara id="form-Architecture_and_Design-form_value.generate_Method-Response">
                    <title>Response</title>
                    <para>

<screen language="Python">{
        "status": "OK",
        "result": {
                "password": "3SQLAdcW_KZL5vO"
            }
    }</screen>

                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_form_value_Service-form_value.list_options_Method">
                <title><literal>form_value.list_options</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-form_value.list_options_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.list_options_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.list_options_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.list_options_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_form_value_Service-form_value.validate_Method">
                <title><literal>form_value.validate</literal> Method</title>
                <para>
                    para
                </para>
                <para>
                    This API call allows access to routines that generate attribute values. It accepts data containing the names and values of other attribute values as input, which can be used to generate the new attribute value requested.
                </para>
                <formalpara id="form-Architecture_and_Design-form_value.validate_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The <literal>form_value.validate</literal> API call accepts the following parameters:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.validate_Method-attribute">
                                <title>attribute</title>
                                <para>
                                    The name of the attribute to validate the value for.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.validate_Method-data">
                                <title>data</title>
                                <para>
                                    The data to validate.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.validate_Method-user_type_id">
                                <title>user_type_id</title>
                                <para>
                                    An optional parameter to indicate to the API that the validation policy for users should be used.
                                </para>

                            </formalpara>
                            <para>
                                Supply an integer indicating the user type to use policies for that user type.
                            </para>
                            <para>
                                Supply a boolean True to use a policy for users, allowing the use of policies not specific to any user type.
                            </para>
                            <para>
                                Supply a boolean False to reject the use of any user policy.
                            </para>
                            <para>
                                The default for this parameter is False.
                            </para>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-form_value.validate_Method-group_type_id">
                                <title>group_type_id</title>
                                <para>
                                    An optional parameter to indicate to the API that the validation policy for groups should be used.
                                </para>

                            </formalpara>
                            <para>
                                Supply an integer indicating the group type to use policies for that group type.
                            </para>
                            <para>
                                Supply a boolean True to use a policy for groups, allowing the use of policies not specific to any group type.
                            </para>
                            <para>
                                Supply a boolean False to reject the use of any group policy.
                            </para>
                            <para>
                                The default for this parameter is False.
                            </para>

                        </listitem>

                    </itemizedlist>

                </para>
                <important>
                    <para>
                        The API call does not allow both the <literal>user_type_id</literal> and <literal>group_type_id</literal> to;
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    both be boolean False,
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    both be boolean True,
                                </para>

                            </listitem>
                            <listitem>
                                <para>
                                    both be an integer reference to each respective type ID.
                                </para>

                            </listitem>

                        </itemizedlist>

                    </para>

                </important>
                <formalpara id="form-Architecture_and_Design-form_value.validate_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.validate_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-form_value.validate_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_group_Service">
            <title>The <literal>group</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_group_Service-group.info_Method">
                <title><literal>group.info</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters are required:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-group.info_Method-group">
                                <title><literal>group</literal></title>
                                <para>
                                    The group to return information for.
                                </para>

                            </formalpara>
                            <remark> Currently, we only allow the group to be searched by the email address associated with the group. </remark>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-group.info_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.info_Method-Response">
                    <title>Response</title>
                    <para>

<screen language="Python">{
        "status": "OK",
        "result": {
                "cn": "sysadmin-main",
                "objectclass": [
                        "top",
                        "groupofuniquenames",
                        "kolabgroupofuniquenames",
                        "posixgroup"
                    ],
                "gidnumber": "666",
                "uniquemember": [
                        "uid=vanmeeuwen,ou=people,dc=klab,dc=cc",
                        "uid=adomaitis,ou=people,dc=klab,dc=cc"
                    ],
                "mail":"sysadmin-main@klab.cc",
                "type_id":3,
                "id":"adf3ce81-088311e1-98bcc2f1-b2ae40b4"
            }
    }</screen>

                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_group_Service-group.members_list_Method">
                <title><literal>group.members_list</literal> Method</title>
                <para>
                    The <literal>group.members_list</literal> service method lists the members of a group.
                </para>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters are required:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-group.members_list_Method-group">
                                <title><literal>group</literal></title>
                                <para>
                                    The group to list the members for.
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-group.members_list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_system_Service">
            <title>The <literal>system</literal> Service</title>
            <section id="sect-Architecture_and_Design-The_system_Service-system.authenticate_Method">
                <title><literal>system.authenticate</literal> Method</title>
                <para>
                    Successful authentication is a prerequisite in order to be able to execute any other action against the system. Upon success, the <literal>system.authenticate</literal> API call returns a session token that MUST be supplied with all subsequent requests for the session, through the HTTP header <literal>X-Session-Token</literal>.
                </para>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameters MUST be supplied with a call to <literal>system.authenticate</literal>:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-username">
                                <title><literal>username</literal></title>
                                <para>
                                    The username.
                                </para>

                            </formalpara>
                            <note>
                                <para>
                                    Currently, only the 'entryDN' and 'mail' attribute values are allowed as the username for an authentication request.
                                </para>

                            </note>
                            <para>
                                See also: <xref linkend="sect-Architecture_and_Design-Authentication_amp_Authorization-The_User_Supplied_Login" />
                            </para>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-password">
                                <title><literal>password</literal></title>
                                <para>
                                    para
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <para>
                    The following parameters MAY be supplied with a call to <literal>system.authenticate</literal>:
                </para>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-system.authenticate_Method-domain">
                                <title><literal>domain</literal></title>
                                <para>
                                    With supplying the <literal>domain</literal> parameter in an authentication request,
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        <example id="exam-Architecture_and_Design-Example_Client_Implementation-Example_system.authenticate_API_call_in_Python">
                            <title>Example <literal>system.authenticate</literal> API call in Python</title>
                            <para>
                                The following is an example of authentication against the API in Python:
                            </para>
                            <para>

<programlisting language="Python">import json
import httplib
import sys

from pykolab import utils

API_HOSTNAME = "kolab-admin.example.org"
API_PORT = "443"
API_SCHEME = "https"
API_BASE = "/api"

username = utils.ask_question("Login")
password = utils.ask_question("Password", password=True)

params = json.dumps({
                'username': username,
                'password': password
            })

if API_SCHEME == "http":
    conn = httplib.HTTPConnection(API_HOSTNAME, API_PORT)
elif API_SCHEME == "https":
    conn = httplib.HTTPSConnection(API_HOSTNAME, API_PORT)

conn.connect()
conn.request('POST', "%s/system.authenticate" %(API_BASE), params)
try:
    response_data = json.loads(conn.getresponse().read())
except ValueError, e:
    print e
    sys.exit(1)

# Check status here, using response_data['status']

if response_data.has_key('result'):
    if response_data['result'].has_key('session_token'):
        session_id = response_data['result']['session_token']</programlisting>

                            </para>

                        </example>

                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.authenticate_Method-Response">
                    <title>Response</title>
                    <para>
                        The following is a response to a successful authentication request (with inserted line-breaks for readability):
                    </para>

                </formalpara>
                <para>

<screen language="Python">{
    "status":"OK",
    "result": {
        "user":"cn=Directory Manager",
        "domain":"klab.cc",
        "session_token":"ndgu4ennb6t51i4b0dvkulhvk6"
    }
}</screen>

                </para>
                <para>
                    The following is a reponse to an unsuccessful call to <literal>system.authenticate</literal> (with inserted line-breaks for readability):
                </para>
                <para>

<screen language="Python">{
    "status":"ERROR",
    "code":500,
    "reason":"Internal error"
}</screen>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.capabilities_Method">
                <title><literal>system.capabilities</literal> Method</title>
                <para>
                    For all service handlers registered, a method <literal>capabilities</literal> can be executed listing the methods available and access to them. The <literal>system.capabilities</literal> API call lists all of the registered service handlers' methods and access.
                </para>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.capabilities_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.quit_Method">
                <title><literal>system.quit</literal> Method</title>
                <para>
                    The quit method ends the session.
                </para>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.quit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_system_Service-system.select_domain_Method">
                <title><literal>system.select_domain</literal> Method</title>
                <para>
                    Select the domain supplied as the current working domain. By default, users are logged in and have access to what they are authorized for in their own domain name space only. Certain users, such as <emphasis>cn=Directory Manager</emphasis>, have access to all domains. This API call allows such users to select the domain name space they are currently working on.
                </para>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params: domain name
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-system.select_domain_Method-Server_side_Implementation_Details">
                    <title>Server-side Implementation Details</title>
                    <para>
                        On the server-side, when <literal>system.select_domain</literal> is called successfully, the selected domain is stored in <code>$_SESSION['user']-&gt;current_domain</code>. This is a private property, however, and the rest of the code is to use the public function <code>$_SESSION['user']-&gt;get_domain()</code>:
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_user_Service">
            <title>The <literal>user</literal> Service</title>
            <para>
                The <literal>user</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_user_Service-user.add_Method">
                <title><literal>user.add</literal> Method</title>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params: user_type_id (obtain from <literal>user_types.list</literal>)
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.add_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.delete_Method">
                <title><literal>user.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.disable_Method">
                <title><literal>user.disable</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.disable_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.edit_Method">
                <title><literal>user.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.enable_Method">
                <title><literal>user.enable</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.enable_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.info_Method">
                <title><literal>user.info</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        The following parameter(s) MUST be supplied with a call to <literal>user.info</literal>:
                    </para>

                </formalpara>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-user.info_Method-user">
                                <title><literal>user</literal></title>
                                <para>
                                    A string allowing the user the information needs to be obtained for to be uniquely identified.
                                </para>

                            </formalpara>
                            <note>
                                <para>
                                    Currently, only the 'entryDN' and 'mail' attribute values are allowed as the username for an authentication request.
                                </para>

                            </note>

                        </listitem>

                    </itemizedlist>

                </para>
                <formalpara id="form-Architecture_and_Design-user.info_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.info_Method-Response">
                    <title>Response</title>
                    <para>
                        The response to a <literal>user.info</literal> API call contains all information to a particular entry in the authentication and authorization database technology, that can be obtained using the bind credentials for the session user.
                    </para>

                </formalpara>
                <para>
                    The output is normalized for abstraction, and looks as follows, with added line-breaks for clarity:
                </para>
                <para>

<screen language="Python">{
    u'status': 'OK',
    u'uid=vanmeeuwen,ou=People,dc=klab,dc=cc': {
            u'mailalternateaddress': [
                    u'vanmeeuwen@klab.cc',
                    u'j.vanmeeuwen@klab.cc'
                ],
            u'displayname': u'van Meeuwen, Jeroen',
            u'uid': u'vanmeeuwen',
            u'mailhost': u'imap.klab.cc',
            u'objectclass': [
                    u'top',
                    u'person',
                    u'inetOrgPerson',
                    u'organizationalPerson',
                    u'mailrecipient',
                    u'kolabInetOrgPerson',
                    u'posixAccount'
                ],
            u'loginshell': u'/bin/bash',
            u'userpassword': u'{SSHA}yGEm7rdOSrTDCd/h4F5q1fx5GTvSynHU',
            u'uidnumber': u'500',
            u'modifiersname': u'cn=directory manager',
            u'modifytimestamp': u'20111206153131Z',
            u'preferredlanguage': u'en_US',
            u'gidnumber': u'500',
            u'createtimestamp': u'20111119171559Z',
            u'sn': u'van Meeuwen',
            u'homedirectory': u'/home/vanmeeuwen',
            u'mail': u'jeroen.vanmeeuwen@klab.cc',
            u'givenname': u'Jeroen',
            u'creatorsname': u'cn=directory manager',
            u'cn': u'Jeroen van Meeuwen'
        }
}</screen>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_user_Service-user.search_Method">
                <title><literal>user.search</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        GET, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user.search_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_user_types_Service">
            <title>The <literal>user_types</literal> Service</title>
            <para>
                The <literal>user_types</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.add_Method">
                <title><literal>user_types.add</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.add_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.delete_Method">
                <title><literal>user_types.delete</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.delete_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.edit_Method">
                <title><literal>user_types.edit</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.edit_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-user_types.list_Method">
                <title><literal>user_types.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-user_types.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_user_types_Service-Storage_Format_for_user_type">
                <title>Storage Format for <literal>user_type</literal></title>
                <para>
                    The user types are backed by database entries, containing the following attributes per user type:
                </para>
                <para>
                    <itemizedlist>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-Storage_Format_for_user_type-_id_">
                                <title> <literal>id</literal> </title>
                                <para>
                                    Of type INT, this attribute is automatically assigned by the database backend, unless specifically supplied on insert.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-Storage_Format_for_user_type-_key_">
                                <title> <literal>key</literal> </title>
                                <para>
                                    Of type VARCHAR(16), the <literal>key</literal> attribute is to hold a machine readable name.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-Storage_Format_for_user_type-_name_">
                                <title> <literal>name</literal> </title>
                                <para>
                                    Of type VARCHAR(128), the <literal>name</literal> attribute is to be the human-readable name for the user type.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-Storage_Format_for_user_type-_description_">
                                <title> <literal>description</literal> </title>
                                <para>
                                    Of type VARCHAR(256), the <literal>description</literal> attribute holds the description for the user type.
                                </para>

                            </formalpara>

                        </listitem>
                        <listitem>
                            <formalpara id="form-Architecture_and_Design-Storage_Format_for_user_type-_attributes_">
                                <title> <literal>attributes</literal> </title>
                                <para>
                                    Of type TEXT, the <literal>attributes</literal> contains a serialized JSON object with the information needed for the API and client interface to build queries and forms for the user type.
                                </para>

                            </formalpara>

                        </listitem>

                    </itemizedlist>

                </para>
                <section id="sect-Architecture_and_Design-Storage_Format_for_user_type-_The_attributes_Attribute_Value_Format">
                    <title> The <literal>attributes</literal> Attribute Value Format</title>
                    <para>
                        The structure of the <literal>attributes</literal> attribute value is:
                    </para>

<screen language="PHP/PHP">Array(
        "&lt;form_field_type&gt;" =&gt; Array(
                "&lt;form_field_name&gt;" =&gt; Array(
                            ['data' =&gt; Array(
                                    "&lt;form_field_name&gt;"[,
                                    "&lt;form_field_name&gt;"[,
                                    "&lt;form_field_name&gt;"],]
                                ),]
                            ['type' =&gt; "text|select|multiselect|...",]
                            ['values' =&gt; Array(
                                    "&lt;value1&gt;"[,
                                    "&lt;value1&gt;"[,
                                    "&lt;value1&gt;"],]
                                ),]
                    )
            )
    )</screen>
                    <para>
                        The <literal>attributes</literal> attribute to a <literal>user_type</literal> entry holds an array with any or all of the following <emphasis>&lt;form_field_type&gt;</emphasis> keys:
                    </para>
                    <para>
                        <itemizedlist>
                            <listitem>
                                <formalpara id="form-Architecture_and_Design-_The_attributes_Attribute_Value_Format-auto_form_fields">
                                    <title><literal>auto_form_fields</literal></title>
                                    <para>
                                        The <literal>auto_form_fields</literal> key holds an array of form fields that correspond with attributes for which the value is to be generated automatically, using an API call.
                                    </para>

                                </formalpara>
                                <para>
                                    The key name for each key =&gt; value pair indicates the form field name for which the value is to be generated automatically.
                                </para>
                                <para>
                                    Each array key corresponds with a user attribute name, and it's value is an array containing the name of the form fields for which the value to submit as part of the API call.
                                </para>
                                <example id="exam-Architecture_and_Design-_The_attributes_Attribute_Value_Format-A_Users_displayname">
                                    <title>A User's <literal>displayname</literal></title>
                                    <para>
                                        Provided the user type's <literal>auto_form_fields</literal> contains an array key of <literal>displayname</literal>, the array value for this key could look as follows:
                                    </para>
                                    <para>

<screen language="PHP/PHP">Array(
        'auto_form_fields' =&gt; Array(
                'displayname' =&gt; Array(
                        'data' =&gt; Array(
                                'givenname',
                                'sn'
                            ),
                    ),
                (...)
            ),
        (...)
    );</screen>

                                    </para>
                                    <para>
                                        This indicates to the client that a form field named 'displayname' is to be populated with the information contained within the form fields named 'givenname' and 'sn'.
                                    </para>
                                    <para>
                                        If the client is capable of doing so, it should also update the form field named 'displayname' after the values for any of the form fields named 'givenname' or 'sn' have been changed.
                                    </para>

                                </example>
                                <para>
                                    With a JSON object payload containing the values of the form fields for which the names are contained within the 'data' key, if any, the client should submit a POST request on change of these form fields, and will be returned the new value for the automatically generated form field.
                                </para>

                            </listitem>
                            <listitem>
                                <formalpara id="form-Architecture_and_Design-_The_attributes_Attribute_Value_Format-form_fields">
                                    <title><literal>form_fields</literal></title>
                                    <para>
                                        The <literal>form_fields</literal> key holds an array of form fields that require user input.
                                    </para>

                                </formalpara>
                                <para>
                                    The key name for each key =&gt; value pair indicates the form field name for which the value is to be supplied by the user.
                                </para>
                                <para>
                                    Because some attributes can be multi-valued, or have a limited list of options, each defined form field in <literal>form_fields</literal> can hold an array with additional key =&gt; value pairs illustrating the type of form field that should be used, and what format to expect the result value in.
                                </para>
                                <para>
                                    <itemizedlist id="item-Architecture_and_Design-_The_attributes_Attribute_Value_Format-Additional_Information_in_form_fields">
                                        <title>Additional Information in <literal>form_fields</literal></title>
                                        <listitem>
                                            <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-maxlength">
                                                <title><literal>maxlength</literal></title>
                                                <para>
                                                    For a form field of type <xref linkend="form-Architecture_and_Design-Additional_Information_in_form_fields-text" /> or type <xref linkend="form-Architecture_and_Design-Additional_Information_in_form_fields-list" />, this value holds the maximum length for a given item.
                                                </para>

                                            </formalpara>

                                        </listitem>
                                        <listitem>
                                            <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-type">
                                                <title><literal>type</literal></title>
                                                <para>
                                                    The <literal>type</literal> is to indicate the type of form field. Options include;
                                                </para>

                                            </formalpara>
                                            <para>
                                                <itemizedlist>
                                                    <listitem>
                                                        <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-text">
                                                            <title><literal>text</literal></title>
                                                            <para>
                                                                This is a regular input field of type text.
                                                            </para>

                                                        </formalpara>
                                                        <para>
                                                            This is the default.
                                                        </para>
                                                        <para>
                                                            Additional parameters for a text form field include <xref linkend="form-Architecture_and_Design-Additional_Information_in_form_fields-maxlength" />.
                                                        </para>

                                                    </listitem>
                                                    <listitem>
                                                        <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-list">
                                                            <title><literal>list</literal></title>
                                                            <para>
                                                                A form field of type <literal>list</literal> is expecting a list of text input values.
                                                            </para>

                                                        </formalpara>
                                                        <para>
                                                            A client web interface could choose to display a textarea with the instructions to supply one item per line, or more advanced (better) equivalents, such as an add/delete widget.
                                                        </para>
                                                        <para>
                                                            A client command-line interface could choose to prompt for input values until an empty value is supplied.
                                                        </para>
                                                        <para>
                                                            Additional parameters for a list form field include <xref linkend="form-Architecture_and_Design-Additional_Information_in_form_fields-maxlength" />, which holds the maximum length of each text value in the list.
                                                        </para>

                                                    </listitem>
                                                    <listitem>
                                                        <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-multiselect">
                                                            <title><literal>multiselect</literal></title>
                                                            <para>
                                                                This form field is a select list, where multiple options may be selected (as opposed to a <xref linkend="form-Architecture_and_Design-Additional_Information_in_form_fields-select" /> list, where only one option may be selected).
                                                            </para>

                                                        </formalpara>
                                                        <para>
                                                            A client interface MUST consult the <literal>form_value.list_options</literal> API call for options, described in <xref linkend="sect-Architecture_and_Design-The_form_value_Service-form_value.list_options_Method" />.
                                                        </para>

                                                    </listitem>
                                                    <listitem>
                                                        <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-select">
                                                            <title><literal>select</literal></title>
                                                            <para>
                                                                This form field is a selection list, of which one option may be selected.
                                                            </para>

                                                        </formalpara>
                                                        <para>
                                                            A client interface MUST consult the <literal>form_value.list_options</literal> API call for options, described in <xref linkend="sect-Architecture_and_Design-The_form_value_Service-form_value.list_options_Method" />.
                                                        </para>

                                                    </listitem>

                                                </itemizedlist>

                                            </para>

                                        </listitem>
                                        <listitem>
                                            <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-value_source">
                                                <title><literal>value_source</literal></title>
                                                <para>
                                                    para
                                                </para>

                                            </formalpara>

                                        </listitem>
                                        <listitem>
                                            <formalpara id="form-Architecture_and_Design-Additional_Information_in_form_fields-values">
                                                <title><literal>values</literal></title>
                                                <para>
                                                    para
                                                </para>

                                            </formalpara>

                                        </listitem>

                                    </itemizedlist>

                                </para>

                            </listitem>
                            <listitem>
                                <formalpara id="form-Architecture_and_Design-_The_attributes_Attribute_Value_Format-fields">
                                    <title><literal>fields</literal></title>
                                    <para>
                                        The <literal>fields</literal> key holds an array of form fields and values for said form fields, that are static. One example of such form fields is <literal>objectclass</literal>.
                                    </para>

                                </formalpara>

                            </listitem>

                        </itemizedlist>

                    </para>

                </section>


            </section>


        </section>

        <section id="sect-Architecture_and_Design-Web_Administration_Panel_API-The_users_Service">
            <title>The <literal>users</literal> Service</title>
            <para>
                The <literal>users</literal> service ...
            </para>
            <section id="sect-Architecture_and_Design-The_users_Service-users.list_Method">
                <title><literal>users.list</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.list_Method-Response">
                    <title>Response</title>
                    <para>
                        The response consists of the following two toplevel keys, contained within a JSON object:
                    </para>

                </formalpara>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>status</literal>
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>result</literal>
                            </para>

                        </listitem>

                    </orderedlist>

                </para>
                <para>
                    The <literal>result</literal> JSON object contains the following two primary keys:
                </para>
                <para>
                    <orderedlist>
                        <listitem>
                            <para>
                                <literal>list</literal>
                            </para>
                            <para>
                                The value represents the list of results. Languages in use today allow the counting of the list's keys, which should get a client application to be able to estimate the number of results contained within the list.
                            </para>

                        </listitem>
                        <listitem>
                            <para>
                                <literal>count</literal>
                            </para>
                            <para>
                                The value represents the total number of results, to allow for pagination on the client.
                            </para>

                        </listitem>

                    </orderedlist>

                </para>

            </section>

            <section id="sect-Architecture_and_Design-The_users_Service-users.search_Method">
                <title><literal>users.search</literal> Method</title>
                <para>
                    para
                </para>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Parameters">
                    <title>Parameters</title>
                    <para>
                        params
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-HTTP_Methods">
                    <title>HTTP Method(s)</title>
                    <para>
                        POST, with an <literal>X-Session-Token</literal> HTTP/1.1 header.
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Example_Client_Implementation">
                    <title>Example Client Implementation</title>
                    <para>
                        para
                    </para>

                </formalpara>
                <formalpara id="form-Architecture_and_Design-users.search_Method-Response">
                    <title>Response</title>
                    <para>
                        para
                    </para>

                </formalpara>

            </section>


        </section>


    </section>


</chapter>