package BookPub::Admin::Command::ListReportConfig;
use strict;
use warnings;

use lib '/app/tools/bookpub/lib';
use BookPub::DB::Item::ReportConfig;
use BookPub::Admin::ReportConfigList;
use base 'BookPub::Command';

use lib '/app/tools/common/lib';
use Common::Assert;
use RSApache::Response::XSLT;

sub cmd      { return 'list_report_config'; }
sub area     { return 'admin'; }
sub pageName { return 'Saved Report Configurations'; }

use constant kTemplate => "/app/tools/bookpub/templates/admin/list_report_config.xsl";

sub execute {
    my ($self) = @_;

    my $response = $self->SUPER::execute();
    return $response if $response;

    $self->{xml}{ReportConfigList} = BookPub::Admin::ReportConfigList->new();

    return RSApache::Response::XSLT->new( $self->{xml}, kTemplate );
}

1;
