
picawebcat - command line interface to PICA::Store

picawebcat [options] <command>
Commands:
get <id(s)>
create <recordfile(s)>
update <id> <recordfile> [<version>]
delete <id(s)>
upsert <recordfile(s)>
add
clean
mapget <mapfile> [<id(s) and/or recordfile(s)>]
mapcreate <mapfile> [<recordfile(s)>]
mapupdate <mapfile> [<id(s) and/or recordfile(s)>]
mapdelete <mapfile> [<id(s) and/or recordfile(s)>]
mapupsert <mapfile> [<id(s) and/or recordfile(s)>]
mapclean <mapfile>
mapadd <mapfile> <recordfile(s)>
mapcreate/mapupdate/mapdelete are equivalent to the commands
create/update/delete with a given map file (option -map).
Options:
-all on update: update all records, also not outdated records
-config <file> set config file (see description with -m)
-dbsid <dbsdi> set database id
-from <file> read ids or files from a file (empty lines ignored)
-help brief help message
-language <lang> set language code
-man full documentation
-map <file> set map file
-password <pwd> set password
-quiet no additional output
-SOAP <url> set SOAP interface base URL
-simulate simulate (only print what would be done)
-userkey <user> set user
-version print version of this script

This script can be used to get, insert, update, and delete records in a PICA::Record storage. The connection to a specific storage can be specified with command line options or in a special config file.
You can use one of five commands get, create, update, delete, and upsert. A get command will print the record(s) data to STDOUT, the other commands only print a status message on success. If an error occurred, the error message is send to STDOUT and the script ends with error code.
The upsert command expects files to be named with their ids and works like:
if ( get <id> ) then
update <id> <file>
else
create <file>
By default the script first looks whether the environment variable WEBCAT_CONF points to a config file, otherwise whether a file named "webcat.conf" located in the current directory exists. The config file can contain key=value pairs of dbsid, SOAP, userkey, password, language. Command line parameters override settings in a config file.
A map file is a convenient way if you regularly change records via webcat.
mapcreate <mapfile> mapcreate <mapfile> <recordfile(s)> mapupdate <mapfile> mapupdate <mapfile> <id(s) and/or recordfile(s)> mapdelete <mapfile> mapdelete <mapfile> <id(s) and/or recordfile(s)> mapget <mapfile> [ <id(s) and/or recordfile(s)> ]
picawebcat get 000000477 picawebcat delete 000000477 picawebcat create myrecord.pica picawebcat update 000000477 myrecord.pica picawebcat mapcreate records.list > creation.log 2> creation.err
If you permform an action on multiple files, the whole list of files is read before action is performed. In a later version we could implement online action while reading the input files.
At the moment only PICA+ files (PICA+ or PICA XML) are supported. We could provide a way to directly transform other metadata formats to PICA+ before storing them.