Add support for ClearlyDefined.

- Remove listing of all CQs as this is a bit redundant

Change-Id: I68c4026d5f84bdc3191bddb03d95ec1f2749b5f9
diff --git a/scripts/iplog.php b/scripts/iplog.php
index 0ca9907..b420b46 100644
--- a/scripts/iplog.php
+++ b/scripts/iplog.php
@@ -250,7 +250,6 @@
 $nDistinctBundles = 0;
 $nTotalBundles =  0;
 $nDistinctCQs = 0;
-$listOfCQs = "";
 
 foreach ($childRepoXmlList as $childRepoXml) {
   $childXmlDoc = new DOMDocument();
@@ -261,14 +260,8 @@
   $nDistinctBundles += $xpath->evaluate("count(/repository/units/unit[provides/provided/@namespace='org.eclipse.equinox.p2.eclipse.type' and provides/provided/@name='bundle' and not(preceding::unit/@id=../../@id)]/@id)");
   $nTotalBundles += $xpath->evaluate("count(/repository/units/unit[provides/provided/@name='bundle' or provides/provided/@name='source']/@id)");
   $nDistinctCQs += $xpath->evaluate("count(/repository/units/unit/properties/property[@name='iplog.bug_id' and not(preceding::property/@value=@value)])");
-  $cqNodeList = $xpath->evaluate("/repository/units/unit/properties/property[@name='iplog.bug_id' and not(preceding::property/@value=@value)]/@value");
-  foreach ($cqNodeList as $node) {
-    $listOfCQs .= "," . $node->nodeValue;
-  }
 }
 
-$ipzillaURL = "https://dev.eclipse.org/ipzilla/buglist.cgi?bug_id=" . $listOfCQs;
-
 echo "<h2>Individual Bundles</h2>";
 
 echo "<h3>Statistics</h3>";
@@ -278,7 +271,6 @@
 
 echo "<h3>CQ Bookkeeping</h3>";
 echo "Total number of distinct CQs: $nDistinctCQs. <br />";
-echo "IPZilla <a href=\"$ipzillaURL\">list of all CQs</a></p>";
 echo "<p>Note: IPZilla is a database for tracking CQs (Contribution Questionnaires) and is only accessible by committers, ";
 echo "since in theory they might contain some non-public information. But, don't worry ... if you are not a committer you are not";
 echo " missing anything ... they are pretty dry! These (and the links provided here) are just some aides for committers to double check our book-keeping.</p>";
diff --git a/scripts/repo-index.xsl b/scripts/repo-index.xsl
index 2c6c1de..5819a5a 100644
--- a/scripts/repo-index.xsl
+++ b/scripts/repo-index.xsl
@@ -42,9 +42,18 @@
         substring(@version, 1 div not(contains(@version,'v'))))" />
   </td>
   <td width="8%">
+  <!-- clearlydefined -->
+  <xsl:if test="contains(properties/property[@name='iplog.bug_id'],'clearlydefined')">
+    <a href="{properties/property[@name='iplog.bug_id']/@value}">
+    ClearlyDefined
+    </a>
+  </xsl:if>
+  <!-- ipzilla -->
+  <xsl:if test="not(contains(properties/property[@name='iplog.bug_id'],'clearlydefined'))">
     <a href="https://dev.eclipse.org/ipzilla/show_bug.cgi?id={properties/property[@name='iplog.bug_id']/@value}">
     <xsl:value-of select="properties/property[@name='iplog.bug_id']/@value" />
     </a>
+  </xsl:if>
   </td>
   <td width="15%">
     <a href="mailto:{$email}">