Changeset 27012

Show
Ignore:
Timestamp:
05.03.2013 18:58:46 (7 years ago)
Author:
ak19
Message:

As John Rose requested: when you build an oai collection with the Create panel's Import Options' OIDType set to assigned and its associated OAImetadata field set to ex.File.FileName? and build the collection, a client can then use OAIDownload to Get Documents from this collection over OAI that have similarly readable filenames, with an additional number suffixed to the filenames. John Rose requested that the first file of such a name not have the hyphen 1 (-1) suffixed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/downloaders/OAIDownload.pm

    r25224 r27012  
    392392 
    393393        my $download_doc_filename = $oai_rec_filename; 
    394         my $new_extension = "\-$count\.$id_file_ext"; 
     394        # As requested by John Rose, don't suffix -$count for the very first document (so no "-1" suffix): 
     395        my $new_extension = ($count > 1) ? "\-$count\.$id_file_ext" : "\.$id_file_ext"; 
    395396        $count++; 
    396397        #$download_doc_filename =~ s/\.oai$/\.$id_file_ext/;