4 "\n\t<!-- " _ x _ " -->\n";
7 MACRO logme(a) PROCESS logme_block x = a.list.join(', ');
16 USE config = XML.LibXML(config_xml);
20 dir = '/reporter/setup/files/' _ stage_dir;
21 dir = config.findvalue(dir);
23 dbname = config.findvalue('/reporter/setup/database/name');
24 dbhost = config.findvalue('/reporter/setup/database/host');
25 d_u = config.findvalue('/reporter/setup/database/user');
26 d_p = config.findvalue('/reporter/setup/database/password');
28 dsn = "dbi:Pg:dbname=" _ dbname _';host=' _ dbhost;
32 DBI.connect(dsn,d_u,d_p);
37 [% INCLUDE header.ttk title="Basic Report Types" %]
39 [% INCLUDE logout.ttk %]
40 [% PROCESS PRINT_STAGE1 %]
42 [% INCLUDE footer.ttk %]
51 [% BLOCK PRINT_STAGE1 %]
53 [% FOR s1 IN DBI.query("select * from reporter.stage1 where pub is true;");
54 file = dir _ '/' _ s1.filename;
55 USE doc = XML.LibXML(file);
56 fact_table = doc.findvalue('//report/@fact-table');
65 [%doc.findvalue('/reporter/report/@name')%]
73 [%doc.findvalue('/reporter/report/description')%]
77 [% PROCESS stage1_detail IF CGI.param('detail') == 1 %]
83 [% PROCESS stage2_new IF CGI.param('create_stage2') == 1 %]
91 col_xpath = "/reporter/tables/table[@id='" _ fact_table _ "']/fields/field[@core='true']";
94 '<h3><u>Core report limiters</u></h3>';
96 FOR col IN config.findnodes(col_xpath);
97 logme(col.findvalue('@name'));
98 widget = col.findvalue('@widget') or col.findvalue('@datatype');
99 INCLUDE "draw_$widget" column = col;
108 [% BLOCK draw_timestamptz %]
110 <b>[% column.findvalue('label') %]</b><br/><br/>
111 <table border=1 width="100%">
114 <b>[% column.findvalue('description') %]</b>
123 name="[% column.parentNode.parentNode.findvalue('tablename') _ '.' _
124 column.findvalue('@name') _ ':range_size' %]" >
125 <option value="">User Selectable</option>
126 <option value="hour">Hour</option>
127 <option value="day">Day</option>
128 <option value="week">Week</option>
129 <option value="month">Month</option>
130 <option value="year">Year</option>
131 <option value="decade">Decade</option>
140 [% BLOCK dim_description %]
144 <td>[% dim.findvalue('name') %]</td>
146 [% PROCESS table_fields table = dim %]
154 [% BLOCK table_fields %]
155 [% FOR f IN table.findnodes('fields/field') %]
158 <td>[% f.findvalue('@name') %] ([% f.findvalue('@datatype') %])</td>
171 [% BLOCK stage1_detail %]
174 Visible Stage2 reports:
177 [% q = 'select count(*) as x from reporter.stage2 ' _
178 'where pub is true or owner = ' _ userid;
179 FOR r IN DBI.query(q);
185 [% PROCESS table_fields table = config.findnodes("/reporter/tables/table[@id='$fact_table']") %]
188 Report Attributes<br/>(dimensions):
192 incs = doc.findnodes('//report/dims/dim/@include');
195 '<table border=1 width="100%">';
197 link_xpath = '/reporter/tables/table[@id="' _ fact_table _'"]'_
198 '/links/link[@field="' _ dim.value() _ '"]/@table';
201 dim_table = config.findvalue(link_xpath);
203 dim_xpath = '/reporter/tables/table[@id="' _ dim_table _'"]';
206 dim_def = config.findnodes(dim_xpath);
208 PROCESS dim_description dim = dim_def;