Changes between Version 22 and Version 23 of BossaExampleOne


Ignore:
Timestamp:
Jul 30, 2008, 10:51:30 AM (16 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BossaExampleOne

    v22 v23  
    1919 * '''ops/bossa_example_make_files.php''': a script that creates image files.
    2020 * '''ops/bossa_example_make_jobs.php''': a script that creates jobs.
    21  * '''inc/bossa_example.inc''': the display and policy functions.
     21 * '''inc/bossa_example.inc''': the application's callback functions.
    2222
    2323We'll go through these scripts and explain how they work.
     
    5050and collects them into a "batch".
    5151
    52 == Display and policy functions ==
     52== Callback functions ==
    5353
    5454The file ([source:/trunk/boinc/html/inc/bossa_example.inc html/inc/bossa_example.inc])
    55 contains display and policy functions.
     55contains the application's callback functions.
     56
    5657The display function is:
    5758{{{
    5859     9  function job_show($job, $inst, $user) {
    59     10      $info = $job->get_info($job);
     60    10      $info = $job->get_opaque_data($job);
    6061    11      $path = $info->path;
    6162    12      page_head("Find the Ellipse");
     
    7576}}}
    7677
    77 It calls a Bossa API function to get the job's opaque data (line 9).
     78This calls a Bossa API function to get the job's opaque data (line 10).
    7879Then it generates a web page containing the image
    7980within a form, so that clicking on the image (or on the None button)
    8081will invoke '''bossa_job_finished.php'''.
    81 
    82 The policy functions are as follows.
    8382
    8483{{{
     
    8988
    9089This is called when a job is issued.
    91 It sets the job's priority to zero so that no further instances will be issued
    92 (unless this one times) out.
     90It sets the job's priority to zero so that no other instances will be issued
     91until further notice.
    9392
    9493{{{
     
    106105}}}
    107106
    108 This is called when a job instance is finished.
     107This is called when an instance is finished.
    109108It gets the user's response to the job,
    110 and stores it in the instance's app data field.
     109and stores it as the instance's opaque data.
    111110
    112111{{{
     
    120119
    121120The remaining functions return short strings
    122 that show the app data for jobs, instances, and users on the Admin page:
     121that summarize the opaque data for jobs, instances, and users on the Admin page:
    123122{{{
    124123function job_summary($job) {
    125     $info = $job->get_info();
     124    $info = $job->get_opaque_data();
    126125    return "<a href=".URL_BASE."$info->path>View image</a>";
    127126}
    128127
    129128function instance_summary($inst) {
    130     $info = $inst->get_info();
     129    $info = $inst->get_opaque_data();
    131130    if ($info->have_ellipse) {
    132131        return "($info->cx, $info->cy)";