<%@ jet package="org.eclipse.emf.releng" imports="java.util.* java.io.*" class="UpdateSiteIndex"%>
<%UpdateSiteIndexGenerator parent = (UpdateSiteIndexGenerator)argument;%>
<%List<UpdateSiteIndexGenerator> children = parent.getChildren();%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  <title><%=parent.getTitle()%></title>
  <meta name="keywords" content="eclipse,emf,emf update site"/>
  <meta name="description" content="EMF's p2 Update Sites"/>
  <link href="//fonts.googleapis.com/css?family=Open+Sans:400,700,300,600,100" rel="stylesheet" type="text/css"/>
  <link rel="stylesheet" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/stylesheets/styles.min.css"/>
  <link rel="icon" type="image/ico" href="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/favicon.ico"/>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>

  <body id="body_solstice">
    <script>

      function copyToClipboard(element) {
        var $temp = $("<input>");
        $("body").append($temp);
        $temp.val($(element).text()).select();
        document.execCommand("copy");
        $temp.remove();
      }

      function toggle(id) {
        var e = document.getElementById(id);
        if (e.title == 'Expand All') {
          e.title= 'Collapse All';
          e.innerHTML = '&#x25E2;';
        } else {
          e.title= 'Expand All';
          e.innerHTML = '&#x25B7;';
        }
      }

      function expand(id) {
        var t = document.getElementById('all');
        var e = document.getElementById(id);
        var f = document.getElementById(id+"_arrows");
        if (t.title == 'Collapse All'){
          e.style.display = 'block';
          f.innerHTML = '&#x25E2;';
        } else {
          e.style.display = 'none';
          f.innerHTML = '&#x25B7;';
        }
      }

      function expand_collapse(id) {
        var e = document.getElementById(id);
        var f = document.getElementById(id+"_arrows");
        if (e.style.display == 'none'){
          e.style.display = 'block';
          f.innerHTML = '&#x25E2;';
        } else {
          e.style.display = 'none';
          f.innerHTML = '&#x25B7;';
        }
      }

    </script>

    <header role="banner" id="header-wrapper">
      <div class="container">
        <div class="row" id="header-row">
          <div class="hidden-xs col-sm-8 col-md-6 col-lg-5" id="header-left">
            <div class="wrapper-logo-default">
              <a href="https://www.eclipse.org/">
                <img class="logo-eclipse-default img-responsive hidden-xs" alt="Eclipse Log" src="https://www.eclipse.org/eclipse.org-common/themes/solstice/public/images/logo/eclipse-426x100.png"/>
              </a>
            </div>
          </div>
        </div>
      </div>
    </header>

    <section class="hidden-print default-breadcrumbs" id="breadcrumb">
      <div class="container">
        <h3 class="sr-only">Breadcrumbs</h3>
        <div class="row">
          <div class="col-sm-16 padding-left-30">
            <ol class="breadcrumb">
              <li><a href="https://www.eclipse.org/">Home</a></li>
              <li><a href="https://www.eclipse.org/projects/">Projects</a></li>
              <li><a href="https://www.eclipse.org/modeling">Modeling</a></li>
              <li><a href="https://www.eclipse.org/modeling/emf">EMF</a></li>
<%for (Map.Entry<String, String> entry : parent.getBreadcrumbs().entrySet()) {%>
  <%if (entry.getValue() == null) {%>
              <li class="active"><%=entry.getKey()%></li>
  <%} else {%>
              <li><a href="<%=entry.getValue()%>"><%=entry.getKey()%></a></li>
  <%}%>
<%}%>
            </ol>
          </div>
          <div class="col-sm-8 margin-top-15"></div>
        </div>
      </div>
    </section>

    <main class="no-promo">
    <div class="novaContent container" id="novaContent">

      <!-- navigation sidebar -->
      <aside id="leftcol" class="col-md-4">
        <ul id="leftnav" class="ul-left-nav fa-ul hidden-print">
          <li class="separator">
           <a class="separator" href="https://www.eclipse.org/modeling/emf">Home</a>
          </li>
 <%for (Map.Entry<String, String> entry : parent.getNavigation().entrySet()) { String label = entry.getValue(); boolean isTopLevel = !label.startsWith("-"); if (!isTopLevel) label = label.substring(1); int index = label.indexOf('@'); if (index != -1) label = label.substring(0, label.length() -1);%>
          <li<%if (isTopLevel) {%> class="separator"<%}%>>
  <%if (!isTopLevel) {%>
            <tt class="orange">&#xbb;</tt>
  <%}%>
            <a class="separator" href="<%=entry.getKey()%>/index.html"><%=label%></a>
  <%if (index != -1) {%>
            <div style="float: right;"><tt class="orange">&#xab;</tt></div>
  <%}%>
          </li>
 <%}%>
        </ul>
      </aside>

      <div id="maincontent">
        <div id="midcolumn">
          <h2 style="text-align: center;"><%=parent.getTitle()%></h2>
