1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 9188 9189 9190 9191 9192 9193 9194 9195 9196 9197 9198 9199 9200 9201 9202 9203 9204 9205 9206 9207 9208 9209 9210 9211 9212 9213 9214 9215 9216 9217 9218 9219 9220 9221 9222 9223 9224 9225 9226 9227 9228 9229 9230 9231 9232 9233 9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373 9374 9375 9376 9377 9378 9379 9380 9381 9382 9383 9384 9385 9386 9387 9388 9389 9390 9391 9392 9393 9394 9395 9396 9397 9398 9399 9400 9401 9402 9403 9404 9405 9406 9407 9408 9409 9410 9411 9412 9413 9414 9415 9416 9417 9418 9419 9420 9421 9422 9423 9424 9425 9426 9427 9428 9429 9430 9431 9432 9433 9434 9435 9436 9437 9438 9439 9440 9441 9442 9443 9444 9445 9446 9447 9448 9449 9450 9451 9452 9453 9454 9455 9456 9457 9458 9459 9460 9461 9462 9463 9464 9465 9466 9467 9468 9469 9470 9471 9472 9473 9474 9475 9476 9477 9478 9479 9480 9481 9482 9483 9484 9485 9486 9487 9488 9489 9490 9491 9492 9493 9494 9495 9496 9497 9498 9499 9500 9501 9502 9503 9504 9505 9506 9507 9508 9509 9510 9511 9512 9513 9514 9515 9516 9517 9518 9519 9520 9521 9522 9523 9524 9525 9526 9527 9528 9529 9530 9531 9532 9533 9534 9535 9536 9537 9538 9539 9540 9541 9542 9543 9544 9545 9546 9547 9548 9549 9550 9551 9552 9553 9554 9555 9556 9557 9558 9559 9560 9561 9562 9563 9564 9565 9566 9567 9568 9569 9570 9571 9572 9573 9574 9575 9576 9577 9578 9579 9580 9581 9582 9583 9584 9585 9586 9587 9588 9589 9590 9591 9592 9593 9594 9595 9596 9597 9598 9599 9600 9601 9602 9603 9604 9605 9606 9607 9608 9609 9610 9611 9612 9613 9614 9615 9616 9617 9618 9619 9620 9621 9622 9623 9624 9625 9626 9627 9628 9629 9630 9631 9632 9633 9634 9635 9636 9637 9638 9639 9640 9641 9642 9643 9644 9645 9646 9647 9648 9649 9650 9651 9652 9653 9654 9655 9656 9657 9658 9659 9660 9661 9662 9663 9664 9665 9666 9667 9668 9669 9670 9671 9672 9673 9674 9675 9676 9677 9678 9679 9680 9681 9682 9683 9684 9685 9686 9687 9688 9689 9690 9691 9692 9693 9694 9695 9696 9697 9698 9699 9700 9701 9702 9703 9704 9705 9706 9707 9708 9709 9710 9711 9712 9713 9714 9715 9716 9717 9718 9719 9720 9721 9722 9723 9724 9725 9726 9727 9728 9729 9730 9731 9732 9733 9734 9735 9736 9737 9738 9739 9740 9741 9742 9743 9744 9745 9746 9747 9748 9749 9750 9751 9752 9753 9754 9755 9756 9757 9758 9759 9760 9761 9762 9763 9764 9765 9766 9767 9768 9769 9770 9771 9772 9773 9774 9775 9776 9777 9778 9779 9780 9781 9782 9783 9784 9785 9786 9787 9788 9789 9790 9791 9792 9793 9794 9795 9796 9797 9798 9799 9800 9801 9802 9803 9804 9805 9806 9807 9808 9809 9810 9811 9812 9813 9814 9815 9816 9817 9818 9819 9820 9821 9822 9823 9824 9825 9826 9827 9828 9829 9830 9831 9832 9833 9834 9835 9836 9837 9838 9839 9840 9841 9842 9843 9844 9845 9846 9847 9848 9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867
|
<?xml version="1.0" encoding="ISO-8859-1" ?>
<sect2 id="vspx_attr_types" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vd="http://www.openlinksw.com/vspx/deps/" xmlns:v="http://www.openlinksw.com/vspx/">
<title>Commonly Used Types of Attributes of VSPX Controls</title>
<refentry id="vc_type_CalculateableValue">
<refmeta>
<refentrytitle>CalculateableValue</refentrytitle>
<refmiscinfo>vspx_simple_type</refmiscinfo>
</refmeta>
<refnamediv>
<refname>CalculateableValue</refname>
<refpurpose>The type of attribute that contains an expression to be calculated at run time.</refpurpose>
</refnamediv>
<refsect1 id="vc_desc_CalculateableValue">
<title>Description</title>
<para>
The type of a string constant or an expression.
If the value of this type is started with '--', the rest of string
is the text of an expression to be calculated in order to get the effective value of the property.
If the value of this type is not started with '--', the effective value is the original string itself.
</para>
<para>
The type identifier 'CalculateableValue' is introduced only for diagnostic purposes, you will never use it in VSPX code.
When Virtuoso server tries to compile an invalid VSPX page, you might see a diagnostic messages like 'the value of attribute X of a control Y does not match pattern ... for type CalculateableValue'.
If you see this then you should check the syntax of the value of the specified attribute.
</para>
</refsect1>
</refentry>
<refentry id="vc_type_ForcedCalculateableValue">
<refmeta>
<refentrytitle>ForcedCalculateableValue</refentrytitle>
<refmiscinfo>vspx_simple_type</refmiscinfo>
</refmeta>
<refnamediv>
<refname>ForcedCalculateableValue</refname>
<refpurpose>The type of attribute that contains an expression to be calculated at run time.</refpurpose>
</refnamediv>
<refsect1 id="vc_desc_ForcedCalculateableValue">
<title>Description</title>
<para>
The type of an expression.
The value of this type must be started with '--', the rest of string
is the text of an expression to be calculated in order to get the effective value of the property.
</para>
<para>
The type identifier 'ForcedCalculateableValue' is introduced only for diagnostic purposes, you will never use it in VSPX code.
When Virtuoso server tries to compile an invalid VSPX page, you might see a diagnostic messages like 'the value of attribute X of a control Y does not match pattern ... for type ForcedCalculateableValue'.
If you see this then you should check the syntax of the value of the specified attribute.
</para>
</refsect1>
</refentry>
<refentry id="vc_type_SqlCode">
<refmeta>
<refentrytitle>SqlCode</refentrytitle>
<refmiscinfo>vspx_simple_type</refmiscinfo>
</refmeta>
<refnamediv>
<refname>SqlCode</refname>
<refpurpose>The type of a string value that is a Text of a Virtuoso/PL procedure.</refpurpose>
</refnamediv>
<refsect1 id="vc_desc_SqlCode">
<title>Description</title>
<para>Text of an event handler or other Virtuoso/PL procedure. This is
expected to be a complete statement or sequence of statements, hence
to be terminated like a statement, unlike the 'calculatable value'
expression case.
</para>
<para>
The type identifier 'SqlCode' is introduced only for diagnostic purposes, you will never use it in VSPX code.
When Virtuoso server tries to compile an invalid VSPX page, you might see a diagnostic messages like 'the value of attribute X of a control Y does not match pattern ... for type SqlCode'.
If you see this then you should check the syntax of the value of the specified attribute.
</para>
</refsect1>
</refentry>
<refentry id="vc_type_SqlName">
<refmeta>
<refentrytitle>SqlName</refentrytitle>
<refmiscinfo>vspx_simple_type</refmiscinfo>
</refmeta>
<refnamediv>
<refname>SqlName</refname>
<refpurpose>The type of attribute that contains a name of the Virtuoso/PL UDT instance that should be created for the control.</refpurpose>
</refnamediv>
<refsect1 id="vc_desc_SqlName">
<title>Description</title>
<para>
The type for a Virtuoso/PL name that should be used during code generation.
KNOWN BUG: If double quotes are used in the value of this type then
the generated code may be incorrect.
This is why this schema restrictes the syntax of values of such type.
</para>
<para>
The type identifier 'SqlName' is introduced only for diagnostic purposes, you will never use it in VSPX code.
When Virtuoso server tries to compile an invalid VSPX page, you might see a diagnostic messages like 'the value of attribute X of a control Y does not match pattern ... for type SqlName'.
If you see this then you should check the syntax of the value of the specified attribute.
</para>
</refsect1>
</refentry>
</sect2>
<sect2 id="vspx_controls" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vd="http://www.openlinksw.com/vspx/deps/" xmlns:v="http://www.openlinksw.com/vspx/">
<title>VSPX Controls</title>
<refentry id="vc_after_data_bind">
<refmeta>
<refentrytitle>after-data-bind</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>after-data-bind</refname>
<refpurpose>Container for code that should be executed after data bind.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_after_data_bind">
<funcprototype id="vc_proto_after_data_bind">
<funcdef>
<<function>after-data-bind</function>>(EventHandler)</<function>after-data-bind</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_after_data_bind">
<title>Description</title>
<para>
The code contained in this element is executed after the default data bind processing on the returning edge of recursion.
The context has self as the page, control as the control with this handler, event as the vspx_event which caused the page invocation.
Any return value from the code is ignored.
</para>
</refsect1>
</refentry>
<refentry id="vc_after_data_bind_container">
<refmeta>
<refentrytitle>after-data-bind-container</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>after-data-bind-container</refname>
<refpurpose>This is identical to v:after-data-bind.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_after_data_bind_container">
<funcprototype id="vc_proto_after_data_bind_container">
<funcdef>
<<function>after-data-bind-container</function>>(EventHandler)</<function>after-data-bind-container</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_after_data_bind_container">
<title>Description</title>
</refsect1>
</refentry>
<refentry id="vc_before_data_bind">
<refmeta>
<refentrytitle>before-data-bind</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>before-data-bind</refname>
<refpurpose>Container for code that should be executed before data bind.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_before_data_bind">
<funcprototype id="vc_proto_before_data_bind">
<funcdef>
<<function>before-data-bind</function>>(EventHandler)</<function>before-data-bind</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_before_data_bind">
<title>Description</title>
<para>
The code contained in this element is executed before the default data bind processing on the descending edge of recursion.
The context has self as the page, control as the control with this handler, event as the vspx_event which caused the page invocation.
A return value from the code if equal to 1 (one) will stop further data-bind processing of the
containing control and it's children if any.
</para>
</refsect1>
</refentry>
<refentry id="vc_before_data_bind_container">
<refmeta>
<refentrytitle>before-data-bind-container</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>before-data-bind-container</refname>
<refpurpose>This is identical to v:before-data-bind.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_before_data_bind_container">
<funcprototype id="vc_proto_before_data_bind_container">
<funcdef>
<<function>before-data-bind-container</function>>(EventHandler)</<function>before-data-bind-container</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_before_data_bind_container">
<title>Description</title>
</refsect1>
</refentry>
<refentry id="vc_before_render">
<refmeta>
<refentrytitle>before-render</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>before-render</refname>
<refpurpose>Container for code that should be executed before rendering.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_before_render">
<funcprototype id="vc_proto_before_render">
<funcdef>
<<function>before-render</function>>(EventHandler)</<function>before-render</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_before_render">
<title>Description</title>
<para>
The code contained in this element is executed on the descending edge of recursion when traversing the vspx control tree before rendering.
This is expected to have side effects on vspx controls only, not to return anything or emit any output.
Any return value from the code is ignored.
</para>
</refsect1>
</refentry>
<refentry id="vc_before_render_container">
<refmeta>
<refentrytitle>before-render-container</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>before-render-container</refname>
<refpurpose>This is identical to v:before-render.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_before_render_container">
<funcprototype id="vc_proto_before_render_container">
<funcdef>
<<function>before-render-container</function>>(EventHandler)</<function>before-render-container</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_before_render_container">
<title>Description</title>
</refsect1>
</refentry>
<refentry id="vc_button">
<refmeta>
<refentrytitle>button</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>button</refname>
<refpurpose>Scriptable button.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_button">
<funcprototype id="vc_proto_button">
<funcdef>
<<function>button</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>action</parameter> (required) </attribute>
<attribute>
<parameter>value</parameter> (required) </attribute>
<attribute>
<parameter>style</parameter> (optional) </attribute>
<attribute>
<parameter>active</parameter> (optional) </attribute>
<attribute>
<parameter>initial-active</parameter> (optional) </attribute>
<attribute>
<parameter>child-window-options</parameter> (optional) </attribute>
<attribute>
<parameter>browser-current</parameter> (optional) </attribute>
<attribute>
<parameter>browser-filter</parameter> (optional) </attribute>
<attribute>
<parameter>browser-list</parameter> (optional) </attribute>
<attribute>
<parameter>browser-mode</parameter> (optional) </attribute>
<attribute>
<parameter>browser-type</parameter> (optional) </attribute>
<attribute>
<parameter>browser-xfer</parameter> (optional) </attribute>
<attribute>
<parameter>selector</parameter> (optional) </attribute>
<attribute>
<parameter>format</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_button">
<title>Description</title>
<para>Scriptable version of Submit Button of the HTML form. Depending of
'action' attribute it may have variants. In some of these variants the button will not have a submit function, as in select and browse buttons. In these cases the button will use client JavaScript to pop up new windows or for setting values in other windows.
</para>
</refsect1>
<refsect1 id="vc_attrs_button">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>action</title>
<para>This specifies the button subclass to use.</para>
<table>
<title>Allowed values of the 'action' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>simple</entry>
<entry>
<para>is a simple submit button, no special functions
</para>
</entry>
</row>
<row>
<entry>submit</entry>
<entry>
<para>an alias of 'simple' button, obsolete
</para>
</entry>
</row>
<row>
<entry>delete</entry>
<entry>
<para>a button for deleting a row in a data-set or data-grid control. This is represented as a submit button with a special on-post script. The delete function is performed based on table, key attributes. (check implementation!!)
</para>
</entry>
</row>
<row>
<entry>browse</entry>
<entry>
<para>Button that opens pup-up window using client-side javascript (browse-button).
This control allows the designer to place some part of a form's input into a pop-up window. When the HTML page is rendered, this control puts a button and associated client-side javascript into the resulting page so clicking the button opens a child window. </para>
</entry>
</row>
<row>
<entry>return</entry>
<entry>
<para>
This is to be used on a page invoked for selecting from a browse button. Specifies that the value of the fields designated by the field children are to be asigned to the corresponding fields of the invoking page.
</para>
</entry>
</row>
<row>
<entry>logout</entry>
<entry>
<para> This will terminate the current session when clicked. Can only occur inside the login control.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Text of the label of the button.</para>
</formalpara>
<formalpara>
<title>style</title>
<para>A style of button, affects appearance.</para>
<table>
<title>Allowed values of the 'style' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>submit</entry>
<entry>
<para>This is a default style used, no special handling.
The button will be rendered as a usual submit button.
</para>
</entry>
</row>
<row>
<entry>url</entry>
<entry>
<para>The button will be rendered as a link, furthermore client side JavaScript code will be produced to act as submit button. </para>
</entry>
</row>
<row>
<entry>image</entry>
<entry>
<para>The button will be rendered as an image on the browser under link button. In that case value of button control must be link to the image file.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the button. The default is '1' meaning 'enable'.</para>
</formalpara>
<formalpara>
<title>initial-active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the button. The default is '1' meaning 'enable'.
Unlike 'active' attribute, this one is effective only when the page is displayed in the first time, not after user posts data back to the page.</para>
</formalpara>
<formalpara>
<title>child-window-options</title>
<para>Options for oppening a child pop-up window.This can be used only in conjuction with action browse.</para>
</formalpara>
<formalpara>
<title>browser-current</title>
<para>Current directory of browsing. Can be used only with browse button for WebDAV or File system resources.</para>
</formalpara>
<formalpara>
<title>browser-filter</title>
<para>Filter expression(s) for browsing. (see above)</para>
</formalpara>
<formalpara>
<title>browser-list</title>
<para>Type of browser list, 0 - short, 1 - long</para>
</formalpara>
<formalpara>
<title>browser-mode</title>
<para>COL, RES or STANDALONE , for a file system or DAV browse button, this specifies whether to return an path name or internal ID.
</para>
</formalpara>
<formalpara>
<title>browser-type</title>
<para>This designates the type of browser: dav or OS (filesystem).</para>
</formalpara>
<formalpara>
<title>browser-xfer</title>
<para>For a browse button, this is the means of transferring the data between windows, DOM is default. No other options in current implementation.</para>
</formalpara>
<formalpara>
<title>selector</title>
<para>For a browse button this is the URL that will be loaded into the pop up window.</para>
</formalpara>
<formalpara>
<title>format = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A sprintf format string for printing the value</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_button">
<title>Declaration of type vspx_button</title>
<para>
Button class, encapsulate all controls originating a event
</para>
<screen>
create type vspx_button under vspx_field as
(
bt_pressed int default 0,
bt_style varchar default 'submit',
bt_close_img varchar,
bt_open_img varchar,
bt_url varchar default '',
bt_l_pars varchar default '',
bt_text varchar default '',
bt_anchor int default 0
) temporary self as ref
overriding method vc_render () returns any,
overriding method vc_xrender () returns any,
overriding method vc_set_model () returns any,
constructor method vspx_button (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_button">
<title>Examples</title>
<example id="vc_ex_button__0">
<title>
Buton shown as an image
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: button__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The button of the form will be shown as a picture plus.gif. Attributes whose names start with 'xhtml_' are
placed into the resulting HTML with no changes.
</para>
<screen>
<v:page name="button__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:button</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:text name="txt1" default=""/>
<v:button name="submit1" action="simple" style="image" xhtml_alt="A test button" value="--'plus.gif'" />
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_button__1">
<title>
Simple 'Add-Number' example
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: button__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form accepts two numbers and calculates their sum.
</para>
<screen>
<v:page name="button__1" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:button</title>
</head>
<body>
<v:form name="f1" type="simple" action="" method="POST">
<v:label name="l1" value="--0" format="%.2f" /><br/>
<v:text name="t1" default="0"/>
<v:text name="t2" default="0"/>
<v:button name="b1" action="simple" value="Add" >
<v:on-post>
self.l1.ufl_value := atof (self.t1.ufl_value) + atof (self.t2.ufl_value);
</v:on-post>
</v:button>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_button__2">
<title>
Simple 'Browse File' dialog
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: button__2.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form allows to select a file from server's file system
<html>
<body>
</para>
<screen>
<v:page name="browse__2" xmlns:v="http://www.openlinksw.com/vspx/">
<v:form name="f1" type="simple" method="POST">
<v:text name="floc" value="" xhtml_size="60%" />
<v:button action='browse' name="cmb" selector="browser/dav_browser.vsp"
child-window-options="resizable=yes, status=no, menubar=no, scrollbars=no, width=640, height=400"
value="Browse"
browser-type="os"
browser-mode="RES"
browser-xfer="DOM"
browser-list="1"
browser-current="1"
browser-filter="*">
<v:field name="floc" />
</v:button>
</v:form>
</v:page>
</body>
</html>
</screen>
</example>
<example id="vc_ex_button__3">
<title>
Simple browse button example
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: button__3.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form allows to select a two values from a different page
<html>
<body>
</para>
<screen>
<v:page name="button__3" xmlns:v="http://www.openlinksw.com/vspx/">
<v:form name="frm" type="simple" method="POST">
<v:text name="fld1" value="" />
<v:text name="fld2" value="" />
<v:button action='browse' name="br1" selector="button__4.vspx"
child-window-options="scrollbars=yes, menubar=no, height=630, width=600"
value="Browse">
<v:field name="fld1" />
<v:field name="fld2" />
</v:button>
</v:form>
</v:page>
</body>
</html>
</screen>
</example>
<example id="vc_ex_button__4">
<title>
Simple select button example
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: button__4.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form returns back to caller form two walues from a text box and select list
<html>
<body>
</para>
<screen>
<v:page name="button__4" xmlns:v="http://www.openlinksw.com/vspx/">
<v:form name="f1" type="simple" method="POST">
<v:text name="sl1" value="Test" />
<v:select-list name="sl2">
<v:item name="*default*" value="0" />
<v:item name="FIRST" value="1" />
<v:item name="SECOND" value="2" />
</v:select-list>
<v:button name="select1" action="return" value="Select">
<v:field name="fld1" ref="sl1" />
<v:field name="fld2" ref="sl2" />
</v:button>
</v:form>
</v:page>
</body>
</html>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/form.vspx">VX-S-2</ulink>
</para>
<para>
<ulink url="/tutorial/web/vx_s_7/products.vspx">VX-S-7</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_calendar">
<refmeta>
<refentrytitle>calendar</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>calendar</refname>
<refpurpose>Databound calendar control.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_calendar">
<funcprototype id="vc_proto_calendar">
<funcdef>
<<function>calendar</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>initial-date</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_calendar">
<title>Description</title>
<para>This is the generic calendar control.</para>
</refsect1>
<refsect1 id="vc_attrs_calendar">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>initial-date = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Expression which returns a date for setting initially the current date of the calendar.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_calendar">
<title>Declaration of type vspx_calendar</title>
<para>
</para>
<screen>
create type vspx_calendar under vspx_control as
(
cal_date date,
cal_meta any,
cal_selected datetime,
cal_current_row vspx_row_template
) temporary self as ref
method vc_get_date_array () returns any,
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
constructor method vspx_calendar (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_calendar">
<title>Examples</title>
<example id="vc_ex_calendar__0">
<title>
A calendar
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: calendar__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This demo will show a calendar allowing to list dates by months
</para>
<screen>
<v:page name="pagecal1" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:form name="form1" type="simple" method="POST" >
<v:calendar name="cal1" initial-date="--now()">
<v:template type="simple" name="chead1" name-to-remove="table" set-to-remove="bottom">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<v:button name="pmon" value="<" action="simple" style="url">
<v:on-post>
self.cal1.cal_date := dateadd ('month', -1, self.cal1.cal_date);
self.cal1.vc_data_bind (e);
</v:on-post>
</v:button>
</td>
<td colspan="5" align="center">
<?V monthname((control.vc_parent as vspx_calendar).cal_date) ?>
<?V year((control.vc_parent as vspx_calendar).cal_date) ?>
</td>
<td align="center">
<v:button name="nmon" value=">" action="simple" style="url">
<v:on-post>
self.cal1.cal_date := dateadd ('month', 1, self.cal1.cal_date);
self.cal1.vc_data_bind (e);
</v:on-post>
</v:button>
</td>
</tr>
<tr><td>Sun</td><td>|Mon</td><td>|Tue</td><td>|Wed</td><td>|Thu</td><td>|Fri</td><td>|Sat</td></tr>
</table>
</v:template>
<v:template type="repeat" name="cbody1" name-to-remove="" set-to-remove="">
<v:template type="browse" name="crow1" name-to-remove="table" set-to-remove="both">
<table>
<tr>
<td align="center"><v:button style="url" action="simple" name="b1" value="--cal_icell(control, 0)" /></td>
<td align="center"><v:button style="url" action="simple" name="b2" value="--cal_icell(control, 1)" /></td>
<td align="center"><v:button style="url" action="simple" name="b3" value="--cal_icell(control, 2)" /></td>
<td align="center"><v:button style="url" action="simple" name="b4" value="--cal_icell(control, 3)" /></td>
<td align="center"><v:button style="url" action="simple" name="b5" value="--cal_icell(control, 4)" /></td>
<td align="center"><v:button style="url" action="simple" name="b6" value="--cal_icell(control, 5)" /></td>
<td align="center"><v:button style="url" action="simple" name="b7" value="--cal_icell(control, 6)" /></td>
</tr>
</table>
</v:template>
</v:template>
<v:template type="simple" name="cbott1" name-to-remove="table" set-to-remove="top">
<table>
</table>
</v:template>
</v:calendar>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_check_box">
<refmeta>
<refentrytitle>check-box</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>check-box</refname>
<refpurpose>Scriptable check-box.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_check_box">
<funcprototype id="vc_proto_check_box">
<funcdef>
<<function>check-box</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>group-name</parameter> (optional) </attribute>
<attribute>
<parameter>initial-checked</parameter> (optional) </attribute>
<attribute>
<parameter>is-boolean</parameter> (optional) </attribute>
<attribute>
<parameter>true-value</parameter> (optional) </attribute>
<attribute>
<parameter>false-value</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_check_box">
<title>Description</title>
<para>is a represantation of HTML check box. Scriptable, databindable.</para>
</refsect1>
<refsect1 id="vc_attrs_check_box">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>group-name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>
When several check boxes are grouped, this is the group name.
This will be submitted instead of the control name on post.
</para>
</formalpara>
<formalpara>
<title>initial-checked = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Specifies whether the control is initially checked.</para>
</formalpara>
<formalpara>
<title>is-boolean</title>
<para>If this attribute is set to '1' then the check-box is forced to ignore its 'initial-checked' status and work using the data-bound value as the only criterion for enabling or disabling its 'checked' property. This mode is convenient for editing two-state data values. Before render, the control will check if the ufl_value is equal to 'true-value' or 'false-value', and it is displayed as checked if the ufl_value is equal to 'true-value' (or it is not equal to any of these two but is not a logical 'false'). On post, a new status of the checkbox is inspected, and the ufl_value is set to 'true-value' if it is checked or 'false-value' otherwise.
The default value of this attribute is '0' meaning that there is no system-level relation between the 'checked' status and the 'value'.
When the form with the check-box submits data, the submitted value of the attribute depends on its 'is-boolean' property. If it's '0' then the result of cast (control.ufl_value as varchar) is submitted; otherwise a string '1' is submitted.
</para>
</formalpara>
<formalpara>
<title>true-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This attribute should be used if and only if 'is-boolean' attribute is set to '1'.
The calculated value of this attribute is saved in ufl_true_value field of the control and is used to represent a logical 'true' for the control. The checkbox is displayed as checked if the bound value is equal to the ufl_true_value. If the checked checkbox is submitted then the bound value of the control is set to the ufl_true_value.
</para>
</formalpara>
<formalpara>
<title>false-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This attribute should be used if and only if 'is-boolean' attribute is set to '1'.
The calculated value of this attribute is saved in ufl_false_value field of the control and is used to represent a logical 'false' for the control. The checkbox is displayed as not checked if the bound value is equal to the ufl_valuse_value. If no checked checkbox is submitted by a form then the bound value of the control is set to ufl_false_value.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_check_box">
<title>Declaration of type vspx_check_box</title>
<para>
</para>
<screen>
create type vspx_check_box under vspx_field
temporary self as ref
constructor method vspx_check_box (name varchar, parent vspx_control),
overriding method vc_render () returns any,
overriding method vc_xrender () returns any,
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_set_model () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_check_box">
<title>Examples</title>
<example id="vc_ex_check_box__0">
<title>
Entry form with a checkbox
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: check_box__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
Depending on the state of the checkbox, the submitted value is either 'checked' or 'unchecked'.
</para>
<screen>
<v:page name="check_box__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:check-box</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:check-box name="cb1" initial-checked="0" value="-- case control.ufl_selected when 1 then 'checked' else 'unchecked' end" />
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/check_box.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_code_file">
<refmeta>
<refentrytitle>code-file</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>code-file</refname>
<refpurpose>Code-behind file containing SQL script.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_code_file">
<funcprototype id="vc_proto_code_file">
<funcdef>
<<function>code-file</function> <attribute>
<parameter>url</parameter> (required) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_code_file">
<title>Description</title>
<para>This element is used to load an external SQL
script after page class compilation and before page execution.
This script may contain page subclass or custom control definitions.
In this way SQL code can be separated from VSPX markup, or in other words
to separate page design from application logic.
</para>
</refsect1>
<refsect1 id="vc_attrs_code_file">
<title>Attributes</title>
<formalpara>
<title>url</title>
<para>URL of file to be loaded after VSPX page compilation.
If relative then the base is the page where the control resides
(i.e. same URL resolution rules applied as for includes).
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_ex_code_file">
<title>Examples</title>
<example id="vc_ex_code_file__0">
<title>
Code-behind SQL script
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: code_file__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The script of a button's post event is in separate SQL file.
The code_file__0.sql contents:
drop type my_page_subclass
;
create type my_page_subclass under DB.dba.page__vspx_code__file____0_vspx
temporary self as ref
overriding method vc_post_b1 (control vspx_button, e vspx_event) returns any,
method button_change (control vspx_button) returns any
;
create method vc_post_b1 (inout control vspx_button, inout e vspx_event) for my_page_subclass
{
if (not control.vc_focus) return;
self.button_change (control);
return;
}
;
create method button_change (inout control vspx_button) for my_page_subclass
{
self.var1 := self.var1 + 1;
control.ufl_value := 'Activated';
}
;
</para>
<screen>
<v:page name="page1" xmlns:v="http://www.openlinksw.com/vspx/" page-subclass="my_page_subclass">
<html>
<body>
<v:code-file url="code_file__0.sql"/>
<v:variable name="var1" type="int" default="0" param-name="id" persist="pagestate" />
<v:form type="simple" name="f1">
<v:label name="l1" value="--self.var1" format="%d" />
<v:button action="simple" name="b1" value="Submit" />
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_column">
<refmeta>
<refentrytitle>column</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>column</refname>
<refpurpose>A column marker.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_column">
<funcprototype id="vc_proto_column">
<funcdef>
<<function>column</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>label</parameter> (optional) </attribute>
<attribute>
<parameter>input-format</parameter> (optional) </attribute>
<attribute>
<parameter>output-format</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_column">
<title>Description</title>
<para>
A column marker for use in v:data-set, v:data-grid and v:data-source.
This element should exist for each selected column of the SQL expression of the data set.
If this is specified under data-set, data-source or data-grid controls, this must be the exact same columns as in SQL statement to be evaluated. If those element is omitted in data-set or data-grid, the columns will be extracted from compilation of the SQL statement.
However, this will always be required for calls of stored procedures that return resultsets and for the data-source control.
</para>
</refsect1>
<refsect1 id="vc_attrs_column">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of column
</para>
</formalpara>
<formalpara>
<title>label = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Alternate text which could be used to display in column headings.
</para>
</formalpara>
<formalpara>
<title>input-format</title>
<para>A sprintf format string for printing the input value
</para>
</formalpara>
<formalpara>
<title>output-format</title>
<para>A sprintf format string for printing the output value
</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_data_grid">
<refmeta>
<refentrytitle>data-grid</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>data-grid</refname>
<refpurpose>Scrollable databound multi-row control.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_data_grid">
<funcprototype id="vc_proto_data_grid">
<funcdef>
<<function>data-grid</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>data</parameter> (optional) </attribute>
<attribute>
<parameter>meta</parameter> (optional) </attribute>
<attribute>
<parameter>nrows</parameter> (optional) </attribute>
<attribute>
<parameter>sql</parameter> (required) </attribute>
<attribute>
<parameter>scrollable</parameter> (optional) </attribute>
<attribute>
<parameter>cursor-type</parameter> (optional) </attribute>
<attribute>
<parameter>edit</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_data_grid">
<title>Description</title>
<para>
<para>This is the generic multi-row database view control. It is used to show repeating data, as from tables
or procedure views. Allows scrolling (paging) editing the data; adding a row or removal of existing rows.
Usually this control generates a PL scrollable cursor of type as specified. The number of rows shown are
configurable via nrows attribute. Note also that column children elements are optional; they can be omitted
so then VSPX engine will compute them from specified SQL statement in 'sql' attribute.</para>
<para>Specific to this control is to have row-template and frame-template, these are to present repeating and non-repeating groups of children elements. The frame-template will usually
have a 'rowset' placeholder to designate the place where repeating group (row-template) will be instantiated. The control expects to find child controls with specific names. for scrolling buttons - [data-grid name]'_prev' and [data-grid name]'_next'; for editing buttons - [data-grid name]'_edit' and [data-grid name]'_delete'.</para>
</para>
</refsect1>
<refsect1 id="vc_attrs_data_grid">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>data = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Expression which returns an array of rowset data, this is an alternative to specifying an SQL expression. The result then will be used to instantiate
the repeating group. An example of such data is the result returned by 'exec' function:</para>
<programlisting>
(
("ALFKI" "Alfreds Futterkiste" "030-0074321" )
("ANATR" "Ana Trujillo Emparedados y helados" "(5) 555-4729" )
)
</programlisting>
</formalpara>
<formalpara>
<title>meta = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This works with combination of data attribute, this expression must return an array of ro metadata. So when this is specified it needs to be an expression returning meta-data for columns. In practice this is the same as 1st element of metadata returned by 'exec()' :</para>
<programlisting>
(
("CustomerID" 182 0 5 0 1 1 "Demo" "CustomerID" "demo" "Customers" 0 )
("CompanyName" 182 0 40 1 1 1 "Demo" "CompanyName" "demo" "Customers" 0 )
("Phone" 182 0 24 1 1 1 "Demo" "Phone" "demo" "Customers" 0 )
)
</programlisting>
<para>
for details of metadata see 'exec()' function description.</para>
</formalpara>
<formalpara>
<title>nrows = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The maximum number of replicas of the row template to be made for rows selected.
This is like the rowset size for a scrollable cursor.</para>
</formalpara>
<formalpara>
<title>sql = <link linkend="vc_type_SqlCode">SqlCode</link>
</title>
<para>The select statement that gets the data.
Parameters to the statement MUST be specified as SQL identifiers prefixed with a colon (named parameter).
The values are given in the control's vspx:param children. These specify the parameter name and a data bound expression for the value.
</para>
</formalpara>
<formalpara>
<title>scrollable</title>
<para>The setting controls whether next and previous page buttons are presented. This can be on even if the cursor is not scrollable as such.</para>
</formalpara>
<formalpara>
<title>cursor-type</title>
<table>
<title>Allowed values of the 'cursor-type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>static</entry>
<entry>
<para>A static cursor is used.</para>
</entry>
</row>
<row>
<entry>dynamic</entry>
<entry>
<para>A dynamic cursor is used.</para>
</entry>
</row>
<row>
<entry>keyset</entry>
<entry>
<para>A keyset cursor is used.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>edit = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Flags whether editing features are enabled on data grid control</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_data_grid">
<title>Declaration of type vspx_data_grid</title>
<para>
Scrollable, Multi-Row data grid Class
</para>
<screen>
create type vspx_data_grid under vspx_form
as (
dg_nrows int default -1, -- how many rows to show on single page
dg_scrollable int default 0, -- scroll on form is enabled
dg_editable int default 1, -- disable edit/add on whole grid
dg_row_meta any, -- metadata
dg_row_data any, -- the data for procedure binding
dg_current_row vspx_row_template, -- current row template
dg_rowno_edit int default null, -- last edited row in result set, to re-display the edit box on error
dg_rows_fetched int default 0, -- these are to keep state for scrolling
dg_prev_bookmark any default null,
dg_last_bookmark any default null
) temporary self as ref
method vc_templates_clean () returns any,
constructor method vspx_data_grid (name varchar, parent vspx_control),
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_view_state (stream any, n int) returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_data_grid">
<title>Examples</title>
<example id="vc_ex_data_grid__0">
<title>
Editable multi-row data grid based on data-grid control
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_grid__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will show a list of customers from the Northwind demo database.
Allows editing, addtion and removal of existing records.
</para>
<screen>
<v:page name="data_grid__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:data-grid name="dg" nrows="5" sql="select CustomerID, CompanyName, Phone from Demo.demo.Customers where CustomerId like :mask" cursor-type="keyset" edit="1">
<v:param name="mask" value="'%'"/>
<v:template name="t1" type="frame">
<div>
<div>
Action
<v:label name="l1" value="--(control.vc_parent as vspx_data_grid).dg_row_meta[0]"/>
<v:label name="l2" value="--(control.vc_parent as vspx_data_grid).dg_row_meta[1]"/>
<v:label name="l3" value="--(control.vc_parent as vspx_data_grid).dg_row_meta[2]"/>
</div>
<v:rowset/>
<v:form type="add"/>
<div>
<v:button name="dg_prev" action="simple" value="&lt;&lt;"/>
<v:button name="dg_next" action="simple" value="&gt;&gt;"/>
</div>
</div>
</v:template>
<v:template name="t2" type="row">
<div>
<v:button name="dg_edit" action="simple" value="Edit"/>
<v:button name="dg_delete" action="simple" value="Delete">
<v:on-post>
delete from Demo.demo.Customers where CustomerID = self.dg.dg_current_row.te_rowset[0];
self.dg.vc_data_bind (e);
</v:on-post>
</v:button>
<v:label name="label1" value="--(control.vc_parent as vspx_row_template).te_rowset[0]"/>
<v:label name="label2" value="--(control.vc_parent as vspx_row_template).te_rowset[1]"/>
<v:label name="label3" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"/>
</div>
</v:template>
<v:template name="t3" type="if-not-exists">
<div>No rows selected</div>
</v:template>
<v:template name="t4" type="edit">
<v:form name="u1" type="update" table="Demo.demo.Customers" if-not-exists="insert">
<v:key column="CustomerID" value="--self.dg.dg_current_row.te_rowset[0]" default="null"/>
<v:template type="if-exists" name="t5">
<div>
<v:button name="b1" action="submit" value="Update"/>
<input type="submit" name="b2" value="Cancel"/>
<v:text name="c_id1" column="CustomerID"/>
<v:text name="c_name1" column="CompanyName"/>
<v:text name="c_phone1" column="Phone"/>
</div>
</v:template>
</v:form>
</v:template>
<v:template name="t6" type="add">
<v:form type="update" name="a1" table="Demo.demo.Customers" if-not-exists="insert">
<v:key column="CustomerID" value="--''" default="null"/>
<v:template name="t7" type="if-exists">
<v:button name="b3" action="submit" value="Add"/>
<v:text name="c_id2" column="CustomerID"/>
<v:text name="c_name2" column="CompanyName"/>
<v:text name="c_phone2" column="Phone"/>
</v:template>
</v:form>
</v:template>
</v:data-grid>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_data_list">
<refmeta>
<refentrytitle>data-list</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>data-list</refname>
<refpurpose>Select list initialized from database table.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_data_list">
<funcprototype id="vc_proto_data_list">
<funcdef>
<<function>data-list</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>table</parameter> (optional) </attribute>
<attribute>
<parameter>key-column</parameter> (optional) </attribute>
<attribute>
<parameter>value-column</parameter> (optional) </attribute>
<attribute>
<parameter>sql</parameter> (optional) </attribute>
<attribute>
<parameter>defvalue</parameter> (optional) </attribute>
<attribute>
<parameter>multiple</parameter> (optional) </attribute>
<attribute>
<parameter>list-document</parameter> (optional) </attribute>
<attribute>
<parameter>list-match</parameter> (optional) </attribute>
<attribute>
<parameter>list-key-path</parameter> (optional) </attribute>
<attribute>
<parameter>list-value-path</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_data_list">
<title>Description</title>
<para>This control is used to make a select list, based on a SQL expression.
Also instead of SQL expression only table name could be given, so then control will compose apropriate select statement.
</para>
</refsect1>
<refsect1 id="vc_attrs_data_list">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>table</title>
<para>A table name for select statement.</para>
</formalpara>
<formalpara>
<title>key-column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A key column name.</para>
</formalpara>
<formalpara>
<title>value-column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A value column name.</para>
</formalpara>
<formalpara>
<title>sql = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An alterantive of 'table' attribute, when this attribute
is specified it must contains a valid select statement. The selection list
will be instantiated using a cursor as this expression is defined.
</para>
</formalpara>
<formalpara>
<title>defvalue = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A default value for the control.</para>
</formalpara>
<formalpara>
<title>multiple</title>
<para>Used to desigante a multiple selection list box.
In this case the control's value will be an array of key data of selected items.
</para>
</formalpara>
<formalpara>
<title>list-document = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to obtain all or some of items of the select-list from an XML document. If this attribute is specified then the value of the calculated attribute should be an XML entity and this entity will be saved in vsl_list_document field of the control; values of 'list-match', 'list-key-path' and 'list-value-path' arguments should specify XQuery expressions that should be used to retrieve keys and displayable values of items.
All selection items composed from the value of 'list-document' will be listed before all items from 'table' or 'sql', if both methods of data retrieval are used.
</para>
</formalpara>
<formalpara>
<title>list-match = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to calculate a string value that is an XQuery expression. The text of this expression will be saved in 'vsl_list_match' member of the control. This expression will be used during data binding to get array of displayable items from the value of 'list-document'. The expression should return a node-set using 'list-document' entity as a context mode; every item of the node-set will be converted into list item via 'list-key-path' and 'list-value-path' expressions.
</para>
</formalpara>
<formalpara>
<title>list-key-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to specify the XQuery expression that calculates key value of a list item, using a result of 'list-match' as a context node. The text of the expression will be saved in 'vsl_list_key_path' member of the control.</para>
</formalpara>
<formalpara>
<title>list-value-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to specify the XQuery expression that calculates a displayable value of a list item, using a result of 'list-match' as a context node. The text of the expression will be saved in 'vsl_list_value_path' member of the control.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_data_list">
<title>Declaration of type vspx_data_list</title>
<para>
</para>
<screen>
create type vspx_data_list under vspx_select_list temporary self as ref
constructor method vspx_data_list (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_data_list">
<title>Examples</title>
<example id="vc_ex_data_list__0">
<title>
Select list based on table source
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_list__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will render in a form a select list containing the customers from Northwind demo database
with a option values their customer IDs.
</para>
<screen>
<v:page name="data_list__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:form name="f1" type="simple" method="POST">
<v:data-list name="dl1" table="Demo.demo.Customers" key-column="CustomerID" value-column="CompanyName"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_data_list__1">
<title>
Select list based on SQL select statement
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_list__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will render in a form a select list containing the customers from Northwind demo database
with a option values their customer IDs.
</para>
<screen>
<v:page name="data_list__1" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:form name="f1" type="simple" method="POST">
<v:data-list name="dl1" sql="select * from Demo.demo.Customers" key-column="CustomerID" value-column="CompanyName"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_3/selectdb.vspx">VX-S-3</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_data_set">
<refmeta>
<refentrytitle>data-set</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>data-set</refname>
<refpurpose>Scrollable, multi-row data bound grid.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_data_set">
<funcprototype id="vc_proto_data_set">
<funcdef>
<<function>data-set</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>sql</parameter> (optional) </attribute>
<attribute>
<parameter>data-source</parameter> (optional) </attribute>
<attribute>
<parameter>data</parameter> (optional) </attribute>
<attribute>
<parameter>meta</parameter> (optional) </attribute>
<attribute>
<parameter>nrows</parameter> (optional) </attribute>
<attribute>
<parameter>scrollable</parameter> (required) </attribute>
<attribute>
<parameter>cursor-type</parameter> (optional) </attribute>
<attribute>
<parameter>edit</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_data_set">
<title>Description</title>
<para>
<para>A container for displaying and/or editing the content of a resultset.
This is the generic multi-row database view control. It is used to show repeating data, as from tables
or procedure views. Allows scrolling (paging) editing the data; adding a row or removal of existing rows.
Usually this control generates a PL scrollable cursor of type. The number of rows shown is
configurable via nrows attribute. Note also that column children elements are optional; they can be omitted
so then VSPX engine will compute them from the specified SQL statement in 'sql' attribute.</para>
<para>This control has the same functionality as the data-grid control but has different syntax, better suited for editing via plugins for 3-d party WYSWYG HTML authoring tools (as Addobe GoLive and similar).</para>
<para>Specific to this control is to have several templates to present repeating and non-repeating groups of children elements. These templates are as follows: two generic templates to represent header and footer sections and one repeating template to enclose edit, add, not-exists and row (browse) sections. All of those templates are optional and their usage can be seen in examples.</para>
<para>Also following the convention for names of controls must be followed: for scrolling buttons - [data-set name]'_prev', [data-set name]'_next', [data-set name]'_first' and [data-set name]'_last'; for editing buttons - [data-set name]'_edit' and [data-set name]'_delete'.</para>
</para>
</refsect1>
<refsect1 id="vc_attrs_data_set">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>sql = <link linkend="vc_type_SqlCode">SqlCode</link>
</title>
<para>The select statement that gets the data.
Parameters to the statement MUST be specified as SQL identifiers prefixed with a colon.
The values are given in the control's vspx:param children. These specify the parameter name and a data bound expression for the value.
</para>
</formalpara>
<formalpara>
<title>data-source = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A reference to a data-source, which wil lbe used to bind the data in data-set grid.
</para>
</formalpara>
<formalpara>
<title>data = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>When this attribute is specified it must be an
expression returning array of arrays. This is an alternative to specifying an
SQL expression or data-source. The result then will be used to instantiate
the repeating group. An example of such data is the result returned by 'exec' function:</para>
<programlisting>
(
("ALFKI" "Alfreds Futterkiste" "030-0074321" )
("ANATR" "Ana Trujillo Emparedados y helados" "(5) 555-4729" )
)
</programlisting>
</formalpara>
<formalpara>
<title>meta = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This attribute is used together with 'data', so when is
specified it needs to be an expression returning a meta-data for columns corresponding to the
these returned by 'data' expression. In practice it's same as 1-st element of metadata returned by 'exec()' :
</para>
<programlisting>
(
("CustomerID" 182 0 5 0 1 1 "Demo" "CustomerID" "demo" "Customers" 0 )
("CompanyName" 182 0 40 1 1 1 "Demo" "CompanyName" "demo" "Customers" 0 )
("Phone" 182 0 24 1 1 1 "Demo" "Phone" "demo" "Customers" 0 )
)
</programlisting>
<para>for details of metadata see 'exec()' function description.</para>
</formalpara>
<formalpara>
<title>nrows = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The maximum number of replicas of the row template to be made for rows selected.
It is like the rowset size for a scrollable cursor.
</para>
</formalpara>
<formalpara>
<title>scrollable</title>
<para>The setting controls whether next and previous page buttons are presented. This can be on even if the cursor is not scrollable as such.</para>
</formalpara>
<formalpara>
<title>cursor-type</title>
<table>
<title>Allowed values of the 'cursor-type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>static</entry>
<entry>
<para>A static cursor is used.</para>
</entry>
</row>
<row>
<entry>dynamic</entry>
<entry>
<para>A dynamic cursor is used.</para>
</entry>
</row>
<row>
<entry>keyset</entry>
<entry>
<para>A keyset cursor is used.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>edit</title>
<para>Flags whether editing features are enabled on data grid control</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_data_set">
<title>Declaration of type vspx_data_set</title>
<para>
</para>
<screen>
create type vspx_data_set under vspx_form
as (
ds_nrows int, -- how many rows to show on single page
ds_scrollable int, -- scroll on form is enabled
ds_editable int default 1, -- disable edit/add on whole grid
ds_row_meta any, -- metadata
ds_row_data any, -- data coming from a function, rowset
ds_current_row vspx_row_template, -- current row template
ds_rowno_edit int default null, -- last edited row in result set, to re-display the edit box on error
ds_rows_fetched int default 0, -- how many rows are fetched for current page
ds_rows_total int default 0, -- how many data rows do we have in total (for vector)
ds_rows_offs int default 0, -- this is the zero-based index of the first row of the current page in the whole list
ds_rows_offs_saved int default 0, -- this is the value of ds_rows_offs that was saved in the page state.
ds_scrolled int default 0,
ds_has_next_page int default 0, -- Flag if there are rows after the current page (so 'next page' button should be enabled).
ds_prev_bookmark any default null, -- Bookmark of the record that was at the beginning of previous retrieval of the page (bmk of the first row of the displayed page)
ds_last_bookmark any default null, -- Bookmark of the record that was at the end of previous retrieval of the page (bmk of the last row of the displayed page)
ds_rows_cache any,
ds_data_source vspx_data_source default null
) temporary self as ref
method vc_templates_clean () returns any,
method vc_reset () returns any,
method ds_column_offset (name varchar) returns any,
method ds_iterate_rows (inx int) returns any,
constructor method vspx_data_set (name varchar, parent vspx_control),
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_view_state (stream any, n int) returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_data_set">
<title>Examples</title>
<example id="vc_ex_data_set__0">
<title>
Editable multi-row data grid based on data-set control
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_set__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will show a list of customers from the Northwind demo database.
Allows editing, addtion and removal of existing records.
</para>
<screen>
<v:page name="data_set__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:data-set name="ds" sql="select CustomerID, CompanyName, Phone from Demo.demo.Customers" nrows="10" scrollable="1" cursor-type="keyset">
<v:template name="t1" type="simple">
<div>
Action
<v:label name="l1" value="CustomerID" format="%s" width="80"/>
<v:label name="l2" value="CompanyName" format="%s" width="80"/>
<v:label name="l3" value="Phone" format="%s" width="80"/>
</div>
</v:template>
<v:template name="t2" type="repeat">
<v:template name="t7" type="if-not-exists">
<div>No rows selected</div>
</v:template>
<v:template name="t5" type="edit">
<v:form name="u1" type="update" table="Demo.demo.Customers" if-not-exists="insert">
<v:key column="CustomerID" value="--self.ds.ds_current_row.te_rowset[0]" default="null"/>
<v:template name="template6" type="simple">
<div>
<v:button name="upd_button" action="submit" value="Update"/>
<input type="submit" name="ds_cancel" value="Cancel"/>
<v:text name="c_id1" column="CustomerID"/>
<v:text name="c_name1" column="CompanyName"/>
<v:text name="c_phone1" column="Phone"/>
</div>
</v:template>
</v:form>
</v:template>
<v:template name="t8" type="add">
<v:form name="a1" type="update" table="Demo.demo.Customers" if-not-exists="insert">
<v:key column="CustomerID" value="--''" default="null"/>
<v:template name="template9" type="simple">
<div>
<v:button name="add_button" action="submit" value="Add"/>
<v:text name="c_id2" column="CustomerID"/>
<v:text name="c_name2" column="CompanyName"/>
<v:text name="c_phone2" column="Phone"/>
</div>
</v:template>
</v:form>
</v:template>
<v:template name="t4" type="browse">
<div>
<v:button name="ds_edit" action="simple" value="Edit"/>
<v:button name="ds_delete" action="simple" value="Delete">
<v:on-post>
delete from Demo.demo.Customers where CustomerID = self.ds.ds_current_row.te_rowset[0];
self.ds.vc_data_bind(e);
</v:on-post>
</v:button>
<v:label name="l5" value="--(control.vc_parent as vspx_row_template).te_rowset[0]"/>
<v:label name="l6" value="--(control.vc_parent as vspx_row_template).te_rowset[1]"/>
<v:label name="l7" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"/>
</div>
</v:template>
</v:template>
<v:template name="t3" type="simple">
<div>
<v:button name="ds_prev" action="simple" value="&lt;&lt;"/>
<v:button name="ds_next" action="simple" value="&gt;&gt;"/>
</div>
</v:template>
</v:data-set>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_data_set__1">
<title>
Simple multi-row data grid based on data-set control
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_set__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will show a list of customers from the Northwind demo database.
Allows scrolling only of existing records.
</para>
<screen>
<v:page name="data_set__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:data-set name="ds" sql="select CustomerID, CompanyName, Phone from Demo.demo.Customers" nrows="10" scrollable="1" cursor-type="keyset">
<v:template name="t1" type="simple">
<div>
<v:label name="l1" value="CustomerID" format="%s" width="80"/>
<v:label name="l2" value="CompanyName" format="%s" width="80"/>
<v:label name="l3" value="Phone" format="%s" width="80"/>
</div>
</v:template>
<v:template name="t2" type="repeat">
<v:template name="t7" type="if-not-exists">
<div>No rows selected</div>
</v:template>
<v:template name="t4" type="browse">
<div>
<v:label name="l5" value="--(control.vc_parent as vspx_row_template).te_rowset[0]"/>
<v:label name="l6" value="--(control.vc_parent as vspx_row_template).te_rowset[1]"/>
<v:label name="l7" value="--(control.vc_parent as vspx_row_template).te_rowset[2]"/>
</div>
</v:template>
</v:template>
<v:template name="t3" type="simple">
<div>
<v:button name="ds_prev" action="simple" value="&lt;&lt;"/>
<v:button name="ds_next" action="simple" value="&gt;&gt;"/>
</div>
</v:template>
</v:data-set>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_3/data_set.vspx">VX-S-3</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_data_source">
<refmeta>
<refentrytitle>data-source</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>data-source</refname>
<refpurpose>Scrollable multi-row data bound source.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_data_source">
<funcprototype id="vc_proto_data_source">
<funcdef>
<<function>data-source</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>expression-type</parameter> (required) </attribute>
<attribute>
<parameter>nrows</parameter> (optional) </attribute>
<attribute>
<parameter>initial-offset</parameter> (optional) </attribute>
<attribute>
<parameter>data</parameter> (optional) </attribute>
<attribute>
<parameter>meta</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_data_source">
<title>Description</title>
<para>Invisible multi-row data source.
This control is an invisible represantation of a result set. Also it offer a
number of methods for accessing and updating the data. It can be used as a source in
the data-set control or as a separate data source for various form controls (such as label, url etc.).
This control is using 'SELECT TOP N,M ..' statements to bind the data into the resultset (when source is a table or SQL statement), hence this should be taken into account when using it.
</para>
</refsect1>
<refsect1 id="vc_attrs_data_source">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>expression-type</title>
<para>Denotes the type of 'expression'</para>
<table>
<title>Allowed values of the 'expression-type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>SQL</entry>
<entry>
<para>The expression is a SQL select statement</para>
</entry>
</row>
<row>
<entry>TABLE</entry>
<entry>
<para>The expression is a table reference</para>
</entry>
</row>
<row>
<entry>PROCEDURE</entry>
<entry>
<para>The expression is a procedure call</para>
</entry>
</row>
<row>
<entry>ARRAY</entry>
<entry>
<para>The rowset is already prepared and supplied as an array of arrays</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>nrows = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The maximum number of rows to be selected.
It is like the rowset size for a scrollable cursor.
</para>
</formalpara>
<formalpara>
<title>initial-offset = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Number of record to start data binding of rowset</para>
</formalpara>
<formalpara>
<title>data = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>When this attribute is specified it must be an
expression returning array of arrays. This is an alternative to specifying an
SQL expression or data-source. The result then will be used to instantiate
the repeating group. An example of such data is the result returned by 'exec' function:</para>
<programlisting>
(
("ALFKI" "Alfreds Futterkiste" "030-0074321" )
("ANATR" "Ana Trujillo Emparedados y helados" "(5) 555-4729" )
)
</programlisting>
</formalpara>
<formalpara>
<title>meta = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This attribute is used together with 'data', so when is
specified it needs to be an expression returning a meta-data for columns corresponding to the
these returned by 'data' expression. In practice it's same as 1-st element of metadata returned by 'exec()' :
</para>
<programlisting>
(
("CustomerID" 182 0 5 0 1 1 "Demo" "CustomerID" "demo" "Customers" 0 )
("CompanyName" 182 0 40 1 1 1 "Demo" "CompanyName" "demo" "Customers" 0 )
("Phone" 182 0 24 1 1 1 "Demo" "Phone" "demo" "Customers" 0 )
)
</programlisting>
<para>for details of metadata see 'exec()' function description.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_data_source">
<title>Declaration of type vspx_data_source</title>
<para>
</para>
<screen>
create type vspx_data_source under vspx_control
as (
ds_row_meta any, -- metadata
ds_row_data any, -- data coming from a function, rowset
ds_array_data any, -- data coming from @data=... where @expression-type='array'
ds_rows_fetched int default 0, -- these are to keep state for scrolling
ds_rows_offs int default 0, -- this is the pos of row at 0 offset
ds_nrows int, -- how many rows to show on single page
ds_total_pages int default 0,
ds_current_page int default 0,
ds_current_pager_idx int default 0,
ds_npages int default 10,
ds_first_page int default 0,
ds_last_page int default 0,
ds_total_rows int default 0,
ds_prev_bookmark any default null,
ds_next_bookmark any default null,
ds_parameters any default null,
ds_columns any default null,
ds_sql varchar default null,
ds_sql_type varchar default 'sql',
ds_current_inx int default 0,
ds_update_inx int default -1,
ds_tables any default null,
ds_insert any default null,
ds_update any default null,
ds_delete any default null,
ds_rb_data any default null,
ds_have_more any default null
)
temporary self as ref
method set_parameter (num any, value any) returns any,
method get_parameter (num any) returns any,
method add_parameter (value any) returns any,
method delete_parameter (num any) returns any,
method get_column_name (num any) returns any,
method set_column_label (num any, value any) returns any,
method get_column_label (num any) returns any,
method get_column_label (col varchar) returns any,
--method set_column_add_style (num int, style any) returns any,
--method get_column_add_style (num int) returns any,
--method set_column_edit_style () returns any,
--method get_column_edit_style () returns any,
--method set_column_browse_style () returns any,
--method get_column_browse_style () returns any,
--method set_column_add_format () returns any,
--method get_column_add_format () returns any,
--method set_column_edit_format () returns any,
--method get_column_edit_format () returns any,
--method set_column_browse_format () returns any,
--method get_column_browse_format () returns any,
method set_item_value (row any, col any, value any) returns any,
method set_item_value (col varchar, value any) returns any,
method get_item_value (row any, col any) returns any,
method get_rb_item_value (row any, col any) returns any,
method get_item_value (col any) returns any,
method get_item_value (col varchar) returns any,
method set_expression (expression varchar) returns any,
method get_expression () returns varchar,
method set_expression_type (type varchar) returns any,
method get_expression_type () returns varchar,
method reset () returns any,
method ds_data_bind (e vspx_event) returns any,
method ds_make_statistic () returns any,
method ds_insert (e vspx_event) returns any,
method ds_update (e vspx_event) returns any,
method ds_delete (e vspx_event) returns any,
method ds_key_params (tbl varchar) returns any,
method ds_tbl_params (tbl varchar) returns any,
method get_current_row () returns any,
constructor method vspx_data_source (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_data_source">
<title>Examples</title>
<example id="vc_ex_data_source__0">
<title>
Simple navigation form using invisible data-source control
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: data_source__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will show a cell of the customers table from the Northwind demo database.
Allows to show different columns : name and phone.
</para>
<screen>
<v:page name="data_source__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:variable name="offset" default="0" type="int"/>
<v:form name="f1" method="POST" type="simple">
<div>There is a hidden data-source on "<?V self.datasource1.ds_sql ?>"</div>
<v:data-source name="datasource1" expression-type="sql" nrows="10" initial-offset="--self.offset">
<v:expression>
select * from Demo.demo.Customers where CustomerID like ? order by CompanyName desc
</v:expression>
<v:param name="mask" value="--('L%')"/>
<v:column name="CompanyName" label="Company Name" input-format="%s" output-format="%s"/>
<v:column name="Phone" label="Telephone" input-format="%s" output-format="%s" />
</v:data-source>
<div>
row #: <v:text name="r1" value="0" /><br />
col #: <v:text name="c1" value="0" /><br />
Seek : <v:button action="simple" name="b1" value="OK" />
</div>
<div>
"<v:label name="l1" value="--self.datasource1.get_column_label (atoi(self.c1.ufl_value))" />" =
<v:label name="l2" value="--self.datasource1.get_item_value (atoi(self.r1.ufl_value),atoi(self.c1.ufl_value))"/>
</div>
<v:on-post>
self.l1.vc_data_bind (e);
self.l2.vc_data_bind (e);
</v:on-post>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_error_summary">
<refmeta>
<refentrytitle>error-summary</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>error-summary</refname>
<refpurpose>Placeholder for error messages.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_error_summary">
<funcprototype id="vc_proto_error_summary">
<funcdef>
<<function>error-summary</function> <attribute>
<parameter>match</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_error_summary">
<title>Description</title>
<para>Placeholder for form error messages.
This is used on a form to mark where error messages resulting from field or form validation are to be placed.
This will be rendered if the vc_is_valid member of the enclosing page is false.
If rendered, this prints an error message generated by a validator or a catch handler.
This control wiil not be instantiated. The error-summary may show errors for all controls or for a group of controls whose name matches a given regular expression.
The vc_error_message members of all controls whose validation failed will be shown at the place marked by this control if attribute 'match' is not specified. Otherwise the vc_error_message of controls whose validation failed and 'name' matches the pattern specified will be shown.
</para>
</refsect1>
<refsect1 id="vc_attrs_error_summary">
<title>Attributes</title>
<formalpara>
<title>match</title>
<para>
This attribute specifies a regular expression to be matched against names of controls with failed validation.
The expression may match more than one control name, concatenating the messages in document order of controls. In this way an error summary may appear in
different places of the page to print errors for different controls.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_ex_error_summary">
<title>Examples</title>
<example id="vc_ex_error_summary__0">
<title>
Validation of text area input
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: error_summary__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains two v:textarea controls with v:validator elements inside.
When the OK button is pressed data are posted back to the same URI
so the page is instantiated again.
If any validator found a violation the message is shown to the user
in the place specified by v:error-summary element.
</para>
<screen>
<v:page name="error_summary__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:error-summary</title>
</head>
<body>
<v:error-summary />
<v:form name="form1" type="simple" action="" method="POST">
<v:textarea name="ta1" default="enter your first text here" value="--coalesce ({?'ta1'}, control.ufl_value)" error-glyph="*">
<v:validator test="length" min="0" max="50" message="The length of the first input should not exceed 50 chars."/>
</v:textarea>
<v:textarea name="ta2" default="enter your second text here" value="--coalesce ({?'ta1'}, control.ufl_value)" error-glyph="*">
<v:validator test="length" min="0" max="50" message="The length of the second input should not exceed 50 chars."/>
</v:textarea>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_error_summary__1">
<title>
Validation of text area input with separate error summaries place
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: error_summary__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains two v:textarea controls with v:validator elements inside.
When the OK button is pressed data are posted back to the same URI
so the page is instantiated again.
If any validator found a violation the message is shown to the user
in the place specified by v:error-summary element depending of a match attribute.
</para>
<screen>
<v:page name="error_summary__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:error-summary</title>
</head>
<body>
<v:error-summary match="ta1"/>
<v:form name="form1" type="simple" action="" method="POST">
<v:textarea name="ta1" default="enter your first text here" value="--coalesce ({?'ta1'}, control.ufl_value)" error-glyph="*">
<v:validator test="length" min="0" max="50" message="The length of the first input should not exceed 50 chars."/>
</v:textarea>
<v:error-summary match="ta2"/>
<v:textarea name="ta2" default="enter your second text here" value="--coalesce ({?'ta1'}, control.ufl_value)" error-glyph="*">
<v:validator test="length" min="0" max="50" message="The length of the second input should not exceed 50 chars."/>
</v:textarea>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_expression">
<refmeta>
<refentrytitle>expression</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>expression</refname>
<refpurpose>An SQL statement that generates a rowset for v:data-source.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_expression">
<funcprototype id="vc_proto_expression">
<funcdef>
<<function>expression</function> <attribute>
<parameter>language</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_expression">
<title>Description</title>
<para>A container for SQL statement generating a rowset or table name (see data-source).</para>
</refsect1>
<refsect1 id="vc_attrs_expression">
<title>Attributes</title>
<formalpara>
<title>language = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Denotes the type of language,
currently only SQL expressions are supported, see 'expression-type' attribute
of the data-source control.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_field">
<refmeta>
<refentrytitle>field</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>field</refname>
<refpurpose>Name of input to be sent to and back between pup-up and parent window.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_field">
<funcprototype id="vc_proto_field">
<funcdef>
<<function>field</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>ref</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_field">
<title>Description</title>
<para>
This element may occur under browse-button or select button,
it enumerates the names of inputs to be sent between pop-up and parent window.</para>
</refsect1>
<refsect1 id="vc_attrs_field">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>ref = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>When a field is used as child of and return button
then this must contain valid reference to name of a input control
(like text, select-list, data-list etc.) from current page. The referenced
control's value will be used to set the value of control with name specified in
attribute 'name' in the target page. The data will be set using automatically generated
JavaScript function.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_form">
<refmeta>
<refentrytitle>form</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>form</refname>
<refpurpose>Generic scriptable container for elements that may accept user's input.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_form">
<funcprototype id="vc_proto_form">
<funcdef>
<<function>form</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>type</parameter> (optional) </attribute>
<attribute>
<parameter>action</parameter> (optional) </attribute>
<attribute>
<parameter>method</parameter> (optional) </attribute>
<attribute>
<parameter>table</parameter> (optional) </attribute>
<attribute>
<parameter>if-not-exists</parameter> (optional) </attribute>
<attribute>
<parameter>concurrency</parameter> (optional) </attribute>
<attribute>
<parameter>triggers</parameter> (optional) </attribute>
<attribute>
<parameter>data-source</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_form">
<title>Description</title>
<para>
This is a grouping element for controls that handle post data and validation of user's input. In case of type 'update', this is a single row update control for a database table.
This retrieves the data from the row identified by the keys and shows the data in the column bound fields enclosed. If responding to a post for a submit inside this form, the form updates/inserts the data and shows the resulting state at the render pass.
</para>
</refsect1>
<refsect1 id="vc_attrs_form">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>type</title>
<para>Type of form, can be 'simple' or 'update'. When this is 'simple' the vspx_form class will be instantiated, otherwise in case of 'update' vspx_update_form subclass will be used.</para>
<table>
<title>Allowed values of the 'type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>simple</entry>
<entry>
<para>
Form with no special data binding.
</para>
</entry>
</row>
<row>
<entry>update</entry>
<entry>
<para>
Form that may be used in templates of type 'update' or 'add'.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>action</title>
<para>
A URL for processing. The data filled-in the form will be submitted to the 'action' page.
Therefore this is a page where the content of that form will be processed.
If it is empty, the target is a current page.
</para>
</formalpara>
<formalpara>
<title>method</title>
<para>A method of transferring the form data, can be POST or GET. The same as 'method' of HTML forms.</para>
<para>The use of 'GET' is not recommended because the length of the URI may easily exceed internal limits of the browser or an intermediate proxy server.</para>
</formalpara>
<formalpara>
<title>table</title>
<para>If the value of 'type' attribute is 'update', the form acts as a single row update control for a database table; and the value of 'table' attribute specifies the name of that table.
It retrieves the data from the row identified by the keys and shows the data in the column bound fields enclosed. If responding to a post for a submit inside this form, the form updates/inserts the data and shows the resulting state at the render pass.
This attribute is required if 'type' is 'update' and prohibited otherwise.</para>
</formalpara>
<formalpara>
<title>if-not-exists</title>
<para>If the keys do not select any row, and the value of this attribute is 'insert', the update form will be filled in with defaults filled in and will do an insert into the table when the form is submitted.
In this case of course the keys will have to be defaulted after the post or will have to be supplied in the post as fields.
Any defaulting should take place in the v:on-post handler which is before the insert or update in the event of the post.
</para>
</formalpara>
<formalpara>
<title>concurrency</title>
<para>If true and a previous value was shown in the form before the post being processed, this causes the system to check whether any of the data has been updated between getting it and the post at hand.
This is a sort of optimistic concurrency control at the row level. If an update is detected, the updated_meanwhile message is set as the error message of the form and no update is made. The render pass may choose to process this message as it will, the default is to show it as any other error message for form level validation failure.
</para>
</formalpara>
<formalpara>
<title>triggers</title>
<para>This is applicable for update form only, when this is OFF no PL triggers
will be fired when inserting or updating.</para>
</formalpara>
<formalpara>
<title>data-source = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>This is applicable to the update form and is
An alternative of 'table'. When is specified the value is suppsed to be
valid reference to existing data-source control. Further the given data-source
will be used to bind/update the data.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_form">
<title>Declaration of type vspx_form</title>
<para>
</para>
<screen>
create type vspx_form under vspx_control
as
(
uf_action varchar default '',
uf_method varchar default 'post',
--uf_inside_form int default 0,
uf_validators any,
uf_xmodel any default null,
uf_xsubmit any default null,
uf_xschema any default null
) temporary self as ref
constructor method vspx_form (name varchar, parent vspx_control),
method prologue_render (sid varchar, realm varchar, nonce varchar) returns any,
method epilogue_render () returns any,
overriding method vc_set_model () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_form">
<title>Examples</title>
<example id="vc_ex_form__0">
<title>
Simple entry form
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: form__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The OK button of the form submits data from the form back to the same page.
</para>
<screen>
<v:page name="form__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:form</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:label name="label1" value="--'Simple form'"/>
<v:text name="txt1" default=""/>
<v:text name="txt2" default=""/>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_form__1">
<title>
Simple entry form containing various controls
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: form__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The OK button of the form submits data from the form back to the same page.
the check-box is validated against ragio group
</para>
<screen>
<v:page name="form__1" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:form | v:validator</title>
</head>
<body>
<v:form name="f1" type="simple" method="POST">
<v:error-summary/><br/>
<v:label name="l1" value="--'Simple form'"/><br/>
<v:url name="u1" value="--'This page'" url="--self.f1.uf_action" /><br/>
<v:text name="t1" value="--self.rb1.ufl_value"/><br/>
<v:text name="t2" value="--'my'||'password'" type="password"/><br/>
<v:text name="t3" value="--'something'||'hidden'" type="hidden"/>
<v:textarea name="ta1" value="--'some text'" /><br/>
<v:check-box name="cb1" value="check-box" /><br/>
<v:radio-group name="rg1">
<v:radio-button name="rb1" value="one" />
<v:radio-button name="rb2" value="two" />
</v:radio-group><br/>
<v:button name="b1" action="simple" value="--'OK'"/><br/>
<v:validator test="sql" message="only when radio is on position one check-box could be checked">
if (self.rb2.ufl_selected and self.cb1.ufl_selected)
{
return 1;
}
</v:validator>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/form.vspx">VX-S-2</ulink>
</para>
<para>
<ulink url="/tutorial/web/vx_s_3/update_form.vspx">VX-S-3</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_hidden">
<refmeta>
<refentrytitle>hidden</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>hidden</refname>
<refpurpose>A wrapper that prevents WYSIWYG editors from displaying its content.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_hidden">
<funcprototype id="vc_proto_hidden">
<funcdef>
<<function>hidden</function> <attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_hidden">
<title>Description</title>
<para>This control does not affect the resulting HTML and Virtuoso/PL code. It is used by some WYSIWYG editors in order to temporarily hide details of the page fragment from the editor's drawing area.</para>
</refsect1>
<refsect1 id="vc_attrs_hidden">
<title>Attributes</title>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_horizontal_template">
<refmeta>
<refentrytitle>horizontal-template</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>horizontal-template</refname>
<refpurpose />
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_horizontal_template">
<funcprototype id="vc_proto_horizontal_template">
<funcdef>
<<function>horizontal-template</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_horizontal_template">
<title>Description</title>
</refsect1>
<refsect1 id="vc_attrs_horizontal_template">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_horizontal_template">
<title>Declaration of type vspx_horizontal_template</title>
<para>
</para>
<screen>
create type vspx_horizontal_template under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
<refentry id="vc_include">
<refmeta>
<refentrytitle>include</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>include</refname>
<refpurpose>A place where the source code of other page should be inserted.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_include">
<funcprototype id="vc_proto_include">
<funcdef>
<<function>include</function> <attribute>
<parameter>url</parameter> (required) </attribute>
<attribute>
<parameter>active</parameter> (optional) </attribute>
<attribute>
<parameter>initial-active</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_include">
<title>Description</title>
<para>The VSPX compiler replaces this control with the content of another page.
This will include the content from the specified url at this point of the page. The url is relative to the page.
The inclusion will be done before compilation of VSPX into Virtuoso/PL, hence the include can contain either vspx or static HTML content.
The only requirement is that the included file be well formed.
Note also that if you are using vspx namespace in the include file, it must be declared as such.
This element will not be instantiated.
instead of instantiating it will be replaced with content of the specified document.
The included page may or may not contain a 'page' element.
If a 'page' element is found in the included file
this will be skipped in the resulting page.
Also names of controls in the included file MUST NOT conflict with names of controls in the top level page or other included content.
</para>
</refsect1>
<refsect1 id="vc_attrs_include">
<title>Attributes</title>
<formalpara>
<title>url</title>
<para>URL of file to be included. If relative then the base is the page where the control resides.
E.g. If '/home/pageA' includes 'subdir1/pageB' and the included page includes 'subdir2/pageC' then 'pageC' should reside
in '/home/subdir1/subdir2', not in '/home/subdir2'.
</para>
</formalpara>
<formalpara>
<title>active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the link. The default is '1' meaning 'enable'.</para>
</formalpara>
<formalpara>
<title>initial-active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the link. The default is '1' meaning 'enable'.
Unlike 'active' attribute, this one is effective only when the page is displayed in the first time, not after user posts data back to the page.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_ex_include">
<title>Examples</title>
<example id="vc_ex_include__0">
<title>
Include a common back-link into the end of page
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: include__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
If the file footer.xml is placed in the same directory where this sample page is located
and contains the paragraph
<P><a href="index.vspx">Back to index</a></P>
then the resulting page will have additional paragraph at the end.
</para>
<screen>
<v:page name="include__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:include</title></head>
<body>
<p>The link after the horizontal ruler is included from footer.xml</p>
<hr/>
<v:include url="footer.xml"/> <!-- this will include the file described above -->
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_isql">
<refmeta>
<refentrytitle>isql</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>isql</refname>
<refpurpose>An interactive SQL control that allows the user to type an SQL statement and to see the result of its execution.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_isql">
<funcprototype id="vc_proto_isql">
<funcdef>
<<function>isql</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>isolation</parameter> (optional) </attribute>
<attribute>
<parameter>timeout</parameter> (optional) </attribute>
<attribute>
<parameter>maxrows</parameter> (optional) </attribute>
<attribute>
<parameter>user</parameter> (optional) </attribute>
<attribute>
<parameter>password</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_isql">
<title>Description</title>
</refsect1>
<refsect1 id="vc_attrs_isql">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>isolation</title>
<para>Transaction isolation level to be used.</para>
<table>
<title>Allowed values of the 'isolation' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>uncomitted</entry>
<entry>
<para>'uncomitted' transaction isolation level</para>
</entry>
</row>
<row>
<entry>committed</entry>
<entry>
<para>'committed' transaction isolation level</para>
</entry>
</row>
<row>
<entry>repeatable</entry>
<entry>
<para>'repeatable' transaction isolation level</para>
</entry>
</row>
<row>
<entry>serializable</entry>
<entry>
<para>'serializable' transaction isolation level</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>timeout = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Query time-out in seconds (currently not supported)</para>
</formalpara>
<formalpara>
<title>maxrows = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Maximum number of rows to be displayed.</para>
</formalpara>
<formalpara>
<title>user = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>SQL user account to perform the query, if not specified
the SQL account used to run the VSPX page will be used.
</para>
</formalpara>
<formalpara>
<title>password = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>When the 'user' attribute is supplied, this is
the user's password.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_isql">
<title>Declaration of type vspx_isql</title>
<para>
A isql control
</para>
<screen>
create type vspx_isql under vspx_form
as
(
-- parameters
isql_custom_exec integer default 0, -- do nothing to allow vspx code to perform actual exec (i.e. dataset open)
isql_explain integer default 0, -- explain instead of execute
isql_maxrows integer default 20,
isql_chunked integer default 0,
isql_current_stmt varchar default null,
isql_current_state any default null,
isql_current_meta any default null,
isql_current_pos int default 0,
isql_current_row int default 0,
isql_rows_fetched int default 0,
isql_user varchar default null,
isql_password varchar default null,
isql_isolation varchar default 'committed',
isql_timeout integer default 60,
isql_text varchar default '', -- sql text to execute
--results
--also used vc_error_message as vector(vector('sqlstate','sqlmessage'), ... ) for multiple statements
isql_mtd any default null, --as vector(mtd, ... ) for multiple statements
isql_res any default null, --as vector(res, ... ) for multiple statements
isql_stmts any default null -- array of statements to be executed on render as cursors
)
temporary self as ref
constructor method vspx_isql (name varchar, parent vspx_control),
method isql_exec () returns any
</screen>
</refsect1>
</refentry>
<refentry id="vc_item">
<refmeta>
<refentrytitle>item</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>item</refname>
<refpurpose>Item representing a selection inside a select list.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_item">
<funcprototype id="vc_proto_item">
<funcdef>
<<function>item</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>value</parameter> (required) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_item">
<title>Description</title>
<para>
Item representing a selection inside a select list.
</para>
</refsect1>
<refsect1 id="vc_attrs_item">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlCode">SqlCode</link>
</title>
<para>The visible value of the option, it will be shown
in the option list.
</para>
</formalpara>
<formalpara>
<title>value</title>
<para>The key value of the option, it will be assigned
to the select control ufl_value is given option is seelcted.
</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_key">
<refmeta>
<refentrytitle>key</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>key</refname>
<refpurpose>A key value of the vspx:form of type 'update'.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_key">
<funcprototype id="vc_proto_key">
<funcdef>
<<function>key</function> <attribute>
<parameter>name</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (required) </attribute>
<attribute>
<parameter>value</parameter> (required) </attribute>
<attribute>
<parameter>default</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_key">
<title>Description</title>
<para>This control defines a key value of the vspx:form of type 'update'.
All the vspx:key children together should select one or zero rows from the table.
Controls inside the form will process fields of this selected row.
</para>
</refsect1>
<refsect1 id="vc_attrs_key">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Not used</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Name of the column in the table to be updated.
This may be either the name of a primary key column or an other column, as long as the selection specified by all vspx:key children of the vspx:form is unambiguous.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The value of the key field referred to by the 'column' attribute.</para>
</formalpara>
<formalpara>
<title>default = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The default value to be used when the 'value' expression returns NULL.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_label">
<refmeta>
<refentrytitle>label</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>label</refname>
<refpurpose>Generic scriptable text.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_label">
<funcprototype id="vc_proto_label">
<funcdef>
<<function>label</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>format</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_label">
<title>Description</title>
<para>This is for displaying a value as plain text.
The underlying class is derived from VSPX_FIELD so the value to be displayed is accessible as a value of any VSPX field.</para>
</refsect1>
<refsect1 id="vc_attrs_label">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>format</title>
<para>A sprintf format string for printing the value</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_label">
<title>Declaration of type vspx_label</title>
<para>
</para>
<screen>
create type vspx_label under vspx_field
as
(
vl_format varchar default '%s'
) temporary self as ref
constructor method vspx_label (name varchar, parent vspx_control),
overriding method vc_render () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_label">
<title>Examples</title>
<example id="vc_ex_label__0">
<title>
Simple dynamic text
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: label__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This page demonstrates output of data values of various types.
</para>
<screen>
<v:page name="label__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:label</title></head>
<body>
Float: <v:label name="flo" value="--3.14" format="%d" /><br/>
Integer: <v:label name="intgr" value="--2+2" format="%d" /><br/>
String: <v:label name="strg" value="--'The quick brown fox has stopped his jumping over the lazy dog'" format="%s" /><br/>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_leaf_template">
<refmeta>
<refentrytitle>leaf-template</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>leaf-template</refname>
<refpurpose />
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_leaf_template">
<funcprototype id="vc_proto_leaf_template">
<funcdef>
<<function>leaf-template</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_leaf_template">
<title>Description</title>
</refsect1>
<refsect1 id="vc_attrs_leaf_template">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_leaf_template">
<title>Declaration of type vspx_leaf_template</title>
<para>
</para>
<screen>
create type vspx_leaf_template under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
<refentry id="vc_local_variable">
<refmeta>
<refentrytitle>local-variable</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>local-variable</refname>
<refpurpose>Local variable - an invisible control to store a temporary value.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_local_variable">
<funcprototype id="vc_proto_local_variable">
<funcdef>
<<function>local-variable</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_local_variable">
<title>Description</title>
<para>
This tag declares a control that can store a temporary value that can be accessed from other controls.
Usually it is an intermediate value that is used by a group of controls of the same form. E.g. if
controls of a form display various data stored in a complex object then it may be convenient to obtain this object once and place it
into value of a local-variable control that is the first child control of a form. The rest of child controls may access the value
from the first child to calculate their values.
</para>
</refsect1>
<refsect1 id="vc_attrs_local_variable">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_login">
<refmeta>
<refentrytitle>login</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>login</refname>
<refpurpose>Authentication parameters of a page.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_login">
<funcprototype id="vc_proto_login">
<funcdef>
<<function>login</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>realm</parameter> (required) </attribute>
<attribute>
<parameter>mode</parameter> (required) </attribute>
<attribute>
<parameter>user-password</parameter> (optional) </attribute>
<attribute>
<parameter>user-password-check</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_login">
<title>Description</title>
<para>
<para>The login control controls authentication for its page.
Depending on options this may or may not be visible.
This works together with a login-form and logout-button controls. The storage of passwords and user names is left to the application, which can specify functions called by these widgets.
The server keeps login information in the following table:</para>
<programlisting>
create table VSPX_SESSION (VS_REALM varchar, VS_SID varchar, VS_UID varchar, VS_STATE long varchar,
primary key (VS_REALM, VS_SID));
</programlisting>
<para> This table is shared between all vspx applications, each with their login differentiated by realm.
The state is an array of name value pairs which will be accessed through connection_get and connection_set inside the page code.</para>
<para>
There are three methods of keeping session state:URL-poisoning, digest authentication and Cookies.The URL-poisoning scheme presents a login dialog form and sets a session ID as hidden form element.
Digest authentication uses an opaque value as session id and is available only for browsers that support standard HTTP 1.1 digest authentication. The Cookie is an analogue of URL poisoning, but in that case session ID is kept as a Cookie, thus cookies must be enabled on the browser.
</para>
<para>
The login control is mandatory when using a persistent page variables (see persist="session" attribute of 'variable' control). This is because HTTP protocol is state-less; therefore value of such variables have to be stored in a table and restored on next hit with same session ID (and realm). Hence as login control maintains a session state (via some mechanism, see notes above), this capability is used to maintain persistent page variables.
Note also that persistent page variables can be used between different pages, in that case all of those pages need to have login control (in most cases it is invisible).
</para>
</para>
</refsect1>
<refsect1 id="vc_attrs_login">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>realm</title>
<para>This is the authentication realm name.</para>
</formalpara>
<formalpara>
<title>mode</title>
<para>This specifies the preferred mode of keeping session and login information.
In the case of url and cookie the name and password will have to be supplied in a form submit. The vspx:login-form control provides a convenient way of doing this. If passwords are transmitted in a form submit, it is best for security to have the login page accessed via SSL only. Many values may be separated by spaces. This is the order of preference. The system will use the first available depending on the user agent.</para>
<table>
<title>Allowed values of the 'mode' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>digest</entry>
<entry>
<para>HTTP digest authentication is used and the session id will travel as the opaque data in the digest headers.</para>
</entry>
</row>
<row>
<entry>url</entry>
<entry>
<para>The url mode means that URL poisoning is used and that the session id passes with the links, posts etc. Some automation is offered for this by the vspx:url and vspx:form and derived controls.</para>
</entry>
</row>
<row>
<entry>cookie</entry>
<entry>
<para>The session id is set in a cookie on browser.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>user-password</title>
<para>The name of a SQL function which will retrieve the password given a user name. If digest authentication is to be possible, this function must be specified. Example:
</para>
<programlisting>
create procedure
sql_user_password (in name varchar)
{
declare pass varchar;
pass := NULL;
whenever not found goto none;
select pwd_magic_calc (U_NAME, U_PASSWORD, 1) into pass
from SYS_USERS where U_NAME = name and U_SQL_ENABLE = 1 and U_IS_ROLE = 0;
none:
return pass;
}
;</programlisting>
</formalpara>
<formalpara>
<title>user-password-check</title>
<para>This is a function which takes the user name and password (unencrypted) and returns true if these match, false otherwise.</para>
<para>
If the application will keep a session state which will automatically be extracted from the application's user repository upon login, then either of these functions may set this using connection_set. This will persist in the session if the login is successful and will be discarded otherwise. An example of such information is a user privilege class, real name, email or such.
These functions may be called one or more times during the session, but no more than one call at the start is guaranteed.</para>
<para>Example:</para>
<programlisting>
create procedure
sql_user_password_check (in name varchar, in pass varchar)
{
if (exists (select 1 from SYS_USERS where U_NAME = name and U_SQL_ENABLE = 1 and U_IS_ROLE = 0 and
pwd_magic_calc (U_NAME, U_PASSWORD, 1) = pass))
return 1;
return 0;
}
;</programlisting>
<para>Note: when the mode is digest the login control will only call user_password and in other modes it will only call user_password_check.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_login">
<title>Declaration of type vspx_login</title>
<para>
</para>
<screen>
create type vspx_login under vspx_form
as (
vl_realm varchar,
vl_mode varchar,
vl_pwd_get varchar,
vl_usr_check varchar,
vl_authenticated int default 0,
vl_user varchar,
vl_sid varchar,
vl_no_login_redirect varchar,
vl_logout_in_progress int default 0
)
temporary self as ref
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
constructor method vspx_login (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_login">
<title>Examples</title>
<example id="vc_ex_login__0">
<title>
Simple login dialog
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: login__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will show simltaniously 'not-autneticated' message and
a simple post counter.
</para>
<screen>
<v:page name="login__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:variable name="ctr" type="int" persist="session" default="0"/>
<v:login name="lc1" realm="vspx" mode="url" user-password-check="sql_user_password_check">
<v:template type="if-no-login">You are not logged in</v:template>
<v:login-form name="f1" required="1" title="Login" user-title="User Name" password-title="Password" submit-title="Login"/>
<v:template type="if-login">
Posted #: <v:label name="l1" value="--self.ctr" format="%d"/>
<v:button name="b1" action="simple" value="Reload">
<v:on-post>
self.ctr := self.ctr + 1;
self.l1.vc_data_bind (e);
</v:on-post>
</v:button>
<v:button name="b2" action="logout" value="Logout"/>
</v:template>
</v:login>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_6/login.vspx">VX-S-6</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_login_form">
<refmeta>
<refentrytitle>login-form</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>login-form</refname>
<refpurpose>A form to be shown if the user is not logged in.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_login_form">
<funcprototype id="vc_proto_login_form">
<funcdef>
<<function>login-form</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>required</parameter> (required) </attribute>
<attribute>
<parameter>title</parameter> (optional) </attribute>
<attribute>
<parameter>user-title</parameter> (optional) </attribute>
<attribute>
<parameter>password-title</parameter> (optional) </attribute>
<attribute>
<parameter>submit-title</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_login_form">
<title>Description</title>
<para>
login-form is the control for getting login information. This may only appear inside a login.
Its function will depend on the type of login being attempted. If the type is digest, this is a button which, when submitted, will send the digest challenge.
</para>
<para>
If the url or cookie session mode is chosen, this will be a form of 2 fields with user name and password and a submit button.
</para>
<para>
if the standard form is not suitable, this can be an arbitrary form. This must post buttons values named "username" and "password" and a submit button named "login". No children need be specified if the default form is OK.
</para>
<para>
If the redirect attribute of template[@type=if-no-login] is not specified,
the contents of this child are instantiated and shown in the place of the login control.
This can be arbitrary content.
</para>
</refsect1>
<refsect1 id="vc_attrs_login_form">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>required</title>
<para>
If digest is the mode, then this means that the login is mandatory and that instead of displaying the login button which will send the challenge if pressed, the challenge will be sent automatically.
</para>
</formalpara>
<formalpara>
<title>title</title>
<para>Title of login button if digest is attempted.
</para>
</formalpara>
<formalpara>
<title>user-title</title>
<para>Title of user name field
</para>
</formalpara>
<formalpara>
<title>password-title</title>
<para>Title of password field
</para>
</formalpara>
<formalpara>
<title>submit-title</title>
<para>Title of submit button
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_login_form">
<title>Declaration of type vspx_login_form</title>
<para>
</para>
<screen>
create type vspx_login_form under vspx_form
as
(
vlf_title varchar,
vlf_user_title varchar,
vlf_password_title varchar,
vlf_submit_title varchar,
vlf_login vspx_login
) temporary self as ref
constructor method vspx_login_form (name varchar, parent vspx_control),
constructor method vspx_login_form (name varchar, title varchar, user_title varchar, password_title varchar, submit_tile varchar, login vspx_login),
overriding method vc_render () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_login_form">
<title>Examples</title>
<example id="vc_ex_login_form__0">
<title>
A simple default login-form
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: login_form__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This example will render just a login form
</para>
<screen>
<v:page name="login_form__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:login-form</title></head>
<body>
<v:login name="login_0" mode="url" user-password-check="sql_user_password_check" realm="vspx">
<v:login-form name="login_form_0"
required="1"
title="Login"
user-title="User Name"
password-title="Password"
submit-title="Login"/>
</v:login>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_method">
<refmeta>
<refentrytitle>method</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>method</refname>
<refpurpose>Page method - a user defined member of page class.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_method">
<funcprototype id="vc_proto_method">
<funcdef>
<<function>method</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>returns</parameter> (optional) </attribute>
<attribute>
<parameter>arglist</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_method">
<title>Description</title>
<para>This creates a custom method of the page class.</para>
</refsect1>
<refsect1 id="vc_attrs_method">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of method to be created</para>
</formalpara>
<formalpara>
<title>returns = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Optional return datatype type</para>
</formalpara>
<formalpara>
<title>arglist</title>
<para>comma-separated list of arguments. For example : "in arg1 varchar, out arg1 integer ..."</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_node">
<refmeta>
<refentrytitle>node</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>node</refname>
<refpurpose>A place holder for rendering a tree node.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_node">
<funcprototype id="vc_proto_node">
<funcdef>
<<function>node</function> <attribute>
<parameter>void</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_node">
<title>Description</title>
<para>This control indicates the place of a subtree inside a node template.</para>
</refsect1>
<refsect1 id="vc_attrs_node">
<title>Attributes</title>
<formalpara>
<title>void</title>
<para>Not used.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_node_template">
<refmeta>
<refentrytitle>node-template</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>node-template</refname>
<refpurpose />
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_node_template">
<funcprototype id="vc_proto_node_template">
<funcdef>
<<function>node-template</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_node_template">
<title>Description</title>
</refsect1>
<refsect1 id="vc_attrs_node_template">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_node_template">
<title>Declaration of type vspx_node_template</title>
<para>
</para>
<screen>
create type vspx_node_template under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
<refentry id="vc_on_init">
<refmeta>
<refentrytitle>on-init</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>on-init</refname>
<refpurpose>Container for code that should be executed at the end of control instantiation.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_on_init">
<funcprototype id="vc_proto_on_init">
<funcdef>
<<function>on-init</function>>(EventHandler)</<function>on-init</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_on_init">
<title>Description</title>
<para>The code contained in this element is executed at the end of the control's constructor.
This is expected to have additional initialization checking etc.
</para>
</refsect1>
</refentry>
<refentry id="vc_on_init_container">
<refmeta>
<refentrytitle>on-init-container</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>on-init-container</refname>
<refpurpose>This is identical to v:on-init.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_on_init_container">
<funcprototype id="vc_proto_on_init_container">
<funcdef>
<<function>on-init-container</function>>(EventHandler)</<function>on-init-container</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_on_init_container">
<title>Description</title>
</refsect1>
</refentry>
<refentry id="vc_on_post">
<refmeta>
<refentrytitle>on-post</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>on-post</refname>
<refpurpose>Container for code that should be executed when the element gets a post.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_on_post">
<funcprototype id="vc_proto_on_post">
<funcdef>
<<function>on-post</function>>(EventHandler)</<function>on-post</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_on_post">
<title>Description</title>
<para>
The code contained in this element is executed when the element gets a post.
For fields and forms, this is a context for an a SQL compound statement that will be executed.
The statement should end with a return 1 or 0. The implicit return is 0. A return of 1 means that the post is fully handled here and not to be passed on to the parent chain.
A 0 means that the post was not handled and the next control up the chain will try.
</para>
<para>
The context has a self which is the page, a vspx_control which is the control which defines this handler, and a origin_control, which is the control that first got the post event. This will be a data field or button. The vspx_event with the post's data will be in the variable event.
</para>
<para>
The interpretation of the return value is the same for other event handlers. SQL
conditions signalled will go to the page, these condition handlers are
invoked in no special context, hence the declare handler for SQL
construct should not be used to pass control between handlers, but only
within handlers.
</para>
</refsect1>
</refentry>
<refentry id="vc_on_post_container">
<refmeta>
<refentrytitle>on-post-container</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>on-post-container</refname>
<refpurpose>This is identical to v:on-post.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_on_post_container">
<funcprototype id="vc_proto_on_post_container">
<funcdef>
<<function>on-post-container</function>>(EventHandler)</<function>on-post-container</function>></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_on_post_container">
<title>Description</title>
</refsect1>
</refentry>
<refentry id="vc_page">
<refmeta>
<refentrytitle>page</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>page</refname>
<refpurpose>Container of VSPX code.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_page">
<funcprototype id="vc_proto_page">
<funcdef>
<<function>page</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>decor</parameter> (optional) </attribute>
<attribute>
<parameter>style</parameter> (optional) </attribute>
<attribute>
<parameter>on-error-redirect</parameter> (optional) </attribute>
<attribute>
<parameter>on-deadlock-retry</parameter> (optional) </attribute>
<attribute>
<parameter>doctype</parameter> (optional) </attribute>
<attribute>
<parameter>doctype-system</parameter> (optional) </attribute>
<attribute>
<parameter>page-subclass</parameter> (optional) </attribute>
<attribute>
<parameter>file-name</parameter> (optional) </attribute>
<attribute>
<parameter>no-script-function</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_page">
<title>Description</title>
<para>The container for the rest of the vspx code.
The page or a subclass of it will be the outermost VSPX element on any VSPX page.
Each .vspx file defines explicitly one custom page class derived from vspx_page.
This element can enclose all HTML elements or can be incorporated in it's children on place apropriate for
rendering the VSPX controls, but one VSPX page must contain only one vspx:page element. and noe VSPX-specific element may appear outside the vspx:page. It can be placed in other HTML stuff or around it, does not matter, but VSP & VSPX code must be inside it (the same applies to customized HTML attributes, i.e. containing <?V & <?U shortcuts).
Note that when using 'include' or 'decoration' features the top level page element will be : in case of include - 'this' page, in case of 'decoration' - the decoration page.
Also page variables, controls will be combined in all cases of inclusion or macro-expansion, so their names must not be duplicated; this means that names of variables introduced by macro expansion or inclusion must not conflict with cnames of variables or controls in the top level page or any included or macro content.
</para>
</refsect1>
<refsect1 id="vc_attrs_page">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of subclass of vspx_page to be generated. The name of class will be prefixed with 'page_' plus that name.
</para>
</formalpara>
<formalpara>
<title>decor</title>
<para>This attribute specifies a 'decoration' page URL. The decoration page is a VSPX page that is wrapped around the including page. The content of the including page is then put in the place indicated by a placeholder element in the decor page. This is useful for defining enclosing tables, headers, footers and other repeating content.
</para>
</formalpara>
<formalpara>
<title>style</title>
<para>This designates an external XSL-T style sheet to be apply over the page, before page compilation. This is useful as a 'macro' feature. The XSLT sheet may define rules for macroexpanding things in the page body.
</para>
</formalpara>
<formalpara>
<title>on-error-redirect</title>
<para>This specifies where to redirect the HTTP client in the event of an an unhandled error.
This will pass a __SQL_STATE, __SQL_MESSAGE and __PAGE as parameters to the error page.
</para>
</formalpara>
<formalpara>
<title>on-deadlock-retry</title>
<para>This specifies how many times to retry page execution upon deadlock.
When the number of retries is reached, the behaviour will be as for other SQL errors.
</para>
</formalpara>
<formalpara>
<title>doctype</title>
<para>This is to specify the resulting document type declaration (DTD) public URI.
</para>
</formalpara>
<formalpara>
<title>doctype-system</title>
<para>This is to specify the resulting document type declaration (DTD) system URI.
</para>
</formalpara>
<formalpara>
<title>page-subclass = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of page subclass to be instantiated for processing.
The subclass with this name MUST already be defined.
The subclass definition can be kept in a code-behind file (see code-file element).
</para>
</formalpara>
<formalpara>
<title>file-name</title>
<para>The name of page to be generated.
Used by wizards to designate where generated page will be stored.
This attribute do not affect VSPX processing.
</para>
</formalpara>
<formalpara>
<title>no-script-function</title>
<para>A function to enable or disable automatic NOSCRIPT element generation.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_page">
<title>Declaration of type vspx_page</title>
<para>
VSPX Page Class , from it must be derived all VSPX pages, no subcalsses for others
</para>
<screen>
create type vspx_page under vspx_control
as (
vc_view_state any,
vc_is_postback int default 0,
vc_persisted_vars any,
vc_event vspx_event,
vc_is_valid int default 1, -- set to 0 when first validator fails
vc_authenticated int default 0, -- is true if login control in the page suceeded
vc_current_id int default 0,
vc_browser_caps any default 0,
vc_authentication_mode int default 1, -- authentication mode 0 - cookie, 1 - url, 2 - digest
vc_debug_log_acc any default null -- The accumulator in xte_nodebld_... style for keeping debugging info.
) temporary self as ref
method vc_state_deserialize (stream any, n int) returns any,
method vc_get_debug_log (title varchar) returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_page">
<title>Examples</title>
<example id="vc_ex_page__0">
<title>
Sample VSPX page
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: page__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
</para>
<screen>
<v:page name="page__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:page</title></head>
<body>
<p>This VSPX page does nothing.<br/>
It does not even print traditional 'Hello world' phrase.</p>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_1/simple.vspx">VX-S-1</ulink>
</para>
<para>
<ulink url="/tutorial/web/vx_s_8/formsty.vspx">VX-S-8</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_param">
<refmeta>
<refentrytitle>param</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>param</refname>
<refpurpose>Named parameter for the cursor.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_param">
<funcprototype id="vc_proto_param">
<funcdef>
<<function>param</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>value</parameter> (required) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_param">
<title>Description</title>
<para>Named parameter for execution of the cursor select statement. This must be the name of a parameter for SQL statement specified, but without leading colon.</para>
</refsect1>
<refsect1 id="vc_attrs_param">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Name of the parameter.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bound value of the parameter.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_placeholder">
<refmeta>
<refentrytitle>placeholder</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>placeholder</refname>
<refpurpose>Placeholder for original page in the decoration page.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_placeholder">
<funcprototype id="vc_proto_placeholder">
<funcdef>
<<function>placeholder</function> <attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_placeholder">
<title>Description</title>
<para>This marks the place in the decoration page where the content of the original page should be placed.</para>
</refsect1>
<refsect1 id="vc_attrs_placeholder">
<title>Attributes</title>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_radio_button">
<refmeta>
<refentrytitle>radio-button</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>radio-button</refname>
<refpurpose>Scriptable radio button.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_radio_button">
<funcprototype id="vc_proto_radio_button">
<funcdef>
<<function>radio-button</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>group-name</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>initial-checked</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_radio_button">
<title>Description</title>
<para>is a scriptable version of HTML radio button.</para>
</refsect1>
<refsect1 id="vc_attrs_radio_button">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>group-name</title>
<para>When several check boxes are to be grouped, this is the name of the group. Upon post the name of the group will be submitted instead of the than name of the control. This also will restrict in the group to have more than one button on</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>initial-checked</title>
<para>This flag specifies whther this control is initially checked.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_radio_button">
<title>Declaration of type vspx_radio_button</title>
<para>
</para>
<screen>
create type vspx_radio_button under vspx_field
temporary self as ref
constructor method vspx_radio_button (name varchar, parent vspx_control),
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_render () returns any,
overriding method vc_xrender () returns any,
overriding method vc_set_model () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_radio_button">
<title>Examples</title>
<example id="vc_ex_radio_button__0">
<title>
Groups of radio buttons.
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: radio_button__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains two groups of radio buttons, three button in each group.
</para>
<screen>
<v:page name="radio_button__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:radio-button</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="GET">
<input type="text" name="qq"/>
<table>
<tr>
<td>
<v:radio-button name="radio1" group-name="radio_group_A" value="--'A-one'" initial-checked="1"/>
<v:radio-button name="radio2" group-name="radio_group_A" value="--'A-two'"/>
<v:radio-button name="radio3" group-name="radio_group_A" value="--'A-three'"/>
</td>
</tr>
<tr>
<td>
<v:radio-button name="radio4" group-name="radio_group_B" value="--'B-one'" initial-checked="1"/>
<v:radio-button name="radio5" group-name="radio_group_B" value="--'B-two'"/>
<v:radio-button name="radio6" group-name="radio_group_B" value="--'B-three'"/>
</td>
</tr>
</table>
<v:button name="submit1" action="simple" style="image" xhtml:alt="A test button" value="--'plus.gif'"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/radio.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_radio_group">
<refmeta>
<refentrytitle>radio-group</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>radio-group</refname>
<refpurpose>A group of radio-buttons.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_radio_group">
<funcprototype id="vc_proto_radio_group">
<funcdef>
<<function>radio-group</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_radio_group">
<title>Description</title>
<para>
This control is used to group containing radio-buttons in a group.
This ensures that only one button is selected at a time.
Note: This control is not mandatory for making such group of
buttons, another option is to use 'group-name' attribute of the radio-button control.
</para>
</refsect1>
<refsect1 id="vc_attrs_radio_group">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the
containing update form sets the field's attributes.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_radio_group">
<title>Declaration of type vspx_radio_group</title>
<para>
</para>
<screen>
create type vspx_radio_group under vspx_field
temporary self as ref
constructor method vspx_radio_group (name varchar, parent vspx_control),
method vc_choose_selected () returns any,
overriding method vc_xrender () returns any,
overriding method vc_set_model () returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_radio_group">
<title>Examples</title>
<example id="vc_ex_radio_group__0">
<title>
Groups of radio buttons.
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: radio_group__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains a groups of radio buttons, grouped with radio-group control.
</para>
<screen>
<v:page name="radio_group_demo" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:form name="sf" type="simple" method="POST">
<v:radio-group name="radio00">
<v:radio-button name="radiob01" value="--'one'" />
<v:radio-button name="radiob02" value="--'two'" />
</v:radio-group>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/radio_group.vspx">VX-S-2</ulink>
</para>
<para>
<ulink url="/tutorial/web/vx_s_3/update_radio.vspx">VX-S-3</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_script">
<refmeta>
<refentrytitle>script</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>script</refname>
<refpurpose>A (redundant) wrapper for SQL code, can be omitted.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_script">
<funcprototype id="vc_proto_script">
<funcdef>
<<function>script</function> <attribute>
<parameter>language</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_script">
<title>Description</title>
<para>
This control can appear only inside event handling controls and it always contain SQL code to be executed when the event occurs.
There is no difference for VSPX compiler whether SQL code is enclosed in 'script' control or not.
Some WYSIWYG tools can display the enclosed SQL code to the application developer according to custom attributes of this control
but it does not affect the generated Virtuoso/PL code of the page.
</para>
</refsect1>
<refsect1 id="vc_attrs_script">
<title>Attributes</title>
<formalpara>
<title>language = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Denotes the type of language,
currently only Virtuoso/PL expressions are supported.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_select_list">
<refmeta>
<refentrytitle>select-list</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>select-list</refname>
<refpurpose>Fixed initialized select list.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_select_list">
<funcprototype id="vc_proto_select_list">
<funcdef>
<<function>select-list</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>multiple</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_select_list">
<title>Description</title>
<para>This is a scriptable version of HTML select control.
It shows a static list of items (see item element). Databind and on-post scripts are allowed.
</para>
</refsect1>
<refsect1 id="vc_attrs_select_list">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>multiple</title>
<para>Used to designate a multiple selection list box.
In this case the control's value will be an array of key data of selected items.
</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_select_list">
<title>Declaration of type vspx_select_list</title>
<para>
</para>
<screen>
create type vspx_select_list under vspx_field
as (
vsl_items any,
vsl_item_values any,
vsl_selected_inx any default null,
vsl_change_script int default 0,
vsl_list_document any default null,
vsl_list_match varchar default null,
vsl_list_key_path varchar default null,
vsl_list_value_path varchar default null,
vsl_multiple int default 0
)
temporary self as ref
overriding method vc_render () returns any,
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_set_model () returns any,
overriding method vc_xrender () returns any,
method vs_set_selected () returns any,
constructor method vspx_select_list (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_select_list">
<title>Examples</title>
<example id="vc_ex_select_list__0">
<title>
A simple static select list
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: select_list__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form of the sample page contains a list of three items.
</para>
<screen>
<v:page name="select_list__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:select-list</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:select-list name="sel_list">
<v:item name="*default*" value="0"/>
<v:item name="FIRST" value="1"/>
<v:item name="SECOND" value="2"/>
</v:select-list>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/select.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_style">
<refmeta>
<refentrytitle>style</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>style</refname>
<refpurpose>A markup tag for use by 'macro stylesheets'.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_style">
<funcprototype id="vc_proto_style">
<funcdef>
<<function>style</function> <attribute>
<parameter>name</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_style">
<title>Description</title>
<para>This control marks the enclosed content for special processing in the 'macro stylesheet' whose name is specified by 'style' attribute of v:page element.</para>
</refsect1>
<refsect1 id="vc_attrs_style">
<title>Attributes</title>
<formalpara>
<title>name</title>
<para>Optional name of the control which could be used
in the macro expansion stylesheet assigned.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
</refentry>
<refentry id="vc_tab">
<refmeta>
<refentrytitle>tab</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>tab</refname>
<refpurpose>Selects one of its children to be active at any one time.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_tab">
<funcprototype id="vc_proto_tab">
<funcdef>
<<function>tab</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>initial-active</parameter> (optional) </attribute>
<attribute>
<parameter>style</parameter> (optional) </attribute>
<attribute>
<parameter>active</parameter> (optional) </attribute>
<attribute>
<parameter>is-input</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_tab">
<title>Description</title>
<para>
A container that contains some number of pages and displays them one by one.
This can be used for multi-page forms or Windows style tabbed decks or making multi-part forms, alternative visualizations of the same data etc.
</para>
</refsect1>
<refsect1 id="vc_attrs_tab">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>initial-active = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>
This is the name of the child template which is active at the time and
which thus will be rendered. Whether inactive templates are
instantiated and keep state is controlled by is-input. The active
attribute initializes the tb_active member of the vspx_tab instance.
This is preserved in the view state. Data bindable.
</para>
</formalpara>
<formalpara>
<title>style</title>
<para>
This determines what HTML control is used to select which child is shown.
If unspecified, there will be no such control and the program logic is responsible for flipping the pages. Otherwise "list" means there is a HTML select control showing the titles of the tabs. "radio" means the titles of the tabs are shown as a radio group. If there is a tab selector widget, it is always above the tabs.
</para>
</formalpara>
<formalpara>
<title>active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the tab switch.
The default is '1' meaning 'enable'.</para>
</formalpara>
<formalpara>
<title>is-input</title>
<para>If true, all the children are considered to be collectively a
multipart form and each will be instantiated when the page is made and
will get to retain a view state. Although only one page of the form
is shown at a time, the state of all is kept. Not data bindable.
The default is '1' meaning 'template contains input'.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_tab">
<title>Declaration of type vspx_tab</title>
<para>
Tab Deck
</para>
<screen>
create type vspx_tab under vspx_form
as
(
tb_active vspx_template,
tb_is_input int default 0,
tb_style varchar
)
temporary self as ref
constructor method vspx_tab (name varchar, parent vspx_control),
--overriding method vc_render () returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_view_state (stream any, n int) returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_tab">
<title>Examples</title>
<example id="vc_ex_tab__0">
<title>
Switching of page content
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: tab__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The sample page contains three templates; only one of three is shown and user can switch them to change the visible content of the page.
</para>
<screen>
<v:page name="tab__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:tab</title></head>
<body>
<v:tab name="tab" initial-active="template1" style="list" is-input="0">
<v:template name="template1" type="simple">This is a first template</v:template>
<v:template name="template2" type="simple">This is a second template</v:template>
<v:template name="template3" type="simple">This is a third template</v:template>
</v:tab>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_5/tab.vspx">VX-S-5</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_template">
<refmeta>
<refentrytitle>template</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>template</refname>
<refpurpose>Container for a group of controls and/or HTML code.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_template">
<funcprototype id="vc_proto_template">
<funcdef>
<<function>template</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>type</parameter> (optional) </attribute>
<attribute>
<parameter>redirect</parameter> (optional) </attribute>
<attribute>
<parameter>condition</parameter> (optional) </attribute>
<attribute>
<parameter>name-to-remove</parameter> (optional) </attribute>
<attribute>
<parameter>set-to-remove</parameter> (optional) </attribute>
<attribute>
<parameter>title</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_template">
<title>Description</title>
<para>The container for any optional, repeatable or otherwise grouped controls or code. The type modifier is used to specify special kind of templates (i.e. repeatable content or tree node representation)</para>
</refsect1>
<refsect1 id="vc_attrs_template">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>type</title>
<para>The behaviour of the template.</para>
<table>
<title>Allowed values of the 'type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>simple</entry>
<entry>
<para>The template contains an arbitrary number of controls and HTML tags and groups them together to control their processing, e.g. to enable or disable them altogether depending on some condition.</para>
</entry>
</row>
<row>
<entry>repeat</entry>
<entry>
<para>A repeating row of v:data-set. The template of this type will be repeated for each row in the window of the data-set. It will be instantiated, data bound, rendered. If the template contains forms and submits, they get the post method called as one would expect.
On data binding, the parent of the template has its dg_current_row data member set to an array representing the selected row from left to right.
</para>
</entry>
</row>
<row>
<entry>row</entry>
<entry>
<para>A repeating row of v:data-grid. The template of this type will be repeated for each row in the window of the v:data-grid. It will be instantiated, data bound, rendered. If the template contains forms and submits, they get the post method called as one would expect.
On data binding, the parent of the template has its dg_current_row data member set to an array representing the selected row from left to right.
</para>
<para>
The controls under this template (such as text, label, button etc.) can access data in current row in order as columns are given by referencing te_rowset member of row template.
</para>
</entry>
</row>
<row>
<entry>frame</entry>
<entry>
<para>
A non-repeating static content of v:data-grid.
Content of this template represents view in page when rows are selected,
position of scroll buttons, rowset and form for adding a record.
</para>
</entry>
</row>
<row>
<entry>if-exists</entry>
<entry>
<para>
Template that is enabled only if the resultset is not empty in v:data-set.
</para>
</entry>
</row>
<row>
<entry>if-not-exists</entry>
<entry>
<para>Template that is enabled only if the resultset is empty in v:data-set.</para>
</entry>
</row>
<row>
<entry>add</entry>
<entry>
<para>Template that is enabled when user adds new record in the resultset in v:data-set (if the resultset is not read-only).
Similarly to templates of type 'edit', the 'add' template contains a vspx:form of type 'update' that is used to allow adding of rows in table as specified.
Usually this form is a vspx_form + vspx_text constrained to columns and table selected in SQL expression of the parent vspx:data-set control with value of key attributes set to null. Please remember to set the 'if-not-exists' attribute of the form to 'insert'.</para>
</entry>
</row>
<row>
<entry>browse</entry>
<entry>
<para>This type is meaningful only for templates right inside templates of type 'repeat'. When the template of type 'repeat' is used multiple times to display every row of a data-set, the template of type 'browse' expands only for those rows that are not currently editable.
</para>
</entry>
</row>
<row>
<entry>edit</entry>
<entry>
<para>Template that is enabled when user edits an existing record in the resultset in v:data-set (if the resultset isnot read-only and if the 'edit' attribute of v:data-set is set to 'true').
The template of this type usually contains a vspx:form of type 'update';
the 'table' attribute of the form is the name of the table from 'sql' attribute of the v:data-set where the 'edit' template is located; controls of the form are usually constrained to columns of the SQL expression of that 'sql' attribute.</para>
</entry>
</row>
<row>
<entry>if-login</entry>
<entry>
<para>Template that is enabled when user is logged in (e.g. for use in v:login. If the login is valid, the contents of this child will be instantiated. This can be for example a button with 'action' attribute set to 'logout', a welcome message or such. When using the vspx:login system, the user name is is obtained by connection_get ('vspx_user').</para>
</entry>
</row>
<row>
<entry>if-not-login</entry>
<entry>
<para>Template that is enabled when user is not yet logged in or is already logged out (e.g. for use in v:login.
The template specifies what to do if there are no credentials with the page.
If the 'redirect' attribute is given, then the entire page containing
this is not processed at all but instead the page specified in the url
is processed instead, with the context being that of the invocation of
this page. The redirect page can thus ask for the login and having
checked it return to this page, since it knows the url for this. In
this way it is possible to bookmark places of which the uri's may
expire, and accessing an expired place will just prompt for the login
before going to the page.
If the redirect is not specified, the content of the template is instantiated and shown. The content can be arbitrary, e.g. the vspx:login-form control can appear here, providing a standard login form that prompts for a user name and password and has a submit button.</para>
</entry>
</row>
<row>
<entry>tree-node</entry>
<entry>
<para>
Template for internal nodes of the tree in v:tree (i.e. for nodes with children).
</para>
</entry>
</row>
<row>
<entry>tree-leaf</entry>
<entry>
<para>Template for terminal nodes of the tree in v:tree (i.e. for nodes without children).</para>
</entry>
</row>
<row>
<entry>input</entry>
<entry>
<para>Template for input the SQL statement to execute it interactively in v:isql element.</para>
</entry>
</row>
<row>
<entry>result</entry>
<entry>
<para>Template to show if v:isql returns result without an error.</para>
</entry>
</row>
<row>
<entry>error</entry>
<entry>
<para>Template to be shown by v:isql if the user entered the SQL query and the execution of this query caused an error.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>redirect</title>
<para>The URL to which the user agent is redirected if not authenticated, applicable only when type is 'if-no-login'.</para>
</formalpara>
<formalpara>
<title>condition = <link linkend="vc_type_SqlCode">SqlCode</link>
</title>
<para>This is a SQL expression to be tested for rendering the template</para>
</formalpara>
<formalpara>
<title>name-to-remove</title>
<para>This works together with set-to-remove, see next.</para>
</formalpara>
<formalpara>
<title>set-to-remove</title>
<para>This combined with name-to-remove gives posibility to remove a HTML elements from output.</para>
<table>
<title>Allowed values of the 'set-to-remove' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>none</entry>
<entry>
<para>The rendered output of the enclosing template will not be affected by the 'name-to-remove' attribute of the template.</para>
</entry>
</row>
<row>
<entry>top</entry>
<entry>
<para>The rendered output of the enclosing template should not contain the first opening tag whose name is equal to the value of 'name-to-remove' attribute of the template.</para>
</entry>
</row>
<row>
<entry>bottom</entry>
<entry>
<para>
The rendered output of the enclosing template should not contain the last closing tag whose name is equal to the value of 'name-to-remove' attribute of the template.
</para>
</entry>
</row>
<row>
<entry>both</entry>
<entry>
<para>
The rendered output of the enclosing template should not contain the both the first opening tag and the last closing tag whose name is equal to the value of 'name-to-remove' attribute of the template.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>title</title>
<para>When used inside tab control, this is used to show as label of the selector</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_template">
<title>Declaration of type vspx_template</title>
<para>
</para>
<screen>
create type vspx_template under vspx_control
temporary self as ref
constructor method vspx_template (name varchar, parent vspx_control)
</screen>
</refsect1>
</refentry>
<refentry id="vc_text">
<refmeta>
<refentrytitle>text</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>text</refname>
<refpurpose>Scriptable, data-bindable input control.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_text">
<funcprototype id="vc_proto_text">
<funcdef>
<<function>text</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>type</parameter> (optional) </attribute>
<attribute>
<parameter>default</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>default-value</parameter> (optional) </attribute>
<attribute>
<parameter>default_value</parameter> (optional) </attribute>
<attribute>
<parameter>format</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_text">
<title>Description</title>
<para>Text input, with scripts and validation options but no implied database binding. String input of the HTML form.</para>
</refsect1>
<refsect1 id="vc_attrs_text">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>type</title>
<table>
<title>Allowed values of the 'type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>plain</entry>
<entry>
<para>The value is displayed in a usual way and user can edit it. This is the default value.</para>
</entry>
</row>
<row>
<entry>password</entry>
<entry>
<para>The value is not shown on the screen to prevent occasional reading, only astericks are shown in the input field.</para>
</entry>
</row>
<row>
<entry>hidden</entry>
<entry>
<para>The text is passed to the target page without displaying it to the user.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>default = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The default value of input field.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>default-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is an expression for setting the default value of the text.</para>
</formalpara>
<formalpara>
<title>default_value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is deprecated alias for 'default-value' attribute (note the difference between minus sign and underscore).</para>
</formalpara>
<formalpara>
<title>format = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_text">
<title>Declaration of type vspx_text</title>
<para>
</para>
<screen>
create type vspx_text under vspx_field
as
(
tf_default varchar default '',
tf_style any default 0 -- 0 is text, 1 is password, 2 is hidden
)
temporary self as ref
overriding method vc_render () returns any,
overriding method vc_set_view_state (e vspx_event) returns any,
overriding method vc_view_state (stream any, n int) returns any,
overriding method vc_set_model () returns any,
overriding method vc_xrender () returns any,
constructor method vspx_text (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_text">
<title>Examples</title>
<example id="vc_ex_text__0">
<title>
Simple text input
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: text__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains text input control with 'Hello' string inside. User can edit the string and submit the changed value
</para>
<screen>
<v:page name="text__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:text</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:text name="txt01" default="Hello"/>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_textarea">
<refmeta>
<refentrytitle>textarea</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>textarea</refname>
<refpurpose>Scriptable text-area input.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_textarea">
<funcprototype id="vc_proto_textarea">
<funcdef>
<<function>textarea</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>error-glyph</parameter> (optional) </attribute>
<attribute>
<parameter>auto-submit</parameter> (optional) </attribute>
<attribute>
<parameter>type</parameter> (optional) </attribute>
<attribute>
<parameter>default_value</parameter> (optional) </attribute>
<attribute>
<parameter>default</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_textarea">
<title>Description</title>
<para>Scriptable, databindable HTML text area.</para>
</refsect1>
<refsect1 id="vc_attrs_textarea">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>error-glyph</title>
<para>The character to be displayed near the resulting HTML input element if the test of v:validator of the element detects an error in the current value of the element.</para>
</formalpara>
<formalpara>
<title>auto-submit</title>
<para>Flag to auto submit the parent form if value of the control is changed.</para>
</formalpara>
<formalpara>
<title>type</title>
<table>
<title>Allowed values of the 'type' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>plain</entry>
<entry>
<para>The value is displayed in a usual way and user can edit it. This is the default value.</para>
</entry>
</row>
<row>
<entry>password</entry>
<entry>
<para>The value is not shown on the screen to prevent occasional reading, only astericks are shown in the input field.</para>
</entry>
</row>
<row>
<entry>hidden</entry>
<entry>
<para>The text is passed to the target page without displaying it to the user.</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>default_value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The default value of the field. Can be accessed via control.ufl_value n data bind stage.</para>
</formalpara>
<formalpara>
<title>default = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Deprecated alias of 'default_value'.</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_textarea">
<title>Declaration of type vspx_textarea</title>
<para>
</para>
<screen>
create type vspx_textarea under vspx_text temporary self as ref
constructor method vspx_textarea (name varchar, parent vspx_control),
overriding method vc_xrender () returns any,
overriding method vc_render () returns any
</screen>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/textarea.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_tree">
<refmeta>
<refentrytitle>tree</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>tree</refname>
<refpurpose>A container for displaying a tree of nested nodes.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_tree">
<funcprototype id="vc_proto_tree">
<funcdef>
<<function>tree</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>show-root</parameter> (optional) </attribute>
<attribute>
<parameter>multi-branch</parameter> (required) </attribute>
<attribute>
<parameter>orientation</parameter> (required) </attribute>
<attribute>
<parameter>root</parameter> (required) </attribute>
<attribute>
<parameter>child-function</parameter> (required) </attribute>
<attribute>
<parameter>start-path</parameter> (required) </attribute>
<attribute>
<parameter>open-at</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_tree">
<title>Description</title>
<para>
<para>This can be used for hierarchical tables of contents,
directory browsing, hierarchical menus and such.
The tree can have either one or more branches open at any time, up to
the leaves. The tree has a root, which may or may not be visible.
The contents of the tree can either be fixed, in which case these are an
XML tree, or dynamic, in which case these are generated level by level
by SQL functions attached to the tree. The tree can have various external appearences.</para>
<para>The tree is represented at run time by a vspx_tree instance.
Nodes of the tree are represented by vspx_tree_node objects,
which are childs of the vspx_tree. The nodes hold an identifier (vc_instance_name)
of the corresponding tree branch, which is used to retrieve children of the node.
These also hold a flag (tn_open member) indicating if the node is open or not.</para>
</para>
</refsect1>
<refsect1 id="vc_attrs_tree">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>show-root</title>
<para>This attribute is obsolete and has no effect.</para>
</formalpara>
<formalpara>
<title>multi-branch</title>
<para>
This determines whether more than one branches can be open at one time.
The values are 0 and 1 (true and false). The default is 0 (false).
</para>
</formalpara>
<formalpara>
<title>orientation</title>
<para>
This can be 'horizontal' or 'vertical', the default is 'vertical'.
The tree can have different styles. The default is a vertical arrangement
with open levels indented, the children under the parent node.
Each node template is a single line. The horizontal style shows each level on a separate line.
In this case it is not allowed multiple open branches. The children of the root will be
shown on one line. When one is opened, its children will fill the next line.
</para>
</formalpara>
<formalpara>
<title>root = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>
This is a SQL expression which produces the root object.
This can be of any data type, a file system path is an example.
</para>
<programlisting>
create procedure root_node (in path varchar)
{
declare i, l int;
declare ret, arr any;
arr :=
vector_concat (sys_dirlist (path, 0), sys_dirlist (path, 1));
return arr;
};
</programlisting>
</formalpara>
<formalpara>
<title>child-function = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>Given the result of the root expression, this must generate an array
of similar elements corresponing to the children of the node in
question. This same function should be applicable to each element of
the array it returns. If the array is empty then the node in question
is a leaf.</para>
<programlisting>
-- Example of this function
create procedure child_node (in node_name varchar, in node varchar)
{
declare i, l int;
declare ret, arr any;
declare exit handler for sqlstate '*'
{
return vector ();
};
if (isstring (file_stat (node_name, 3)))
return vector ();
arr :=
vector_concat (sys_dirlist (node_name, 0), sys_dirlist (node_name, 1));
return arr;
}
;
</programlisting>
</formalpara>
<formalpara>
<title>start-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is an expression which will be evaluated and passed to the 'root' function as argument.
</para>
</formalpara>
<formalpara>
<title>open-at = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is an expression which will be used as XPath
expression to designate which branches of the tree are open
and which are not initially.
</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_tree">
<title>Declaration of type vspx_tree</title>
<para>
</para>
<screen>
create type vspx_tree under vspx_control
as
(
vt_current_node int default -1,
vt_node any default null,
vt_open_at varchar default null,
vt_xpath_id varchar default null
)
temporary self as ref
overriding method vc_view_state (stream any, n int) returns any,
method vc_get_state () returns any,
method vc_open_at (path varchar) returns any,
constructor method vspx_tree (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_tree">
<title>Examples</title>
<example id="vc_ex_tree__0">
<title>
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: tree__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
</para>
<screen>
<v:page name="demo_tree" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:form name="f1" method="POST" type="simple">
<div>
<v:tree name="tree1" multi-branch="1" orientation="vertical"
root="root_node" start-path="." child-function="child_node" >
<v:node-template name="node_tmpl">
<div STYLE="margin-left:1em;">
<v:button name="tree1_toggle" action="simple" style="image" value="--case (control.vc_parent as vspx_tree_node).tn_open when 0 then 'plus.gif' else 'minus.gif' end" />
<b><v:label name="label1" value="--(control.vc_parent as vspx_tree_node).tn_value" /></b>
<v:node />
</div>
</v:node-template>
<v:leaf-template name="leaf_tmpl">
<div STYLE="margin-left:1em;">
<v:label name="label2" value="--(control.vc_parent as vspx_tree_node).tn_value" />
</div>
</v:leaf-template>
</v:tree>
</div>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_4/tree.vspx">VX-S-4</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_url">
<refmeta>
<refentrytitle>url</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>url</refname>
<refpurpose>Generic scriptable hypertext link.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_url">
<funcprototype id="vc_proto_url">
<funcdef>
<<function>url</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>column</parameter> (optional) </attribute>
<attribute>
<parameter>null-value</parameter> (optional) </attribute>
<attribute>
<parameter>value</parameter> (optional) </attribute>
<attribute>
<parameter>element-value</parameter> (optional) </attribute>
<attribute>
<parameter>element-place</parameter> (optional) </attribute>
<attribute>
<parameter>element-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-params</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-path</parameter> (optional) </attribute>
<attribute>
<parameter>element-update-params</parameter> (optional) </attribute>
<attribute>
<parameter>fmt-function</parameter> (optional) </attribute>
<attribute>
<parameter>cvt-function</parameter> (optional) </attribute>
<attribute>
<parameter>format</parameter> (optional) </attribute>
<attribute>
<parameter>url</parameter> (required) </attribute>
<attribute>
<parameter>active</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_url">
<title>Description</title>
<para>Dynamic data bindable hypertext link.</para>
</refsect1>
<refsect1 id="vc_attrs_url">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>column = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of the column bound.
If nothing else is specified, the column meta data from the containing update form sets the field's attributes.
</para>
</formalpara>
<formalpara>
<title>null-value</title>
<para>This value will be shown if value of the column is NULL, also
value of the control will be set to null if this value is passed upon POST request.
</para>
</formalpara>
<formalpara>
<title>value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Data bindable value of control, represents value of HTML control to be drawn.
The calculated value of this attribute is stored in the control in ufl_value field.
</para>
</formalpara>
<formalpara>
<title>element-value = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>An XML entity that contains a value to be displayed by an HTML control.
The calculated value is stored in ufl_element_value field of the control.
This value is used only if ufl_value is null (e.g. if the 'value' attribute is not set at all), and the method vc_get_value_from_element() will be used to calculate ufl_value based on ufl_element_value, ufl_element_path and ufl_element_place.
</para>
</formalpara>
<formalpara>
<title>element-place = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>The place of actual data inside an XML element. The calculated value of this attribute is stored in ufl_element_place field of the control. This is to process XMLSchema-compatible data without writing extra code for handling NULL values. The XML element can contain the value to be bound in either attribute or in an inner text node. XMLSchema treats missing attributes as NULL values. missing text node as an empty string value and if 'xsi:nil' attribute is 'true' then inner text value is NULL no matter if there are any text nodes. These self-evident rules are convenient for XQuery data retrieval but not for data update: an result of some XQuery expression can point to data but not to a place where data should occur in the future.
The use of 'element-place' allows to eliminate the problem. Attributes 'element-value', 'element-path' and 'element-update-path' may locate an element that is always present whereas 'element-place' describes where the desired datum will occur in the element.
The value of this attribute should be a string of syntax '@attributename' or 'text()'. If this is '@attributename' then the effective bound value is a value of the specified attribute or NULL if the specified attribute is missing. On update, either the attribute is created/edited in order to set non-NULL value or the attribute is deleted in order to set NULL.
If text() is specified then both text value of the element and the value of its 'xsi:nil' are properly handled on both data bind and update.</para>
</formalpara>
<formalpara>
<title>element-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the path inside the entity that comes from 'element-value' attribute. The default path is 'self::node()'. This path is used to point precisely to an subentity that should actually be used for data binding. The calculated value of this attribute should be a string in XQuery syntax, and it is saved in ufl_element_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-path' attribute is missing. The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_params member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-path = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Like the value of 'element-path', this is the path inside the entity that comes from 'element-value' attribute. The difference is that 'element-path' is used inside 'vc_get_value_from_element() during data-bind to set ufl_value based on ufl_element_value whereas 'element-update-path' is used during data update inside 'vc_put_value_to_element() in order to save data inside the document that is referenced by ufl_element_value. The default path for update is equal to the path for data bind, i.e. it is the value of the calculated 'element-path' attribute or 'self::node()'. The calculated value of 'element-update-path' should be a string in XQuery syntax, and it is saved in ufl_element_update_path member of the control.</para>
</formalpara>
<formalpara>
<title>element-update-params = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is the vector of parameter values of the path specified by 'element-update-path' attribute. The default is NULL indicating no parameters. The attribute is calculated but not used if 'element-update-path' attribute is missing (e.g. you should not try to specify 'element-path' without 'element-update-path' and both 'element-params' and 'element-update-params' in hope that values from 'element-update-params' will be passed to 'element-path' on update). The calculated value of this attribute should be either NULL or a vector of even length whose items are parameter names and parameter values; refer to the description of xquery_eval() function for more details. The value of the attribute is saved in ufl_element_update_params member of the control.</para>
</formalpara>
<formalpara>
<title>fmt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert the value that is bound to the control into a string to use during the rendering. The value of this attribute should be a name of function that takes a single argument of the type that matches the type of ufl_value and returns a string. If this is used then the value of 'cvt-function' should probably be a name of function that converts the string back to the desired data type.
If a control supports 'format' attribute then the format is applied to the result of 'fmt-function', so the value returned by fmt-function may be e.g. an integer to be formatted by '%d' format.
The calculated value of this attribute is stored in ufl_fmt_fn field of the control.</para>
</formalpara>
<formalpara>
<title>cvt-function = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>This is to convert a user input of type varchar into a value that should be stored in ufl_value (and e.g. placed into some database column by an update).
The calculated value of this attribute is stored in ufl_cvt_fn field of the control.
For more details, see the description of 'fmt_function' attribute above.</para>
</formalpara>
<formalpara>
<title>format</title>
<para>A sprintf format string for printing the value</para>
</formalpara>
<formalpara>
<title>url = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to be printed in place of href attribute.</para>
</formalpara>
<formalpara>
<title>active = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>A data bound value to enable or disable the url. The default is '1' meaning 'enable'.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_url">
<title>Declaration of type vspx_url</title>
<para>
</para>
<screen>
create type vspx_url under vspx_field
as
(
vu_format varchar default '%s',
vu_url varchar default '',
vu_l_pars varchar default '',
vu_is_local int default 0
)
temporary self as ref
overriding method vc_render () returns any,
constructor method vspx_url (name varchar, parent vspx_control)
</screen>
</refsect1>
<refsect1 id="vc_ex_url">
<title>Examples</title>
<example id="vc_ex_url__0">
<title>
Simple dynamic link
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: url__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This draws an anchor in browser screen.
</para>
<screen>
<v:page name="url__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head><title>VSPX samples | v:url</title></head>
<body>
<v:url name="url0" value="--'index'" url="--'index.vspx'" format="A link to page with name %s and extension VSPX" />
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_validator">
<refmeta>
<refentrytitle>validator</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>validator</refname>
<refpurpose>A validator that is applied to user input.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_validator">
<funcprototype id="vc_proto_validator">
<funcdef>
<<function>validator</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>test</parameter> (required) </attribute>
<attribute>
<parameter>min</parameter> (optional) </attribute>
<attribute>
<parameter>max</parameter> (optional) </attribute>
<attribute>
<parameter>regexp</parameter> (optional) </attribute>
<attribute>
<parameter>expression</parameter> (optional) </attribute>
<attribute>
<parameter>empty-allowed</parameter> (optional) </attribute>
<attribute>
<parameter>message</parameter> (optional) </attribute>
<attribute>
<parameter>runat</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_validator">
<title>Description</title>
<para>
The validator objects are invoked when the element's control gets posted. the validator elements only make sense inside field or form types of controls. the validators are invoked in the order given, and the first one to fail stops the invocation chain, so that no later ones are attempted.
furthermore the vc_is_valid member of the containing page class instance will be reset to false (0) to stop further processing. see also error-summary element and error-glyph attribute of field element.
</para>
</refsect1>
<refsect1 id="vc_attrs_validator">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>test</title>
<para>The type of test to be performed, can be 'length', 'value', 'regexp' or 'sql'.
</para>
</formalpara>
<formalpara>
<title>min</title>
<para>A lower limit in value and length tests
</para>
</formalpara>
<formalpara>
<title>max</title>
<para>The upper limit for value and length tests
</para>
</formalpara>
<formalpara>
<title>regexp</title>
<para>The REGEXP pattern to match field value
</para>
</formalpara>
<formalpara>
<title>expression</title>
<para>A SQL expression for validation
</para>
</formalpara>
<formalpara>
<title>empty-allowed</title>
<para>If specified as true (1) this will allow submitting an empty field
</para>
</formalpara>
<formalpara>
<title>message</title>
<para>The error message to be associated to parent control when the test represented by this validator fails.
</para>
</formalpara>
<formalpara>
<title>runat</title>
<para>Where to perform validation, at server side after posting, or at browser side when entering the values. Note that client side validators can be assigned only to input controls, hence client side form validators for inter-field integrity testing are not allowed.</para>
<para>Client side validators will generate client side JavaScript.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_validator">
<title>Declaration of type vspx_validator</title>
<para>
</para>
<screen>
</screen>
</refsect1>
<refsect1 id="vc_ex_validator">
<title>Examples</title>
<example id="vc_ex_validator__0">
<title>
Validation of text area input
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: validator__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The form contains a v:textarea control with v:validator assigned. When the OK button is pressed,
data are posted back to the same URI so the page is instantiated again.
If validator found a violation, the message is shown right after the text input.
(The error reporting may be changed by using v:error-summary VSPX control and
by adding 'error-glyph' attribute to the v:textarea.)
</para>
<screen>
<v:page name="validator__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:validator</title>
</head>
<body>
<v:form name="form1" type="simple" action="" method="POST">
<v:textarea name="ta1" default="enter your text here" value="--coalesce ({?'ta1'}, control.ufl_value)">
<v:validator test="length" min="0" max="50" message="The input length should not exceed 50 chars."/>
</v:textarea>
<v:button name="submit1" action="simple" value="OK"/>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
<tip>
<title>See Also: Reference Material in the Tutorial:</title>
<para>
<ulink url="/tutorial/web/vx_s_2/date.vspx">VX-S-2</ulink>
</para>
</tip>
</refentry>
<refentry id="vc_variable">
<refmeta>
<refentrytitle>variable</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>variable</refname>
<refpurpose>Page variable - a user defined member of page class.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_variable">
<funcprototype id="vc_proto_variable">
<funcdef>
<<function>variable</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>type</parameter> (required) </attribute>
<attribute>
<parameter>default</parameter> (optional) </attribute>
<attribute>
<parameter>persist</parameter> (optional) </attribute>
<attribute>
<parameter>param-name</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_variable">
<title>Description</title>
<para>
This element declares a data member for the page subclass corresponding to the containing page.
The value of this data member can be preserved between consecutive postbacks.
The attribute "persist" determine how to save the variable's value: to session table for inter-page usage, keep in page state only or do not keep it at all.
Note that inter-page variable storage is available only when a vspx:login control is included on the page and authentication is performed; also the name of page variables in corresponding pages needs to be same.
There is no special class for this control because only a data member will be added.
Also the page defines two special variables 'sid' and 'realm' for login control.
So when an existing login control is is in authenticated state, these will contain values for session id and application realm.
Also every non-repeating control of the page will be represented as a page variable and thus be acessible as 'self.<name_of_control>' anywhere in the VSPX page after page initialization.
</para>
</refsect1>
<refsect1 id="vc_attrs_variable">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The name of page class member.</para>
</formalpara>
<formalpara>
<title>type = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>The SQL data type of the variable.</para>
</formalpara>
<formalpara>
<title>default = <link linkend="vc_type_SqlCode">SqlCode</link>
</title>
<para>The default value. Must be a literal scalar value suitable for the default clause of a user defined type member.</para>
</formalpara>
<formalpara>
<title>persist</title>
<table>
<title>Allowed values of the 'persist' attribute</title>
<tgroup cols="2">
<tbody>
<row>
<entry>session</entry>
<entry>
<para>keep the variable in the session; needs a login control to be present</para>
</entry>
</row>
<row>
<entry>pagestate</entry>
<entry>
<para>keep the variable in page view state</para>
</entry>
</row>
<row>
<entry>temp</entry>
<entry>
<para>do not keep variable</para>
</entry>
</row>
<row>
<entry>0</entry>
<entry>
<para>same as 'pagestate'</para>
</entry>
</row>
<row>
<entry>1</entry>
<entry>
<para>same as 'session'</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</formalpara>
<formalpara>
<title>param-name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>This specifies an optional name of a URL parameter for setting the page variable value.
When this is specified and there is a parameter matching the name, the variable is set after it. This is a shorthand for an explicit call of keyword_get.
</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_ex_variable">
<title>Examples</title>
<example id="vc_ex_variable__0">
<title>
Declaration of page variable
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: variable__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
The v:variable element defines a new member of page class and hance we can access it with self.mask in rest of VSPX code.
</para>
<screen>
<v:page name="variable__0" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<head>
<title>VSPX samples | v:variable</title>
</head>
<body>
<v:variable name="mask" type="varchar" default="null"/>
<?vsp self.mask := 'first value'; ?>
<p>The variable value is set to '<?V self.mask ?>'</p>
<?vsp self.mask := 'second value'; ?>
<p>The variable value is set to '<?V self.mask ?>'</p>
</body>
</html>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_vscx">
<refmeta>
<refentrytitle>vscx</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>vscx</refname>
<refpurpose />
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_vscx">
<funcprototype id="vc_proto_vscx">
<funcdef>
<<function>vscx</function> <attribute>
<parameter>name</parameter> (required) </attribute>
<attribute>
<parameter>annotation</parameter> (optional) </attribute>
<attribute>
<parameter>initial-enable</parameter> (optional) </attribute>
<attribute>
<parameter>enabled</parameter> (optional) </attribute>
<attribute>
<parameter>instantiate</parameter> (optional) </attribute>
<attribute>
<parameter>control-udt</parameter> (optional) </attribute>
<attribute>
<parameter>xsd-stub-xhtml</parameter> (optional) </attribute>
<attribute>
<parameter>width</parameter> (optional) </attribute>
<attribute>
<parameter>height</parameter> (optional) </attribute>
<attribute>
<parameter>url</parameter> (required) </attribute>
<attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_vscx">
<title>Description</title>
<para>Custom control encapsulated in a separate VSPX page. This is a
wrapper for custom control instantiation. The target URL MUST contain
a valid VSPX page reference. In this way repeatable pieces of code can be reused in
form of instantiation of their page class, this is different from inclusion.
The target page variables can be initialized as attributes in this control, where
name of attribute is a name of variable of target page and value is
an expression to be assigned.
</para>
</refsect1>
<refsect1 id="vc_attrs_vscx">
<title>Attributes</title>
<formalpara>
<title>name = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>A page level unique name identifying a control.</para>
</formalpara>
<formalpara>
<title>annotation</title>
<para>A human readable comment.</para>
</formalpara>
<formalpara>
<title>initial-enable = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is initially visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>enabled = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control is visible. True by default. Could be data-bound to an SQL expression.</para>
</formalpara>
<formalpara>
<title>instantiate = <link linkend="vc_type_CalculateableValue">CalculateableValue</link>
</title>
<para>Determines whether a control instantiate its children. It is true by default. It could be data-bound to an SQL expression. Unlike most of calcucateable attributes, the value of this attribute for a control is calcluated before calling 'on-init' event handler of the control; other values are calculated before calling 'before-data-bind' event handler.</para>
</formalpara>
<formalpara>
<title>control-udt = <link linkend="vc_type_SqlName">SqlName</link>
</title>
<para>At run time every control is represented as an instance of some user-defined type (UDT). VSPX compiles selects the UDT to use depending on name of the XML element that represents the control and maybe some of its attributes. In some specific cases the application developer may instruct VSPX compiler to use some other UDT, e.g. an application-specific UDT that is derived from the preset one. If specified, the value of 'control-udt' attribute should be equal to the name of the desired target UDT.</para>
</formalpara>
<formalpara>
<title>xsd-stub-xhtml</title>
<para>This attribute is for internal use only. It has no effect if added to the source VSPX file.</para>
</formalpara>
<formalpara>
<title>width</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>height</title>
<para>Visible width of the control when it is displayed in WYSIWYG tools when the source VSPX text is edited.
The value of this attribute will not be used when the resulting HTML is rendered.</para>
</formalpara>
<formalpara>
<title>url</title>
<para>Reference to a VSPX page to be instantiated as a control.</para>
</formalpara>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_vscx">
<title>Declaration of type vspx_vscx</title>
<para>
</para>
<screen>
create type vspx_vscx under vspx_form
self as ref temporary
constructor method vspx_vscx (name varchar, parent vspx_control, uri varchar),
overriding method vc_pre_render (stream any, n int) returns any
</screen>
</refsect1>
<refsect1 id="vc_ex_vscx">
<title>Examples</title>
<example id="vc_ex_vscx__0">
<title>
Outer page, including a navigation bar via vscx__1.vspx
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: vscx__0.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This page will embed another page twice, but not as simple inclusion. The
second page is treated as a control and it's page class will be instantiated twice as
as a child of outer page.
</para>
<screen>
<v:page name="outer_page" xmlns:v="http://www.openlinksw.com/vspx/">
<html>
<body>
<v:variable name="var1" type="int" default="0" />
<h3>Embeeding a page as a custom control</h3>
<v:form type="simple" name="f1">
<div>
<div>control1</div>
<v:vscx name="bar1" url="vscx__1.vspx"/>
</div>
<div>
<div>control2</div>
<v:vscx name="bar2" url="vscx__1.vspx"/>
</div>
<div>
<v:text name="txt2" />
<v:button action="simple" value="Outer" name="b2" />
</div>
</v:form>
</body>
</html>
</v:page>
</screen>
</example>
<example id="vc_ex_vscx__1">
<title>
Simple navigation bar used as custom control
</title>
<para>
<?xml version="1.0"?>
<!--
-
- $Id: vscx__1.vspx,v 1.2 2006/08/16 00:04:15 source Exp $
-
- This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
- project.
-
- Copyright (C) 1998-2006 OpenLink Software
-
- This project is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation; only version 2 of the License, dated June 1991.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
This page is used inside vscx__0.vspx one as a custom control.
</para>
<screen>
<v:page name="custom_bar" xmlns:v="http://www.openlinksw.com/vspx/">
<v:variable name="test" type="int" default="12" />
<table border="1" cellspacing="1" cellpadding="0">
<tr>
<td>
<v:url name="u1" value="Home" url="--http_path ()" /> |
</td>
<td>
<v:url name="u2" value="Settings" url="--http_path ()||'?settings'" /> |
</td>
<td>
<v:url name="u3" value="Posts" url="--http_path ()||'?posts'" /> |
</td>
<td>
<v:url name="u4" value="Maintenance" url="--http_path ()||'?maint'" />
</td>
</tr>
</table>
<div>
<v:form type="simple" name="f1">
<v:text name="txt1" />
<v:button name="b1" action="simple" value="Inner"/>
</v:form>
</div>
</v:page>
</screen>
</example>
</refsect1>
</refentry>
<refentry id="vc_xsd_stub">
<refmeta>
<refentrytitle>xsd-stub</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>xsd-stub</refname>
<refpurpose>This is for internal use only.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_xsd_stub">
<funcprototype id="vc_proto_xsd_stub">
<funcdef>
<<function>xsd-stub</function> <attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_xsd_stub">
<title>Description</title>
<para>
This control should never appear in the VSPX source.
It is for internal use only.
Before applying XML schema validation to the page,
Virtuoso replaces non-VSPX tags with this one when they reside inside v:page.
</para>
</refsect1>
<refsect1 id="vc_attrs_xsd_stub">
<title>Attributes</title>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_xsd_stub">
<title>Declaration of type vspx_xsd_stub</title>
<para>
</para>
<screen>
create type vspx_xsd_stub under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
<refentry id="vc_xsd_stub_script">
<refmeta>
<refentrytitle>xsd-stub-script</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>xsd-stub-script</refname>
<refpurpose>This is for internal use only.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_xsd_stub_script">
<funcprototype id="vc_proto_xsd_stub_script">
<funcdef>
<<function>xsd-stub-script</function> <attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_xsd_stub_script">
<title>Description</title>
<para>
This control should never appear in the VSPX source.
It is for internal use only.
Before applying XML schema validation to the page,
Virtuoso replaces non-VSPX tags with this one when they reside inside event script tag such as v:on-init.
</para>
</refsect1>
<refsect1 id="vc_attrs_xsd_stub_script">
<title>Attributes</title>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_xsd_stub_script">
<title>Declaration of type vspx_xsd_stub_script</title>
<para>
</para>
<screen>
create type vspx_xsd_stub_script under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
<refentry id="vc_xsd_stub_top">
<refmeta>
<refentrytitle>xsd-stub-top</refentrytitle>
<refmiscinfo>vspx_control</refmiscinfo>
</refmeta>
<refnamediv>
<refname>xsd-stub-top</refname>
<refpurpose>This is for internal use only.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="vc_syn_xsd_stub_top">
<funcprototype id="vc_proto_xsd_stub_top">
<funcdef>
<<function>xsd-stub-top</function> <attribute>
<parameter>debug-srcfile</parameter> (optional) </attribute>
<attribute>
<parameter>debug-srcline</parameter> (optional) </attribute>
<attribute>
<parameter>debug-log</parameter> (optional) </attribute>
/></funcdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="vc_desc_xsd_stub_top">
<title>Description</title>
<para>
This control should never appear in the VSPX source.
It is for internal use only.
Before applying XML schema validation to the page,
Virtuoso replaces non-VSPX tags with this one when they reside outside v:page.
</para>
</refsect1>
<refsect1 id="vc_attrs_xsd_stub_top">
<title>Attributes</title>
<formalpara>
<title>debug-srcfile</title>
<para>URI of the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-srcline</title>
<para>Line number in the source document where the tag comes from.</para>
</formalpara>
<formalpara>
<title>debug-log</title>
<para>This defines what sort of data are saved to the debugging log.
</para>
</formalpara>
</refsect1>
<refsect1 id="vc_udt_xsd_stub_top">
<title>Declaration of type vspx_xsd_stub_top</title>
<para>
</para>
<screen>
create type vspx_xsd_stub_top under vspx_control
as ( vc_stub any ) temporary self as ref
</screen>
</refsect1>
</refentry>
</sect2>
|