Changeset 246


Ignore:
Timestamp:
1999-04-26T11:56:36+12:00 (25 years ago)
Author:
sjboddie
Message:

Now checks collect.cfg for a 'doctype' field and if it finds it it's passed
to the plugins as metadata and goes in the gdbm as 'classifytype' at the
top level of each document.

File:
1 edited

Legend:

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

    r215 r246  
    9999    }
    100100
     101    # set the classifytype to use for displaying documents - if the doctype field hasn't
     102    # been set in the collect.cfg then the receptionist currently defaults to displaying
     103    # documents as 'Book'
     104    if ($self->{'newgdbm'}) {
     105    if (open (COLCFG, $colcfgname)) {
     106        while (defined ($line = &cfgread::read_cfg_line('mgbuilder::COLCFG'))) {
     107        if (scalar(@$line) == 2) {
     108            my $key = shift (@$line);
     109            if ($key eq "doctype") {
     110            $self->{'classifytype'} = shift (@$line);
     111            }
     112        }
     113        }
     114        close (COLCFG);
     115    }
     116    }
     117
    101118    # load up the document processor for building
    102119    # if a buildproc class has been created for this collection, use it
     
    477494    }
    478495    $self->{'buildproc'}->reset();
     496
     497    my $metadata = {};
     498    if (defined $self->{'classifytype'} && $self->{'classifytype'} =~ /\w/) {
     499    $metadata->{'classifytype'} = $self->{'classifytype'};
     500    }
    479501    &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
    480            "", {}, $self->{'buildproc'});
     502           "", $metadata, $self->{'buildproc'});
    481503
    482504    # output classification information
Note: See TracChangeset for help on using the changeset viewer.