<%if (children.isEmpty()) {String date = parent.getDate(); if (date != null) {%>
          <p style="font-size: 125%; text-align: center;">
            <b>Built: <%=date%></b>
          </p>
<%}}%>
<%if (!parent.isRoot()) {%>
          <p style="text-align: center;">
            <button title="Copy to Clipboard" class="orange" style="font-size: 150%; background-color: white; border: none; padding: 0px 0px;" onclick="copyToClipboard('#p1')">&#x270e;</button>
            <span id="p1" style="font-size: 125%"><%=parent.getSiteURL()%></span>
  <%Map<String, String> repositories = parent.getRepositoryChildren(); if (repositories != null) { for (Map.Entry<String, String> entry : repositories.entrySet()) {String repository = entry.getKey(); String relativeURL = entry.getValue(); String id = parent.getFolderID(repository);%>
            <br/>
            <button title="Copy to Clipboard" class="orange" style="font-size: 125%; margin-left: 1em; background-color: white; border: none; padding: 0px 0px;" onclick="copyToClipboard('#<%=id%>')">&#x270e;</button>
            <a href="<%=relativeURL%>/index.html" id="<%=id%>" style="font-size: 100%; font-weight: normal;"><%=repository%></a>
   <%}}%>
          </p>
 <%}%>
          <br/>
          <img style="float:right" src="https://www.eclipse.org/modeling/emf/images/emf_logo.png" alt=""/>
