Select Git revision
report.pm 12.95 KiB
package SLUB::LZA::TA::Command::report;
use SLUB::LZA::TA -command;
use v5.36;
use SLUB::LZA::TA::Archivematica::Elasticsearch;
use SLUB::LZA::TA::Archivematica::Elasticsearch::PrepareQuery;
use SLUB::LZA::TA::Output;
use Date::Calc qw(Date_to_Time Today Add_Delta_YM Add_Delta_YMD Day_of_Week);
use namespace::autoclean -except => qr{SLUB::LZA::TA::.*};
# VERSION
# ABSTRACT: report module for ta-tool
sub abstract { return "print AIP reports about Archival Information System (AIS)";}
my $base_cmd = "$0 report";
my $dummycmd = " "x length($base_cmd);
my $description=<<"DESCR";
Ask an AIS for some statistics about AIPs.
Overview:
$base_cmd [--daily| --weekly | --monthly | --yearly] [--workflow=WORKFLOW]
$dummycmd --version
$dummycmd --help
Examples:
* Report statistics of AIPs last month for workflow Kitodo
'$base_cmd --monthly --workflow Kitodo'
* Report statistics of AIPs last year
'$base_cmd --yearly'
A printable PDF version could be generated using ff. commands:
'$base_cmd | asciidoctor-pdf - > report.pdf'
HINT: If you want lists, use the 'search' command instead!
DESCR
sub description {
return "$description"
}
sub opt_spec {
my @global_opts= SLUB::LZA::TA::common_global_opt_spec();
my @local_opts = (
[ 'datemode' => hidden => {
one_of => [
[ 'daily|d' => 'report based on last day'],
[ 'weekly|W' => 'report based on last week'],
[ 'monthly|m' => 'report based on last month (default)' ],
[ 'yearly|y' => 'report based on last year' ],
[ 'ldpyearly' => 'report based on last LDP year 01.11. - 31.10.'],
[ 'complete|c'=> 'report based on all AIPs'],
],
},
],
[],
[ 'output-format' => hidden => {
one_of => [
[ 'output-as-csv|C' => 'prints output as Comma Separated Values (CSV)' ],
[ 'output-as-raw|R' => 'print raw hash output' ],
[ 'output-as-rsv|r' => 'prints output as Raw Strings Values (RSV)' ],
[ 'output-as-asciidoc|a' => 'prints output as AsciiDoc [default]' ],
],
}
],
[],
[ 'with-ldp|l' => 'report with LDP'],
[ 'workflow|w=s' => 'LZA internal workflow name (optional)'],