IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18552


Ignore:
Timestamp:
Jul 15, 2008, 10:21:17 AM (18 years ago)
Author:
bills
Message:

Adapt to changes in the postage stamp server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/web/request.php

    r18247 r18552  
    1919// BEGIN Local configuration
    2020
    21 $COMMAND_DIR = "/export/data0/bills/psconfig/debug.linrh64/bin";
    22 $dsroot = "/export/data1/datastore/dsroot";
    23 $dbname = "simtest";
     21$COMMAND_DIR = "XXX";
     22$WORKDIR = "XXX";
     23$dsroot = "XXX";
     24$dbname = "XXX";
    2425
    2526// END Local configuration
     
    5253
    5354// Initialize the request variables that we depend upon
    54 $rvar_project="simtest";
     55$rvar_project="";
     56
     57$gpc1_selected="";
     58$mops_selected="";
     59$simtest_selected="";
     60
     61$require_class_id = 0;
    5562
    5663$rvar_user_tag="";
     
    8188
    8289import_request_variables("gp", "rvar_");
     90
     91if ($rvar_project == "gpc1") {
     92    $gpc1_selected = "selected";
     93    $require_class_id = 1;
     94} else if ($rvar_project == "simtest") {
     95    $simtest_selected = "selected";
     96    $require_class_id = 0;
     97} else {
     98    $mops_selected = "selected";
     99    $require_class_id = 0;
     100}
    83101
    84102// figure out which select_by is set and save it's checked value
     
    184202                }
    185203
     204            } else {
     205                $last_request_id = 0;
    186206            }
    187207        } catch (Exception $e) {
     
    229249    $cmd = "pstamp_runcommand.sh pstamp_webrequest.pl";
    230250
    231     // NOTE: If it is used, -list_uri must be the first argument to pstamp_webrequest.pl
    232    
    233251    if ($list_checked) {
    234         $cmd .= " -list_uri";
     252        $cmd .= " --job_type list_uri";
    235253        $making_stamps = 0;
    236254    } else if ($get_checked) {
    237255        $making_stamps = 0;
    238         $cmd .= " -get_image";
     256        $cmd .= " --job_type get_image";
    239257    }
    240258
     
    246264        throw new Exception('project must be specified.');
    247265    }
    248     $cmd .= " -project $rvar_project";
     266    $cmd .= " --project $rvar_project";
    249267
    250268    if (!$rvar_user_tag) {
     
    308326
    309327    if (($rvar_img_type == "raw") || ($rvar_img_type == "chip")) {
    310 #        if (! $rvar_class_id ) {
    311 #            throw new Exception("must specify Class ID with Image Type $rvar_img_type.");
    312 #        }
    313         if ((!$rvar_class_id) || ($rvar_class_id = "all")) {
     328        if ($require_class_id && ! $rvar_class_id ) {
     329            throw new Exception("must specify Class ID with Image Type $rvar_img_type.");
     330        }
     331        if ((!$rvar_class_id) || ($rvar_class_id == "all")) {
    314332            $cmd .= " null";
    315333        } else {
     
    328346    global $COMMAND_DIR;
    329347
    330     // echo "running $command_line\n";
     348    //    echo "running $command_line\n";
    331349
    332350    exec ("$COMMAND_DIR/$command_line", $output_array, $command_status);
    333351
    334352    $size = sizeof($output_array);
    335     // echo "output_array  contains $size lines\n";
     353    //     echo "command_status: $command_status output_array  contains $size lines\n";
    336354    if ($command_status == 0) {
    337355        // On success we just remember the results
     
    361379    $doURL = 1;
    362380    if ($doURL) {
    363         // echo "output_line: $line\n";
     381//        echo "output_line: $line\n";
    364382        $elements = explode(" ", $line);
    365383        if (count($elements) == 3) {
     
    428446        global $outFileset;
    429447        global $dsroot;
    430         $parse_error = "$dsroot/$outFileset/parse_error";
     448        $parse_error = "$WORKDIR/$request_id/parse_error.txt";
    431449        #echo "reading $parse_error\n";
    432450        // readfile( $parse_error );
     
    520538    <tr><td><b>Project:</b>&nbsp;&nbsp;&nbsp;</td>
    521539        <td><select name="project">
    522 <!--            <option>gpc1 -->
    523             <option>simtest
     540           <option <?php echo $gpc1_selected;?> >gpc1
     541           <option <?php echo $mops_selected;?> >megacam-mops
     542           <option <?php echo $simtest_selected;?> >simtest
    524543        </td>
    525544    </tr>
     
    562581&nbsp;&nbsp;&nbsp;&nbsp;
    563582<b>
    564 <?php if ($rvar_project == "gpc1") {
     583<?php if (0 && $rvar_project == "gpc1") {
    565584        echo "Chip ID:";
    566585      } else {
     
    747766<?php
    748767    $size = sizeof($output_array);
     768    // echo "<pre>size of output array is $size\n</pre>";
    749769    if ($command_status == 0) {
    750770        if ($list_checked) {
     
    752772            // later we might add links to cause a stamp to be made from a selected file
    753773            for ($i = 0; $i < $size; $i++)  {
    754                 echo "<tr><td>$output_array[$i]</td></tr>";
     774                // $uri = array_shift($output_array);
     775                $uri = $output_array[$i];
     776                echo "<tr><td>$uri</td></tr>";
    755777            }
    756778        } else {
    757779            // output the list of urls
    758780            for ($i = 0; $i < $size; $i++)  {
    759                 printURL($output_array[$i]);
     781                // $uri = array_shift($output_array);
     782                $uri = $output_array[$i];
     783                printURL($uri);
    760784            }
    761785        }
Note: See TracChangeset for help on using the changeset viewer.