#!/usr/bin/perl -s

$title = "Centralized Conferencing (XCON) - IETF 64 Agenda";

if ($t)
{
  print "Content-Type: text/plain\n\n";
  print "$title\n\n";
  print "CHAIRS: Alan Johnston <ajohnston\@tello.com>\n".
        "        Adam Roach <adam\@nostrum.com>\n\n";
}
else
{
print
  "Content-Type: text/html\n".
  "\n".
  "<HTML><HEAD><TITLE>$title</TITLE></HEAD>\n".
  "<BODY>\n".
  "<H1>$title</h1>\n".
  "\n".
  "<pre>\n".
  "\n".
  "CHAIRS: Alan Johnston &lt;ajohnston&#64;tello.com>\n".
  "        Adam Roach &lt;adam&#64;nostrum.com>\n".
  "\n".
  "</pre>\n";
}

foreach $entry (<DATA>)
{
  chop;
  ($time, $name, $topic, $drafts, $presentations) = split(';', $entry);
  if ($time && !$topic)
  {
    if ($t)
    {
      print "\n$name======================================\n\n";
    }
    else
    {
      if ($tod)
      {
        print "</TABLE></CENTER><p>\n";
      }
      print 
      "<h3>$name</h3>\n".
      "<CENTER><TABLE border=1>\n".
      "<TR>\n".
      "  <TH>Time</TH>\n".
      "  <TH>Length</TH>\n".
      "  <TH>Discussion Leader</TH>\n".
      "  <TH>Topic</TH>\n".
      "  <TH>Draft</TH>\n".
      "  <TH>Slides</TH>\n";
    }
    $tod = $time;
    next;
  }
  @drafts = split(',', $drafts);
  @presentations = split(',', $presentations);
  $start = $tod;
  $h = int($tod / 100);
  $m = $tod % 100;
  $m += $time;
  $h += int($m / 60);
  $m %= 60;
  $tod = $h*100 + $m;
  if ($t)
  {
    $name =~ s/<br>//i;
    printf ("%4.4d - %4.4d  $topic\n", $start, $tod);
    print "             $name ($time minutes)\n";
    foreach $draft(@drafts)
    {
      print "             $draft\n";
    }
    print "\n";
  }
  else
  {
    foreach $draft (@drafts)
    {
      if (-e "../../drafts/$draft")
      {
        $draft =~ s/(.*)/<a href="\/xcon\/drafts\/$1">$1<\/a>/;
      }
      else
      {
        if ($f)
        {
          system ("cd ../../drafts; wget http://www.ietf.org/internet-drafts/$draft");
        }
        $draft =~ s/(.*)/<a href="http:\/\/www.ietf.org\/internet-drafts\/$1">$1<\/a><sup>*<\/sup>/;
        $nonlocal++;
      }
    }

    foreach $presentation (@presentations)
    {
      $presentation =~ s/([^.]*)\.(.*)/<a href="slides\/$1.$2">$2<\/a>/;
    }

    print "<TR>\n";
    printf ("  <TD>%4.4d - %4.4d</TD>\n", $start, $tod);
    print "  <TD>$time minutes</TD>\n";
    print "  <TD>$name</TD>\n";
    print "  <TD>$topic</TD>\n";
    print "  <TD>";
    print join ("<BR>",@drafts);
    print "  &nbsp;</TD>\n";
    print "  <TD>";
    print join (", ",@presentations);
    print "  &nbsp;</TD>\n";
    print "</TR>\n";
  }
}


print "</TABLE></CENTER></BODY></HTML>" unless ($t);
# time (in minutes);presenter;topic;drafts,drafts;slides,slides
__DATA__
0900;TUESDAY, November 8th, 2005, 0900-1130
5;Chairs;Agenda Bash;;xcon-agenda-ietf64.ppt
10;Chairs;Status Update;;
10;Chairs;Charter: Updating Milestones;;
15;Gonzalo Camarillo;Floor Control: Epilogue;draft-ietf-xcon-bfcp-05.txt,draft-ietf-mmusic-sdp-bfcp-02.txt,draft-ietf-xcon-floor-control-req-03.txt;camarillo-xcon-bfcp-ietf64.ppt
45;Mary Barnes;XCON Framework;draft-ietf-xcon-framework-02.txt;barnes-xcon-fw-ietf64.ppt
10;Oscar Novo;XCON Common Data Model;draft-novo-xcon-common-data-model-00.txt;novo-common-conf-info-data-model-ietf64.ppt
20;Orit Levin;Conference Package;draft-levin-xcon-conference-package-ext-00.txt;levin-conf-pkg-ext-ietf64.ppt
15;Dave Morgan;Role Definitions for Common Conferencing;draft-morgan-xcon-roles-00.txt;morgan-role-defs-ietf64.ppt
10;Chris Boulton;MSRP Centralized Conferencing;draft-boulton-xcon-msrp-conferencing-02.txt;boulton-conf-ietf64.ppt
10;Roni Even;People and Content Video Streams;draft-even-xcon-pnc-00.txt;even-pnc-ietf64.ppt
1510;WEDNESDAY, November 9th, 2005, 1510-1610
10;Chairs;Protocol Selection Discussion;;xcon-agenda-ietf64.ppt
10;Orit Levin;CCCP;draft-levin-xcon-cccp-03.txt;levin-cccp-ietf64.ppt
15;Chris Boulton;Media Templates;draft-boulton-xcon-media-template-02.txt;boulton-media-templates-ietf64.ppt
25;Chairs;Protocol Selection Open Discussion;;
