ReportConfig(3pm)

πŸ“¦ version 2.1.1, in arch rolling

✨ ReportConfig(3pm) ✨

okay bestie, so this is the LogReport's Lire Documentation page for Lire::ReportConfig, and honestly it's giving backstage-pass energy πŸŽ€ β€” it's the API to the report configuration file, and you're gonna want it in your life.


πŸ’– NAME πŸ’–

Lire::ReportConfig β€” the API to the report configuration file, no cap 🫢


⭐ SYNOPSIS ⭐

like, here's the whole vibe in code:

use Lire::ReportConfig;

my $templates = Lire::ReportConfig->templates();
if ( Lire::ReportConfig->has_template( 'www_default' ) ) {
    my $report_cfg = Lire::ReportConfig->template( 'www_default' )->as_value();
    my $report = $report_cfg->generate_report( $report );
}

πŸ¦‹ DESCRIPTION πŸ¦‹

so this class represents report configurations β€” literally that's its whole job, main character energy πŸ‘‘. And how are report configurations stored? As an XML configuration, using the Lire::Report::ReportSpec configuration type. slay.


🌸 TEMPLATES 🌸

template reports are configuration specification files, and you'll find them sitting in the directories that the 'lr_templates_path' configuration variable points at. iykyk πŸ’…

πŸŽ€ templates()

returns an array reference with the names of all the defined templates. all of them. periodt.

πŸŽ€ has_template( $name )

returns true if there's actually a template named $name available β€” a little vibe check for your templates ✨

πŸŽ€ template( $name )

returns a Lire::Config::Object that defines the template ReportConfig named $name. and bestie, check this: its spec() method would return a Lire::Config::ReportSpec object, and its as_value() method would instantiate a Lire::ReportConfig object. obsessed πŸ’–


🌈 CONSTRUCTORS 🌈

🧚 new()

creates a new, totally empty Lire::ReportConfig object β€” fresh out the box 🎁

the created report configuration object doesn't contain any section, report or filter specifications. like, nothing. blank slate. adorable.

🧚 new_from_file( $superservice, $report_cfg )

this will create a new report configuration object for the $superservice superservice, based on the report configuration file $report_cfg. that's the whole thing, no notes πŸ’œ


πŸ‘‘ OBJECT METHODS πŸ‘‘

πŸ’… filename( [ $new_filename ] )

returns (and optionally changes) the filename from which this ReportConfig was loaded. it will return undef if the ReportConfig wasn't loaded from a file. so if it's undef... yeah, no file, bestie πŸ™ˆ

πŸ’… title( [ $new_title ] )

returns (and optionally changes) the title that will be assigned to the report. cute little label, love that for you 🏷️

πŸ’… schemas()

returns an array reference containing the name of the schemas used in this report. ✨

πŸ’… sections()

returns this report configuration's sections as an array of Lire::Section objects. very demure, very array.

πŸ’… add_section( $section )

adds a section to this report configuration. the $section parameter should be a Lire::ReportSection object β€” like, don't just throw anything in there, okay? 🫢

πŸ’… merge_filters()

calling this method will make sure that all report specifications take into account their section's filter specification. teamwork!

⚠️ heads up: this method will modify all report specifications. after this, their object representation won't be identical to the one in the XML report specification. so yeah, it changes things β€” that's the whole point, but don't say I didn't warn you 😭

prints the report configuration on the $fh filehandle. if you omit the $fh parameter, it'll be printed on STDOUT instead. easy πŸ’–

πŸ’… create_report( $timespan_start, $timespan_end )

returns a Lire::Report object based on this report's configuration file. the $timespan_start and $timespan_end attributes will be used to initiate the Report object. ⏰

used when generating an XML report from a DLF source, and when merging XML reports. and the real job? delegated to Lire::ReportSection::create_report_section(). iconique delegation behavior πŸ‘‘

πŸ’… create_analyser_streams( $store )

this method makes sure a DlfStream is available in the Lire::DlfStore $store for each schema used by this report configuration. the stream gets created by running the first analyser that's able to generate the schema using existing streams. 🧚

πŸ’… generate_report( $store )

generates a Lire::Report from this report configuration. the report is computed using the streams in the Lire::DlfStore $store. this is the moment, this is the main event πŸ”₯

πŸ’… merge_report_files( @report_files )

generates a new Lire::Report based on this report configuration by merging XML reports. every report spec contained in the configuration will be the result of merging all the subreports having the same id. matching ids unite πŸ’œ


πŸ” SEE ALSO πŸ”


✍️ AUTHOR ✍️

Francis J. Lacoste <flacoste@logreport.org> πŸ’–


πŸŽ€ VERSION πŸŽ€

$Id: ReportConfig.pm,v 1.38 2006/07/23 13:16:29 vanbaal Exp $


Copyright (C) 2002, 2004 Stichting LogReport Foundation LogReport@LogReport.org

this file is part of Lire.

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.

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. 🫢

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. ✨


okay that's the whole page, bestie β€” go forth and configure those reports πŸ’…βœ¨

🌟 sign-off time: this was Lire 2.1.1, dated 2025-09-28, and the page is ReportConfig(3pm). mwah πŸ’–
πŸ“¦ where this page comes from