[%
PROCESS inputs;
BLOCK class_table;
WRAPPER html/table width='100%' style='border-top: 1px solid black';
WRAPPER html/row;
WRAPPER html/cell align="right" width="30%";
%]Name:[%
END;
WRAPPER html/cell;
classname.findvalue('label');
END;
END;
WRAPPER html/row;
WRAPPER html/cell align="right";
%]Description:[%
END;
WRAPPER html/cell;
classname.findvalue('description');
END;
END;
IF classname.findvalue('@fact-table') == 'true' AND CGI.param('create_stage2') != 1;
WRAPPER html/row;
WRAPPER html/cell align="right";
%]Actions:[%
END;
WRAPPER html/cell;
IF CGI.param('detail');
%]No Details[%
ELSE;
%]Details[%
END;
%]|New Report Template[%
END;
END;
WRAPPER html/row;
INCLUDE html/cell align="right" valign='top' content='Report Templates:';
WRAPPER html/cell;
q = 'select * from reporter.stage2 ' _
'where pub is true or owner = ' _ DBI.quote(user.id());
FOR r = DBI.query(q);
INCLUDE anchor
href="stage2?id=" _ r.id
content=utils.JSON2perl(r.params).templatename;
'
';
END;
END;
END;
END;
INCLUDE class_detail IF CGI.param('detail') == 1;
END;
END;
BLOCK class_fields;
FOR f = classname.findnodes('fields/field');
WRAPPER html/row;
WRAPPER html/cell align="right";
f.findvalue('label');
END;
WRAPPER html/cell;
%] ([%
IF f.findvalue('description');
f.findvalue('description');
%] -- [%
END;
f.findvalue('@name')%]::[%f.findvalue('@datatype') %])[%
END;
END;
END;
END;
BLOCK class_detail;
INCLUDE class_fields;
IF classname.findvalue('@fact-table') == 'true' AND nosub != 1;
WRAPPER html/row;
WRAPPER html/cell align="right";
%]Report Dimensions
and Attributes:[%
END;
WRAPPER html/cell;
incs = classname.findnodes('links/link/@field');
FOR dim = incs;
link_xpath = '/reporter/tables/table[@id="' _ fact_table _'"]'_
'/links/link[@field="' _ dim.value() _ '"]/@table';
logme(link_xpath);
dim_table = config.findvalue(link_xpath);
dim_xpath = '/reporter/tables/table[@id="' _ dim_table _ '"]';
logme(dim_xpath);
dim_def = config.findnodes(dim_xpath);
INCLUDE class_table classname = dim_def;
END;
END;
END;
END;
END;
%]