fedora_admin.pl - Fedora Commons Administrative client
./fedora_admin.pl [options] [cmd] cmd: list doc ID [DSID] find query|terms STR update ID [active|inactive|deleted] purge ID list_datastreams ID list_methods ID list_relationships ID set_relationships ID FILE get_dissemination ID SDEFPID METHOD get_datastream ID DSID [DATE] set_datastream ID DSID url|file|xml FILE update_datastream ID DSID active|inactive|deleted|versionable|notversionable purge_datastream ID DSID validate ID history ID [DSID] xml ID export ID import ID|new file|xml FILE options: --database=<NAME> --exporter=<EXPORTER> --importer=<IMPORTER> --param foo=bar -y -d directory_containing_catmandu.yml
fedora_admin.pl is a Fedora Commons-compatible client that execute HTTP Rest commands to a Fedora server.
fedora_admin.pl is intended to be conformat to Fedora Commons version up to Fedore 3.6.x.
This script requires a catmandu.yml file containing the connection parameters to the Fedora repository. Here is an example 'catmandu.yml' file:
--- store: fedora: package: FedoraCommons options: baseurl: http://localhost:8080/fedora username: fedoraAdmin password: fedoraAdmin
This file needs to be provided in the working directory or can be specified in the directory given by the -d option or specified in the environment by setting CATMANDU_CONF
export CATMANDU_CONF=/etc/catamandu_conf_dir
Name of a Fedora Commons server configured in catmandu.yml.
Name of a Catmandu::Exporter or a configuration in catmandu.yml.
Name of a Catmandu::Importer or a configuration in catmandu.yml.
Pass a parameter "FOO" with value "BAR" as optional parameter to a fedora_admin.pl command.
Answer yes to all question.
Configuration directory
Returns a list of all object identifiers (pid-s) that are store in the Fedora server.
Returns a short description of the object with identifier ID (audit trail, dublin core, object properties, pid and version).
Return a short description about the latets version of datastream DSID in object ID.
Execute a search query on the Fedora Commons server. One of 'query' or 'terms' is required.
Updates the status of an object with identifier ID.
Purges the object with identifier ID.
Returns a listing of all datastreams for an object with identifier ID.
Returns a listing of all methods for an object with identifier ID.
Returns a RDF/Turtle expression of all relationships defined for an object with identifier ID. The turtle includes all relationships for all the datastreams.
Updates all relationships of an object with identifier ID with RDF/Turtle expressions from FILE.
$ cat /tmp/rel.ttl <info:fedora/demo:20> <info:fedora/fedora-system:def/model#hasModel> <info:fedora/fedora-system:ServiceDeployment-3.0> ; <info:fedora/fedora-system:def/model#isContractorOf> <info:fedora/demo:FO_TO_PDFDOC>, <info:fedora/demo:TEI_TO_PDFDOC> ; <info:fedora/fedora-system:def/model#isDeploymentOf> <info:fedora/demo:19> . $ fedora_admin.pl set_relationships demo:20 /tmp/rel.ttl
Returns the binary stream when executing a dissemination on an object with identifier ID, sDef definition SDEFPID and method identifier METHOD.
$ fedora_admin.pl --param width=100 demo:29 demo:27 resizeImage
Returns the binary stream for an object with identifier ID and data stream identifier DSID.
Updates a data stream DSID for an object with identifiet ID. Use the url, file or xml upload mechanism to import a file FILE.
$ fedora_admin.pl demo:99 PDF file /tmp/my/pdf $ fedora_admin.pl --param controlGroep=E \ demo:99 PDF url http://inst.org/my.pdf
Update the datastream status of an object with identifier ID and data stream identifier DSID.
Purges the data stream DSID from an object with identifier ID.
Validate the content of an object with identifier ID.
Returns the version history of an object with identifier ID. Optionally provide a data stream identifier DSID.
Return an XML dump of an object with identifier ID.
Exports the object with identifier ID to standard ouput.
$ fedora_admin.pl --param context=archive demo:999
See https://wiki.duraspace.org/display/FEDORA36/REST+API#RESTAPI-export for possible parameters.
Imports an object into the Fedora store. Force an own identifier using or let the Fedora store mint a new one using 'new'.
$ fedora_admin.pl --param format=info:fedora/fedora-system:ATOMZip-1.1 \ demo:999 file /tmp/demo_999.zip $ fedora_admin.pl --param format=info:fedora/fedora-system:ATOMZip-1.1 \ --param ownerId=admin \ new file /tmp/demo_999.zip
See https://wiki.duraspace.org/display/FEDORA36/REST+API#RESTAPI-ingest for possible parameters.
L<Catmandu>, L<Catmandu::FedoraCommons>
Patrick Hochstenbach, "<patrick.hochstenbach at ugent.be>"
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Catmandu::FedoraCommons, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catmandu::FedoraCommons
CPAN shell
perl -MCPAN -e shell install Catmandu::FedoraCommons
For more information on module installation, please visit the detailed CPAN module installation guide.