shared initialization code
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 28 Sep 2005 19:30:50 +0000 (19:30 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 28 Sep 2005 19:30:50 +0000 (19:30 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1880 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/reporter/templates/logic_header.ttk [new file with mode: 0644]

diff --git a/Open-ILS/src/reporter/templates/logic_header.ttk b/Open-ILS/src/reporter/templates/logic_header.ttk
new file mode 100644 (file)
index 0000000..2fc450d
--- /dev/null
@@ -0,0 +1,31 @@
+[%
+
+BLOCK logme_block;
+       "\n\t<!-- " _ x _ " -->\n";
+END;
+
+MACRO logme(a) PROCESS logme_block x = a.list.join(', ');
+
+USE CGI;
+USE DBI;
+USE WebSession;
+USE utils = WebUtils;
+USE config = XML.LibXML(config_xml, expand_xinclude => 1);
+
+dir = '/reporter/setup/files/' _ stage_dir;
+dir = config.findvalue(dir);
+
+dbname = config.findvalue('/reporter/setup/database/name');
+dbhost = config.findvalue('/reporter/setup/database/host');
+d_u = config.findvalue('/reporter/setup/database/user');
+d_p = config.findvalue('/reporter/setup/database/password');
+
+dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost;
+
+logme([dsn,d_u,d_p]);
+
+DBI.connect(dsn,d_u,d_p);
+
+stage2_insert = 'INSERT INTO reporter.stage2 (stage1, params, owner, pub)' _
+                                               ' VALUES ( ?,?,?,? )';
+%]