[%
BLOCK logme_block;
"\n\t\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);
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);
%]
[% INCLUDE header.ttk title="Basic Report Types" %]
[% INCLUDE logout.ttk %]
[% PROCESS PRINT_STAGE1 %]
[% INCLUDE footer.ttk %]
[% BLOCK PRINT_STAGE1 %]
[% FOR s1 IN DBI.query("select * from reporter.stage1 where pub is true;");
file = dir _ '/' _ s1.filename;
USE doc = XML.LibXML(file);
fact_table = doc.findvalue('//report/@fact-table');
logme(fact_table);
%]
Name:
[%doc.findvalue('/reporter/report/@name')%]
Description:
[%doc.findvalue('/reporter/report/description')%]
[% PROCESS stage1_detail IF CGI.param('detail') == 1 %]
[% END %]
[% END %]
[% PROCESS stage2_new IF CGI.param('create_stage2') == 1 %]
[%
BLOCK stage2_new;
col_xpath = "/reporter/tables/table[@id='" _ fact_table _ "']/fields/field[@core='true']";
logme(col_xpath);
'
Core report limiters
';
FOR col IN config.findnodes(col_xpath);
logme(col.findvalue('@name'));
widget = col.findvalue('@widget') or col.findvalue('@datatype');
INCLUDE "draw_$widget" column = col;
END;
END;
%]
[% BLOCK draw_timestamptz %]
[% column.findvalue('label') %]
[% column.findvalue('description') %]
Report Range Size:
[% END %]
[% BLOCK dim_description %]
Name:
[% dim.findvalue('name') %]
[% PROCESS table_fields table = dim %]
[% END %]
[% BLOCK table_fields %]
[% FOR f IN table.findnodes('fields/field') %]