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

search.pm

Blame
  • Andreas Romeyke's avatar
    Andreas Romeyke authored
    - reorganized options
    9d3044b9
    History
    search.pm 3.79 KiB
    package SLUB::LZA::TA::Command::search;
    use SLUB::LZA::TA -command;
    use strict;
    use warnings;
    use feature qw(say);
    use SLUB::LZA::TA::Archivematica::Elasticsearch;
    use Data::Printer;
    
    
    # VERSION
    
    # ABSTRACT: search IEs module for ta-tool
    
    sub abstract {"searches Archival Information System (AIS)";}
    
    my $description=<<"DESCR";
    Searches an AIS for descriptive or source metadata on behalf of the Technical Analyst.
    Returns AIP id. Only the first 10 matches will be presented by default.
    
    Examples:
    
      * Which AIP has this dc identifier?
        '$0 search -d SLUB:LZA:Kitodo:kitodo:422766'
      * Which AIPs are public domain?
        '$0 search -s publicdomain'
      * Which AIPs are copyrighted?
        '$0 search -s copyrighted'
      * Which AIPs were modified in 2021-05-31?
        '$0 search -m 2021-05-31'
        Which AIPs have at least one invalid file?
        '$0 search --with-invalid-files'
      * Which AIPs with mkv-files are in archive?
        '$0 search --pronom-format=fmt/569'
    
      * Which AIP has this dc identifier? Print the AIP id, lzaid of matching AIP
        as Rows of String Values (RSV)
        '$0 search -d SLUB:LZA:Kitodo:kitodo:422766 --with-lzaid --output-as-rsv'
    
        
    DESCR
    
    sub description {
        "$description"
    }
    sub opt_spec {
        return(
            ["target-version|V" => "get current elasticsearch version", {shortcircuit => 1}],
            ["debug" => "enable user agent debug output"],
            ["output-format" => hidden => {
                one_of => [
                  ["output-as-rsv|r" => "prints output as Raw Strings Values (RSV) [default]"],
                  ["output-as-csv|C" => "prints output as Comma Separated Values (CSV)"],
                  ["verbose|v" => "enable verbose output, returns full elasticsearch response"],
                ]
              }
            ],
            ["with-lzaid" => "also returns lzaid"],
            ["with-path" => "also returns AIP path"],
            ["with-size" => "also returns AIP size"],
            ["with-filecount" => "also returns AIPs file count"],
            ["with-export2archive-date" => "also returns AIP export to archive date"],
            ["with-creationdate" => "also returns AIP creation date"],
            ["datemode" => hidden => {
                one_of => [
                  ["creationdate|c=s" => "search based on creationdate string"],
                  ["modificationdate|m=s" => "search based on modificationdate string"]
                ]
              }
            ],
            ["lzaid|l=s", "search a specific AIP by given LZA id"],