Changeset 461 for trunk/gsdl/perllib


Ignore:
Timestamp:
1999-08-13T16:21:40+12:00 (25 years ago)
Author:
sjboddie
Message:

added ability to add collection-level metadata with collectionmeta
field in collect.cfg

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/colcfg.pm

    r139 r461  
    2727                    'archivedir|cachedir|builddir|textindex|removeold)$',
    2828            '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
    29             '^(subcollection)$');
     29            '^(subcollection|collectionmeta)$');
    3030}
    3131
     
    3737                    'archivedir|cachedir|builddir|textindex|removeold)$',
    3838            '^(maintainer|languages|indexsubcollections|indexes|plugins)$',
    39             '^(subcollection)$');
     39            '^(subcollection|collectionmeta)$');
    4040}
    4141
  • trunk/gsdl/perllib/mgbuilder.pm

    r378 r461  
    504504    $self->{'buildproc'}->reset();
    505505
     506    if (defined $self->{'collect_cfg'}->{'collectionmeta'}) {
     507
     508    if (!defined $self->{'index_mapping'}) {
     509        $self->{'index_mapping'} =
     510        $self->create_index_mapping ($self->{'collect_cfg'}->{'indexes'});
     511    }
     512
     513    print PIPEOUT "[collection]\n";
     514
     515    foreach $cmeta (keys (%{$self->{'collect_cfg'}->{'collectionmeta'}})) {
     516        if ($cmeta =~ s/^\.//) {
     517        if (defined $self->{'index_mapping'}->{$cmeta}) {
     518            print PIPEOUT "<$self->{'index_mapping'}->{$cmeta}>" .
     519            $self->{'collect_cfg'}->{'collectionmeta'}->{".$cmeta"} . "\n";
     520        } else {
     521            print STDERR "mgbuilder: warning bad collectionmeta option '$cmeta' - ignored\n";
     522        }
     523        } else {
     524        print PIPEOUT "<$cmeta>$self->{'collect_cfg'}->{'collectionmeta'}->{$cmeta}\n";
     525        }
     526    }
     527    print PIPEOUT "\n" . ('-' x 70) . "\n";
     528
     529    }
     530   
     531
    506532    &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
    507533           "", {}, $self->{'buildproc'}, $self->{'maxdocs'});
Note: See TracChangeset for help on using the changeset viewer.