Bug 22371 - MARC bibliographic framework plugin to generate Cutter-Sanborn
Summary: MARC bibliographic framework plugin to generate Cutter-Sanborn
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low new feature (vote)
Assignee: Ítalo
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-19 14:53 UTC by Ítalo
Modified: 2021-05-09 12:40 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
First implementation of cutter generator (210.66 KB, patch)
2019-02-21 17:02 UTC, Ítalo
Details | Diff | Splinter Review
Plugin with comments in english (210.78 KB, text/plain)
2019-03-07 14:11 UTC, Ítalo
Details
Updated plugin code, using String.prototype.normalize() (210.31 KB, text/plain)
2019-03-07 16:52 UTC, Ítalo
Details
Bug 22371: Add MARC21 cataloguing plugin to generate Cutter-Sanborn (211.78 KB, patch)
2021-04-17 15:05 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 22371: Add MARC21 cataloguing plugin to generate Cutter-Sanborn (211.56 KB, patch)
2021-04-21 20:52 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Ítalo 2019-02-19 14:53:57 UTC
The plugin (.pl) generates the Cutter-Sanborn code, and will be added to the list of plugins intended for the fields in MARC bibliographic frameworks. To use the plugin, it is necessary to associate it with the Cutter field in the framework. By clicking on the Cutter field, the plugin generates the Cutter code, from the values entered in the fields 100$a (Personal name), 110$a (Corporate name) and/or 245$a (Title statement).

An initial version of the plugin was created, which operates as follows:
1) Use the field 100$a to generate the Cutter, and adds the first letter of the title (245$a) to the end of the Cutter code;
2) If field 100$a is not filled, use field 110$a and add the first letter of the title (245$a) to the end of the Cutter code;
3) If none of the fields 100$a or 110$a are filled, the cutter is generated from field 245$a, without adding the first letter of the title to the end of the code.

Some observations:
- To fill the Cutter, simply click on the field and the cutter is displayed.
- If none of the fields are filled, the cutter is not generated.
- It is important to fill the indicator 2 of field 245 with the number of characters used by the article preceding the title of the work (if any). The blank spaces also count. If the indicator 2 is not filled, the plugin understands that the value is 0.
- For fields with special characters, the following list of characters is currently considered: ãâáàÃÃÂÁÀÉÊéêÍÎíîóõôṌÕÔṌÚÛúûçÇÑñ
Comment 1 Ítalo 2019-02-21 17:02:08 UTC
Created attachment 85466 [details] [review]
First implementation of cutter generator
Comment 2 Cori Lynn Arnold 2019-03-06 00:35:16 UTC
I'm trying to test this functionality. Can you explain this step in more detail:

 To use the plugin, it is necessary to associate it with the Cutter field in the framework. 

