Publish RAP Runtime 3.21 M1

Change-Id: If34466fdbc9e86ec25905eba579311d69605ef7e
diff --git a/_builds/builds-3.21.xml b/_builds/builds-3.21.xml
new file mode 100644
index 0000000..0bc31ea
--- /dev/null
+++ b/_builds/builds-3.21.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<builds version="3.21" simultaneousRelease="2022-06">
+
+  <feature id="runtime">
+    <name>RAP (Runtime)</name>
+    <description>based on Eclipse 4.24 (2022-06)</description>
+    <site>https://download.eclipse.org/rt/rap/3.21</site>
+    <downloadPath>/rt/rap/3.21/</downloadPath>
+  </feature>
+
+  <feature id="runtime4">
+    <name>RAP E4 (Runtime)</name>
+    <description>based on Eclipse 4.24 (2022-06)</description>
+    <site>https://download.eclipse.org/rt/rap/3.21/e4</site>
+    <downloadPath>/rt/rap/3.21/e4/</downloadPath>
+  </feature>
+
+  <feature id="tools">
+    <name>RAP Tools</name>
+    <description>for use with Eclipse 4.24 (2022-06)</description>
+    <site>https://download.eclipse.org/rt/rap/tools/3.21</site>
+    <downloadPath>/rt/rap/tools/3.21/</downloadPath>
+  </feature>
+
+  <build name="3.21 M1" type="M"
+      shortname="M1"
+      status="completed"
+      publishDate="2022-04-15"
+      news="3.21/?build=M1"
+      runtimeZip="rap-3.21.0-M1-20220415-1308.zip"
+      runtime4Zip="rap-e4-3.21.0-M1-20220415-1308.zip"
+      toolsZip=""
+      />
+
+  <build name="3.21 M2" type="M"
+      shortname="M2"
+      status="planned"
+      publishDate="2022-05-06"
+      news="3.21/?build=M2"
+      runtimeZip=""
+      runtime4Zip=""
+      toolsZip=""
+      />
+
+  <build name="3.21 M3" type="M"
+      shortname="M3"
+      status="planned"
+      publishDate="2022-05-27"
+      news="3.21/?build=M3"
+      runtimeZip=""
+      runtime4Zip=""
+      toolsZip=""
+      />
+
+  <build name="3.21 RC1" type="RC"
+      shortname="RC1"
+      status="planned"
+      publishDate="2022-06-03"
+      news="3.21/?build=RC1"
+      runtimeZip=""
+      runtime4Zip=""
+      toolsZip=""
+      />
+
+  <build name="3.21 RC2" type="RC"
+      shortname="RC2"
+      status="planned"
+      publishDate="2022-06-10"
+      news="3.21/?build=RC2"
+      runtimeZip=""
+      runtime4Zip=""
+      toolsZip=""
+      />
+
+  <build name="3.21" type="R"
+      shortname="R"
+      status="planned"
+      publishDate="2022-06-15"
+      news="3.21/"
+      runtimeZip=""
+      runtime4Zip=""
+      toolsZip=""
+      />
+
+</builds>
diff --git a/_sidebar/arrivals.php b/_sidebar/arrivals.php
index fd0a1a4..0cd88c7 100644
--- a/_sidebar/arrivals.php
+++ b/_sidebar/arrivals.php
@@ -33,7 +33,18 @@
       </span>
       <span class="terminal-field">
         <span class="terminal-overlay"></span>
-        <span class="terminal-text">2022-04-15</span>
+        <span class="terminal-text terminal-arrived">ARRIVED</span>
+      </span>
+    </div>
+
+    <div class="terminal-row">
+      <span class="terminal-field">
+        <span class="terminal-overlay"></span>
+        <span class="terminal-text">RAP 3.21 M2</span>
+      </span>
+      <span class="terminal-field">
+        <span class="terminal-overlay"></span>
+        <span class="terminal-text">2022-05-06</span>
       </span>
     </div>
 
diff --git a/_sidebar/releases.php b/_sidebar/releases.php
index 6cfbb83..99ebdc8 100644
--- a/_sidebar/releases.php
+++ b/_sidebar/releases.php
@@ -5,6 +5,9 @@
   <div class="sideitemcontent">
     <ul>
       <li>
+        <a href="/rap/downloads/3.21/">RAP 3.21&emsp;2022-06</a>
+      </li>
+      <li>
         <a href="/rap/downloads/3.20/">RAP 3.20&emsp;2022-03</a>
       </li>
       <li>
