Changeset 10217
- Timestamp:
- 2005-07-06T15:25:48+12:00 (19 years ago)
- Location:
- trunk/gsdl/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/doc.pm
r9953 r10217 57 57 'OIDtype'=>"hash"}, $class; 58 58 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 67 62 if (defined $source_filename) { 68 63 my $collect_dir = $ENV{'GSDLCOLLECTDIR'}; … … 97 92 98 93 return $self; 94 } 95 # set lastmodified for OAI purposes, added by GRB, moved by kjdon 96 sub 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 } 99 106 } 100 107 … … 192 199 } 193 200 194 # returns the source_filename as it was provided201 # returns the gsdldoctype as it was provided 195 202 # the default of "indexed_doc" is used if no document 196 203 # type was provided -
trunk/gsdl/perllib/docsave.pm
r10154 r10217 150 150 my $collection = $self->{'collection'}; 151 151 152 # set the lastmodified time before we write it out. 153 $doc_obj->set_lastmodified(); 154 152 155 if ($self->{'groupsize'} > 1) { 153 156 $self->group_process ($doc_obj);
Note:
See TracChangeset
for help on using the changeset viewer.