IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2013, 1:09:34 PM (13 years ago)
Author:
bills
Message:

Implement ACTION = 'PREVIEW' for postage stamp requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_parser_run.pl

    r34232 r35364  
    158158my $request_fault = $PSTAMP_INVALID_REQUEST;
    159159
     160my $action = 'PROCESS';
     161
    160162if (-r $uri) {
    161163    # run the appropriate parse command to parse the queue the jobs for this request
    162164    # first check the extension header to find the EXTNAME
    163     $request_type = find_request_type($uri);
     165    $request_type = find_request_type($uri, \$action);
    164166
    165167    if ($request_type) {
     
    240242
    241243    if ($success) {
    242         $newState = 'run';
     244        if ($action eq 'PROCESS') {
     245            $newState = 'run';
     246        } elsif ($action eq 'PREVIEW') {
     247            $newState = 'parsed';
     248        } else {
     249            print STDERR "WARNING Ignoring unexpected value for ACTION found in request header: $action\n";
     250        }
    243251    } else {
    244252        $fault = $error_code >> 8;
     
    275283    # find the EXTNAME in the input fits table
    276284    my $file_name = shift;
    277     my $out = `echo $file_name | fields -x 0 EXTNAME`;
     285    my $r_action = shift;
     286
     287    my $out = `echo $file_name | fields -x 0 EXTNAME ACTION`;
    278288
    279289    if ($out) {
    280290        # output from fields is filename value
    281         my ($dummy, $extname) = split " ", $out;
     291        my ($dummy, $extname, $action) = split " ", $out;
     292
     293        $$r_action = $action if ($action);
    282294
    283295        return $extname;
Note: See TracChangeset for help on using the changeset viewer.