Changeset 10217


Ignore:
Timestamp:
2005-07-06T15:25:48+12:00 (19 years ago)
Author:
kjdon
Message:

moved the addition of lastmodified metadata from the new method, into docsave.process - this way it doesn't affect the HASH id

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r9953 r10217  
    5757              'OIDtype'=>"hash"}, $class;
    5858
    59     #GRB: Added code to set lastmodified for OAI purposes
    60     if ((defined $doc_type) && (defined $source_filename) && (-e $source_filename)) {
    61     my $file_stat = stat($source_filename);
    62     my $mtime = $file_stat->mtime;
    63     $self->add_utf8_metadata($self->get_top_section(), "lastmodified", $file_stat->mtime);
    64     }
    65     #GRB: end inserted code
    66 
     59    # used to set lastmodified here, but this can screw up the HASH ids, so
     60    # the docsave processor now calls set_lastmodified
     61   
    6762    if (defined $source_filename) {
    6863    my $collect_dir = $ENV{'GSDLCOLLECTDIR'};
     
    9792
    9893    return $self;
     94}
     95# set lastmodified for OAI purposes, added by GRB, moved by kjdon
     96sub set_lastmodified {
     97    my $self = shift (@_);
     98
     99    my $source_filename = $self->get_source_filename();
     100    if ((defined $self->get_metadata_element ($self->get_top_section(), "gsdldoctype")) &&
     101    (defined $source_filename) && (-e $source_filename)) {
     102    my $file_stat = stat($source_filename);
     103    my $mtime = $file_stat->mtime;
     104    $self->add_utf8_metadata($self->get_top_section(), "lastmodified", $file_stat->mtime);
     105    }
    99106}
    100107
     
    192199}
    193200
    194 # returns the source_filename as it was provided
     201# returns the gsdldoctype as it was provided
    195202# the default of "indexed_doc" is used if no document
    196203# type was provided
  • trunk/gsdl/perllib/docsave.pm

    r10154 r10217  
    150150    my $collection = $self->{'collection'};
    151151
     152    # set the lastmodified time before we write it out.
     153    $doc_obj->set_lastmodified();
     154
    152155    if ($self->{'groupsize'} > 1) {
    153156    $self->group_process ($doc_obj);
Note: See TracChangeset for help on using the changeset viewer.