File: inifile.vspx

package info (click to toggle)
virtuoso-opensource 6.1.6%2Bdfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (286 lines) | stat: -rw-r--r-- 13,181 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0"?>
<!--
 -
 -  $Id$
 -
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -
 -  Copyright (C) 1998-2012 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
 -
 -
-->
<v:page name="inifile_editor_page" decor="yacutia_decor.vspx" style="yacutia_style.xsl"
  doctype="-//W3C//DTD XHTML 1.0 Transitional//EN" fast-render="1" xmlns:v="http://www.openlinksw.com/vspx/" xmlns:vm="http://www.openlinksw.com/vspx/macro">
  <vm:pagetitle>Virtuoso System Parameters</vm:pagetitle>
  <vm:pagewrapper>
    <vm:variables>
      <v:variable persist="1" name="pos" type="integer" default="0" />
      <v:variable persist="1" name="sect" type="varchar" default="null" />
      <v:variable persist="1" name="sections" type="integer" default="0" />
      <v:variable persist="1" name="items" type="integer" default="0" />
      <v:variable persist="1" name="to_del" type="integer" default="0" />
      <v:variable persist="1" name="to_rem" type="varchar" default="null" />
    </vm:variables>
    <vm:menu>
      <vm:menuitem value="Initial parameters" />
    </vm:menu>
    <vm:header caption="Virtuoso server startup parameters">
      <vm:help id="inifile" sect=""/>
    </vm:header>
    <vm:pagebody>
      <script type="text/javascript">
	function postSect (f, i)
	{
	  f.dd_sect.value = i;
	  f.submit ();
	}
      </script>
      <v:method name="astyle" arglist="in cmp varchar, in cmp1 varchar">
	if (cmp = cmp1 or (cmp1 is null and cmp = 1))
	  return 'page_tab_selected';
	return 'page_tab';
      </v:method>
      <v:form name="virtini" 
              action="inifile.vspx"  
              method="POST" 
              type="simple" 
              xmlns:xhtml="http://www.w3.org/1999/xhtml"  
              fast-render="1" xmlns:v="http://www.openlinksw.com/vspx/">
        <v:before-data-bind>
          <v:script>
            <![CDATA[
              declare _pos integer;
              _pos := atoi(get_keyword('dd_sect', control.vc_page.vc_event.ve_params, '0'));
              self.pos := _pos;
              self.sect := cfg_section_name(virtuoso_ini_path(), _pos);
              self.sections := cfg_section_count(virtuoso_ini_path());
              self.items := cfg_item_count(virtuoso_ini_path(), self.sect);
              self.to_del := atoi(get_keyword('delete', control.vc_page.vc_event.ve_params, '0'));
            ]]>
          </v:script>
        </v:before-data-bind>
	<v:template name="editor_template" type="simple" enabled="-- neq(self.to_del, 1)">
	<input type="hidden" name="dd_sect" value="<?V self.pos ?>" />
	<h3 class="clear">Virtuoso configuration file "<?V adm_get_init_name() ?>"</h3>
      <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
        <tr valign='top'>
          <td>
            <table cellpadding='10' cellspacing='0' border='0' width='100%'>
              <tr>
                <td>
                  <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                      <?vsp
                        declare i integer;
                        i := 0;
                        while (i < self.sections)
                        {
			  declare sec_name varchar;
			  sec_name := cfg_section_name(virtuoso_ini_path(), i);

			  ?>
			  <td class="<?V self.astyle (sec_name, self.sect) ?>" align="center">
			    <a style="page_tab" href="#" onclick="javascript:postSect (document.virtini, '<?V i ?>')"><?vsp
			     http(sec_name);
			  ?></a>
			   </td>
			  <?vsp
                          i := i + 1;
                        }
                      ?>
                        <td class="page_tab_empty" align="center" width="100%">
                          <table cellpadding="0" cellspacing="0">
                            <tr>
			      <td width="100%">
                              </td>
                            </tr>
                          </table>
                        </td>
                    </tr>
                  </table>
                  <table class="tab_page">
                    <tr>
		      <td valign="top">
			<!-- MAIN -->
          <table cellpadding="3" cellspacing="0" border="0">
            <tr>
              <!--td align="right" valign="top">
                <table cellpadding="3" cellspacing="0" border="0">
                  <tr>
                    <td>Section</td>
                  </tr>
                  <tr>
                    <td>
                      <?vsp
                        declare i integer;
                        i := 0;
                        http('<select size="10" name="dd_sect" onchange="javascript:document.virtini.submit();">');
                        while (i < self.sections)
                        {
                          http('<option ');
                          http(select_if(cfg_section_name(virtuoso_ini_path(), i), self.sect));
                          http(' value="');
                          http(cast(i as varchar));
                          http('">');
                          http(cfg_section_name(virtuoso_ini_path(), i)); http('</option>');
                          i := i + 1;
                        }
                        http('</select>');
                      ?>
                    </td>
                  </tr>
                </table>
              </td-->
              <td valign="top">
                <table cellpadding="3" cellspacing="0" border="0">
                  <!--tr>
                    <td colspan="3">
                      <?V self.sect ?>
                    </td>
                  </tr-->
                  <tr class="listing_header_row">
                    <th>Name</th>
                    <th>Value</th>
                    <th>Action</th>
                  </tr>
                  <?vsp
                    declare j integer;
                    declare item, item_value varchar;
                    j := 0;
                    while (j < self.items)
                    {
                      item := cfg_item_name(virtuoso_ini_path(), self.sect, j);
                      item_value := cfg_item_value(virtuoso_ini_path(), self.sect, item);
                      if (item <> 'SafeExecutables' and item <> 'DbaExecutables' and item <> 'DirsAllowed' and item <> 'DirsDenied')
                      {
                        http(sprintf('<tr><td><input type="hidden" name="n_%V" value="%V">%V</td>', item, item, item));
                        http(sprintf('<td><input type="text" size="40" name="_ini_%V" value="%V" /></td>', item, item_value));
			http(sprintf('<td  class="listing_col_action"><a href="inifile.vspx?to_go=%s&delete=1&dd_sect=%i&update_ini=1&sid=%s&realm=%s"><img src="images/icons/del_16.png" border="0" alt="Remove" title="Remove"/>&#160;Remove</a></td></tr>', item, self.pos, self.sid , self.realm));
                      }
                      else
                      {
                        http(sprintf('<tr><td>%V</td>', item));
                        http(sprintf('<td>%V</td>', item_value));
                        http(sprintf('<td>&nbsp;</td></tr>', item));
                      }
                      j := j + 1;
                    }
                    if ('' <> get_keyword('add', control.vc_page.vc_event.ve_params, ''))
                    {
                      http('<tr><td colspan="3" class="genlistheadt">New:</td></tr>');
                      http('<tr><td><input type="text" name="_new_item" value="" /></td>');
                      http('<td><input type="text" size="40" name="_new_value" value="" /></td></tr>');
                    }
                  ?>
                  <tr>
                    <td colspan="2" align="left">
		      <v:button name="update_ini" action="simple" value="Save changes"
			enabled="--case when self.items or get_keyword('add', self.vc_event.ve_params) is not null then 1 else 0 end">
                        <v:on-post>
                          <![CDATA[
                            declare idx integer;
                            declare item, item_value, new_item varchar;
                            idx := 0;
                            while (idx < length(control.vc_page.vc_event.ve_params))
                            {
                              item := aref(control.vc_page.vc_event.ve_params, idx);
                              if ('_ini_' = left(item, 5))
                              {
                                item := ltrim(item, '_ini_');
                                new_item := get_keyword(concat('n_', item), control.vc_page.vc_event.ve_params, item);
                                item_value := aref(control.vc_page.vc_event.ve_params, idx + 1);
                                if (new_item <> item)
                                  cfg_write(virtuoso_ini_path(), self.sect, item, '');
                                cfg_write(virtuoso_ini_path(), self.sect, new_item, item_value);
                              }
                              idx := idx + 2;
                            }
                            if ('' <> get_keyword('_new_item', control.vc_page.vc_event.ve_params, ''))
                            {
                              item := get_keyword('_new_item', control.vc_page.vc_event.ve_params, null);
                              item_value := get_keyword('_new_value', control.vc_page.vc_event.ve_params, '');
                              cfg_write(virtuoso_ini_path(), self.sect, item, item_value);
                            }
                            http_request_status('HTTP/1.1 302 Found');
                            http_header(sprintf('Location: inifile.vspx?sid=%s&realm=%s&dd_sect=%i\r\n', self.sid , self.realm, self.pos));
                          ]]>
                        </v:on-post>
                      </v:button>
                      <?vsp
                        if ('' = get_keyword('add', control.vc_page.vc_event.ve_params, ''))
                          http('<input type="submit" name="add" value="Add" />');
                      ?>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
	  <!-- END -->
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
        </v:template>
        <v:template name="editor_template2" type="simple" enabled="-- equ(self.to_del, 1)">
               <input type="hidden" name="dd_sect" value="<?V get_keyword('dd_sect', control.vc_page.vc_event.ve_params, '') ?>"/>
                <?vsp
                  declare _pos integer;
                  _pos := atoi(get_keyword('dd_sect', control.vc_page.vc_event.ve_params, '0'));
                  self.pos := _pos;
                  self.sect := cfg_section_name(virtuoso_ini_path(), _pos);
                  self.to_rem := get_keyword('to_go', control.vc_page.vc_event.ve_params, '');
                ?>
	       <div class="confirm_dialog">
		 <img class="dialog_icon" src="images/icons/stop_32.png" alt="Stop" title="Stop"/>
		 <div class="confirm_text">
		   You are about to remove the parameter "<?V self.to_rem ?>", are you sure? <br />
                   This removal cannot be undone. Do you wish to continue?
		 </div>

                <v:button name="but_yes" action="simple" value="Yes">
                  <v:on-post>
                    <![CDATA[
                      if (self.to_rem is not null and self.to_rem <> '')
                        cfg_write(virtuoso_ini_path(), self.sect, self.to_rem, '');
                      self.to_rem := '';
                      self.to_del := 0;
                      http_request_status('HTTP/1.1 302 Found');
                      http_header(sprintf('Location: inifile.vspx?sid=%s&realm=%s&dd_sect=%i\r\n', self.sid , self.realm, self.pos));
                    ]]>
                  </v:on-post>
                </v:button>
                <v:button name="but_no" action="simple" value="No">
                  <v:on-post>
                    <![CDATA[
                      self.to_del := 0;
                      http_request_status('HTTP/1.1 302 Found');
                      http_header(sprintf('Location: inifile.vspx?sid=%s&realm=%s&dd_sect=%i\r\n', self.sid , self.realm, self.pos));
                    ]]>
                  </v:on-post>
                </v:button>
	       </div>
        </v:template>
      </v:form>
    </vm:pagebody>
  </vm:pagewrapper>
</v:page>