Changeset 24924

Show
Ignore:
Timestamp:
09.01.2012 11:19:41 (8 years ago)
Author:
davidb
Message:

Introduction of action to support frame writing

Location:
gs3-extensions/html-to-expeditee/trunk/src
Files:
3 added
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/html-to-expeditee/trunk/src/src/cgi-bin/html-to-expeditee.pl.in

    r24923 r24924  
    4646    $gsdl_cgi->checked_chdir($gsdlhome); 
    4747 
    48 ##    require cgiactions::metadataaction; 
     48    require cgiactions::HtmlToExpediteeAction; 
    4949     
    5050    # Useful debug statement for seeing what packages have been included 
     
    5656    $gsdl_cgi->{'xml'} = 0; 
    5757 
    58  
    5958    my $collect = $gsdl_cgi->clean_param("c");    
    6059    my $cl = $gsdl_cgi->clean_param("cl");    
     
    7675        $gsdl_cgi->generate_error("No site specified."); 
    7776    } 
    78     $gsdl_cgi->delete("site"); 
    7977    } 
    8078 
    81     my $collect_dir = $gsdl_cgi->get_collection_dir($site); 
    82  
    83  
    84  
    8579    my $fn = $gsdl_cgi->clean_param("fn");     # frame number 
    8680 
    8781    if (defined $fn) { 
    88     my $json_str = $gsdl_cgi->param("json"); 
    89      
    90     my $output_dir = &util::filename_cat($collect_dir,$collect,"export"); 
    91  
    92     if (!-d $output_dir) { 
    93         &util::mk_dir($output_dir); 
    94     } 
    95     my $frame_filename = &util::filename_cat($output_dir,"$fn.exp"); 
    96  
    97     if (open(FOUT,">$frame_filename")) { 
    98  
    99         print FOUT $json_str; 
    100         close(FOUT); 
    101  
    102         # write out next free frame num 
    103  
    104         $gsdl_cgi->generate_message("html-to-expeditee saved frame $fn");    
    105     } 
    106     else { 
    107         $gsdl_cgi->generate_error("Failed to open $frame_filename for output"); 
    108     } 
     82 
     83    my $action = new HtmlToExpediteeAction($gsdl_cgi,$iis6_mode); 
     84 
     85    $action->do_action(); 
     86 
    10987 
    11088    } 
     
    277255         }); 
    278256 
    279           expFrame = htmlToExpeditee(iframeDoc.body); 
     257          var expFrameTree = htmlToExpeditee(iframeDoc.body); 
     258          var expFrame = JSON.stringify(expFrameTree); 
    280259          //alert(expFrame); 
    281260 
     
    288267        params += "&site=" + site; 
    289268          } 
    290           params += "&fn=" + frameID; 
     269          params += "&a=generate-frame&fn=" + frameID; 
    291270          params += "&json=" + escape(expFrame); 
    292271 
     
    302281          // console.log("doc oid = " + docOID); 
    303282 
     283         // is the following line used ???? 
    304284          var cl = document.getElementById("cl").value; 
    305285