Description
Ian Walls
2011-01-08 22:01:18 UTC
(En réponse au commentaire 0) > otherwise there is no commandline script for exporting the MARC biblios. We (BibLibre) have a developpment to provide. It gives the ability to tools/export.pl to manage options described here: http://wiki.koha-community.org/wiki/Export_Biblio_RFC We will attach patch sooner on this bz I think. Created attachment 9955 [details] [review] Bug 5600: Command line interface for tools/export.pl export.pl [--format=format] [--date=date] [--dont_export_items] [--deleted_barcodes] [--clean] --filename=outputfile * format is either 'xml' or 'marc' (default) * date should be entered as the 'dateformat' syspref is set (dd/mm/yyyy for metric, yyyy-mm-dd for iso, mm/dd/yyyy for us) * records exported are the ones that have been modified since 'date' * if --deleted_barcodes is used, a list of barcodes of items deleted since 'date' is produced (or from all deleted items if no date is specified) * --clean removes NSE/NSB This patch seems to eliminate the ability to export from the staff client. Wouldn't it be better to either make the script so that it can be accessed via CGI or command-line, or add a second script (which I think may have been what Ian and Paul agreed was the best option for this sort of script)? Jared, it's the case: the script tools/export.pl is accessible via CGI and command-line. I've tested this patch and both command-line and CGI worked for me. Can you give us more information about how it did not work for you ? Matthias, (In reply to comment #4) > Jared, it's the case: the script tools/export.pl is accessible via CGI and > command-line. > > I've tested this patch and both command-line and CGI worked for me. > > Can you give us more information about how it did not work for you ? I did not try the patch yet. I was going to test it, but when I took a look at the patch to see what it did, it looked like it turned the CGI script into a command-line script. If I misunderstood what it is supposed to do, that's excellent, and I will test and sign off. Sorry for the confusion! When I apply this patch and try to view tools/export.pl in the web browser, I got the following software error: Can't use an undefined value as a HASH reference at /home/jcamins/kohaclone/tools/export.pl line 99. Created attachment 10200 [details] [review] Bug 5600: Command line interface for tools/export.pl Fixed bug when IndependantBranches is ON. It was caused by calling C4::Context->userenv before get_template_and_user (userenv is undef in this case). Rebased on master There are a lot conflicts between the current version of tools/export.pl and this patch. Created attachment 10671 [details] [review] Bug 5600: Command line interface for tools/export.pl Rebased on master and fixed conflicts Created attachment 10676 [details] [review] Bug 5600: Command line interface for tools/export.pl export.pl [--format=format] [--date=date] [--dont_export_items] [--deleted_barcodes] [--clean] --filename=outputfile * format is either 'xml' or 'marc' (default) * date should be entered as the 'dateformat' syspref is set (dd/mm/yyyy for metric, yyyy-mm-dd for iso, mm/dd/yyyy for us) * records exported are the ones that have been modified since 'date' * if --deleted_barcodes is used, a list of barcodes of items deleted since 'date' is produced (or from all deleted items if no date is specified) * --clean removes NSE/NSB Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> CONFLICT (content): Merge conflict in tools/export.pl Created attachment 10954 [details] [review] Bug 5600: Command line interface for tools/export.pl Rebased on master This one is already signed off by Jared QA Comments: Nothing to say, seems to work as expected. Marking Passed QA. Created attachment 10997 [details] [review] Bug 5600: Command line interface for tools/export.pl export.pl [--format=format] [--date=date] [--dont_export_items] [--deleted_barcodes] [--clean] --filename=outputfile * format is either 'xml' or 'marc' (default) * date should be entered as the 'dateformat' syspref is set (dd/mm/yyyy for metric, yyyy-mm-dd for iso, mm/dd/yyyy for us) * records exported are the ones that have been modified since 'date' * if --deleted_barcodes is used, a list of barcodes of items deleted since 'date' is produced (or from all deleted items if no date is specified) * --clean removes NSE/NSB Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> QA comment: * unconditionnal warn inside = +warn $backupdir; Created attachment 11099 [details] [review] Bug 5600: Command line interface for tools/export.pl Removed unconditionnal warn. QA comment: running this script under plack, on the web interface does not work at all. I get a nasty: An Error Occurred 500 Internal Server Error In the log, I can see: Variable "$backupdir" is not available at /home/paul/koha.dev/koha-community/tools/export.pl line 452. Unknown option: port Unknown option: i Unknown option: i Unknown option: e Unknown option: reload Trying to reload the page result in CPU being 100% used, Firefox waiting for a long long time, There is no problem in CGI mode (In reply to comment #18) > QA comment: running this script under plack, on the web interface does not > work at all. > > I get a nasty: > An Error Occurred > > 500 Internal Server Error > > In the log, I can see: > Variable "$backupdir" is not available at > /home/paul/koha.dev/koha-community/tools/export.pl line 452. > Unknown option: port > Unknown option: i > Unknown option: i > Unknown option: e > Unknown option: reload > > Trying to reload the page result in CPU being 100% used, Firefox waiting for > a long long time, > There is no problem in CGI mode There is a patch to fix this on another bug. (In reply to comment #19) > There is a patch to fix this on another bug. See Bug 8437 Created attachment 11331 [details] [review] Bug 5600 follow-up: Fix commandline check in order to work under Plack With plackup, @ARGV can contains elements so we can't check the size of @ARGV to tell whether we are in command line mode or not. Instead we check environment variable GATEWAY_INTERFACE. Also fix the use of a global variable in a subroutine The follow-up needs a signoff here. Created attachment 11334 [details] [review] Bug 5600: very tiny follow-up to pass perlcritic open was called with 2 arguments instead of 3 QA comment: * the 1st follow-up fixes the Plack problem, well done * the 2nd follow-up makes perlcritc happy No reason not to pass QA. So... follow-up signed-off & everything passed QA ! Ok in master. |