added series stuff and updated hint for actor::stat_cat*
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 10 May 2005 15:06:57 +0000 (15:06 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 10 May 2005 15:06:57 +0000 (15:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@691 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/WORM.pm
Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm

index 48cc098..d667899 100644 (file)
@@ -358,6 +358,9 @@ sub modify_from_fieldmapper {
        metabib::keyword_field_entry->has_a( source => 'biblio::record_entry' );
        metabib::keyword_field_entry->has_a( field => 'config::metabib_field' );
        
+       metabib::series_field_entry->has_a( source => 'biblio::record_entry' );
+       metabib::series_field_entry->has_a( field => 'config::metabib_field' );
+       
        metabib::metarecord_source_map->has_a( metarecord => 'metabib::metarecord' );
        metabib::metarecord_source_map->has_a( source => 'biblio::record_entry' );
 
@@ -396,6 +399,7 @@ sub modify_from_fieldmapper {
        biblio::record_entry->has_many( author_field_entries => 'metabib::author_field_entry' );
        biblio::record_entry->has_many( subject_field_entries => 'metabib::subject_field_entry' );
        biblio::record_entry->has_many( keyword_field_entries => 'metabib::keyword_field_entry' );
+       biblio::record_entry->has_many( series_field_entries => 'metabib::series_field_entry' );
 
        metabib::metarecord->has_many( source_records => [ 'metabib::metarecord_source_map' => 'source'] );
 
index 963eec6..4930a30 100644 (file)
@@ -48,6 +48,14 @@ metabib::keyword_field_entry->columns( Primary => qw/id/ );
 metabib::keyword_field_entry->columns( Essential => qw/field value source/ );
 
 #-------------------------------------------------------------------------------
+package metabib::series_field_entry;
+use base qw/metabib/;
+
+metabib::series_field_entry->table( 'metabib_series_field_entry' );
+metabib::series_field_entry->columns( Primary => qw/id/ );
+metabib::series_field_entry->columns( Essential => qw/field value source/ );
+
+#-------------------------------------------------------------------------------
 package metabib::metarecord_source_map;
 use base qw/metabib/;
 
index 2a1c8fe..159c245 100644 (file)
        );
 
        #-------------------------------------------------------------------------------
+       package metabib::series_field_entry;
+
+       metabib::series_field_entry->table( 'metabib.series_field_entry' );
+       metabib::series_field_entry->sequence( 'metabib.series_field_entry_id_seq' );
+       metabib::series_field_entry->columns( 'FTS' => 'index_vector' );
+
+       OpenILS::Application::Storage->register_method(
+               api_name        => 'open-ils.storage.direct.metabib.series_field_entry.batch.create',
+               method          => 'copy_create',
+               api_level       => 1,
+               'package'       => 'OpenILS::Application::Storage',
+               cdbi            => 'metabib::series_field_entry',
+       );
+
+       #-------------------------------------------------------------------------------
 
        #-------------------------------------------------------------------------------
        #package metabib::title_field_entry_source_map;
index 1364e10..1686026 100644 (file)
@@ -224,7 +224,7 @@ sub search_class_fts {
        return undef;
 }
 
-for my $class ( qw/title author subject keyword/ ) {
+for my $class ( qw/title author subject keyword series/ ) {
        __PACKAGE__->register_method(
                api_name        => "open-ils.storage.metabib.$class.search_fts.metarecord",
                method          => 'search_class_fts',
@@ -324,7 +324,7 @@ sub search_class_fts_count {
        return $recs;
 
 }
-for my $class ( qw/title author subject keyword/ ) {
+for my $class ( qw/title author subject keyword series/ ) {
        __PACKAGE__->register_method(
                api_name        => "open-ils.storage.metabib.$class.search_fts.metarecord_count",
                method          => 'search_class_fts_count',
index fb1b858..ddd84d5 100644 (file)
@@ -77,7 +77,7 @@ my @fp_mods_xpath = (
                        },
        ],
 
-       '//mods:mods/mods:relatedItem[@type!="host"]' => [
+       '//mods:mods/mods:relatedItem[@type!="host" and @type!="series"]' => [
                        title   => {
                                        xpath   => [
                                                        '//mods:mods/mods:relatedItem/mods:titleInfo[mods:title and (@type="uniform")]',
@@ -189,6 +189,7 @@ my $rm_old_tr;
 my $rm_old_ar;
 my $rm_old_sr;
 my $rm_old_kr;
+my $rm_old_ser;
 
 my $fr_create;
 my $rd_create;
@@ -204,6 +205,7 @@ my %descriptor_code = (
        cat_form => 'substr($ldr,18,1)',
        pub_status => 'substr($ldr,5,1)',
        item_lang => 'substr($oo8,35,3)',
+       #lit_form => '(substr($ldr,6,1) =~ /^(?:f|g|i|m|o|p|r)$/) ? substr($oo8,33,1) : "0"',
        audience => 'substr($oo8,22,1)',
 );
 
@@ -254,6 +256,8 @@ sub wormize {
                unless ($rm_old_sr);
        $rm_old_kr = $self->method_lookup( 'open-ils.storage.direct.metabib.keyword_field_entry.mass_delete')
                unless ($rm_old_kr);
+       $rm_old_ser = $self->method_lookup( 'open-ils.storage.direct.metabib.series_field_entry.mass_delete')
+               unless ($rm_old_ser);
        $rd_create = $self->method_lookup( 'open-ils.storage.direct.metabib.record_descriptor.batch.create')
                unless ($rd_create);
        $fr_create = $self->method_lookup( 'open-ils.storage.direct.metabib.full_rec.batch.create')
@@ -266,6 +270,8 @@ sub wormize {
                unless ($$create{subject});
        $$create{keyword} = $self->method_lookup( 'open-ils.storage.direct.metabib.keyword_field_entry.batch.create')
                unless ($$create{keyword});
+       $$create{series} = $self->method_lookup( 'open-ils.storage.direct.metabib.series_field_entry.batch.create')
+               unless ($$create{series});
 
 
        my ($outer_xact) = $in_xact->run;
@@ -355,6 +361,7 @@ sub wormize {
        $rm_old_ar->run( { source => \@docids } );
        $rm_old_sr->run( { source => \@docids } );
        $rm_old_kr->run( { source => \@docids } );
+       $rm_old_ser->run( { source => \@docids } );
 
        unless ($no_map) {
                my ($sm) = $create_source_map->run(@source_maps);
@@ -383,7 +390,7 @@ sub wormize {
        }
 
        # step 5: insert the new metadata
-       for my $class ( qw/title author subject keyword/ ) {
+       for my $class ( qw/title author subject keyword series/ ) {
                my @md_list = ();
                for my $doc ( @mods_data ) {
                        my ($did) = keys %$doc;
index 4bcfbbe..a7d7906 100644 (file)
@@ -70,10 +70,10 @@ sub _init {
                'Fieldmapper::actor::card'                      => { hint => 'ac'    },
                'Fieldmapper::config::standing'                 => { hint => 'cst'   },
                'Fieldmapper::config::copy_status'              => { hint => 'ccs'   },
-               'Fieldmapper::actor::stat_cat'                  => { hint               => 'asc',
+               'Fieldmapper::actor::stat_cat'                  => { hint               => 'actsc',
                                                                     proto_fields       => { entries => 1 } },
-               'Fieldmapper::actor::stat_cat_entry'            => { hint => 'asce'    },
-               'Fieldmapper::actor::stat_cat_entry_user_map'   => { hint => 'acscecm'  },
+               'Fieldmapper::actor::stat_cat_entry'            => { hint => 'actsce'    },
+               'Fieldmapper::actor::stat_cat_entry_user_map'   => { hint => 'actscecm'  },
                'Fieldmapper::actor::org_unit'                  => { hint               => 'aou',
                                                                     proto_fields       => { children => 1 } },
                'Fieldmapper::actor::org_unit_type'             => { hint               => 'aout',
@@ -128,6 +128,7 @@ sub _init {
                'Fieldmapper::metabib::author_field_entry'      => { hint => 'mafe' },
                'Fieldmapper::metabib::subject_field_entry'     => { hint => 'msfe' },
                'Fieldmapper::metabib::keyword_field_entry'     => { hint => 'mkfe' },
+               'Fieldmapper::metabib::series_field_entry'      => { hint => 'msefe' },
                'Fieldmapper::metabib::full_rec'                => { hint => 'mfr'  },
                'Fieldmapper::metabib::record_descriptor'       => { hint => 'mrd'  },
                'Fieldmapper::metabib::metarecord_source_map'   => { hint => 'mmrsm'},