File: hw.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (2129 lines) | stat: -rw-r--r-- 82,697 bytes parent folder | download
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
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.25 $ -->
 <reference id="ref.hyperwave">
  <title>Hyperwave functions</title>
  <titleabbrev>Hyperwave</titleabbrev>

  <partintro>

   <sect1 id="hw-intro">
    <title>Introduction</title>
    <para>
     <productname>Hyperwave</productname> has been developed at <ulink url="&url.iicm;">IICM</ulink> in Graz. It started with
     the name <acronym>Hyper-G</acronym> and changed to Hyperwave when
     it was commercialised (If I remember properly it was in 1996).
    </para>
    <para>
     Hyperwave is not free software. The current version, 4.1, is
     available at <ulink url="&url.hyperwave;">www.hyperwave.com</ulink>.  
     A time limited version can be ordered for free (30 days).
    </para>
    <para>
     Hyperwave is an information system similar to a database
     (<acronym>HIS</acronym>, Hyperwave Information Server). Its focus
     is the storage and management of documents. A document can be any
     possible piece of data that may as well be stored in file. Each
     document is accompanied by its object record. The object record
     contains meta data for the document. The meta data is a list of
     attributes which can be extended by the user. Certain attributes
     are always set by the Hyperwave server, other may be modified by
     the user. An attribute is a name/value pair of the form name=value.
     The complete object record contains as many of those pairs as the
     user likes. The name of an attribute does not have to be unique,
     e.g. a title may appear several times within an object record.
     This makes sense if you want to specify a title in several languages.
     In such a case there is a convention, that each title value is
     preceded by the two letter language abbreviation followed by a colon,
     e.g. 'en:Title in English' or 'ge:Titel in deutsch'. Other attributes
     like a description or keywords are potential candidates. You may
     also replace the language abbreviation by any other string as long
     as it separated by colon from the rest of the attribute value.
    </para>
    <para>
     Each object record has native a string representation with each
     name/value
     pair separated by a newline. The Hyperwave extension also knows
     a second representation which is an associated array with the
     attribute name being the key. Multilingual attribute values itself
     form another associated array with the key being the language
     abbreviation. Actually any multiple attribute forms an associated
     array with the string left to the colon in the attribute value
     being the key. (This is not fully implemented. Only the attributes
     Title, Description and Keyword are treated properly yet.)
    </para>
    <para>
     Besides the documents, all hyper links contained in a document
     are stored as object records as well. Hyper links which
     are in a document will be removed from it and stored as individual
     objects, when the document is inserted into the database.
     The object record of the link contains information
     about where it starts and where it ends.
     In order to gain the original document you will have
     to retrieve the plain document without the links and the list
     of links and reinsert them (The functions
     <function>hw_pipedocument</function> and <function>hw_gettext</function>
     do this for you. The advantage of separating links
     from the document is obvious. Once a document to which a link
     is pointing to changes its name, the link can easily be modified
     accordingly. The document containing the link is not affected
     at all. You may even add a link to a document without modifying
     the document itself.
    </para>
    <para>
     Saying that <function>hw_pipedocument</function> and
     <function>hw_gettext</function> do the link insertion automatically
     is not as simple as it sounds. Inserting links implies a certain
     hierarchy of the documents. On a web server this is given by the
     file system, but Hyperwave has its own hierarchy and names do not
     reflect the position of an object in that hierarchy. Therefore
     creation of links first of all requires a mapping from the Hyperwave
     hierarchy and namespace into a web hierarchy respective web namespace.
     The fundamental difference between Hyperwave and the web is the clear
     distinction between names and hierarchy in Hyperwave. The name does
     not contain any information about the objects position in the hierarchy.
     In the web the
     name also contains the information on where the object is located
     in the hierarchy. This leads to two possibles ways of mapping. Either
     the Hyperwave hierarchy and name of the Hyperwave object is reflected
     in the URL or the name only.
     To make things simple the second approach is used.
     Hyperwave object with name 'my_object' is mapped to
     'http://host/my_object' disregarding where it resides in the
     Hyperwave hierarchy.
     An object with name 'parent/my_object' could be the child of
     'my_object' in the Hyperwave hierarchy, though in a web namespace it
     appears to be just the opposite and the user might get confused. 
     This can only be prevented by selecting reasonable object names.
    </para>
    <para>
     Having made this decision a second problem arises. How do you
     involve PHP? The URL http://host/my_object will not call any
     PHP script unless you tell your web server to rewrite it to
     e.g. 'http://host/php3_script/my_object' and the script 'php3_script'
     evaluates the $PATH_INFO variable and retrieves the object with
     name 'my_object' from the Hyperwave server. Their is just one little
     drawback which can be fixed easily. Rewriting any URL would not allow
     any access to other document on the web server. A PHP script for
     searching in the Hyperwave server would be impossible. Therefore
     you will need at least a second rewriting rule to exclude certain
     URLS like all e.g. starting with http://host/Hyperwave. This is
     basically sharing of a namespace by the web and Hyperwave server.
    </para>
    <para>
     Based on the above mechanism links are insert into documents.
    </para>
    <para>
     It gets more complicated if PHP is not run as a server module or CGI
     script but as a standalone application e.g. to dump the content of
     the Hyperwave server on a CD-ROM. In such a case it makes sense to
     retain the Hyperwave hierarchy and map in onto the file system. This
     conflicts with the object names if they reflect its own hierarchy
     (e.g. by choosing names including '/'). Therefore '/' has to be
     replaced by another character, e.g. '_'. to be continued.
    </para>
    <para>
     The network protocol to communicate with the Hyperwave server is called
     <ulink url="&spec.hyperwave;">HG-CSP</ulink> (Hyper-G Client/Server
     Protocol). It is based on messages to initiate certain actions, e.g. get
     object record.  In early versions of the Hyperwave Server two native
     clients (Harmony, Amadeus) were provided for communication with the
     server. Those two disappeared when Hyperwave was commercialised.  As a
     replacement a so called wavemaster was provided. The wavemaster is like a
     protocol converter from <abbrev>HTTP</abbrev> to <abbrev>HG-CSP</abbrev>.
     The idea is to do all the administration of the database and
     visualisation of documents by a web interface.  The wavemaster implements
     a set of placeholders for certain actions to customise the interface.
     This set of placeholders is called the <abbrev>PLACE</abbrev> Language.
     <abbrev>PLACE</abbrev> lacks a lot of features of a real programming
     language and any extension to it only enlarges the list of placeholders.
     This has led to the use of JavaScript which IMO does not make life
     easier.
    </para>
    <para>
     Adding Hyperwave support to PHP should fill in the gap of a
     missing programming language for interface customisation.  It
     implements all the messages as defined by the
     <abbrev>HG-CSP</abbrev> but also provides more powerful commands
     to e.g. retrieve complete documents.
    </para>
    <para>
     Hyperwave has its own terminology to name certain pieces of
     information. This has widely been taken over and extended.
     Almost all functions operate on one of the following data types.

     <itemizedlist>
      <listitem>
       <simpara>
        object ID: An unique integer value for each object in the
        Hyperwave server. It is also one of the attributes of the
        object record (ObjectID). Object ids are often used as an
        input parameter to specify an object.
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        object record: A string with attribute-value pairs of the form
        attribute=value. The pairs are separated by a carriage return
        from each other. An object record can easily be converted into
        an object array with <function>hw_object2array</function>.
        Several functions return object records.  The names of those
        functions end with obj.
       </simpara>
      </listitem> 
      <listitem>
       <simpara>
        object array: An associated array with all attributes of an
        object. The key is the attribute name. If an attribute occurs
        more than once in an object record it will result in another
        indexed or associated array. Attributes which are language
        depended (like the title, keyword, description) will form an
        associated array with the key set to the language
        abbreviation. All other multiple attributes will form an
        indexed array. PHP functions never return object arrays.
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        hw_document: This is a complete new data type which holds the
        actual document, e.g. HTML, PDF etc. It is somewhat optimised
        for HTML documents but may be used for any format.
       </simpara>
      </listitem>
     </itemizedlist>
    </para> 
    <para>
     Several functions which return an array of object records do also
     return an associated array with statistical information about
     them. The array is the last element of the object record
     array. The statistical array contains the following entries:
     <variablelist>
      <varlistentry>
       <term>Hidden</term>
       <listitem>
        <simpara>
         Number of object records with attribute PresentationHints
         set to Hidden.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>CollectionHead</term>
       <listitem>
        <simpara>
         Number of object records with attribute
         PresentationHints set to CollectionHead.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>FullCollectionHead</term>
       <listitem>
        <simpara>
         Number of object records with attribute
         PresentationHints set to FullCollectionHead.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>CollectionHeadNr</term>
       <listitem>
        <simpara>
         Index in array of object records with
         attribute PresentationHints set to CollectionHead.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>FullCollectionHeadNr</term>
       <listitem>
        <simpara>
         Index in array of object records with
         attribute PresentationHints set to FullCollectionHead.
        </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>Total</term>
       <listitem>
        <simpara>
         Total: Number of object records.
        </simpara>
       </listitem>
      </varlistentry>
     </variablelist>
    </para>
   </sect1>

   <sect1 id="hw-apache">
    <title>Integration with Apache</title>
    <para>
     The Hyperwave extension is best used when PHP is compiled as an
     Apache module. In such a case the underlying Hyperwave server can
     be hidden from users almost completely if Apache uses its rewriting
     engine. The following instructions will explain this.
    </para>
    <para>
     Since PHP with Hyperwave support built into Apache is intended
     to replace the native Hyperwave solution based on Wavemaster I
     will assume that the Apache server will only serve as a Hyperwave
     web interface. This is not necessary but it simplifies the
     configuration.  The concept is quite simple. First of all you
     need a PHP script which evaluates the <envar>PATH_INFO</envar>
     variable and treats its value as the name of a Hyperwave
     object. Let's call this script 'Hyperwave'.  The URL
     <systemitem role="url">http://your.hostname/Hyperwave/name_of_object</systemitem>
     would than return the Hyperwave object with the name
     'name_of_object'. Depending on the type of the object the script
     has to react accordingly. If it is a collection, it will probably
     return a list of children. If it is a document it will return the
     mime type and the content. A slight improvement can be achieved
     if the Apache rewriting engine is used.  From the users point of
     view it would be more straight forward if the URL
     <systemitem role="url">http://your.hostname/name_of_object</systemitem> would
     return the object.  The rewriting rule is quite easy:

     <informalexample>
      <programlisting role="apache-conf">
<![CDATA[
RewriteRule ^/(.*) /usr/local/apache/htdocs/HyperWave/$1 [L]
]]>
      </programlisting>
     </informalexample>

     Now every URL relates to an object in the Hyperwave server. This
     causes a simple to solve problem. There is no way to execute a
     different script, e.g. for searching, than the 'Hyperwave'
     script.  This can be fixed with another rewriting rule like the
     following:

     <informalexample>
      <programlisting role="apache-conf">
<![CDATA[
RewriteRule ^/hw/(.*) /usr/local/apache/htdocs/hw/$1 [L]
]]>
      </programlisting>
     </informalexample>

     This will reserve the directory <filename class="directory">/usr/local/apache/htdocs/hw</filename> for
     additional scripts and other files. Just make sure this rule is
     evaluated before the one above. There is just a little drawback:
     all Hyperwave objects whose name starts with 'hw/' will be
     shadowed. So, make sure you don't use such names. If you need
     more directories, e.g. for images just add more rules or place
     them all in one directory.  Finally, don't forget to turn on the
     rewriting engine with

     <informalexample>
      <programlisting role="apache-conf">
<![CDATA[
RewriteEngine on
]]>
      </programlisting>
     </informalexample>

     My experiences have shown that you will need the following
     scripts:

     <itemizedlist>
       <listitem>
        <simpara>
        to return the object itself
        </simpara>
       </listitem>
       <listitem>
        <simpara>
        to allow searching
        </simpara>
       </listitem>
       <listitem>
        <simpara>
        to identify yourself
        </simpara>
       </listitem>
       <listitem>
        <simpara>
        to set your profile
        </simpara>
       </listitem>
       <listitem>
        <simpara>
        one for each additional function like to show
        the object attributes, to show information about users,
        to show the status of the server, etc.
        </simpara>
       </listitem>
     </itemizedlist>
    </para>
   </sect1>

   <sect1 id="hw-todo">
    <title>Todo</title>
    <para>
     There are still some things todo:
     <itemizedlist>
      <listitem><simpara>The hw_InsertDocument has to be split into
        <function>hw_insertobject</function> and
        <function>hw_putdocument</function>.</simpara></listitem>
      <listitem><simpara>The names of several functions are not fixed, yet.
       </simpara></listitem>
      <listitem><simpara>Most functions require the current connection
        as its first parameter. This leads to a lot of typing, which
        is quite often not necessary if there is just one open
        connection. A default connection will
        improve this.</simpara></listitem>
      <listitem><simpara>Conversion form object record into object array
        needs to handle any multiple attribute.
       </simpara></listitem>
     </itemizedlist>
    </para>
   </sect1>
  </partintro>

  <refentry id="function.hw-array2objrec">
   <refnamediv>
    <refname>hw_Array2Objrec</refname>
    <refpurpose>convert attributes from object array to object record</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>strin</type><methodname>hw_array2objrec</methodname>
      <methodparam><type>array</type><parameter>object_array</parameter></methodparam>
     </methodsynopsis>
    <para>
     Converts an <parameter>object_array</parameter> into an object record.
     Multiple attributes like 'Title' in different languages are treated
     properly.
    </para>
    <para>
     See also <function>hw_objrec2array</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-children">
   <refnamediv>
    <refname>hw_Children</refname>
    <refpurpose>object ids of children</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_children</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object ids. Each id
     belongs to a child of the collection with ID
     <parameter>objectID</parameter>.
     The array contains all children both documents and collections.</para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-childrenobj">
   <refnamediv>
    <refname>hw_ChildrenObj</refname>
    <refpurpose>object records of children</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_childrenobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object records. Each object record
     belongs to a child of the collection with ID
     <parameter>objectID</parameter>.
     The array contains all children both documents and collections.</para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-close">
   <refnamediv>
    <refname>hw_Close</refname>
    <refpurpose>closes the Hyperwave connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_close</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns &false; if connection is not a valid connection index,
     otherwise &true;.  Closes down the connection to a Hyperwave server
     with the given connection index.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-connect">
   <refnamediv>
    <refname>hw_Connect</refname>
    <refpurpose>opens a connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_connect</methodname>
      <methodparam><type>string</type><parameter>host</parameter></methodparam>
      <methodparam><type>int</type><parameter>port</parameter></methodparam>
      <methodparam><type>string</type><parameter>username</parameter></methodparam>
      <methodparam><type>string</type><parameter>password</parameter></methodparam>
     </methodsynopsis>
    <para>
     Opens a connection to a Hyperwave server and returns a connection
     index on success, or &false; if the connection
     could not be made. Each of the arguments should be a quoted string,
     except for the port number. The <parameter>username</parameter> and
     <parameter>password</parameter> arguments are
     optional and can be left out. In such a case no identification with
     the server will be done. It is similar to identify as user anonymous.
     This function returns a connection
     index that is needed by other Hyperwave functions. You can have
     multiple connections open at once. Keep in mind, that the password
     is not encrypted.
    </para>
    <para>
     See also <function>hw_pconnect</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-cp">
   <refnamediv>
    <refname>hw_Cp</refname>
    <refpurpose>copies objects</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_cp</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>array</type><parameter>object_id_array</parameter></methodparam>
      <methodparam><type>int</type><parameter>destination id</parameter></methodparam>
     </methodsynopsis>
    <para>
     Copies the objects with object ids as specified in the second
     parameter to the collection
     with the id <parameter>destination id</parameter>.
    </para>
    <para>
     The value return is the number of copied objects.
    </para>
    <para>
     See also <function>hw_mv</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-deleteobject">
   <refnamediv>
    <refname>hw_Deleteobject</refname>
    <refpurpose>deletes object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_deleteobject</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>object_to_delete</parameter></methodparam>
     </methodsynopsis>
    <para>
     Deletes the object with the given object id in the second
     parameter. It will delete all instances of the object.
    </para>
    <para>
     Returns &true; if no error occurs otherwise &false;.
    </para>
    <para>
     See also <function>hw_mv</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-docbyanchor">
   <refnamediv>
    <refname>hw_DocByAnchor</refname>
    <refpurpose>object id object belonging to anchor</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_docbyanchor</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>anchorID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an th object id of the document to
     which <parameter>anchorID</parameter> belongs.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-docbyanchorobj">
   <refnamediv>
    <refname>hw_DocByAnchorObj</refname>
    <refpurpose>object record object belonging to anchor</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_docbyanchorobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>anchorID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an th object record of the document to
     which <parameter>anchorID</parameter> belongs.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-document-attributes">
   <refnamediv>
    <refname>hw_Document_Attributes</refname>
    <refpurpose>object record of hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_document_attributes</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the object record of the document.
    </para>
    <para>
     For backward compatibility, <function>hw_documentattributes</function>
     is also accepted. This is deprecated, however.
    </para>
    <para>
     See also <function>hw_document_bodytag</function>,
     and <function>hw_document_size</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-document-bodytag">
   <refnamediv>
    <refname>hw_Document_BodyTag</refname>
    <refpurpose>body tag of hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_document_bodytag</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the BODY tag of the document. If the document is an HTML
     document the BODY tag should be printed before the document.
    </para>
    <para>
     See also <function>hw_document_attributes</function>,
     and <function>hw_document_size</function>.
    </para>
    <para>
     For backward compatibility, <function>hw_documentbodytag</function>
     is also accepted. This is deprecated, however.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-document-content">
   <refnamediv>
    <refname>hw_Document_Content</refname>
    <refpurpose>returns content of hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_document_content</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the content of the document. If the document is an HTML
     document the content is everything after the BODY tag. Information
     from the HEAD and BODY tag is in the stored in the object record.
    </para>
    <para>
     See also <function>hw_document_attributes</function>,
     <function>hw_document_size</function>,
     and <function>hw_document_setcontent</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-document-setcontent">
   <refnamediv>
    <refname>hw_Document_SetContent</refname>
    <refpurpose>sets/replaces content of hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_document_setcontent</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
      <methodparam><type>string</type><parameter>content</parameter></methodparam>
     </methodsynopsis>
    <para>
     Sets or replaces the content of the document. If the document is an HTML
     document the content is everything after the BODY tag. Information
     from the HEAD and BODY tag is in the stored in the object record.
     If you provide this information in the content of the document too,
     the Hyperwave server will change the object record accordingly when
     the document is inserted. Probably not a very good idea.
     If this functions fails the document will retain its old content.
    </para>
    <para>
     See also <function>hw_document_attributes</function>,
     <function>hw_document_size</function>,
     and <function>hw_document_content</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-document-size">
   <refnamediv>
    <refname>hw_Document_Size</refname>
    <refpurpose>size of hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_document_size</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the size in bytes of the document.</para>
    <para>
     See also <function>hw_document_bodytag</function>,
     and <function>hw_document_attributes</function>.
    </para>
    <para>
     For backward compatibility, <function>hw_documentsize</function>
     is also accepted. This is deprecated, however.
    </para>    
   </refsect1>
  </refentry>

  <refentry id="function.hw-errormsg">
   <refnamediv>
    <refname>hw_ErrorMsg</refname>
    <refpurpose>returns error message</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_errormsg</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns a string containing the last error message or 'No Error'. If &false;
     is returned, this function failed.
     The message relates to the last command.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-edittext">
   <refnamediv>
    <refname>hw_EditText</refname>
    <refpurpose>retrieve text document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_edittext</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Uploads the text document to the server. The object record
     of the document may not be modified while the document
     is edited. 
     This function will only works for pure text documents. It will
     not open a special data connection and therefore blocks the
     control connection during the transfer.
    </para>
    <para>
     See also <function>hw_pipedocument</function>,
     <function>hw_free_document</function>,
     <function>hw_document_bodytag</function>,
     <function>hw_document_size</function>,
     <function>hw_output_document</function>,
     <function>hw_gettext</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-error">
   <refnamediv>
    <refname>hw_Error</refname>
    <refpurpose>error number</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_error</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the last error number. If the return value is 0 no error has
     occurred. The error relates to the last command.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-free-document">
   <refnamediv>
    <refname>hw_Free_Document</refname>
    <refpurpose>frees hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_free_document</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Frees the memory occupied by the Hyperwave document.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getparents">
   <refnamediv>
    <refname>hw_GetParents</refname>
    <refpurpose>object ids of parents</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getparents</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an indexed array of object ids. Each object id belongs to
     a parent of the object with ID <parameter>objectID</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getparentsobj">
   <refnamediv>
    <refname>hw_GetParentsObj</refname>
    <refpurpose>object records of parents</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getparentsobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an indexed array of object records plus an associated array with statistical
     information about the object records. The associated array is the
     last entry of the returned array. Each object record belongs to
     a parent of the object with ID <parameter>objectID</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getchildcoll">
   <refnamediv>
    <refname>hw_GetChildColl</refname>
    <refpurpose>object ids of child collections</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getchildcoll</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object ids. Each object ID
     belongs to a child collection of the collection with ID
     <parameter>objectID</parameter>. The function will not
     return child documents.</para>
    <para>
     See also <function>hw_children</function>,
     and <function>hw_getchilddoccoll</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getchildcollobj">
   <refnamediv>
    <refname>hw_GetChildCollObj</refname>
    <refpurpose>object records of child collections</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getchildcollobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object records. Each object records
     belongs to a child collection of the collection with ID
     <parameter>objectID</parameter>. The function will not return
     child documents.
    </para>
    <para>
     See also <function>hw_childrenobj</function>,
     and <function>hw_getchilddoccollobj</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getremote">
   <refnamediv>
    <refname>hw_GetRemote</refname>
    <refpurpose>Gets a remote document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_getremote</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns a remote document. Remote documents in Hyperwave notation
     are documents retrieved from an external source. Common remote
     documents are for example external web pages or queries in
     a database.  In order to be able to access external sources
     throught remote documents Hyperwave introduces the HGI (Hyperwave
     Gateway Interface) which is similar to the CGI. Currently, only
     ftp, http-servers and some databases can be accessed by the HGI.
     Calling <function>hw_getremote</function> returns the document from
     the external source.  If you want to use this function you should be
     very familiar with HGIs.  You should also consider to use PHP instead
     of Hyperwave to access external sources. Adding database support
     by a Hyperwave gateway should be more difficult than doing it in PHP.
    </para>
    <para>
     See also <function>hw_getremotechildren</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getremotechildren">
   <refnamediv>
    <refname>hw_GetRemoteChildren</refname>
    <refpurpose>Gets children of remote document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_getremotechildren</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>string</type><parameter>object record</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the children of a remote document. Children of a remote
     document are remote documents itself.
     This makes sense
     if a database query has to be narrowed and is explained in
     Hyperwave Programmers' Guide. If the number of children is 1 the
     function will return the document itself formated by the Hyperwave
     Gateway Interface (HGI). If the number of children
     is greater than 1 it will return an array of object record with
     each maybe the input value for another call to
     <function>hw_getremotechildren</function>. Those object records are
     virtual and do not exist in the Hyperwave server, therefore they
     do not have a valid object ID. How exactely such an object record
     looks like is up to the HGI.
     If you want to use this function you should be very familiar with HGIs.
     You should also consider to use PHP instead of Hyperwave to access
     external
     sources. Adding database support by a Hyperwave gateway should be more
     difficult than doing it in PHP.
    </para> 
    <para>
     See also <function>hw_getremote</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getsrcbydestobj">
   <refnamediv>
    <refname>hw_GetSrcByDestObj</refname>
    <refpurpose>Returns anchors pointing at object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getsrcbydestobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the object records of all anchors pointing to the object with ID
     <parameter>objectID</parameter>. The object can either be a document
     or an anchor of type destination.</para>
    <para>
     See also <function>hw_getanchors</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getobject">
   <refnamediv>
    <refname>hw_GetObject</refname>
    <refpurpose>object record</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getobject</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>[int|array]</type><parameter>objectID</parameter></methodparam>
      <methodparam><type>string</type><parameter>query</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the object record for the object with ID
     <parameter>objectID</parameter> if the second parameter is an integer.
     If the second parameter is an array of integer the function will
     return an array of object records. In such a case the last
     parameter is also evaluated which is a query string.
    </para>
    <para>
     The query string has the following syntax:</para>
    <simpara>
     &lt;expr> ::= "(" &lt;expr> ")" |</simpara>  <simpara>
             "!" &lt;expr> |          /* NOT */</simpara><simpara>
             &lt;expr> "||" &lt;expr> |  /* OR */</simpara><simpara>
             &lt;expr> "&amp;&amp;" &lt;expr> |  /* AND */</simpara><simpara>
             &lt;attribute> &lt;operator> &lt;value></simpara><simpara>

  &lt;attribute> ::= /* any attribute name (Title, Author, DocumentType ...) */</simpara><simpara>

  &lt;operator> ::= "=" |    /* equal */</simpara><simpara>
                 "&lt;" |    /* less than (string compare) */</simpara><simpara>
                 ">" |    /* greater than (string compare) */</simpara><simpara>
                 "~"      /* regular expression matching */</simpara><simpara></simpara>
    <para>
     The query allows to further select certain objects from the list
     of given objects. Unlike the other
     query functions, this query may use not indexed attributes. How many
     object records are returned depends on the query and if access to
     the object is allowed.
    </para>
    <para>
     See also <function>hw_getandlock</function>,
     and <function>hw_getobjectbyquery</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getandlock">
   <refnamediv>
    <refname>hw_GetAndLock</refname>
    <refpurpose>return bject record and lock object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_getandlock</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the object record for the object with ID
     <parameter>objectID</parameter>.
     It will also lock the object, so other users cannot access
     it until it is unlocked.
    </para>
    <para>
     See also <function>hw_unlock</function>,
     and <function>hw_getobject</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-gettext">
   <refnamediv>
    <refname>hw_GetText</refname>
    <refpurpose>retrieve text document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_gettext</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
      <methodparam choice="opt"><type>mixed</type><parameter>
        rootID/prefix
       </parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the document with object ID
     <parameter>objectID</parameter>. If the document
     has anchors which can be inserted, they will be inserted already.
     The optional parameter <parameter>rootID/prefix</parameter> can
     be a string or an integer. If it is an integer it determines
     how links are inserted
     into the document. The default is 0 and will result in links that
     are constructed from the name of the link's destination object. This
     is useful for web applications. If a link points to an object with
     name 'internet_movie' the HTML link will be
     &lt;A HREF="/internet_movie">. The actual location of the source and
     destination object in the document hierachy is disregarded. You
     will have to set up your web browser, to rewrite that URL to for
     example '/my_script.php3/internet_movie'. 'my_script.php3' will
     have to evaluate $PATH_INFO and retrieve the document.
     All links will have the prefix '/my_script.php3/'. If you do not
     want this you can set the optional parameter
     <parameter>rootID/prefix</parameter> to any prefix which
     is used instead. Is this case it has to be a string.
    </para>
    <para>
     If <parameter>rootID/prefix</parameter> is an integer and
     unequal to 0 the link is constructed from all the names
     starting at the object with the id <parameter>rootID/prefix</parameter>
     separated by a slash relative to the current object.
     If for example the above document 'internet_movie' is located
     at 'a-b-c-internet_movie' with '-' being the seperator between
     hierachy levels on the Hyperwave server and the source document is
     located at 'a-b-d-source' the resulting HTML link would be:
     &lt;A HREF="../c/internet_movie">. This is useful if you want
     to download the whole server content onto disk and map
     the document hierachy onto the file system.
    </para>
    <para>
     This function will only work for pure text documents. It will
     not open a special data connection and therefore blocks the
     control connection during the transfer.
    </para>
    <para>
     See also <function>hw_pipedocument</function>,
     <function>hw_free_document</function>,
     <function>hw_document_bodytag</function>,
     <function>hw_document_size</function>,
     and <function>hw_output_document</function>.
     </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getobjectbyquery">
   <refnamediv>
    <refname>hw_GetObjectByQuery</refname>
    <refpurpose>search object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getobjectbyquery</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>string</type><parameter>query</parameter></methodparam>
      <methodparam><type>int</type><parameter>max_hits</parameter></methodparam>
     </methodsynopsis>
    <para>
     Searches for objects on the whole server and returns an array of
     object ids. The maximum number of matches is limited to 
     <parameter>max_hits</parameter>. If <parameter>max_hits</parameter>
     is set to -1 the maximum number of matches is unlimited.
    </para>
    <para>
     The query will only work with indexed attributes.
    </para>
    <para>
     See also <function>hw_getobjectbyqueryobj</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getobjectbyqueryobj">
   <refnamediv>
    <refname>hw_GetObjectByQueryObj</refname>
    <refpurpose>search object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getobjectbyqueryobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>string</type><parameter>query</parameter></methodparam>
      <methodparam><type>int</type><parameter>max_hits</parameter></methodparam>
     </methodsynopsis>
    <para>
     Searches for objects on the whole server and returns an array of
     object records. The maximum number of matches is limited to
     <parameter>max_hits</parameter>. If <parameter>max_hits</parameter>
     is set to -1 the maximum number of matches is unlimited.
    </para>
    <para>
     The query will only work with indexed attributes.
    </para>
    <para>
     See also <function>hw_getobjectbyquery</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getobjectbyquerycoll">
   <refnamediv>
    <refname>hw_GetObjectByQueryColl</refname>
    <refpurpose>search object in collection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getobjectbyquerycoll</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
      <methodparam><type>string</type><parameter>query</parameter></methodparam>
      <methodparam><type>int</type><parameter>max_hits</parameter></methodparam>
     </methodsynopsis>
    <para>
     Searches for objects in collection with ID
     <parameter>objectID</parameter> and returns an array of
     object ids. The maximum number of matches is limited to
     <parameter>max_hits</parameter>.
     If <parameter>max_hits</parameter>
     is set to -1 the maximum number of matches is unlimited.
    </para>
    <para>
     The query will only work with indexed attributes.</para>
    <para>
     See also <function>hw_getobjectbyquerycollobj</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getobjectbyquerycollobj">
   <refnamediv>
    <refname>hw_GetObjectByQueryCollObj</refname>
    <refpurpose>search object in collection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getobjectbyquerycollobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
      <methodparam><type>string</type><parameter>query</parameter></methodparam>
      <methodparam><type>int</type><parameter>max_hits</parameter></methodparam>
     </methodsynopsis>
    <para>
     Searches for objects in collection with ID
     <parameter>objectID</parameter> and returns an array of
     object records. The maximum number of matches is limited to
     <parameter>max_hits</parameter>.
     If <parameter>max_hits</parameter>
     is set to -1 the maximum number of matches is unlimited.
    </para>
    <para>
     The query will only work with indexed attributes.
    </para>
    <para>
     See also <function>hw_getobjectbyquerycoll</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getchilddoccoll">
   <refnamediv>
    <refname>hw_GetChildDocColl</refname>
    <refpurpose>object ids of child documents of collection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getchilddoccoll</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns array of object ids for child documents of a collection.
    </para>
    <para>
     See also <function>hw_children</function>,
     and <function>hw_getchildcoll</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getchilddoccollobj">
   <refnamediv>
    <refname>hw_GetChildDocCollObj</refname>
    <refpurpose>object records of child documents of collection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getchilddoccollobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object records for child documents of a collection.</para>
    <para>
     See also <function>hw_childrenobj</function>,
     and <function>hw_getchildcollobj</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getanchors">
   <refnamediv>
    <refname>hw_GetAnchors</refname>
    <refpurpose>object ids of anchors of document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getanchors</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object ids with anchors of the document
     with object ID <parameter>objectID</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getanchorsobj">
   <refnamediv>
    <refname>hw_GetAnchorsObj</refname>
    <refpurpose>object records of anchors of document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_getanchorsobj</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of object records with anchors of the document
     with object ID <parameter>objectID</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-mv">
   <refnamediv>
    <refname>hw_Mv</refname>
    <refpurpose>moves objects</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_mv</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>array</type><parameter>object id array</parameter></methodparam>
      <methodparam><type>int</type><parameter>source id</parameter></methodparam>
      <methodparam><type>int</type><parameter>destination id</parameter></methodparam>
     </methodsynopsis>
    <para>
     Moves the objects with object ids as specified in the second
     parameter from the collection with id <parameter>source id</parameter>
     to the collection with the id <parameter>destination id</parameter>.
     If the destination id is 0 the objects will
     be unlinked from the source collection. If this is the last instance
     of that object it will be deleted. If you want to delete all instances
     at once, use <function>hw_deleteobject</function>.
    </para>
    <para>
     The value return is the number of moved objects.
    </para>
    <para>
     See also <function>hw_cp</function>,
     and <function>hw_deleteobject</function>.
     </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-identify">
   <refnamediv>
    <refname>hw_Identify</refname>
    <refpurpose>identifies as user</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_identify</methodname>
      <methodparam><type>string</type><parameter>username</parameter></methodparam>
      <methodparam><type>string</type><parameter>password</parameter></methodparam>
     </methodsynopsis>
    <para>
     Identifies as user with <parameter>username</parameter> and
     <parameter>password</parameter>. Identification
     is only valid for the current session. I do not thing this
     function will be needed very often. In most cases it will
     be easier to identify with the opening of the connection.
    </para>
    <para>
     See also <function>hw_connect</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-incollections">
   <refnamediv>
    <refname>hw_InCollections</refname>
    <refpurpose>check if object ids in collections</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_incollections</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>array</type><parameter>object_id_array</parameter></methodparam>
      <methodparam><type>array</type><parameter>collection_id_array</parameter></methodparam>
      <methodparam><type>int</type><parameter>return_collections</parameter></methodparam>
     </methodsynopsis>
    <para>
     Checks whether a set of objects (documents or collections)
     specified by the <parameter>object_id_array</parameter> is part of
     the collections listed in <parameter>collection_id_array</parameter>.
     When the fourth parameter <parameter>return_collections</parameter> is 0,
     the subset of object ids that is part of the collections (i.e.,
     the documents or collections that are children of one or more
     collections of collection ids or their subcollections, recursively)
     is returned as an array. When the fourth parameter is 1, however, the
     set of collections that have one or more objects of this subset as
     children are returned as an array. This option allows a client to,
     e.g., highlight the part of the collection hierarchy that contains
     the matches of a previous query, in a graphical overview.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-info">
   <refnamediv>
    <refname>hw_Info</refname>
    <refpurpose>info about connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_info</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns information about the current connection. The returned string
     has the following format: &lt;Serverstring&gt;, &lt;Host&gt;,
     &lt;Port&gt;, &lt;Username&gt;, &lt;Port of Client&gt;,
     &lt;Byte swapping&gt;
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-inscoll">
   <refnamediv>
    <refname>hw_InsColl</refname>
    <refpurpose>insert collection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_inscoll</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
      <methodparam><type>array</type><parameter>object_array</parameter></methodparam>
     </methodsynopsis>
    <para>
     Inserts a new collection with attributes as in
     <parameter>object_array</parameter> into
     collection with object ID <parameter>objectID</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-insdoc">
   <refnamediv>
    <refname>hw_InsDoc</refname>
    <refpurpose>insert document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_insdoc</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>parentID</parameter></methodparam>
      <methodparam><type>string</type><parameter>object_record</parameter></methodparam>
      <methodparam><type>string</type><parameter>text</parameter></methodparam>
     </methodsynopsis>
    <para>
     Inserts a new document with attributes as in
     <parameter>object_record</parameter> into collection with object ID
     <parameter>parentID</parameter>. This function inserts either 
     an object record only or an object record and a pure ascii text in
     <parameter>text</parameter> if <parameter>text</parameter> is given.
     If you want to insert a general document of any kind use
     <function>hw_insertdocument</function> instead.
    </para>
    <para>
     See also <function>hw_insertdocument</function>,
     and <function>hw_inscoll</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-insertdocument">
   <refnamediv>
    <refname>hw_InsertDocument</refname>
    <refpurpose>upload any document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_insertdocument</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>parent_id</parameter></methodparam>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
      Uploads a document into the collection with
      <parameter>parent_id</parameter>.
      The document has to be created before with
      <function>hw_new_document</function>. Make sure that
      the object record of the new document contains at least
      the attributes: Type, DocumentType, Title and Name. Possibly
      you also want to set the MimeType. The functions returns the
      object id of the new document or &false;.
    </para>
    <para>
     See also <function>hw_pipedocument</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-insertobject">
   <refnamediv>
    <refname>hw_InsertObject</refname>
    <refpurpose>inserts an object record</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_insertobject</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>string</type><parameter>object rec</parameter></methodparam>
      <methodparam><type>string</type><parameter>parameter</parameter></methodparam>
     </methodsynopsis>
    <para>
      Inserts an object into the server. The object can be
      any valid hyperwave object. See the HG-CSP documentation
      for a detailed information on how the parameters have to be.
    </para>
    <para>
      Note: If you want to insert an Anchor, the attribute Position
      has always been set either to a start/end value or to
      'invisible'. Invisible positions are needed if the annotation
      has no correspondig link in the annotation text.
    </para> 
    <para>
     See also <function>hw_pipedocument</function>,
     <function>hw_insertdocument</function>,
     <function>hw_insdoc</function>,
     and <function>hw_inscoll</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-mapid">
   <refnamediv>
    <refname>hw_mapid</refname>
    <refpurpose>Maps global id on virtual local id</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_mapid</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>server id</parameter></methodparam>
      <methodparam><type>int</type><parameter>object id</parameter></methodparam>
     </methodsynopsis>
    <para>
      Maps a global object id on any hyperwave server, even those
      you did not connect to with <function>hw_connect</function>,
      onto a virtual object id. This virtual object id can then be
      used as any other object id, e.g. to obtain the object record
      with <function>hw_getobject</function>. The server id is the
      first part of the global object id (GOid) of the object which
      is actually the IP number as an integer.
    </para>
    <para>
      Note: In order to use this function you will have to set
      the F_DISTRIBUTED flag, which can currently only be set at
      compile time in hg_comm.c. It is not set by default. Read
      the comment at the beginning of hg_comm.c
    </para> 
   </refsect1>
  </refentry>


  <refentry id="function.hw-modifyobject">
   <refnamediv>
    <refname>hw_Modifyobject</refname>
    <refpurpose>modifies object record</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_modifyobject</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>object_to_change</parameter></methodparam>
      <methodparam><type>array</type><parameter>remove</parameter></methodparam>
      <methodparam><type>array</type><parameter>add</parameter></methodparam>
      <methodparam><type>int</type><parameter>mode</parameter></methodparam>
     </methodsynopsis>
    <para>
     This command allows to remove, add, or modify individual attributes
     of an object record.  The object is specified by the Object ID
     <parameter>object_to_change</parameter>. The first array
     <parameter>remove</parameter> is a list of attributes to remove.
     The second array <parameter>add</parameter> is a list of attributes
     to add. In order to modify an attribute one will have to remove
     the old one and add a new one. <function>hw_modifyobject</function>
     will always remove the attributes before it adds attributes unless
     the value of the attribute to remove is not a string or array.
    </para>
    <para>
     The last parameter determines if the modification is performed
     recursively. 1 means recurive modification. If some of the objects
     cannot be modified they will be skiped without notice.
     <function>hw_error</function> may not indicate an error though
     some of the objects could not be modified.
    </para>
    <para>
     The keys of both arrays are the attributes name. The value of each
     array element can either be an array, a string or anything else.
     If it is an array
     each attribute value is constructed by the key of each element plus
     a colon and the value of each element. If it is a string it is taken
     as the attribute value. An empty string will result in a complete
     removal of that attribute. If the value is neither a string nor an
     array but something else, e.g. an integer, no operation at all will
     be performed on the attribute. This is neccessary if you want to
     to add a completely new attribute not just a new value for an existing
     attribute. If the remove array contained
     an empty string for that attribute, the attribute would be tried to be
     removed which would fail since it doesn't exist. The following addition of
     a new value for that attribute would also fail. Setting the value
     for that attribute to e.g. 0 would not even try to remove it and
     the addition will work.
    </para>
    <para>
     If you would like to change the attribute 'Name' with the current
     value 'books' into 'articles' you will have to create two arrays
     and call <function>hw_modifyobject</function>.
     <example>
      <title>modifying an attribute</title>
      <programlisting role="php">
<![CDATA[
       // $connect is an existing connection to the Hyperwave server
       // $objid is the ID of the object to modify
       $remarr = array("Name" => "books");
       $addarr = array("Name" => "articles");
       $hw_modifyobject($connect, $objid, $remarr, $addarr);
]]>
      </programlisting>
     </example>
     In order to delete/add a name=value pair from/to the object record just
     pass the remove/add array and set the last/third parameter to an empty
     array. If the attribute is the first one with that name to add, set
     attribute value in the remove array to an integer.
     <example>
      <title>adding a completely new attribute</title>
      <programlisting role="php">
<![CDATA[
       // $connect is an existing connection to the Hyperwave server
       // $objid is the ID of the object to modify
       $remarr = array("Name" => 0);
       $addarr = array("Name" => "articles");
       $hw_modifyobject($connect, $objid, $remarr, $addarr);
]]>
      </programlisting>
     </example>
    </para>
    <para>
     <note>
      <simpara>
       Multilingual attributes, e.g. 'Title', can be modified in two
       ways. Either by providing the attributes value in its native
       form 'language':'title' or by providing an array with elements
       for each language as described above. The above example would
       than be:
      </simpara>
     </note>
     <example>
      <title>modifying Title attribute</title>
      <programlisting role="php">
<![CDATA[
       $remarr = array("Title" => "en:Books");
       $addarr = array("Title" => "en:Articles");
       $hw_modifyobject($connect, $objid, $remarr, $addarr);
]]>
      </programlisting>
     </example>
      or
     <example>
      <title>modifying Title attribute</title>
      <programlisting role="php">
<![CDATA[
       $remarr = array("Title" => array("en" => "Books"));
       $addarr = array("Title" => array("en" => "Articles", "ge"=>"Artikel"));
       $hw_modifyobject($connect, $objid, $remarr, $addarr);
]]>
      </programlisting>
     </example>
     This removes the english title 'Books' and adds the english title
     'Articles' and the german title 'Artikel'.
     <example>
      <title>removing attribute</title>
      <programlisting role="php">
<![CDATA[
       $remarr = array("Title" => "");
       $addarr = array("Title" => "en:Articles");
       $hw_modifyobject($connect, $objid, $remarr, $addarr);
]]>
      </programlisting>
     </example>
     <note>
      <simpara> 
       This will remove all attributes with the name 'Title' and adds
       a new 'Title' attribute. This comes in handy if you want to
       remove attributes recursively.  
      </simpara>
     </note>
     <note>
      <simpara>
       If you need to delete all attributes with a certain name you
       will have to pass an empty string as the attribute value.
      </simpara>
     </note>
     <note>
      <simpara>
       Only the attributes 'Title', 'Description' and 'Keyword' will
       properly handle the language prefix. If those attributes don't carry
       a language prefix, the prefix 'xx' will be assigned.
      </simpara>
     </note>
     <note>
      <simpara>
       The 'Name' attribute is somewhat special. In some cases it cannot 
       be complete removed. You will get an error message 'Change of base
       attribute' (not clear when this happens). Therefore you will always
       have to add a new Name first and than remove the old one.
      </simpara>
     </note>
     <note>
      <simpara>
       You may not suround this function by calls to
       <function>hw_getandlock</function> and <function>hw_unlock</function>.
       <function>hw_modifyobject</function> does this internally.
      </simpara>
     </note>
    </para>
    <para>
      Returns &true; if no error occurs otherwise &false;.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-new-document">
   <refnamediv>
    <refname>hw_New_Document</refname>
    <refpurpose>create new document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_new_document</methodname>
      <methodparam><type>string</type><parameter>object_record</parameter></methodparam>
      <methodparam><type>string</type><parameter>document_data</parameter></methodparam>
      <methodparam><type>int</type><parameter>document_size</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns a new Hyperwave document with document data set to
     <parameter>document_data</parameter> and object record set to
     <parameter>object_record</parameter>. The length of the 
     <parameter>document_data</parameter> has to passed in
     <parameter>document_size</parameter>This function does not
     insert the document into the Hyperwave server.
    </para>
    <para>
     See also <function>hw_free_document</function>,
     <function>hw_document_size</function>,
     <function>hw_document_bodytag</function>,
     <function>hw_output_document</function>,
     and <function>hw_insertdocument</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-objrec2array">
   <refnamediv>
    <refname>hw_Objrec2Array</refname>
    <refpurpose>convert attributes from object record to object array</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>hw_objrec2array</methodname>
      <methodparam><type>string</type><parameter>object_record</parameter></methodparam>
      <methodparam choice="opt"><type>array</type><parameter>
        format
       </parameter></methodparam>
     </methodsynopsis>
    <para>
     Converts an <parameter>object_record</parameter> into an object array.
     The keys of the resulting array are the attributes names.
     Multi-value attributes like 'Title' in different languages form its own
     array. The keys of this array are the left part to the colon of the
     attribute value. This left part must be two characters long.
     Other multi-value attributes without a prefix form an indexed array.
     If the optional parameter is missing the 
     attributes 'Title', 'Description'
     and 'Keyword' are treated as language attributes and the attributes
     'Group', 'Parent' and 'HtmlAttr' as non-prefixed multi-value attributes.
     By passing an array holding the type for each attribute you can
     alter this behaviour. The array is an associated array with the attribute
     name as its key and the value being one of
     <literal>HW_ATTR_LANG</literal> or <literal>HW_ATTR_NONE</literal>
    </para>
    <para>
     See also <function>hw_array2objrec</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-output-document">
   <refnamediv>
    <refname>hw_Output_Document</refname>
    <refpurpose>prints hw_document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_output_document</methodname>
      <methodparam><type>int</type><parameter>hw_document</parameter></methodparam>
     </methodsynopsis>
    <para>
     Prints the document without the BODY tag.
    </para>
    <para>
     For backward compatibility, <function>hw_outputdocument</function> is
     also accepted. This is deprecated, however.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-pconnect">
   <refnamediv>
    <refname>hw_pConnect</refname>
    <refpurpose>make a persistent database connection</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_pconnect</methodname>
      <methodparam><type>string</type><parameter>host</parameter></methodparam>
      <methodparam><type>int</type><parameter>port</parameter></methodparam>
      <methodparam><type>string</type><parameter>username</parameter></methodparam>
      <methodparam><type>string</type><parameter>password</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns a connection index on success, or &false; if the connection
     could not be made.  Opens a persistent connection to a Hyperwave
     server. Each of the arguments should be a quoted string,
     except for the port number. The <parameter>username</parameter>
     and <parameter>password</parameter> arguments are
     optional and can be left out. In such a case no identification with
     the server will be done. It is similar to identify as user anonymous.
     This function returns a connection
     index that is needed by other Hyperwave functions. You can have
     multiple persistent connections open at once.</para>
    <para>
     See also <function>hw_connect</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-pipedocument">
   <refnamediv>
    <refname>hw_PipeDocument</refname>
    <refpurpose>retrieve any document</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_pipedocument</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the Hyperwave document with object ID
     <parameter>objectID</parameter>. If the document
     has anchors which can be inserted, they will have been inserted already.
     The document will be transfered via a special data connection which
     does not block the control connection.</para>
    <para>
     See also <function>hw_gettext</function> for more on link insertion,
     <function>hw_free_document</function>,
     <function>hw_document_size</function>,
     <function>hw_document_bodytag</function>,
     and <function>hw_output_document</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-root">
   <refnamediv>
    <refname>hw_Root</refname>
    <refpurpose>root object id</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_root</methodname>
      <methodparam><parameter/></methodparam>
     </methodsynopsis>
    <para>
     Returns the object ID of the hyperroot collection. Currently this
     is always 0. The child collection of the hyperroot is the root
     collection of the connected server.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-unlock">
   <refnamediv>
    <refname>hw_Unlock</refname>
    <refpurpose>unlock object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_unlock</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
      <methodparam><type>int</type><parameter>objectID</parameter></methodparam>
     </methodsynopsis>
    <para>
     Unlocks a document, so other users regain access.
    </para>
    <para>
     See also <function>hw_getandlock</function>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-who">
   <refnamediv>
    <refname>hw_Who</refname>
    <refpurpose>List of currently logged in users</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>int</type><methodname>hw_who</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns an array of users currently logged into the Hyperwave server.
     Each entry in this array is an array itself containing the elements id,
     name, system, onSinceDate, onSinceTime, TotalTime and self. 'self'
     is 1 if this entry belongs to the user who initianted the request.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.hw-getusername">
   <refnamediv>
    <refname>hw_getusername</refname>
    <refpurpose>name of currently logged in user</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_getusername</methodname>
      <methodparam><type>int</type><parameter>connection</parameter></methodparam>
     </methodsynopsis>
    <para>
     Returns the username of the connection.
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-stat'>
   <refnamediv>
    <refname>hw_stat</refname>
    <refpurpose>
     Returns status string
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_stat</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>
  
  <refentry id='function.hw-setlinkroot'>
   <refnamediv>
    <refname>hw_setlinkroot</refname>
    <refpurpose>
     Set the id to which links are calculated
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>void</type><methodname>hw_setlinkroot</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
      <methodparam><type>int</type><parameter>rootid</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-connection-info'>
   <refnamediv>
    <refname>hw_connection_info</refname>
    <refpurpose>
     Prints information about the connection to Hyperwave server
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>void</type><methodname>hw_connection_info</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-dummy'>
   <refnamediv>
    <refname>hw_dummy</refname>
    <refpurpose>
     Hyperwave dummy function
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_dummy</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
      <methodparam><type>int</type><parameter>id</parameter></methodparam>
      <methodparam><type>int</type><parameter>msgid</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-insertanchors'>
   <refnamediv>
    <refname>hw_insertanchors</refname>
    <refpurpose>
     Inserts only anchors into text
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_insertanchors</methodname>
      <methodparam><type>int</type><parameter>hwdoc</parameter></methodparam>
      <methodparam><type>array</type><parameter>anchorecs</parameter></methodparam>
      <methodparam><type>array</type><parameter>dest</parameter></methodparam>
      <methodparam choice="opt"><type>array</type><parameter>urlprefixes</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-getrellink'>
   <refnamediv>
    <refname>hw_getrellink</refname>
    <refpurpose>
     Get link from source to dest relative to rootid
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>string</type><methodname>hw_getrellink</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
      <methodparam><type>int</type><parameter>rootid</parameter></methodparam>
      <methodparam><type>int</type><parameter>sourceid</parameter></methodparam>
      <methodparam><type>int</type><parameter>destid</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

  <refentry id='function.hw-changeobject'>
   <refnamediv>
    <refname>hw_changeobject</refname>
    <refpurpose>
     Changes attributes of an object (obsolete)
    </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>void</type><methodname>hw_changeobject</methodname>
      <methodparam><type>int</type><parameter>link</parameter></methodparam>
      <methodparam><type>int</type><parameter>objid</parameter></methodparam>
      <methodparam><type>array</type><parameter>attributes</parameter></methodparam>
     </methodsynopsis>
    <para>
     &warn.undocumented.func;
    </para>
   </refsect1>
  </refentry>

 </reference>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->