shared initialization code
[Evergreen.git] / Open-ILS / src / reporter / templates / logic_header.ttk
1 [%
2
3 BLOCK logme_block;
4         "\n\t<!-- " _ x _ " -->\n";
5 END;
6
7 MACRO logme(a) PROCESS logme_block x = a.list.join(', ');
8
9 USE CGI;
10 USE DBI;
11 USE WebSession;
12 USE utils = WebUtils;
13 USE config = XML.LibXML(config_xml, expand_xinclude => 1);
14
15 dir = '/reporter/setup/files/' _ stage_dir;
16 dir = config.findvalue(dir);
17
18 dbname = config.findvalue('/reporter/setup/database/name');
19 dbhost = config.findvalue('/reporter/setup/database/host');
20 d_u = config.findvalue('/reporter/setup/database/user');
21 d_p = config.findvalue('/reporter/setup/database/password');
22
23 dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost;
24
25 logme([dsn,d_u,d_p]);
26
27 DBI.connect(dsn,d_u,d_p);
28
29 stage2_insert = 'INSERT INTO reporter.stage2 (stage1, params, owner, pub)' _
30                                                 ' VALUES ( ?,?,?,? )';
31 %]