Log updates
[beagleboard.org.git] / code / .docs / prototype_Global / function_helma.sqlshell.getDatasources.html
blobb0c234278dda4a231619ba5cc7a701d4f397536e
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2 <html>
4 <head>
5 <title></title>
6 <style type="text/css">
8 body, p, td, th, li {
9 font-family: verdana, sans-serif;
10 font-size: 10pt;
13 big.top {
14 font-size: 18pt;
15 font-weight: bold;
18 big {
19 font-size: 13pt;
20 font-weight: bold;
23 a {
24 font-weight:bold;
25 color: #cc3333;
26 text-decoration:none;
28 a:hover {
29 text-decoration:underline;
32 .navig {
33 font-size: 9px;
34 text-decoration: none;
35 font-weight:normal;
38 li {
39 padding-bottom: 5px;
43 .mainbox {
44 border-color:#999999;
45 padding-top:5px;
46 padding-bottom:5px;
47 border-bottom-width:1px;
48 border-bottom-style:dotted;
51 .headline {
52 font-weight:bold;
53 background:#dfdfdf;
54 border-color:#999999;
55 padding-top:5px;
56 padding-bottom:5px;
59 </style>
60 </head>
62 <body>
64 <table width="90%" border="0" cellspacing="1" cellpadding="5">
65 <tr>
66 <td class="headline">
67 <big><tt>Global.helma.sqlshell.getDatasources&nbsp;()</tt></big><br>
68 </td>
69 </tr>
71 <tr>
72 <td class="mainbox">
73 Get an array of names of all defined data sources suitable for use
74 in html.select macro.<br><br>
76 <ul>
83 </ul>
84 </td>
85 </tr>
86 </table>
88 <table width="90%" border="0" cellspacing="1" cellpadding="5">
89 <tr>
90 <td>Sourcecode in helmaTools.zip/Global/helma.sqlshell.js:
91 <pre><font color="#aaaaaa">18:</font> helma.sqlshell.getDatasources = function() {
92 <font color="#aaaaaa">19:</font> var dbmap = app.getDbProperties();
93 <font color="#aaaaaa">20:</font> var sources = [];
94 <font color="#aaaaaa">21:</font> for (var i in dbmap) {
95 <font color="#aaaaaa">22:</font> var dot = i.indexOf(<font color="#9999aa">&quot;.&quot;</font>);
96 <font color="#aaaaaa">23:</font> if (dot &gt; -1 &amp;&amp; i.lastIndexOf(<font color="#9999aa">&quot;.url&quot;</font>) == i.length-4) {
97 <font color="#aaaaaa">24:</font> var source = i.substring(0, dot);
98 <font color="#aaaaaa">25:</font> sources.push([source, source]);
99 <font color="#aaaaaa">26:</font> }
100 <font color="#aaaaaa">27:</font> }
101 <font color="#aaaaaa">28:</font> return sources;
102 <font color="#aaaaaa">29:</font> }
103 </pre>
104 </td>
105 </tr>
107 </table>
113 </body>
114 </html>