.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Report 3pm" .TH Report 3pm 2025-09-28 "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::Report \- Interface to a Lire report. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 3 \& use Lire::ReportParser::ReportBuilder; \& my $parser = new Lire::ReportParser::ReportBuilder; \& my $report = $parser\->parse( "report.xml" ); \& \& print $report\->superservice(), " report\en"; \& print "Generated on ", scalar( localtime( $report\->date() ) ), "\en"; \& print "Timespan starts on ", scalar( localtime( $report\->timespan_start() ) ), "\en"; \& print "Timespan ends on ", scalar( localtime( $report\->timespan_start() ) ), "\en"; \& foreach my $s ( $report\->sections() ) { \& print "Section: \*(Aq", $s\->title(), "\*(Aq has ", scalar $s\->subreports(), \& " subreports in it\en"; \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module offers an API to the report generated by Lire. The \&\fBLire::ReportParser::ReportBuilder\fR\|(3pm) can be used to create a Lire::Report object from an XML file that complies with the Lire Report Markup Language DTD. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" A Lire::Report object can be built from an XML report file, from the \&\fBnew()\fR method or from a Lire::ReportConfig object. .ie n .SS "new( [ $timespan_period ], [ $timespan_start ], [ $timespan_end ] )" .el .SS "new( [ \f(CW$timespan_period\fP ], [ \f(CW$timespan_start\fP ], [ \f(CW$timespan_end\fP ] )" .IX Subsection "new( [ $timespan_period ], [ $timespan_start ], [ $timespan_end ] )" Creates a new Lire::Report. The \f(CW$timespan_period\fR, \f(CW$timespan_start\fR and \&\f(CW$timespan_end\fR parameters initialize the attributes of the same name. .SH "OBJECT METHODS" .IX Header "OBJECT METHODS" .SS \fBversion()\fP .IX Subsection "version()" Returns the version number of the report format which was used in the external representation of this report. The current version is 2.1. .SS generator([$generator) .IX Subsection "generator([$generator)" Returns the generator string that will be outputted in comments when the \fBwrite_report()\fR method is used. One can change that value by passing a new value through the \f(CW$generator\fR parameter. .ie n .SS "date( [ $new_date ] )" .el .SS "date( [ \f(CW$new_date\fP ] )" .IX Subsection "date( [ $new_date ] )" Returns (and optionanly changes) the date in seconds since epoch on which this report was generated. .ie n .SS "timespan_period( [ $new_period ] )" .el .SS "timespan_period( [ \f(CW$new_period\fP ] )" .IX Subsection "timespan_period( [ $new_period ] )" Returns (and optionnally changes) the period of the report. The period can be \*(Aqhourly\*(Aq, \*(Aqdaily\*(Aq, \*(Aqweekly\*(Aq, \*(Aqmonthly\*(Aq or \*(Aqyearly\*(Aq. When the period is undef, it is an arbitrary period. .ie n .SS "timespan_start( [ $new_start ] )" .el .SS "timespan_start( [ \f(CW$new_start\fP ] )" .IX Subsection "timespan_start( [ $new_start ] )" Returns (and optionnally changes) the start of the timespan covered by this report in seconds since epoch. .ie n .SS "timespan_end( [ $new_end ] )" .el .SS "timespan_end( [ \f(CW$new_end\fP ] )" .IX Subsection "timespan_end( [ $new_end ] )" Returns (and optionnally changes) the end of the timespan covered by this report in seconds since epoch. .SS "title( [$title] )" .IX Subsection "title( [$title] )" Returns the report\*(Aqs title, if it has one. .PP If the \f(CW$title\fR is parameter is set, the report\*(Aqs title will be set to this new value. .SS "description( [$new_desc] )" .IX Subsection "description( [$new_desc] )" Returns the report description. This description is encoded in DocBook XML. .PP If the \f(CW$description\fR parameter is set, this method will set the description to this new value. If the \f(CW$description\fR parameter is undef, that description will be removed. .SS "sections( )" .IX Subsection "sections( )" Returns the report\*(Aqs sections as an array. This will be an array of Lire::Report::Section objects. .ie n .SS "add_section( $section )" .el .SS "add_section( \f(CW$section\fP )" .IX Subsection "add_section( $section )" Adds a section to this report. The \f(CW$section\fR parameter should be a Lire::Report::Section object. .ie n .SS "subreport_by_id( $id )" .el .SS "subreport_by_id( \f(CW$id\fP )" .IX Subsection "subreport_by_id( $id )" Returns the Lire::Report::Subreport object with \f(CW$id\fR. Returns undef when there is no subreport with that ID. .SS \fBschemas()\fP .IX Subsection "schemas()" Returns an array reference containing all the schemas used by this report. .SS "write_report( [FH] );" .IX Subsection "write_report( [FH] );" Write the report in XML format on the FH filehandle or STDOUT if omitted. .PP This method takes care of adding stuff like the XML header \f(CW\*(C` .Ve .SH VERSION .IX Header "VERSION" \&\f(CW$Id:\fR Report.pm,v 1.35 2006/07/23 13:16:29 vanbaal Exp $ .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2002, 2004 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.