Ignore:
Timestamp:
2012-09-20T09:34:45+12:00 (12 years ago)
Author:
kjdon
Message:

new OIDtype, filename, will use the file name without any folders or file extension. Must be unique filenames in the collection. BasePlugin add_OID method returns if an id has already been set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r25557 r26221  
    204204    my ($type, $metadata) = @_;
    205205
    206     if (defined $type && $type =~ /^(hash|hash_on_file|hash_on_ga_xml|incremental|dirname|assigned)$/) {
     206    if (defined $type && $type =~ /^(hash|hash_on_file|hash_on_ga_xml|incremental|filename|dirname|assigned)$/) {
    207207    $self->{'OIDtype'} = $type;
    208208    } else {
     
    401401        $OID = "D" . $OIDcount;
    402402        $OIDcount ++;
    403      
     403    } elsif ($self->{'OIDtype'} eq "filename") {
     404        my $filename = $self->get_source_filename();
     405        $OID = &File::Basename::fileparse($filename, qr/\.[^.]*/);
     406        $OID = &util::tidy_up_oid($OID);
    404407    } elsif ($self->{'OIDtype'} eq "dirname") {
    405408        $OID = 'J';
Note: See TracChangeset for help on using the changeset viewer.