Bug 37486

Summary: Selectively populate OAI-PMH set by set_id using build_oai_sets.pl
Product: Koha Reporter: David Cook <dcook>
Component: Web servicesAssignee: David Cook <dcook>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, lisette
Version: MainKeywords: no-sandbox
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement adds an "-s" parameter to build_oai_sets.pl, so that you can selectively build OAI-PMH sets. This is useful when you have many sets, and you just need to build or rebuild one set. For example, misc/migration_tools/build_oai_sets.pl -v -s XXXX (where XXXX = the set ID)
Version(s) released in:
Circulation function:
Attachments: Bug 37486: Only build OAI-PMH set for one set at a time
Bug 37486: Tidy
Bug 37486: Only build OAI-PMH set for one set at a time
Bug 37486: Tidy

Description David Cook 2024-07-26 02:17:44 UTC
There are times where you just want to rebuild 1 OAI-PMH set, so it would be good to have build_oai_sets.pl use a param like --spec or --set to just work with one set at a time.
Comment 1 David Cook 2024-12-09 05:13:03 UTC
Created attachment 175286 [details] [review]
Bug 37486: Only build OAI-PMH set for one set at a time

This change adds a "-s" parameter to build_oai_sets.pl, so that
you can selectively build OAI-PMH sets.

This is useful when you have many sets, and you just need
to build or rebuild 1 set.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/admin/oai_sets.pl
2. Create setA and setB
3. Add mapping for setA:
245$a is equal to Gairm.
4. Add mapping for setB:
245$a is equal to Continuous delivery /
5. In the database, run the following SQL:
select * from oai_sets;

6. Identify the ID for setB
7. Run the following command where XXXX is the ID for setB:
perl misc/migration_tools/build_oai_sets.pl -v -s XXXX

8. Note that the only data added to the "oai_sets_biblios"
table is for setB

9. prove t/db_dependent/OAI/Sets.t
Comment 2 David Cook 2024-12-09 05:13:05 UTC
Created attachment 175287 [details] [review]
Bug 37486: Tidy
Comment 3 David Nind 2025-01-09 10:08:40 UTC
Created attachment 176287 [details] [review]
Bug 37486: Only build OAI-PMH set for one set at a time

This change adds a "-s" parameter to build_oai_sets.pl, so that
you can selectively build OAI-PMH sets.

This is useful when you have many sets, and you just need
to build or rebuild 1 set.

Test plan:
0. Apply the patch
1. Go to http://localhost:8081/cgi-bin/koha/admin/oai_sets.pl
2. Create setA and setB
3. Add mapping for setA:
245$a is equal to Gairm.
4. Add mapping for setB:
245$a is equal to Continuous delivery /
5. In the database, run the following SQL:
select * from oai_sets;

6. Identify the ID for setB
7. Run the following command where XXXX is the ID for setB:
perl misc/migration_tools/build_oai_sets.pl -v -s XXXX

8. Note that the only data added to the "oai_sets_biblios"
table is for setB

9. prove t/db_dependent/OAI/Sets.t

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-01-09 10:08:43 UTC
Created attachment 176288 [details] [review]
Bug 37486: Tidy

Signed-off-by: David Nind <david@davidnind.com>