diff --git a/downloads/3.21/index.php b/downloads/3.21/index.php
new file mode 100644
index 0000000..9e5b478
--- /dev/null
+++ b/downloads/3.21/index.php
@@ -0,0 +1,137 @@
+<?php
+
+  include( $_SERVER['DOCUMENT_ROOT'] . "/rap/_projectCommon.php" );
+  require_once( $_SERVER['DOCUMENT_ROOT'] . "/rap/_Builds.php" );
+
+  $builds = new Builds( "3.21" );
+
+  $title = "RAP - " . $builds->getVersion() . " Downloads";
+  $navPosition = array( "download", "downloads" );
+  printHeader( $title, $navPosition );
+
+  function getBuildTypeHeader( $type ) {
+    if( $type === "Release" ) {
+      return $type;
+    }
+    return $type . "s";
+  }
+
+?>
+
+<div id="midcolumn">
+
+  <h1>RAP <?= $builds->getVersion() ?></h1>
+
+  <p>
+    Release Date: <?= formatDate( $builds->findBuild( "R" )->getPublishDate() ); ?>
+<? if( $builds->getSimultaneousRelease() ) { ?>
+      - together with Eclipse <?= $builds->getSimultaneousRelease(); ?>
+<? } ?>
+    <br/>
+    <a href="/rap/noteworthy/<?= $builds->findBuild( "R" )->getNews() ?>">New &amp; Noteworthy</a>
+  </p>
+
+  <h2>Features</h2>
+
+  <h3>RAP (Runtime)</h3>
+
+  <p>
+    <?= $builds->getDescription( "runtime" ) ?>
+  </p>
+
+  <p>
+    Software Site:
+    <img src="/rap/images/site.gif" alt="site" />
+    <?= $builds->getUpdateSite( "runtime" ) ?>
+  </p>
+
+  <h3>RAP E4 (Runtime)</h3>
+
+  <p>
+    <?= $builds->getDescription( "runtime4" ) ?>
+  </p>
+
+  <p>
+    Software Site:
+    <img src="/rap/images/site.gif" alt="site" />
+    <?= $builds->getUpdateSite( "runtime4" ) ?>
+  </p>
+
+  <h3>RAP Tools</h3>
+
+  <p>
+    <?= $builds->getDescription( "tools" ) ?>
+  </p>
+
+  <p>
+    Software Site:
+    <img src="/rap/images/site.gif" alt="site" />
+    <?= $builds->getUpdateSite( "tools" ) ?>
+  </p>
+
+  <h2>Builds</h2>
+
+  <table class="builds">
+
+<? $lastType = NULL; ?>
+<? foreach( $builds->getPreviousBuilds( '' ) as $build ) { ?>
+<?   if( $lastType != $build->getType() ) { ?>
+
+      <tr><td colspan="3"><h3><?= getBuildTypeHeader( $build->getType() ) ?></h3></td></tr>
+
+<?   } ?>
+<?   $lastType = $build->getType(); ?>
+
+    <tr>
+      <td class="build-header">
+        <strong><?= $build->getName() ?></strong>
+      </td>
+      <td>
+        <?= formatDate( $build->getPublishDate() ) ?>
+      </td>
+
+<?   if( $build->isCompleted() ) { ?>
+
+      <td>
+        <a href="/rap/noteworthy/<?= $build->getNews() ?>">New &amp; Noteworthy</a>
+      </td>
+      <td>
+        <a href="<?= $build->getZipFileUrl( "runtime" ) ?>">
+          <img src="/rap/images/zip.gif" alt="zip" /> RAP
+        </a>
+      </td>
+      <td>
+        <a href="<?= $build->getZipFileUrl( "runtime4" ) ?>">
+          <img src="/rap/images/zip.gif" alt="zip" /> RAP E4
+        </a>
+      </td>
+      <td>
+        <a href="<?= $build->getZipFileUrl( "tools" ) ?>">
+          <img src="/rap/images/zip.gif" alt="zip" /> RAP Tools
+        </a>
+      </td>
+
+<?   } else { ?>
+
+      <td colspan="3">
+        <em>planned</em>
+      </td>
+
+<? } ?>
+
+    </tr>
+
+<? } ?>
+
+  </table>
+
+</div>
+
+<div id="rightcolumn">
+  <?php includeSidebar( "rap-feed.php" ) ?>
+  <?php includeSidebar( "contributors.php" ) ?>
+</div>
+
+<?php
+  printFooter();
+?>
diff --git a/downloads/index.php b/downloads/index.php
index ca9055f..2c5ae30 100644
--- a/downloads/index.php
+++ b/downloads/index.php
@@ -10,7 +10,7 @@
   // --- TO BE CHANGED WITH EVERY RELEASE ---
 
   $releaseBuilds = new Builds( "3.20" );
