.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RowColHandler 3pm" .TH RowColHandler 3pm 2024-07-12 "Lire 2.1.1" "LogReport's Lire Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Lire::ReportParser::RowColHandler \- Lire::ReportParser subclass which synthetize row .SH SYNOPSIS .IX Header "SYNOPSIS" In XML Report processors: .PP .Vb 1 \& package MyParser; \& \& use base qw/Lire::ReportParser::RowColHandler/; \& \& sub handle_header_row { \& my ( $self, $row ) = @_; \& \& ... \& } \& \& sub handle_row { \& my ( $self, $row ) = @_; \& \& ... \& } \& \& sub handle_table_summary { \& my ( $self, $nrecords, $row ) = @_; \& \& .... \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" The Lire::ReportParser::RowColHandler module is a Lire::ReportParser subclass which will synthetize \fBhandle_row()\fR events. This makes it easier to write subclases which onlypurpose is to format the report. Instead of having to reconstruct the table row from the various entry_start, group_start, handle_name, events, the subclass only has to process \fBhandle_row()\fR events. .SH "USING Lire::ReportParser::RowColHandler" .IX Header "USING Lire::ReportParser::RowColHandler" Client only have to inherit from Lire::ReportParser::RowColHandler. After that, they can define \fBhandle_row()\fR, \fBhandle_header_row()\fR and \&\fBhandle_table_summary()\fR method. .PP There is a parameter that the RowColHandler accepts and its \&\f(CW\*(C`summary_when\*(C'\fR which specify when the \fBhandle_table_summary()\fR event will be synthetised ( \f(CW\*(C`before\*(C'\fR or \f(CW\*(C`after\*(C'\fR the table's body.) When it's \f(CW\*(C`before\*(C'\fR the event will be generated after the header_row events but before any \fBhandle_row()\fR events. Otherwise, it will be generated once all \fBhandle_row()\fR events are processed. The default is \f(CW\*(C`before\*(C'\fR. .ie n .SS "handle_table_summary( $nrecords, $row )" .el .SS "handle_table_summary( \f(CW$nrecords\fP, \f(CW$row\fP )" .IX Subsection "handle_table_summary( $nrecords, $row )" Called after the table summary is available (and depending on the \&\f(CW\*(C`summary_when\*(C'\fR initialisation parameter). \f(CW$nrecords\fR contains the number of records used to compute the report and \f(CW$row\fR is an array reference to the table summary value. The \f(CW$row\fR array contains as much elements as there is columns in the table. Only the numerical column will have a value in there, others will be set to undef. .PP The summary value are hash reference containing the same values than is available in the Lire::ReportParser's \fBhandle_summary_value()\fR event. .ie n .SS "handle_header_row( $row )" .el .SS "handle_header_row( \f(CW$row\fP )" .IX Subsection "handle_header_row( $row )" This will called once for each header row there is. The first header row contains all the numerical columns as well as the main categorical column. .PP \&\f(CW$row\fR is an array reference containing as much element as there is columns in the table. Column's labels which shouldn't appear on this row are undef. Other elements will contain the related Lire::Report::ColumnInfo object. .ie n .SS "handle_row( $row )" .el .SS "handle_row( \f(CW$row\fP )" .IX Subsection "handle_row( $row )" This event will be called for each row to display in the table. .PP \&\f(CW$row\fR is an array reference containing the data that should appear in the row. It contains as many elements as there are columns defined in the table. Empty column will have undef as content. Other elements will be an hash reference identical to what would be received in the \&\fBhandle_name()\fR or \fBhandle_value()\fR method of Lire::ReportParser. The only difference is that summary value will have a key \f(CW\*(C`is_summary\*(C'\fR set to 1. .PP In the case of spanning columns, the data element will be in the \&\fBcol_start()\fR element. The other cells will be undef. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBLire::ReportParser\fR\|(3pm) \fBLire::Report::ColumnInfo\fR\|(3pm) .SH VERSION .IX Header "VERSION" \&\f(CW$Id:\fR RowColHandler.pm,v 1.13 2006/07/23 13:16:31 vanbaal Exp $ .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2002 Stichting LogReport Foundation LogReport@LogReport.org .PP This file is part of Lire. .PP Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. .SH AUTHOR .IX Header "AUTHOR" Francis J. Lacoste