From 1c77dcdcf252a9ed9fb3d09aecf995f9ced96399 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 25 Feb 2005 23:56:17 +0000 Subject: [PATCH] lots of cleanup... no testing yet, no data to test git-svn-id: svn://svn.open-ils.org/ILS/trunk@134 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Storage.pm | 106 ++----- .../OpenILS/Application/Storage/CDBI.pm | 34 ++- .../OpenILS/Application/Storage/CDBI/actor.pm | 16 +- .../OpenILS/Application/Storage/CDBI/asset.pm | 13 +- .../Application/Storage/CDBI/biblio.pm | 29 +- .../Application/Storage/CDBI/config.pm | 5 +- .../Application/Storage/CDBI/metabib.pm | 5 +- .../OpenILS/Application/Storage/Driver/Pg.pm | 267 ++++++++---------- .../OpenILS/Application/Storage/FTS.pm | 14 +- .../OpenILS/Application/Storage/Publisher.pm | 5 + 10 files changed, 258 insertions(+), 236 deletions(-) create mode 100644 Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm index 1eea8e22d9..1878db8b10 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm @@ -5,120 +5,64 @@ use base qw/OpenSRF::Application/; use OpenSRF::EX qw/:try/; use OpenSRF::Utils::Logger qw/:level/; -my $log = "OpenSRF::Utils::Logger"; +# Pull this in so we can adjust it's @ISA +use OpenILS::Application::Storage::CDBI; -sub DESTROY {}; +use OpenILS::Application::Storage::FTS; -our $_db_driver; -our $_db_params; +# Suck in the method publishing modules +use OpenILS::Application::Storage::Publisher; -sub driver { - return $_db_driver; -} +# the easy way to get to the logger... +my $log = "OpenSRF::Utils::Logger"; + +sub DESTROY {}; sub initialize { - return $_db_driver if (defined $_db_driver); + my $conf = OpenSRF::Utils::SettingsClient->new; $log->debug('Initializing ' . __PACKAGE__ . '...', DEBUG); - my $driver = $conf->get_value( apps => storage => app_settings => databases => 'driver'); - my $_db_params = $conf->get_value( apps => storage => app_settings => databases => 'database'); + my $driver = "OpenILS::App::Storage::Driver::". + $conf->config_value( apps => storage => app_settings => databases => 'driver'); - $_db_driver = "OpenILS::App::Storage::Driver::$driver"; + eval "use $driver;"; + throw OpenILS::EX::Config ( "Can't load $driver! : $@" ) if ($@); - eval "use $_db_driver;"; - throw OpenILS::EX::Config ( "Can't load $_db_driver! : $@" ) if ($@); + @OpenILS::Application::Storage::CDBI::ISA = ( $driver ); - $_db_driver->initialize if ($_db_driver->can('initialize')); + OpenILS::Application::Storage::CDBI->initialize if ($driver->can('initialize')); - push @OpenILS::Application::Storage::CDBI::ISA, $_db_driver; } sub child_init { + my $conf = OpenSRF::Utils::SettingsClient->new; + $log->debug('Running child_init for ' . __PACKAGE__ . '...', DEBUG); - $_db_driver->child_init if ($_db_driver->can('child_init')); + + OpenILS::Application::Storage::CDBI->child_init( + $conf->config_value( apps => storage => app_settings => databases => 'database') + ); - return 1 if ($_db_driver->db_Main($_db_params)); + return 1 if ($_db_driver->db_Main()); return 0; } -sub getBiblioFieldMaps { - my $self = shift; - my $client = shift; - my $id = shift; - $log->debug(" Executing [".$self->method."] as [".$self->api_name."]",INTERNAL); - - if ($self->api_name =~ /by_class$/) { - if ($id) { - return _cdbi2Hash( config::metarecord_field_map->search( fieldclass => $id ) ); - } else { - throw OpenSRF::EX::InvalidArg ('Please give me a Class to look up!'); - } - } else { - if ($id) { - return _cdbi2Hash( config::metarecord_field_map->retrieve( $id ) ); - } else { - return _cdbi_list2AoH( config::metarecord_field_map->retrieve_all ); - } - } -} -__PACKAGE__->register_method( - method => 'getBiblioFieldMaps', - api_name => 'open-ils.storage.config.metarecord_field', - argc => 1, -); -__PACKAGE__->register_method( - method => 'getBiblioFieldMaps', - api_name => 'open-ils.storage.config.metarecord_field.list', - argc => 0, -); -__PACKAGE__->register_method( - method => 'getBiblioFieldMaps', - api_name => 'open-ils.storage.config.metarecord_field.list.by_class', - argc => 1, -); - - -sub getBiblioFieldMapClasses { - my $self = shift; - my $client = shift; - my $id = shift; - - $log->debug(" Executing [".$self->method."] as [".$self->api_name."]",INTERNAL); - - if ($id) { - return _cdbi2Hash( config::metarecord_field_class_map->retrieve( $id ) ); - } else { - return _cdbi_list2AoH( config::metarecord_field_class_map->retrieve_all ); - } -} -__PACKAGE__->register_method( - method => 'getBiblioFieldMapClasses', - api_name => 'open-ils.storage.config.metarecord_field_class', - argc => 1, -); -__PACKAGE__->register_method( - method => 'getBiblioFieldMapClasses', - api_name => 'open-ils.storage.config.metarecord_field_class.list', - argc => 0, -); sub _cdbi2Hash { + my $self = shift; my $obj = shift; return { map { ( $_ => $obj->$_ ) } $obj->columns }; } sub _cdbi_list2AoH { + my $self = shift; my @objs = @_; return [ map { _cdbi2oilsHash($_) } @objs ]; } -#------------------------------------------------------------------------------- -package OpenILS::App::Storage::CDBI; -use vars qw/@ISA/; - 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm index cf88d71db3..35cfe010ca 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm @@ -1,4 +1,36 @@ -package OpenILS::App::Storage::CDBI; +package OpenILS::Application::Storage::CDBI; use vars qw/@ISA/; +use Class::DBI; +use base qw/Class::DBI/; + +our $VERSION = 1; + +use OpenILS::Application::Storage::CDBI::actor; +use OpenILS::Application::Storage::CDBI::asset; +use OpenILS::Application::Storage::CDBI::biblio; + + +#------------------------------------------------------------------------------- +asset::copy->has_a( call_number => 'asset::call_number' ); +#------------------------------------------------------------------------------- +asset::call_number->has_a( record => 'biblio::record_entry' ); +asset::call_number->has_many( copies => 'asset::copy' ); +#------------------------------------------------------------------------------- + + +#------------------------------------------------------------------------------- +biblio::record_note->has_a( record => 'biblio::record_entry' ); +#------------------------------------------------------------------------------- +biblio::record_entry->might_have( note => 'biblio::record_note' ); +biblio::record_entry->has_many( nodes => 'biblio::record_node' ); +biblio::record_entry->has_many( call_numbers => 'asset::call_number' ); +#biblio::record_entry->has_a( metarecord => 'metabib::metarecord' ); +#biblio::record_entry->has_many( field_entries => 'metabib::field_entry' ); +#------------------------------------------------------------------------------- +biblio::record_node->has_a( owner_doc => 'biblio::record_entry' ); +biblio::record_node->has_a( parent_node => 'biblio::record_node::subnode', + inflate => sub { return biblio::record_node::subnode::_load(@_) }); +#------------------------------------------------------------------------------- + 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/actor.pm index 299ed9c481..980eb2c1f2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/actor.pm @@ -1,12 +1,26 @@ +package OpenILS::Application::Storage::CDBI::actor; +our $VERSION = 1; + #------------------------------------------------------------------------------- package actor; -use base qw/OpenILS::App::Storage::CDBI/; +use base qw/OpenILS::Application::Storage::CDBI/; #------------------------------------------------------------------------------- package actor::usr; use base qw/actor/; + +__PACKAGE__->table( 'actor_usr' ); +__PACKAGE__->columns( All => qw/id usrid usrname email prefix first_given_name + second_given_name family_name suffix address + home_ou gender dob active master_account + super_user usrgoup passwd/ ); + #------------------------------------------------------------------------------- package actor::org_unit_type; use base qw/actor/; + +__PACKAGE__->table( 'actor_org_unit_type' ); +__PACKAGE__->columns( All => qw/id name depth parent can_have_users/); + #------------------------------------------------------------------------------- package actor::org_unit; use base qw/actor/; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/asset.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/asset.pm index 38db5445e0..20af1e49d9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/asset.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/asset.pm @@ -1,12 +1,23 @@ +package OpenILS::Application::Storage::CDBI::asset; +our $VERSION = 1; + #------------------------------------------------------------------------------- package asset; -use base qw/OpenILS::App::Storage::CDBI/; +use base qw/OpenILS::Application::Storage::CDBI/; #------------------------------------------------------------------------------- package asset::call_number; use base qw/asset/; + +__PACKAGE__->table( 'asset_call_number' ); +__PACKAGE__->columns( All => qw/id record label/ ); + #------------------------------------------------------------------------------- package asset::copy; use base qw/asset/; + +__PACKAGE__->table( 'asset_copy' ); +__PACKAGE__->columns( All => qw/id call_number barcode/ ); + #------------------------------------------------------------------------------- 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm index 07999edd71..6c08cea5c9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/biblio.pm @@ -1,15 +1,42 @@ +package OpenILS::Application::Storage::CDBI::biblio; +our $VERSION = 1; + #------------------------------------------------------------------------------- package biblio; -use base qw/OpenILS::App::Storage::CDBI/; +use base qw/OpenILS::Application::Storage::CDBI/; #------------------------------------------------------------------------------- package biblio::record_entry; use base qw/biblio/; +#use OpenILS::Application::Storage::CDBI::asset; + +biblio::record_entry->table( 'biblio_record_entry' ); +biblio::record_entry->columns( All => qw/id tcn_source tcn_value metarecord + creator editor create_date edit_date + source active deleted/ ); + #------------------------------------------------------------------------------- +package biblio::record_node::subnode; +sub _load { + my $intra_doc_id = shift; + my $owner_doc = shift()->owner_doc; + return (biblio::record_node->search( owner_doc => $owner_doc, intra_doc_id => $intra_doc_id ))[0]; +} + package biblio::record_node; use base qw/biblio/; + +biblio::record_node->table( 'biblio_record_data' ); +biblio::record_node->columns( All => qw/id owner_doc intra_doc_id parent_node node_type namespace_uri name value/ ); + #------------------------------------------------------------------------------- package biblio::record_note; use base qw/biblio/; +biblio::record_note->table( 'biblio_record_note' ); +biblio::record_note->columns( All => qw/id record value creator editor create_date edit_date/ ); +biblio::record_note->columns( Stringify => qw/value/ ); + +#------------------------------------------------------------------------------- + 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm index 6e62413a2c..7607d50005 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm @@ -1,6 +1,9 @@ +package OpenILS::Application::Storage::CDBI::config; +our $VERSION = 1; + #------------------------------------------------------------------------------- package config; -use base qw/OpenILS::App::Storage::CDBI/; +use base qw/OpenILS::Application::Storage::CDBI/; #------------------------------------------------------------------------------- 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm index 58023503ba..92125e3bd5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm @@ -1,6 +1,9 @@ +package OpenILS::Application::Storage::CDBI::metabib; +our $VERSION = 1; + #------------------------------------------------------------------------------- package metabib; -use base qw/OpenILS::App::Storage::CDBI/; +use base qw/OpenILS::Application::Storage::CDBI/; #------------------------------------------------------------------------------- 1; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm index 41ade711cb..9634f22364 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg.pm @@ -1,168 +1,151 @@ -#------------------------------------------------------------------------------- -use Class::DBI; -package Class::DBI; - -sub search_fti { - my $self = shift; - my @args = @_; - if (ref($args[-1]) eq 'HASH') { - $args[-1]->{_placeholder} = "to_tsquery('default',?)"; - } else { - push @args, {_placeholder => "to_tsquery('default',?)"}; +{ # Based on the change to Class::DBI in OpenILS::Application::Storage. This will + # allow us to use TSearch2 via a simple cdbi "search" interface. + #------------------------------------------------------------------------------- + use Class::DBI; + package Class::DBI; + + sub search_fti { + my $self = shift; + my @args = @_; + if (ref($args[-1]) eq 'HASH') { + $args[-1]->{_placeholder} = "to_tsquery('default',?)"; + } else { + push @args, {_placeholder => "to_tsquery('default',?)"}; + } + $self->_do_search("@@" => @args); } - $self->_do_search("@@" => @args); } -#------------------------------------------------------------------------------- -package OpenILS::Application::Storage::FTS; -use OpenSRF::Utils::Logger qw/:level/; -my $log = 'OpenSRF::Utils::Logger'; +{ # Every driver needs to provide a 'compile()' method to OpenILS::Application::Storage::FTS. + # If that driver wants to support FTI, that is... + #------------------------------------------------------------------------------- + package OpenILS::Application::Storage::FTS; + use OpenSRF::Utils::Logger qw/:level/; + my $log = 'OpenSRF::Utils::Logger'; -sub compile { - my $self = shift; - my $term = shift; + sub compile { + my $self = shift; + my $term = shift; - $self = ref($self) || $self; - $self = bless {} => $self; + $self = ref($self) || $self; + $self = bless {} => $self; - $self->decompose($term); + $self->decompose($term); - my $newterm = join('&', $self->words); + my $newterm = join('&', $self->words); - if ($self->nots) { - $newterm = '('.$newterm.')&('. join('|', $self->nots) . ')'; - } + if ($self->nots) { + $newterm = '('.$newterm.')&('. join('|', $self->nots) . ')'; + } - $newterm = OpenILS::Application::Storage->driver->quote($newterm); + $newterm = OpenILS::Application::Storage->driver->quote($newterm); - $self->{fts_query} = ["to_tsquery('default',$newterm)"]; - $self->{fts_query_nots} = []; - $self->{fts_op} = '@@'; + $self->{fts_query} = ["to_tsquery('default',$newterm)"]; + $self->{fts_query_nots} = []; + $self->{fts_op} = '@@'; - return $self; + return $self; + } } -#------------------------------------------------------------------------------- -package OpenILS::Application::Storage::Driver::Pg; -use base qw/Class::DBI DBD::Pg OpenILS::Application::Storage/; -use DBI; -use DBD::Pg; -use OpenSRF::Utils::Logger qw/:level/; - -__PACKAGE__->set_sql( retrieve_limited => 'SELECT * FROM __TABLE__ ORDER BY id LIMIT ?' ); - -my $_dbh; +{ # The driver package itself just needs a db_Main method for Class::DBI to call. + # any other fixups can go in here too... Also, the drivers should subclass the + # DBI driver that they are wrapping, or provide a 'quote()' method that calls + # the DBD::xxx::quote() method on FTI's behalf. + # + # The dirver MUST be a subclass of Class::DBI. + #------------------------------------------------------------------------------- + package OpenILS::Application::Storage::Driver::Pg; + use base qw/Class::DBI OpenILS::Application::Storage/; + use DBI; + use DBD::Pg; + use OpenSRF::Utils::Logger qw/:level/; + + __PACKAGE__->set_sql( retrieve_limited => 'SELECT * FROM __TABLE__ ORDER BY id LIMIT ?' ); + + my $_db_params; + sub child_init { + my $self = shift; + $_db_params = shift; + } -sub db_Main { - return $_dbh if (defined $_dbh and $_dbh->ping); + my $_dbh; + sub db_Main { + my $self = shift; - my $self = shift; + return $_dbh if (defined $_dbh and $_dbh->ping); - my %args = (%OpenILS::Application::Storage::_db_params,@_); + my %attrs = ( %{$self->_default_attributes}, + RootClass => 'DBIx::ContextualFetch', + ShowErrorStatement => 1, + RaiseError => 1, + AutoCommit => 1, + PrintError => 1, + Taint => 1, + pg_enable_utf8 => 1, + FetchHashKeyName => 'NAME_lc', + ChopBlanks => 1, + ); - my %attrs = ( %{$self->_default_attributes}, - RootClass => 'DBIx::ContextualFetch', - ShowErrorStatement => 1, - RaiseError => 1, - AutoCommit => 1, - PrintError => 1, - Taint => 1, - pg_enable_utf8 => 1, - FetchHashKeyName => 'NAME_lc', - ChopBlanks => 1, - ); + $log->debug(" Default attributes for this DB connection are:\n\t".join("\n\t",map { "$_\t==> $attrs{$_}" } keys %attrs), INTERNAL); - $log->debug(" Default attributes for this DB connection are:\n\t".join("\n\t",map { "$_\t==> $attrs{$_}" } keys %attrs), INTERNAL); + $_dbh = DBI->connect( "dbi:Pg:host=$_db_params{host};dbname=$_db_params{database}",$_db_params{user},$_db_params{pw}, \%attrs ); + $_dbh->do("SET CLIENT_ENCODING TO 'SQL_ASCII';"); - $_dbh = DBI->connect( "dbi:Pg:host=$args{host};dbname=$args{database}",$args{user},$args{pw}, \%attrs ); - $_dbh->do("SET CLIENT_ENCODING TO 'SQL_ASCII';"); + return $_dbh; + } - return $_dbh; + sub quote { + return $_dbh->quote(@_) + } } -#------------------------------------------------------------------------------- -package asset::call_number; -use base qw/OpenILS::App::Storage::CDBI/; - -__PACKAGE__->table( 'asset.call_number' ); -__PACKAGE__->sequence( 'asset.call_number_id_seq' ); -__PACKAGE__->columns( Primary => qw/id/ ); -__PACKAGE__->columns( Essential => qw/record/ ); - -__PACKAGE__->has_a( record => 'biblio::record_entry' ); -__PACKAGE__->has_many( copies => 'asset::copy' ); - - - -#------------------------------------------------------------------------------- -package asset::copy; -use base qw/OpenILS::App::Storage::CDBI/; - -__PACKAGE__->table( 'asset.copy' ); -__PACKAGE__->sequence( 'asset.copy_id_seq' ); -__PACKAGE__->columns( Primary => qw/id/ ); -__PACKAGE__->columns( Essential => qw/call_number barcode/ ); - -#__PACKAGE__->has_a( call_number => 'asset::call_number' ); - - - -#------------------------------------------------------------------------------- -package biblio::record_entry; -use base qw/OpenILS::App::Storage::CDBI/; - -__PACKAGE__->table( 'biblio.record_entry' ); -__PACKAGE__->sequence( 'biblio.record_entry_id_seq' ); -__PACKAGE__->columns( Primary => qw/id/ ); - -#__PACKAGE__->columns( Essential => qw/tcn_source tcn_value metarecord creator editor create_date edit_date source active deleted/ ); -__PACKAGE__->columns( Others => qw/tcn_source tcn_value metarecord creator editor create_date edit_date source active deleted/ ); - -__PACKAGE__->has_a( note => 'biblio::record_note' ); -__PACKAGE__->has_many( nodes => 'biblio::record_data' ); - -#__PACKAGE__->has_a( metarecord => 'metabib::metarecord' ); -#__PACKAGE__->has_many( field_entries => 'metabib::field_entry' ); -#__PACKAGE__->has_many( call_numbers => 'asset::call_number' ); - -#------------------------------------------------------------------------------- -package biblio::record_node::subnode; -sub _load { - my $intra_doc_id = shift; - my $owner_doc = shift()->owner_doc; - return (biblio::record_node->search( owner_doc => $owner_doc, intra_doc_id => $intra_doc_id ))[0]; +{ + #--------------------------------------------------------------------- + package asset::call_number; + + __PACKAGE__->table( 'asset.call_number' ); + __PACKAGE__->sequence( 'asset.call_number_id_seq' ); + + #--------------------------------------------------------------------- + package asset::copy; + + __PACKAGE__->table( 'asset.copy' ); + __PACKAGE__->sequence( 'asset.copy_id_seq' ); + + #--------------------------------------------------------------------- + package biblio::record_entry; + + __PACKAGE__->table( 'biblio.record_entry' ); + __PACKAGE__->sequence( 'biblio.record_entry_id_seq' ); + + #--------------------------------------------------------------------- + package biblio::record_node; + + __PACKAGE__->table( 'biblio.record_data' ); + __PACKAGE__->sequence( 'biblio.record_data_id_seq' ); + + #--------------------------------------------------------------------- + package biblio::record_note; + + __PACKAGE__->table( 'biblio.record_note' ); + __PACKAGE__->sequence( 'biblio.record_note_id_seq' ); + + #--------------------------------------------------------------------- + package actor::usr; + + __PACKAGE__->table( 'actor.usr' ); + __PACKAGE__->sequence( 'actor.usr_id_seq' ); + + #--------------------------------------------------------------------- + package actor::org_unit_type; + + __PACKAGE__->table( 'actor.org_unit_type' ); + __PACKAGE__->sequence( 'actor.org_unit_type_id_seq' ); + + #--------------------------------------------------------------------- + } -package biblio::record_node; -use base qw/OpenILS::App::Storage::CDBI/; - -__PACKAGE__->table( 'biblio.record_data' ); -__PACKAGE__->sequence( 'biblio.record_data_id_seq' ); -__PACKAGE__->columns( Primary => qw/id/ ); -__PACKAGE__->columns( Essential => qw/owner_doc intra_doc_id parent_node node_type namespace_uri name value/ ); - -__PACKAGE__->has_a( owner_doc => 'biblio::record_entry' ); -__PACKAGE__->has_a( - parent_node => 'biblio::record_node::subnode', - inflate => sub { return biblio::record_node::subnode::_load(@_) }, -); - - -#------------------------------------------------------------------------------- -package biblio::record_note; -use base qw/OpenILS::App::Storage::CDBI/; - -__PACKAGE__->table( 'biblio.record_note' ); -__PACKAGE__->sequence( 'biblio.record_note_id_seq' ); -__PACKAGE__->columns( Primary => qw/id/ ); -__PACKAGE__->columns( Stringify => qw/value/ ); -__PACKAGE__->columns( Essential => qw/record value creator editor create_date edit_date/ ); - -__PACKAGE__->has_a( record_entry => 'biblio::record_entry' ); - -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- - 1; - diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm index 848069309a..d9aff0c535 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/FTS.pm @@ -1,9 +1,9 @@ -use OpenILS::Utils::Logger qw/:level/; -my $log = 'OpenILS::Utils::Logger'; +use OpenSRF::Utils::Logger qw/:level/; +my $log = 'OpenSRF::Utils::Logger'; #------------------------------------------------------------------------------- package OpenILS::Application::Storage::FTS; -use OpenILS::Utils::Logger qw/:level/; +use OpenSRF::Utils::Logger qw/:level/; sub compile { die "You must override me somewhere!"; @@ -38,13 +38,13 @@ sub decompose { $self->{ fts_op } = 'ILIKE'; for my $part ( @words, @parts ) { - $part = OpenILS::Application::Storage->driver->quote($part); - push @{ $self->{ fts_query }, "'\%$part\%'"; + $part = OpenILS::Application::Storage::CDBI->quote($part); + push @{ $self->{ fts_query } }, "'\%$part\%'"; } for my $part ( @nots ) { - $part = OpenILS::Application::Storage->driver->quote($part); - push @{ $self->{ fts_query_not }, "'\%$part\%'"; + $part = OpenILS::Application::Storage::CDBI->quote($part); + push @{ $self->{ fts_query_not } }, "'\%$part\%'"; } $self->{ raw } = $term; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm new file mode 100644 index 0000000000..3a329fcc68 --- /dev/null +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher.pm @@ -0,0 +1,5 @@ +package OpenILS::Application::Storage::Publisher; +our $VERSION = 1; +use OpenILS::Application::Storage::Publisher::config; +use OpenILS::Application::Storage::Publisher::biblio; + -- 2.43.2