Skip to content
Snippets Groups Projects
Select Git revision
  • 0779294c070cf94ed9b16b0e4ed963c9680e31cc
  • master default protected
  • diag
  • version1.3-archivematica
  • version1.2-archivematica
  • version1.1-archivematica
  • version1.0-archivematica
  • version1.0-rosetta
8 results

search.pm

Blame
  • report.pm 15.96 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'],
                    [ 'date-from=s' => 'report based on date range, beginning date in format "YYYY-MM-DD", implies "--date-to"'],
                ],
              },
            ],
            [ 'date-to=s' => 'report based on date range, end date in format "YYYY-MM-DD", implies "--date-from"'],
            [],
            [ '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]' ],
                ],
            }
            ],
            [],