IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2013, 3:39:39 PM (13 years ago)
Author:
eugene
Message:

merged from trunk

Location:
branches/eam_branches/ipp-20130307/pstamp/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130307/pstamp/scripts

  • branches/eam_branches/ipp-20130307/pstamp/scripts/pstamp_parser_run.pl

    r34232 r35412  
    158158my $request_fault = $PSTAMP_INVALID_REQUEST;
    159159
     160# default action is to process the request after parsing. This can be overridden by
     161# PREVIEW mode for pstamp requests
     162my $action = 'PROCESS';
     163
    160164if (-r $uri) {
    161165    # run the appropriate parse command to parse the queue the jobs for this request
    162166    # first check the extension header to find the EXTNAME
    163     $request_type = find_request_type($uri);
     167    $request_type = find_request_type($uri, \$action);
    164168
    165169    if ($request_type) {
     
    240244
    241245    if ($success) {
    242         $newState = 'run';
     246        # XXX: This bit of the postage stamp request API has slipped in here because we need to control
     247        # the new state of the request
     248        if ($action eq 'PROCESS') {
     249            $newState = 'run';
     250        } elsif ($action eq 'PREVIEW') {
     251            $newState = 'parsed';
     252        } else {
     253            print STDERR "WARNING Ignoring unexpected value for ACTION found in request header: $action\n";
     254        }
    243255    } else {
    244256        $fault = $error_code >> 8;
     
    275287    # find the EXTNAME in the input fits table
    276288    my $file_name = shift;
    277     my $out = `echo $file_name | fields -x 0 EXTNAME`;
     289    my $r_action = shift;
     290
     291    my $out = `echo $file_name | fields -x 0 EXTNAME ACTION`;
    278292
    279293    if ($out) {
    280294        # output from fields is filename value
    281         my ($dummy, $extname) = split " ", $out;
     295        my ($dummy, $extname, $action) = split " ", $out;
     296
     297        # Set the action if it is defined in the request header
     298        # XXX:consider doing this only if extname is PS1_PS_REQUSET
     299        $$r_action = $action if ($action);
    282300
    283301        return $extname;
Note: See TracChangeset for help on using the changeset viewer.