<%if (parent.isRoot()) {%>
           <p>This is the root folder for the Eclipse Modeling Framework's p2 update sites.</p>
           <p>These update sites are produced by <a href="https://ci.eclipse.org/emf/" target="emf_jipp">https://ci.eclipse.org/emf/</a>.</p>
           <p>EMF provides a large number of fine-grained features that are useful for provisioning a minimal target platform and for building smaller RCP applications and IDE products.</p>
<%} else {%>
           <p>
             This is a p2 update site for the Eclipse Modeling Framework.
             Use the <button title="Copy to Clipboard" class="orange" style="background-color: white; border: none; padding: 0px 0px;" onclick="copyToClipboard('#p1')">&#x270e;</button> glyph to copy the update site URL to the system clipboard.
  <%if (parent.hasArchive()) {%>
             Alternatively, you can download the archive of this repository from the download sidebar on the right.
  <%}%>
           </p>
  <%{String buildType = parent.getBuildType(); boolean isLatest = parent.isLatest(); Map<String, String> repositoryChildren = parent.getRepositoryChildren(); if ("nightly".equals(buildType)) {%>
    <%if (isLatest) {%>
           <p>
             This composite update site references the most recent successful nightly build.
           </p>
    <%} else if (repositoryChildren != null) {%>
           <p>
             This composite update site references the <%=parent.getRepositoryChildren().size()%> most recent successful nightly builds.
           </p>
    <%} else {%>
           <p>
             This simple update site will be retained <b>only</b> until it is no longer one of the <%=UpdateSiteGenerator.RETAINED_NIGHTLY_BUILDS%> most recent successful nightly builds.
           </p>
    <%}%>
  <%} else if ("milestone".equals(buildType)) {%>
    <%if (isLatest) {%>
           <p>
             This composite update site references the most recent successful milestone build.
           </p>
    <%} else if (repositoryChildren != null) {%>
           <p>
             This composite update site references <%=parent.getRepositoryChildren().size()%> successful milestone builds.
             These sites will be retained <b>only</b> until the first successful milestone build of the next EMF release.
           </p>
    <%} else {%>
           <p>
             This simple update site will be retained <b>only</b> until the first successful milestone build of the next EMF release.
           </p>
    <%}%>
  <%} else {%>
    <%if (isLatest) {%>
           <p>
             This composite update site references the most recent release of EMF.
           </p>
    <%} else if (repositoryChildren != null) {%>
           <p>
             This composite update site references <%=parent.getRepositoryChildren().size()%> releases.
             These sites will be retained <b>permanently</b>.
           </p>
    <%} else {%>
           <p>
             This simple update site will be retained <b>permanently</b>.
           </p>
    <%}%>
  <%}}%>
  <%if (!children.isEmpty()) {%>
           <p>This update site provides access to the following coarse-grained SDK features, useful for installing in a development IDE,
              as well as coarse-grained Target Component features, useful provisioning a complete target platform:</p>
  <%} else {%>
           <p>This update site provides access to the following fine-grained features:</p>
  <%}%>
<%}%>
<%if (!children.isEmpty()) {%>
  <%List<String> sdks = parent.getSDKs(); if (!sdks.isEmpty()) {%>
           <ul>
    <%for (String sdk: sdks) {%>
             <li><%=sdk%></li>
    <%}%>
           </ul>
  <%}%>
           <p>
             The update sites listed below provide access to specific versions of the features listed above.
  <%if (parent.isRoot()) {%>
             Use the <button title="Copy to Clipboard" class="orange" style="background-color: white; border: none; padding: 0px 0px;">&#x270e;</button> glyph to copy the update site URL to the system clipboard.
  <%}%>
           </p>
  <%for (UpdateSiteIndexGenerator child : children) { String id = parent.getFolderID(child.getFolderName());%>
           <h3><a href="<%=child.getRelativeIndexURL()%>" style="font-weight: normal;"><%=child.getTitle()%></a></h3>
           <p>The following is the p2 update site URL for this repository:</p>
           <p style="margin-left: 1em">
             <button title="Copy to Clipboard" class="orange" style="font-size: 125%; background-color: white; border: none; padding: 0px 0px;" onclick="copyToClipboard('#<%=id%>')">&#x270e;</button>
             <a href="<%=child.getRelativeIndexURL()%>" id="<%=id%>" style="font-weight: normal;"><%=child.getSiteURL()%></a>
           </p>
           <p>Click the header link or the update site link for more details.</p>
  <%}%>
<%} else {%>
  <%List<String> features = parent.getFeatures(); if (!features.isEmpty()) {%>
          <ul style="margin-left: -1em">
    <%for (String feature: features) {%>
            <%if (parent.isSDK(feature)) {%><b><%}%><li style="font-size: 90%;"><%=feature.replace(" ", "&nbsp;")%></li><%if (parent.isSDK(feature)) {%></b><%}%>
    <%}%>
           </ul>
  <%}%>
  <%Map<String, List<String>> bundles = parent.getBundles(); if (!bundles.isEmpty()) { %>
           <h3>EMF Bundles</h3>
           <p>
             This update site provides access to the bundles listed below.
             Each section is expandable via
    <%{ StringBuilder onClick = new StringBuilder(); for (String bundle : bundles.keySet()) {  onClick.append("expand('").append(parent.getFolderID(bundle)).append("');"); }%>
             <span style="white-space: nowrap;">the&nbsp;<button id="all" title="Expand All" class="orange" style="background-color: white; border: none; padding: 0px 0px;" onclick="toggle('all');<%=onClick%>">&#x25B7;</button>&nbsp;glyph</span>
    <%}%>
             to provide detailed information about the exports and imports of each bundle.
           </p>
           <ul>
             <li>
               The &#x21D6; glyph denotes the exported bundle identifier along with its full version.
             </li>
             <li>
               The &#x2196; glyph denotes an exported java package along with its full version, if specified.
             </li>
             <li>
               The &#x21D8; glyph denotes a required bundle along with its version range, if specified, as well as information about whether the requirement is optional and if so, whether it's greedy.
             </li>
             <li>
               The &#x2198; glyph denotes a required package along with its version range, if specified.
             </li>
           </ul>

          <ul style="margin-left: -1em; list-style-type: none; padding: 0; margin: 0;">
    <%for (Map.Entry<String, List<String>> entry: bundles.entrySet()) { String bundle = entry.getKey(); String id = parent.getFolderID(bundle);%>
            <li style="font-size: 90%;">
              <button id="<%=id%>_arrows" class="orange" style="background-color: white; margin-left: 1em; border: none; padding: 0px 0px;" onclick="expand_collapse('<%=id%>');">&#x25B7;</button>
              <span style="font-size:100%;"><%=bundle.replace(" ", "&nbsp;")%></span>
              <div id="<%=id%>" style="display:none; margin-left: 2em;">
      <%for (String line : entry.getValue()) {%>
                <%=line%><br/>
      <%}%>
              </div>
            </li>
    <%}%>
           </ul>
  <%}%>
<%}%>

        </div>

