Catmandu::Exporter::BagIt - Package that exports data as BagIts
use Catmandu::Exporter::BagIt; my $exporter = Catmandu::Exporter::BagIt->new( overwrite => 0 , skip_manifest => 0, ); $exporter->add($bagit_record); $exporter->commit;
The parsed BagIt record is a HASH containing the key '_id' containing the BagIt directory name and one or more fields:
{ '_id' => 'bags/demo01', 'version' => '0.97', # Not required, all bags will be 0.97 'tags' => { 'Bagging-Date' => '2014-10-03', # Not required, generated ... 'Bag-Software-Agent' => 'FooBar', # Not required, generated ... 'DC-Title' => 'My downloads' , 'DC-Creator' => 'Bunny, Bugs' , }, }, 'fetch' => [ { 'http://server/download1.pdf' => 'data/my_download1.pdf' } , { 'http://server2/download2.pdf' => 'data/my_download2.pdf' } , ], };
All URL's in the fetch array will be mirrored and added to the bag. All payload files should be put in the 'data' subdirectory as shown in the example above.
This module inherits all methods of Catmandu::Exporter.
In addition to the configuration provided by Catmandu::Exporter the exporter can be configured with the following parameters:
Optional. Skip an item when the BagIt for it already exists.
Optional. Throws an Catmandu::Error when the exporter tries to overwrite an existing directory.
Optional. Skips the re-calculation of MD5 manifest checksums in case BagIt directories get overwritten. Use this option for instance when overwriting only the tags of a bag.
Catmandu, Catmandu::Exporter, Archive::BagIt
Patrick Hochstenbach <Patrick.Hochstenbach@UGent.be>
This software is copyright (c) 2014 by Patrick Hochstenbach.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Catmandu::BagIt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::BagIt
CPAN shell
perl -MCPAN -e shell install Catmandu::BagIt
For more information on module installation, please visit the detailed CPAN module installation guide.