Bugzilla – Attachment 169894 Details for
Bug 37538
Improve documentation printed by connexion_import_daemon.pl --help
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Improve output of `connexion_import_daemon.pl --help`
file_37538.txt (text/plain), 10.52 KB, created by
Rudolf Byker
on 2024-07-31 14:52:42 UTC
(
hide
)
Description:
Improve output of `connexion_import_daemon.pl --help`
Filename:
MIME Type:
Creator:
Rudolf Byker
Created:
2024-07-31 14:52:42 UTC
Size:
10.52 KB
patch
obsolete
>From 7a3186c65f44f14e4ce659692b3e129399de7d9e Mon Sep 17 00:00:00 2001 >From: Rudolf Byker <rudolfbyker@gmail.com> >Date: Wed, 31 Jul 2024 16:48:57 +0200 >Subject: [PATCH] Bug 37538: Improve documentation for the OCLC import daemon > script. > >To test: >1) Run `/usr/share/koha/bin/connexion_import_daemon.pl --help` >2) Read the output and check for errors, whether grammatical, spelling, or factual. > >Sponsored-by: Reformational Study Centre <www.refstudycentre.com> >--- > misc/bin/connexion_import_daemon.pl | 207 +++++++++++++++++++++++----- > 1 file changed, 170 insertions(+), 37 deletions(-) > >diff --git a/misc/bin/connexion_import_daemon.pl b/misc/bin/connexion_import_daemon.pl >index 40bff5d..851edd8 100755 >--- a/misc/bin/connexion_import_daemon.pl >+++ b/misc/bin/connexion_import_daemon.pl >@@ -32,44 +32,177 @@ GetOptions( > > if ( $help || !$config ) { > print <<EOF >-$0 --config=my.conf >-Parameters : >- --daemon | -d - go to background; prints pid to stdout >- --config | -c - config file >- --help | -? - this message >+OCLC Import Daemon >+ >+This script hosts a server which listens for connections from an OCLC Connexion client or WorldShare Record Manager. >+ >+The records are forwarded to Koha by sending a request to the handler at `/cgi-bin/koha/svc/import_bib` on the >+intranet of the configured Koha instance. The request is authenticated using the credentials of a Koha staff user. >+ >+See the documentation for the `import_bib` endpoint at >+https://wiki.koha-community.org/wiki/Koha_/svc/_HTTP_API#POST_.2Fsvc.2Fimport_bib . >+The `import_bib` endpoint is being phased out. This script should be rewritten to use the newer REST API instead. >+ >+If you have multiple Koha instances, run a separate instance of this script for each one, using a different port and >+different credentials for each one. >+ >+Usage: >+ $0 --config=my.conf >+ >+Command line options: >+ --daemon | -d - Run in the background. Prints the process ID to stdout. >+ --config | -c - Specify the config file to use. Required. >+ --help | -? - Print this message. > > Config file format: >- Lines of the form: >- name: value >- >- # comments are supported >- No quotes >- >- Parameter Names: >- host - ip address or hostname to bind to, defaults all available >- port - port to bind to, mandatory >- log - log file path, stderr if omitted >- debug - dumps requests to the log file, passwords inclusive >- koha - koha intranet base url, eg http://librarian.koha >- user - koha user, authentication >- password - koha user password, authentication >- match - marc_matchers.code: ISBN or ISSN >- overlay_action - import_batches.overlay_action: replace, create_new or ignore >- overlay_framework - if overlaying records - move to a new framework, if blank will use default >- if not included it will use the framework of the existing record >- nomatch_action - import_batches.nomatch_action: create_new or ignore >- item_action - import_batches.item_action: always_add, >- add_only_for_matches, add_only_for_new or ignore >- import_mode - stage or direct >- framework - to be used if import_mode is direct, if blank, will use default >- connexion_user - User sent from connexion client >- connexion_password - Password sent from connexion client >- >- Note: If connexion parameters are not defined request authentication will not be checked >- You should specify a different user for connexion to protect the Koha credentials >- >- All process related parameters (all but ip and port) have default values as >- per Koha import process. >+ Each line has the form: >+ NAME: VALUE >+ For example: >+ port: 5500 >+ >+ Empty parameters look like this: >+ NAME: >+ For example: >+ overlay_framework: >+ >+ Values should not be quoted. >+ >+ Lines starting with # are treated as comments. >+ >+ Parameters: >+ host >+ The IP address or host name to bind to (i.e., listen on). >+ Defaults to 0.0.0.0, i.e., listen on all interfaces. >+ >+ port >+ The port to bind to (i.e., listen on). >+ Typically 5500. >+ This must be different from the port used by any other service on the same machine. >+ Required. >+ >+ log >+ The path to the log file. >+ Logs are written to stderr if omitted. >+ >+ debug >+ Dumps all incoming requests to the log file. >+ WARNING: This includes the connexion user's password, if it is part of the request. >+ Use 1 for on and 0 for off. >+ Defaults to 0 (off). >+ >+ koha >+ The base URL of the intranet of your Koha instance, e.g. http://librarian.koha >+ When this script is running on the same machine as the Koha instance, and you have dedicated port for the Koha >+ intranet, you can use http://localhost:port here. Otherwise, use the URL you would use when accessing your Koha >+ intranet through a browser. >+ Required. >+ >+ user >+ The Koha user used for logging in to the intranet of your Koha instance. >+ Required. >+ >+ password >+ The password of the Koha user. >+ Required. >+ >+ connexion_user >+ The user name expected to be sent by the connexion client with every request. >+ If set, also set `connexion_password`. In this case, request authentication will be checked. >+ If omitted, also omit `connexion_password`. In this case, request authentication will not be checked, and >+ anyone with access to the port opened by this script will be able to send records into your Koha instance. >+ >+ connexion_password >+ The password expected to be sent by the connexion client with every request. >+ WARNING: Do NOT use the same password as the Koha user password. >+ >+ import_mode >+ Where the imported records should go. See the explanation below. >+ Available values: >+ stage >+ The records will be imported into the staging area (reservoir) at /cgi-bin/koha/tools/manage-marc-import.pl >+ into a batch called `(webservice)`. >+ The records will also show up below the catalog results in the staff client when doing a "cataloging search" >+ at /cgi-bin/koha/cataloguing/addbooks.pl?q=... >+ direct >+ The records will be imported directly into the catalog. They will show up in all catalog searches >+ as soon as the indexing catches up. >+ Defaults to `stage`. >+ >+ match >+ Which code to use for matching MARC records when deciding whether to add or replace a record. >+ Corresponds to the "Matching rule applied" field at /cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=... >+ Available options: >+ ISBN >+ Use the International Standard Book Number (MARC 020\$a) >+ ISSN >+ Use the International Standard Serial Number (MARC 022\$a) >+ KohaBiblio >+ Use the Koha biblio number (MARC 999\$c) >+ See `C4::Matcher`. >+ >+ overlay_action >+ What to do when the incoming record matches a record already in the catalog. >+ Corresponds to the "Action if matching record found" field at /cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=... >+ Available values: >+ replace >+ Replace the existing record with the incoming record. >+ create_new >+ Create a new record alongside the existing record. >+ ignore >+ Discard the incoming record. >+ >+ nomatch_action >+ What to do when the incoming record does not match any record in the catalog. >+ Corresponds to the "Action if no match found" field at /cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=... >+ Available values: >+ create_new >+ Create a new record. >+ ignore >+ Discard the incoming record. >+ >+ item_action >+ What to do when the incoming MARC record contains one or more items embedded in field 952. >+ Corresponds to the "Item processing" field at /cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=... >+ Available values: >+ always_add >+ add_only_for_matches >+ add_only_for_new >+ replace >+ ignore >+ >+ framework >+ The cataloging framework to use when no match was found in the catalog (i.e., when adding a new record). >+ Defaults to the default framework configured at /cgi-bin/koha/admin/biblio_framework.pl >+ >+ overlay_framework >+ The cataloging framework to use when a match was found in the catalog (i.e., when replacing an existing record). >+ Corresponds to the "Replacement record framework" field at /cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=... >+ You have three options here: >+ Do not specify this parameter. >+ The default framework configured at /cgi-bin/koha/admin/biblio_framework.pl will be used. >+ Specify this parameter without a value, i.e., `overlay_framework:`. >+ The new record will use the same framework as the record being replaced. >+ Specify this parameter with a value, e.g., `overlay_framework: my_framework`. >+ The new record will use the specified framework. >+ >+Explanation of `import_mode`: >+ - When using `direct`, each request will create a new batch and import the batch immediately. >+ - When using `stage`, each request will cause records to be added to an existing batch. >+ - The batch name is always `(webservice)`. >+ - If you change `import_mode` from `stage` to `direct` after some records have already been staged, the next request >+ will cause all records in that batch to be imported into the catalog, not just the records from the latest request. >+ - These config parameters define the settings of the batch that is created, whether or not it is imported immediately: >+ - `match` >+ - `overlay_action` >+ - `nomatch_action` >+ - `item_action` >+ - `framework` >+ - `overlay_framework` >+ - If one or more of these parameters are changed, a new batch is created with the new settings, and any new records >+ are added to that batch instead of to the old one. >+ - If you stage a record that cannot be imported then all future imports will be stuck until that batch is cleaned >+ and deleted. >+ > EOF > ; > exit; >@@ -265,7 +398,7 @@ sub read_request { > $in =~ m/(.)$/; > my $lastchar = $1; > my ($xml, $user, $password, $local_user); >- my $data = $in; # copy for diagmostic purposes >+ my $data = $in; # copy for diagnostic purposes > while () { > my $first = substr( $data, 0, 1 ); > if (!defined $first) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37538
:
169894
|
169921