Changeset 26752


Ignore:
Timestamp:
2013-01-19T15:25:13+13:00 (11 years ago)
Author:
davidb
Message:

Added subroutine for writing a collection.inf file to the frameset directory. This is so that GlamED knows what framesets to load in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/html-to-expeditee/trunk/src/perllib/cgiactions/HtmlToExpediteeAction.pm

    r26731 r26752  
    6464}
    6565
     66##
     67# Subroutine for writing a collection.inf file -
     68# this is just so that when we load GlamED, it will
     69# only try to process framesets containing this file.
     70##
     71sub write_collection_info
     72{
     73    my ($output_dir,$collect) = @_;
     74   
     75    my $filename = &util::filename_cat($output_dir,"collection.inf");
     76    my $status = undef;
     77   
     78    if(open(FNOUT,">$filename")){
     79        binmode(FNOUT,":utf8");
     80       
     81        print FNOUT "$collect";
     82        close(FNOUT);
     83        $status =1;
     84    }else{
     85        print STDERR "Failed to open $filename for outputting collection info\n";
     86       
     87        $status = 0;
     88    }
     89   
     90    return $status;
     91}
    6692
    6793sub generate_frame
     
    90116    my $exp_frame_tree = decode_json $json_str_utf8;
    91117   
    92     my $output_dir = &util::filename_cat($collect_dir,$collect,"export");
     118    #output frameset to a subfolder within export directory.
     119    my $output_dir = &util::filename_cat($collect_dir,$collect,"export",$collect);
     120    #my $output_dir = &util::filename_cat($collect_dir,$collect,"export");
    93121
    94122    if (!-d $output_dir) {
     
    104132    # write out next free frame num
    105133    $expeditee_frame_io->saveLastFrameNumber($fn,$collect);
    106 
     134   
     135    # TODO: Have a parameter so that this file is only written out if requested.
     136    write_collection_info($output_dir,$collect);
     137   
    107138    $gsdl_cgi->generate_message("html-to-expeditee saved frame $fn");
    108139    }
Note: See TracChangeset for help on using the changeset viewer.