[% BLOCK logme_block; "\n\t\n"; END; MACRO logme(a) PROCESS logme_block x = a.list.join(', '); %] [% USE DBI; USE WebSession; USE utils = WebUtils; USE config = XML.LibXML(config_xml); userid = 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); %]
[% PROCESS PRINT_STAGE1 %] [% BLOCK PRINT_STAGE1 %]Name: | [%doc.findvalue('/reporter/report/@name')%] |
Description: | [%doc.findvalue('/reporter/report/description')%] |
Visible Stage2 reports: | [% q = 'select count(*) as x from reporter.stage2 ' _ 'where pub is true or owner = ' _ userid; FOR r IN DBI.query(q); r.x; END %] |
Report Attributes (dimensions): |
[%
incs = doc.findnodes('//report/dims/dim/@include');
FOR dim IN incs;
' |