[397017] Move EMF Query website to git
diff --git a/_projectCommon.php b/_projectCommon.php
index fe8c2d8..f0d0561 100644
--- a/_projectCommon.php
+++ b/_projectCommon.php
@@ -13,16 +13,16 @@
$Nav->setLinkList(null);
$projectname = "emf-query";
+$projectdisplayname = "EMF Query";
+$modelingprojectname = "modeling";
+$topprojectname = "emf";
+$shortprojectname = "query";
$debug = (isset ($_GET["debug"]) && preg_match("/^\d+$/", $_GET["debug"]) ? $_GET["debug"] : -1);
include_once($_SERVER["DOCUMENT_ROOT"] . "/emf-query/downloads/scripts.php");
$regs = null;
-$projects = array("EMF Query" => "emf-query");
-$proj = "/modeling";
-$shortprojectname = "query";
-
$buildtypes = array(
"R" => "Release",
"S" => "Stable",
diff --git a/downloads/downloads-common.php b/downloads/downloads-common.php
index 6f552d3..145ede3 100644
--- a/downloads/downloads-common.php
+++ b/downloads/downloads-common.php
@@ -28,15 +28,11 @@
# store an array of paths to hide
$hiddenBuilds = is_readable($_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/hidden.txt") ? file($_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/hidden.txt") : array();
-// include extras-$proj.php or extras-$projectname.php
-$files = array ($_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/extras-" . $shortprojectname . ".php", $_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/extras-" . $projectname . ".php");
-foreach ($files as $file)
+// include extras-$projectname.php
+$extras = $_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/extras-$projectname.php";
+if (file_exists($extras))
{
- if (file_exists($file))
- {
- include_once($file);
- break;
- }
+ include_once($extras);
}
$hadLoadDirSimpleError = 1; //have we echoed the loadDirSimple() error msg yet? if 1, omit error; if 0, echo at most 1 error
@@ -44,13 +40,13 @@
$showAll = (isset($_GET["showAll"]) && preg_match("/^(1)$/", $_GET["showAll"], $regs) ? $regs[1] : "0");
$showMax = (isset($_GET["showMax"]) && preg_match("/^(\d+)$/", $_GET["showMax"], $regs) ? $regs[1] : ($sortBy == "date" ? "10" : "5"));
-$PWD = "/home/local/data/httpd/download.eclipse.org/modeling/emf/query/downloads/drops";
+$PWD = "/home/local/data/httpd/download.eclipse.org/$modelingprojectname/$topprojectname/$shortprojectname/downloads/drops";
$downloadScript = getdownloadScript();
$downloadPre = "";
print "<div id=\"midcolumn\">\n";
-print "<h2>EMF Query P2 Repositories & SDK Dropins</h2>\n";
+print "<h2>$projectdisplayname P2 Repositories & SDK Dropins</h2>\n";
print "<p>This page provides a bundled P2 repository and different SDK dropins (in runnable form) for each build.</p>";
$branches = loadDirSimple($PWD, ".*", "d");
diff --git a/downloads/downloads-scripts.php b/downloads/downloads-scripts.php
index 1d2bde5..f9c250c 100644
--- a/downloads/downloads-scripts.php
+++ b/downloads/downloads-scripts.php
@@ -144,7 +144,7 @@
function createFileLinks($dls, $PWD, $branch, $ID, $pre2, $filePreProj, $ziplabel = "") // the new way - use a ziplabel pregen'd from a dir list!
{
- global $projectname, $suf, $proj, $shortprojectname, $filePreStatic, $projects;
+ global $projectname, $suf, $modelingprojectname, $shortprojectname, $filePreStatic;
$uu = 0;
if (!$ziplabel)
@@ -168,11 +168,11 @@
$u = $u ? array("$u") : array("");
}
- // support EMF page with three different valid prefixes which can
+ // support a page with three different valid prefixes which can
// overlap when searched using dynamic check below
- if ($filePreStatic && is_array($filePreStatic) && array_key_exists($proj,$filePreStatic))
+ if ($filePreStatic && is_array($filePreStatic) && array_key_exists($modelingprojectname,$filePreStatic))
{
- $filePreProj = array($filePreStatic[$proj][$cnt]); // just one value to check
+ $filePreProj = array($filePreStatic[$modelingprojectname][$cnt]); // just one value to check
}
$tries = array();
@@ -231,10 +231,10 @@
function fileFound($PWD, $url, $label, $md5AlignRight = true, $icon = null)
{
- global $downloadScript, $downloadPre, $projectname, $proj, $shortprojectname;
+ global $downloadScript, $downloadPre, $projectname, $modelingprojectname, $topprojectname, $shortprojectname;
$out = "";
- $mid = "$downloadPre/$proj/emf/$shortprojectname/downloads/drops/";
+ $mid = "$downloadPre/$modelingprojectname/$topprojectname/$shortprojectname/downloads/drops/";
$md5files = array("$url.md5", preg_replace("#/([^/]+$)#", "/checksum/$1", $url) . ".md5");
foreach ($md5files as $md5file)
{
@@ -251,7 +251,7 @@
function doNLSLinksList($packs, $cols, $subcols, $packSuf, $folder, $isArchive = false)
{
- global $downloadScript, $downloadPre, $projectname, $proj, $shortprojectname;
+ global $downloadScript, $downloadPre, $projectname, $modelingprojectname, $shortprojectname;
foreach ($packs as $name => $packPre)
{
@@ -271,7 +271,7 @@
$ret = array();
}
$ret[] = "<a href=\"" . ($isArchive ? "http://archive.eclipse.org" : $downloadScript) .
- "$downloadPre/$projectname$proj/downloads/drops/$folder$packPre$packMid-$packMid2$packSuf\">$alt2</a>";
+ "$downloadPre/$projectname/$modelingprojectname/downloads/drops/$folder$packPre$packMid-$packMid2$packSuf\">$alt2</a>";
$cnt++;
}
if (sizeof($ret) > 0)
@@ -285,7 +285,7 @@
foreach ($subcols as $alt2 => $packMid2)
{
$ret[] = "<a href=\"" . ($isArchive ? "http://archive.eclipse.org" : $downloadScript) .
- "$downloadPre/$projectname$proj/downloads/drops/$folder$packPre$packMid-$packMid2$packSuf\">$alt2</a>";
+ "$downloadPre/$projectname/$modelingprojectname/downloads/drops/$folder$packPre$packMid-$packMid2$packSuf\">$alt2</a>";
}
print join(", ", $ret);
}
@@ -332,7 +332,7 @@
function outputBuild($branch, $ID, $c)
{
- global $PWD, $dls, $filePre, $proj, $sortBy, $shortprojectname, $jdk14testsPWD, $jdk50testsPWD, $jdk60testsPWD, $testsPWD, $deps, $projectname, $hiddenBuilds;
+ global $PWD, $dls, $filePre, $modelingprojectname, $sortBy, $shortprojectname, $jdk14testsPWD, $jdk50testsPWD, $jdk60testsPWD, $testsPWD, $deps, $projectname, $hiddenBuilds;
# suppress hidden builds for public server
foreach ($hiddenBuilds as $hb) {
@@ -366,17 +366,17 @@
$ret .= "<ul id=\"r$ID\"" . (($c == 0 && !isset($_GET["hlbuild"])) || isset($_GET["hlbuild"]) && $ID == $_GET["hlbuild"] ? "" : " style=\"display: none\"") . ">\n";
- if (!isset($filePre[$proj]) && isset($filePre["/"]))
+ if (!isset($filePre[$modelingprojectname]) && isset($filePre["/"]))
{
- $filePre[$proj] = $filePre["/"];
+ $filePre[$modelingprojectname] = $filePre["/"];
}
- if (!isset($filePre[$proj]))
+ if (!isset($filePre[$modelingprojectname]))
{
$topProj = preg_replace("#.+/(.+)#","$1", $projectname);
- $filePre[$proj] = array($shortprojectname);
+ $filePre[$modelingprojectname] = array($shortprojectname);
}
- $ret .= createFileLinks($dls, $PWD, $branch, $ID, $pre2, $filePre[$proj], $ziplabel);
+ $ret .= createFileLinks($dls, $PWD, $branch, $ID, $pre2, $filePre[$modelingprojectname], $ziplabel);
$ret .= "</ul>\n";
$ret .= "</li>\n";
@@ -393,12 +393,11 @@
function showArchived($oldrels)
{
- global $projectname, $proj;
+ global $projectname, $modelingprojectname;
$thresh = sizeof($oldrels) > 5 ? ceil(sizeof($oldrels)/3) : 6;
- #print "<div id=\"midcolumn\">\n";
print "<h3><a name=\"archives\"></a>Archived Releases</h3>\n";
- print "<p>Older " . project_name($proj) . " releases have been moved to archive.eclipse.org, and can be accessed here:</p>";
+ print "<p>Older $projectdisplayname releases have been moved to archive.eclipse.org, and can be accessed here:</p>";
print '<table cellspacing="0" cellpadding="0" border="0" style="margin:0"><tr valign="top">'."\n";
print "<td><ul id=\"archives\">\n";
$cnt=-1;
@@ -415,9 +414,9 @@
}
else if (!is_array($oldrels[$z]))
{
- print "<li style=''><a href=\"http://archive.eclipse.org/$projectname$proj/downloads/drops/$z/R$oldrels[$z]/\">$z</a> (" . IDtoDateStamp($oldrels[$z], 2) . ")</li>\n";
+ print "<li style=''><a href=\"http://archive.eclipse.org/$projectname/$modelingprojectname/downloads/drops/$z/R$oldrels[$z]/\">$z</a> (" . IDtoDateStamp($oldrels[$z], 2) . ")</li>\n";
}
- else // optional syntax with hardcoded datestamp and URL, like for old EMF/SDO/XSD 1.x builds
+ else
{
print "<li><a href=\"" . $oldrels[$z][1] . "\">$z</a> (" . $oldrels[$z][0] . ")</li>\n";
}
diff --git a/downloads/index.php b/downloads/index.php
index 5af55aa..b455bbc 100644
--- a/downloads/index.php
+++ b/downloads/index.php
@@ -23,7 +23,7 @@
/* $project => sections/Project Name => (prettyname => filename) */
$dls = array(
/*"/newProj" => array(
- "Project Name" => array( # same as value in _projectCommon.php's $projects array
+ "Project Name" => array(
"<acronym title=\"Click to download archived All-In-One p2 Repo Update Site\"><img alt=\"Click to download archived All-In-One p2 Repo Update Site\" src=\"/$projectname/images/dl-icon-update-zip.gif\"/> <b style=\"color:green\">All-In-One Update Site</b></acronym>" => "Update",
"SDK (Runtime, Source)" => "SDK",
"Runtime" => "runtime",
@@ -31,38 +31,37 @@
"Automated Tests" => "automated-tests"
)
),*/
- "query" => array(
- "EMF Query" => array(
- "<acronym title=\"Click to download archived All-In-One p2 Repo Update Site\"><img alt=\"Click to download archived All-In-One p2 Repo Update Site\" src=\"/$projectname/images/dl-icon-update-zip.gif\"/> <b style=\"color:green\">All-In-One Update Site</b></acronym>" => "emf-query-Update",
- "SDK (Runtime, Source)" => "emf-query-SDK",
- "Runtime" => "emf-query-runtime",
- "Examples" => "emf-query-examples",
- "Automated Tests" => "emf-query-automated-tests"
+ "$shortprojectname" => array(
+ "$projectdisplayname" => array(
+ "<acronym title=\"Click to download archived All-In-One p2 Repo Update Site\"><img alt=\"Click to download archived All-In-One p2 Repo Update Site\" src=\"/$projectname/images/dl-icon-update-zip.gif\"/> <b style=\"color:green\">All-In-One Update Site</b></acronym>" => "$projectname-Update",
+ "SDK (Runtime, Source)" => "$projectname-SDK",
+ "Runtime" => "$projectname-runtime",
+ "Examples" => "$projectname-examples",
+ "Automated Tests" => "$projectname-automated-tests"
)
),
);
-/* list of valid file prefixes for projects who have been renamed; keys have leading / to match $proj */
+/* list of valid file prefixes for projects who have been renamed; keys have leading / to match $modelingprojectname */
/* only required if using something other than the default; otherwise will be generated */
-$filePre = array( # use "/" because GEF has no parent or child projects/components
- "/emf-query" => array("emf"),
+$filePre = array(
+ "/$projectname" => array("$topprojectname"),
);
-/* define showNotes(), $oldrels, doLanguagePacks() in extras-$proj.php (or just extras.php for flat projects) if necessary, downloads-common.php will include them */
+/* define showNotes(), $oldrels, doLanguagePacks() in extras-$projectname.php if necessary, downloads-common.php will include them */
/* end config */
-require_once($_SERVER["DOCUMENT_ROOT"] . "/emf-query/downloads/downloads-common.php");
+require_once($_SERVER["DOCUMENT_ROOT"] . "/$projectname/downloads/downloads-common.php");
$html = ob_get_contents();
ob_end_clean();
-$trans = array_flip($projects);
-$pageTitle = "EMF Query P2 Repositories and Zip Downloads";
-$pageKeywords = "emf query";
+$pageTitle = "$projectdisplayname P2 Repositories and Zip Downloads";
+$pageKeywords = "$topprojectname $projectname $shortprojectname";
$pageAuthor = "Anthony Hunter";
# Generate the web page
-$App->AddExtraHtmlHeader('<link rel="stylesheet" type="text/css" href="/emf-query/style.css"/>' . "\n");
-$App->AddExtraHtmlHeader('<script src="/emf-query/downloads/downloads.js" type="text/javascript"></script>' . "\n"); //ie doesn't understand self closing script tags, and won't even try to render the page if you use one
+$App->AddExtraHtmlHeader('<link rel="stylesheet" type="text/css" href="/' . $projectname . '/style.css"/>' . "\n");
+$App->AddExtraHtmlHeader('<script src="/' . $projectname . '/downloads/downloads.js" type="text/javascript"></script>' . "\n"); //ie doesn't understand self closing script tags, and won't even try to render the page if you use one
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>
diff --git a/downloads/scripts.php b/downloads/scripts.php
index 4ddcce1..e13556f 100644
--- a/downloads/scripts.php
+++ b/downloads/scripts.php
@@ -53,23 +53,6 @@
}
}
-function project_name($proj)
-{
- global $projects, $projectname;
-
- if (isset($projects))
- {
- $tmp = array_flip($projects);
- $proj = preg_replace("#^/#", "", $proj);
- return isset($tmp[$proj]) ? $tmp[$proj] :(isset($tmp[$projectname]) ? $tmp[$projectname] : "");
- }
- else
- {
- return strtoupper($proj);
- }
-
-}
-
function debug($str, $level = 0)
{
global $debug;
@@ -185,47 +168,16 @@
}
}
-function changesetForm($bugid = "")
-{
- ?>
-<form action="http://www.eclipse.org/modeling/emf/news/changeset.php"
- method="get" target="_blank">
- <p>
- <label for="bugid">Bug ID: </label><input size="7" type="text"
- name="bugid" id="bugid" value="<?php print $bugid; ?>" /> <input
- type="submit" value="Go!" />
- </p>
- <p>
- <a href="javascript:void(0)"
- onclick="javascript:this.style.display = 'none'; document.getElementById('changesetinfo').style.display = 'block';">How
- does this work?</a>
- </p>
- <div id="changesetinfo" style="display: none">
- <p>Use this form to generate a bash shell script which can be run
- against the projects and plugins in your workspace to produce a patch
- file showing all changes for a given bug.</p>
- <p>
- The requested bug must be indexed in the <a
- href="http://www.eclipse.org/modeling/searchcvs.php?q=190525">Search
- CVS</a> database. Download the generated script for more
- information. If the script is empty, then the bug was not found.
- </p>
- </div>
-</form>
-<?php
-
-}
-
function getDownloadScript()
{
global $projectname;
if(strstr($projectname, "/") !== false)
{
- list($topProj, $parentProj) = explode("/", $projectname); # modeling, emf
+ list($topProj, $parentProj) = explode("/", $projectname);
}
else
{
- list($topProj, $parentProj) = array("NONE", $projectname); # NONE, gef
+ list($topProj, $parentProj) = array("NONE", $projectname);
}
# if this is a Modeling page, use /modeling/download.php;