<%if (parent.hasArchive()) { String archiveName = new File(parent.getArchive()).getName(); String sha256Name = new File(parent.getDigest("SHA-256")).getName(); String sha512Name = new File(parent.getDigest("SHA-512")).getName();%>
        <div style="padding-top: 100;" id="rightcolumn">
          <div class="sideitem">
            <h6>Downloads</h6>
            <p>
              <a style="font-size: 90%;" href="<%=parent.getArchiveDownloadURL()%>" target="_blank"><%=archiveName%></a>
              <br/>
              <a class="btn btn-warning" style="margin-top: 5pt; font-size: 90%;" href="<%=parent.getArchiveDownloadURL()%>" target="_blank" title="Download <%=archiveName%>">Download</a>
              <a class="btn btn-warning" style="margin-top: 5pt; border-color: DarkGreen; background-color: OliveDrab; font-size: 90%; padding-left: 0.2em; padding-right: 0.2em;" href="<%=sha256Name%>" target="_blank" title="Download <%=sha256Name%>">sha256</a>
              <a class="btn btn-warning" style="margin-top: 5pt; border-color: DarkGreen; background-color: OliveDrab; font-size: 90%; padding-left: 0.2em; padding-right: 0.2em;" href="<%=sha512Name%>" target="_blank" title="Download <%=sha512Name%>">sha512</a>
            </p>
          </div>
  <%{ Map<String, String> commits = parent.getCommits(); if (!commits.isEmpty()) {%>
          <div class="sideitem">
            <h6>Git Commits</h6>
    <%for (Map.Entry<String, String> entry : commits.entrySet()) { String label = entry.getKey(); String url = entry.getValue(); String gitRepoURL = url.substring(0, url.indexOf("commit")) + "log/";String id = url.substring(url.indexOf('=') + 1);%>
            <p>
              <button title="Copy Commit ID <%=id%> to Clipboard" class="orange" style="font-size: 150%; background-color: transparent; border: none; padding: 0px 0px;" onclick="copyToClipboard('#<%=label.toLowerCase()%>_commit_id')">&#x270e;</button>
              <a style="font-size: 100%;" href="<%=gitRepoURL%>" target="<%=label.toLowerCase()%>_git"><%=label%></a>
              <br/>
              <tt><a id="<%=label.toLowerCase()%>_commit_id" class="btn btn-warning" style="text-transform: none; margin-top: 5pt; border-color: DarkGreen; background-color: OliveDrab; font-size: 70%; padding-top: 0.2ex; padding-bottom: 0.2ex; padding-left: 0.2em; padding-right: 0.2em;" href="<%=url%>" target="<%=label.toLowerCase()%>_git_commit" title="<%=label%> Git Commit ID"><%=id%></a></tt>
            </p>
    <%}%>
          </div>
  <%}}%>
        </div>

<%}%>
      </div>
     </div>
     </main>
  </body>
</html>