Thanks!
-cori lynn
Comment 3 paxed 2019-03-06 09:57:29 UTC
Any chance of converting the comments in the plugin to english?
Comment 4 paxed 2019-03-06 10:02:57 UTC
Should also perhaps use String.prototype.normalize() if it's available
Comment 5 Ítalo 2019-03-07 13:19:52 UTC
(In reply to Cori Lynn Arnold from comment #2)
> I'm trying to test this functionality. Can you explain this step in more
> detail:
> 
>  To use the plugin, it is necessary to associate it with the Cutter field in
> the framework. 
> 
> Thanks!
> -cori lynn

Hello Cori!

To associate the plugin with the cutter field, you must set the 'cutter.pl' plugin in your MARC framework. this can be done through the following steps:

1. Navigate to More > Administration > MARC bibliographic framework;
2. On the framework which you want to use de plugin, click on Action > MARC Structure;
3. On the field to be associated with the plugin, click on Actions > Subfields;
4. Select the tab corresponding to the cutter subfield;
5. On the "Other options (choose one)" panel, select "cutter.pl" in "Plugin" dropdown menu, and save changes.

Hope it works!
Comment 6 Ítalo 2019-03-07 14:11:22 UTC
Created attachment 86277 [details]
Plugin with comments in english
Comment 7 Ítalo 2019-03-07 14:13:42 UTC
(In reply to paxed from comment #3)
> Any chance of converting the comments in the plugin to english?

Paxed, I inserted a new attachment named 'Plugin with comments in english'.
Comment 8 Ítalo 2019-03-07 16:52:36 UTC
Created attachment 86304 [details]
Updated plugin code, using String.prototype.normalize()
Comment 9 Ítalo 2019-03-07 16:55:12 UTC
(In reply to paxed from comment #4)
> Should also perhaps use String.prototype.normalize() if it's available

Paxed, the new attachment ('Updated plugin code, using String.prototype.normalize()') was done with normalize().
Thanks for the suggestion!
Comment 10 paxed 2019-03-08 12:11:51 UTC
(In reply to Ítalo from comment #9)
> (In reply to paxed from comment #4)
> > Should also perhaps use String.prototype.normalize() if it's available
> 
> Paxed, the new attachment ('Updated plugin code, using
> String.prototype.normalize()') was done with normalize().
> Thanks for the suggestion!

You probably shouldn't split the string into character array (and then join it later), but use the normalize directly on the string and remove the combining diacritics (eg. with a regular expression).
Comment 11 Devinim 2020-02-27 13:38:24 UTC
Hi,

There are many Italian variables in code
Comment 12 Bernardo Gonzalez Kriegel 2020-02-28 02:32:50 UTC
(In reply to Devinim from comment #11)
> Hi,
> 
> There are many Italian variables in code

Not Italian, Portuguese :)
Comment 13 David Nind 2021-04-11 00:25:44 UTC
Hi Ítalo.

As this patch is not formatted the "normal" way, then the development environments we use don't work - so I'm not able to test and sign off the usual way.

See the Developer Handbook, https://wiki.koha-community.org/wiki/Developer_handbook and look for :
- the Development workflow (https://wiki.koha-community.org/wiki/Development_workflow)  
- submitting a patch https://wiki.koha-community.org/wiki/Submitting_A_Patch
- commit messages https://wiki.koha-community.org/wiki/Commit_messages

There is a bit of a hurdle to get these things in!

Feel free to ask for help on how to do this on the bug, Development email list, or IRC (there are times where there are more people around to help - day time European and US time zones are probably better, it is normally very quiet over the weekend). 

I'm not a developer, so I don't think I will be much help in getting your patch formatted and attached to Bugzilla the right way...

I'm also not sure whether the variable names need to be English (as per comment #11 and #12) - something some of the developers will be able to answer.

I've changed status to In Discussion in the meantime until it is ready for sign off. 

David Nind
Comment 14 Katrin Fischer 2021-04-17 15:05:29 UTC
Created attachment 119796 [details] [review]
Bug 22371: Add MARC21 cataloguing plugin to generate Cutter-Sanborn

To associate the plugin with the cutter field, you must set the 'cutter.pl'
plugin in your MARC framework. this can be done through the following steps:

1. Navigate to More > Administration > MARC bibliographic framework;
2. On the framework which you want to use de plugin, click on Action > MARC Structure;
3. On the field to be associated with the plugin, click on Actions > Subfields;
4. Select the tab corresponding to the cutter subfield;
5. On the "Other options (choose one)" panel, select "cutter.pl" in "Plugin" dropdown menu, and save changes.
Comment 15 Katrin Fischer 2021-04-17 15:05:48 UTC
I've turned this into a patch file, but haven't tested it. Please try it out!
Comment 16 David Nind 2021-04-21 20:48:47 UTC
(In reply to Katrin Fischer from comment #15)
> I've turned this into a patch file, but haven't tested it. Please try it out!

Thanks Katrin! The patch applies, and I will have a go at testing.
Comment 17 David Nind 2021-04-21 20:52:14 UTC
Created attachment 119978 [details] [review]
Bug 22371: Add MARC21 cataloguing plugin to generate Cutter-Sanborn

To associate the plugin with the cutter field, you must set the 'cutter.pl'
plugin in your MARC framework. this can be done through the following steps:

1. Navigate to More > Administration > MARC bibliographic framework;
2. On the framework which you want to use de plugin, click on Action > MARC Structure;
3. On the field to be associated with the plugin, click on Actions > Subfields;
4. Select the tab corresponding to the cutter subfield;
5. On the "Other options (choose one)" panel, select "cutter.pl" in "Plugin" dropdown menu, and save changes.

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 David Nind 2021-04-21 21:06:36 UTC
I'm not a cataloguer, and don't understand all the nuances here, so it may pay for someone familiar with this to review as well.

Testing notes:
- Followed the test plan
- Added the cutter plugin to 050$a (most likely this isn't technically correct, but it shows the code being generated by cutter.pl)
- Used koha-testing-docker and the sample data, tested with a couple of records
- Programming Perl / Tom Christiansen, Brian D. Foy & Larry Wall. (Record number 262) 
  . classification code generated: C555p (C = first letter of author; 555 = from table in source code from surname; p = first letter of the title)
  . changed indicator 2 for 245 to 4: code generated = C555r (next character in the title after 4 characters, that is, the 5th character)
- Perl Better Practices (Record number 191):
  . added corporate author to 110$a (1151 Academia Sinica, Nanking. Inst. of Soil Science)
  . classification code generated: A168p (A = first letter of author; 168 = from table in source code for aca; p = first letter of the title)
Comment 19 Katrin Fischer 2021-05-09 12:40:32 UTC
I really like this and always happy to have new contribs, but I am worried about something in the behaviour of this plugin.

I've also tried linking it to 050$a. When I import a record with a 050$a set already or open a record that already has it and click into the field or tab through the fields, the plugin is immediately triggered, killing the original value.

I think we need this to trigger only 'on demand' or when the field is empty to avoid unintentional data loss.