-  $stableBuilds = new Builds( "3.20" );
+  $stableBuilds = new Builds( "3.21" );
 
   // ---
 
diff --git a/noteworthy/3.21/_news-M1.html b/noteworthy/3.21/_news-M1.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-M1.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/_news-M2.html b/noteworthy/3.21/_news-M2.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-M2.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/_news-M3.html b/noteworthy/3.21/_news-M3.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-M3.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/_news-R.html b/noteworthy/3.21/_news-R.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-R.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/_news-RC1.html b/noteworthy/3.21/_news-RC1.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-RC1.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/_news-RC2.html b/noteworthy/3.21/_news-RC2.html
new file mode 100644
index 0000000..d58db9e
--- /dev/null
+++ b/noteworthy/3.21/_news-RC2.html
@@ -0,0 +1,2 @@
+<div>
+</div>
diff --git a/noteworthy/3.21/index.php b/noteworthy/3.21/index.php
new file mode 100644
index 0000000..bee13b6
--- /dev/null
+++ b/noteworthy/3.21/index.php
@@ -0,0 +1,75 @@
+<?php
+
+  include( $_SERVER['DOCUMENT_ROOT'] . "/rap/_projectCommon.php" );
+  require_once( $_SERVER['DOCUMENT_ROOT'] . "/rap/_Builds.php" );
+
+  $buildName = isset( $_GET[ 'build' ] ) ? $_GET[ 'build' ] : "R";
+
+  $builds = new Builds( "3.21" );
+
+  $build = $builds->findBuild( $buildName );
+  if( !$build ) {
+    header( "HTTP/1.1 404 Not Found" );
+    exit( "Unknown build id" );
+  }
+
+  $PAGE_TITLE = "RAP " . $build->getName() . " - New and Noteworthy";
+  $PAGE_NAV_POSITION = array( "documentation", "noteworthy" );
+
+  printHeader();
+
+?>
+
+<div id="midcolumn">
+
+  <h1><?= $PAGE_TITLE ?></h1>
+
+  <p>
+    Here's a list of the most noteworthy things in the RAP
+    <?= $build->getName() ?> <?= strtolower( $build->getType() ) ?>
+<? if( $build->isCompleted() ) { ?>
+      which is available for <a href="http://www.eclipse.org/rap/downloads/">download</a>
+      since <?php echo formatDate( $build->getPublishDate() ) ?>.
+<? } else { ?>
+      which will be available for <a href="http://www.eclipse.org/rap/downloads/">download</a>
+      on <?php echo formatDate( $build->getPublishDate() ) ?>.
+      In the meantime, all changes described here are available in the most recent
+      <a href="http://www.eclipse.org/rap/downloads/">nightly build</a>.
+<? } ?>
+  </p>
+
+<? include( "_news-${buildName}.html" ); ?>
+
+  <h2>Bugfixes</h2>
+
+  <p>
+    <a href="<?= createBuglistUrl( $build->getTargetMilestones() ) ?>">This list</a>
+    shows all bugs that have been fixed for this <?php echo strtolower( $build->getType() ); ?>.
+  </p>
+
+<? if( $buildName !== "R" && substr( $buildName, 0, 2 ) !== "SR" ) { ?>
+  <h2>Previous Builds</h2>
+
+  <p>
+    The above features are just the ones that are new since the last milestone build.
+    Summaries for earlier builds:
+  </p>
+  <ul>
+<? foreach( $builds->getPreviousBuilds( $build->getShortName() ) as $prevBuild ) { ?>
+    <li>
+      <a href="./?build=<?php echo $prevBuild->getShortName(); ?>">News for RAP <?php echo $prevBuild->getName(); ?></a>
+    </li>
+<? } ?>
+  </ul>
+<? } ?>
+
+</div>
+
+<div id="rightcolumn">
+  <? includeSidebar( "migrationguide.php" ) ?>
+  <? includeSidebar( "releases.php" ) ?>
+</div>
+
+<?
+  printFooter();
+?>
diff --git a/noteworthy/index.php b/noteworthy/index.php
index 852be13..64c0222 100644
--- a/noteworthy/index.php
+++ b/noteworthy/index.php
@@ -1,5 +1,5 @@
 <?php
 
-  header( "Location: /rap/noteworthy/3.20/" );
+  header( "Location: /rap/noteworthy/3.21/" );
 
 ?>