From 1760e51657936452e3e9153f1bf4c985846889a5 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 30 Aug 2005 15:14:08 +0000 Subject: [PATCH] initial (perl-side) authority support git-svn-id: svn://svn.open-ils.org/ILS/trunk@1770 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Storage/CDBI.pm | 9 ++++ .../Application/Storage/CDBI/authority.pm | 45 +++++++++++++++++++ .../Application/Storage/Driver/Pg/dbi.pm | 42 +++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/authority.pm diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm index 6fcf59c9f9..7ec18e0084 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm @@ -6,6 +6,7 @@ use Class::DBI::AbstractSearch; use OpenILS::Application::Storage::CDBI::actor; use OpenILS::Application::Storage::CDBI::action; use OpenILS::Application::Storage::CDBI::asset; +use OpenILS::Application::Storage::CDBI::authority; use OpenILS::Application::Storage::CDBI::biblio; use OpenILS::Application::Storage::CDBI::config; use OpenILS::Application::Storage::CDBI::metabib; @@ -393,15 +394,20 @@ sub modify_from_fieldmapper { asset::call_number->has_a( creator => 'actor::user' ); asset::call_number->has_a( editor => 'actor::user' ); + authority::record_note->has_a( record => 'authority::record_entry' ); biblio::record_note->has_a( record => 'biblio::record_entry' ); + authority::record_entry->has_a( creator => 'actor::user' ); + authority::record_entry->has_a( editor => 'actor::user' ); biblio::record_entry->has_a( creator => 'actor::user' ); biblio::record_entry->has_a( editor => 'actor::user' ); metabib::metarecord->has_a( master_record => 'biblio::record_entry' ); + authority::record_descriptor->has_a( record => 'authority::record_entry' ); metabib::record_descriptor->has_a( record => 'biblio::record_entry' ); + authority::full_rec->has_a( record => 'authority::record_entry' ); metabib::full_rec->has_a( record => 'biblio::record_entry' ); metabib::title_field_entry->has_a( source => 'biblio::record_entry' ); @@ -449,6 +455,9 @@ sub modify_from_fieldmapper { asset::call_number->has_many( copies => 'asset::copy' ); asset::call_number->has_many( notes => 'asset::call_number_note' ); + authority::record_entry->has_many( record_descriptor => 'authority::record_descriptor' ); + authority::record_entry->has_many( notes => 'authority::record_note' ); + biblio::record_entry->has_many( record_descriptor => 'metabib::record_descriptor' ); biblio::record_entry->has_many( notes => 'biblio::record_note' ); biblio::record_entry->has_many( call_numbers => 'asset::call_number' ); diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/authority.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/authority.pm new file mode 100644 index 0000000000..d5e4499daf --- /dev/null +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/authority.pm @@ -0,0 +1,45 @@ +package OpenILS::Application::Storage::CDBI::authority; +our $VERSION = 1; + +#------------------------------------------------------------------------------- +package authority; +use base qw/OpenILS::Application::Storage::CDBI/; +#------------------------------------------------------------------------------- +package authority::record_entry; +use base qw/authority/; + +authority::record_entry->table( 'authority_record_entry' ); +authority::record_entry->columns( All => qw/id arn_source arn_value creator editor + create_date edit_date source active + deleted marc last_xact_id/ ); + +#------------------------------------------------------------------------------- +package authority::record_note; +use base qw/authority/; + +authority::record_note->table( 'authority_record_note' ); +authority::record_note->columns( All => qw/id record value creator + editor create_date edit_date/ ); +#------------------------------------------------------------------------------- +package authority::full_rec; +use base qw/authority/; + +authority::full_rec->table( 'authority_full_rec' ); +authority::full_rec->columns( Primary => qw/id/ ); +authority::full_rec->columns( Essential => qw/record tag ind1 ind2 subfield value/ ); + +#------------------------------------------------------------------------------- +package authority::record_descriptor; +use base qw/authority/; +#use OpenILS::Application::Storage::CDBI::asset; + +authority::record_descriptor->table( 'authority_rec_descriptor' ); +authority::record_descriptor->columns( Primary => qw/id/ ); +authority::record_descriptor->columns( Essential => qw/record record_status + char_encoding/ ); + +#------------------------------------------------------------------------------- + + +1; + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm index 8d36c58108..a3678aa776 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm @@ -210,6 +210,12 @@ asset::stat_cat_entry_copy_map->table( 'asset.stat_cat_entry_copy_map' ); asset::stat_cat_entry_copy_map->sequence( 'asset.stat_cat_entry_copy_map_id_seq' ); + #--------------------------------------------------------------------- + package authority::record_entry; + + authority::record_entry->table( 'authority.record_entry' ); + authority::record_entry->sequence( 'authority.record_entry_id_seq' ); + #--------------------------------------------------------------------- package biblio::record_entry; @@ -222,6 +228,12 @@ #biblio::record_marc->table( 'biblio.record_marc' ); #biblio::record_marc->sequence( 'biblio.record_marc_id_seq' ); # + #--------------------------------------------------------------------- + package authority::record_note; + + authority::record_note->table( 'authority.record_note' ); + authority::record_note->sequence( 'authority.record_note_id_seq' ); + #--------------------------------------------------------------------- package biblio::record_note; @@ -450,6 +462,20 @@ ); + #------------------------------------------------------------------------------- + package authority::record_descriptor; + + authority::record_descriptor->table( 'authority.rec_descriptor' ); + authority::record_descriptor->sequence( 'authority.rec_descriptor_id_seq' ); + + OpenILS::Application::Storage->register_method( + api_name => 'open-ils.storage.direct.authority.record_descriptor.batch.create', + method => 'copy_create', + api_level => 1, + 'package' => 'OpenILS::Application::Storage', + cdbi => 'authority::record_descriptor', + ); + #------------------------------------------------------------------------------- package metabib::record_descriptor; @@ -467,6 +493,22 @@ #------------------------------------------------------------------------------- + #------------------------------------------------------------------------------- + package authority::full_rec; + + authority::full_rec->table( 'authority.full_rec' ); + authority::full_rec->sequence( 'authority.full_rec_id_seq' ); + authority::full_rec->columns( 'FTS' => 'index_vector' ); + + OpenILS::Application::Storage->register_method( + api_name => 'open-ils.storage.direct.authority.full_rec.batch.create', + method => 'copy_create', + api_level => 1, + 'package' => 'OpenILS::Application::Storage', + cdbi => 'authority::full_rec', + ); + + #------------------------------------------------------------------------------- package metabib::full_rec; -- 2.43.2