From 9b1ab41991f99ce4050caa7f6c86361c692ee2fe Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <andreas.romeyke@slub-dresden.de>
Date: Thu, 30 May 2024 16:06:34 +0200
Subject: [PATCH] - added support for payload values - enhanced help

---
 lib/SLUB/LZA/TA/Command/search.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/SLUB/LZA/TA/Command/search.pm b/lib/SLUB/LZA/TA/Command/search.pm
index d9ebc91..46980de 100644
--- a/lib/SLUB/LZA/TA/Command/search.pm
+++ b/lib/SLUB/LZA/TA/Command/search.pm
@@ -96,9 +96,11 @@ sub opt_spec {
         [ 'with-ldp-project' => 'also returns AIP ldp-project'],
         [ 'with-location' => 'also returns AIP location' ],
         [ 'with-path' => 'also returns AIP path' ],
+        [ 'with-payload-size' => 'also returns original payload size in Bytes'],
+        [ 'with-payload-filecount' => 'also returns original payload file count'],
         [ 'with-result-index' => 'also returns result index' ],
         [ 'with-score' => 'also returns score of Elastic Search match (higher => better)' ],
-        [ 'with-size' => 'also returns AIP size' ],
+        [ 'with-size' => 'also returns AIP size in bytes (sum of all file sizes without inodes used for directories)' ],
         [ 'with-slubarchiv-archivalvaluedescription|with-archival-value-description' => 'also returns AIP slubarchiv-archivalvaluedescription'],
         [ 'with-slubarchiv-exporttoarchivedate|with-export2archive-date' => 'also returns AIP slubarchiv-exporttoarchivedate'],
         [ 'with-slubarchiv-externalid' => 'also returns AIP slubarchiv-externalid'],
@@ -162,6 +164,12 @@ sub validate_args {
         $self->usage_error("--lzaid expects string which is conform to SLUBArchiv internal scheme")
             unless ($opt->{lzaid} =~ m/^$rx_up:$rx_up:$rx_up:$rx_lw:$rx_lw$/);
     }
+    if (exists $opt->{'with_payload_size'}) {
+        $opt->{'with_payload_oxum'} = 1;
+    }
+    if (exists $opt->{'with_payload_filecount'}) {
+        $opt->{'with_payload_oxum'} = 1;
+    }
     return 1;
 }
 
-- 
GitLab