Clean up articles.

Change-Id: I1fd671737f3b31dd38940af3b889752266d1228c
diff --git a/Article-Adapters/code/org.eclipse.articles.adapters.core/.gitignore b/Article-Adapters/code/org.eclipse.articles.adapters.core/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/Article-Adapters/code/org.eclipse.articles.adapters.core/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/Article-Adapters/code/org.eclipse.articles.adapters.properties/.gitignore b/Article-Adapters/code/org.eclipse.articles.adapters.properties/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/Article-Adapters/code/org.eclipse.articles.adapters.properties/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/Article-Adapters/code/org.eclipse.articles.adapters.ui/.gitignore b/Article-Adapters/code/org.eclipse.articles.adapters.ui/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/Article-Adapters/code/org.eclipse.articles.adapters.ui/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/article.php b/article.php
index d77455a..62a749f 100644
--- a/article.php
+++ b/article.php
@@ -1,94 +1,54 @@
-<?php  																														require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");	require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); 	require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); 	$App 	= new App();	$Nav	= new Nav();	$Menu 	= new Menu();		include($App->getProjectCommon());    # All on the same line to unclutter the user's desktop'
-/*******************************************************************************
- * Copyright (c) 2007 Eclipse Foundation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Wayne Beaton (Eclipse Foundation)- initial API and implementation
- *******************************************************************************/
-
-	#*****************************************************************************
-	#
-	# article.php
-	#
-	# Author: 		Wayne Beaton
-	# Date:			2005-11-16
-	#
-	# Description: This page provides a frame for articles.
-	#
-	#
-	#****************************************************************************
-	
-	require_once("parts/functions.php");
-	
-	$host = $_SERVER['HTTP_HOST'];
-    $root = $_SERVER['DOCUMENT_ROOT'] . '/articles';
-	$file = $_GET['file'];
-		
-	// If the requested article does not exist, redirect to a warning page.
-	if (!is_valid_article_file($file)) $file = "nosucharticle.html";
-		
-	$article_path = "$root/$file";
-	
-	
-	$info_file = dirname($article_path) . '/info.xml';
-	if (file_exists($info_file)) {
-		$info = simplexml_load_file($info_file);
-	} else {
-		$info = null;
-	}
-		
-	#
-	# Begin: page-specific settings.  Change these. 
-	$pageTitle 		= get_title_from_html_document($article_path);
-	// TODO Should be able to extract the title from the XML data.
-	$pageKeywords	= "article, articles, tutorial, tutorials, how-to, howto, whitepaper, whitepapers, white, paper";
-	$pageAuthor		= "Wayne Beaton";
-	
-	# End: page-specific settings
-	#
-	$App->ExtraHtmlHeaders = "<link rel=\"stylesheet\" type=\"text/css\" href=\"layout.css\" media=\"screen\" />\n<base href=\"http://$host/articles/$file\"/>\n";
-
-	//$charset = "UTF-8";//$App->getHTTPParameter('charset');
-	//if ($charset) header("Content-Type: text/html; charset=$charset");
-	
-	ob_start();
-?>
-	<div style="float: left;">
-		<a href="/articles/index.php"><img src="/articles/images/back.gif"/> Back to Eclipse Corner Articles</a>
-	</div>
-	<div style="float: right;">
-		<!-- AddThis Button BEGIN -->
-		<script type="text/javascript">addthis_pub  = 'wbeaton';</script>
-		<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s9.addthis.com/button1-addthis.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
-		<!-- AddThis Button END -->
-		<a target="_blank" href="/articles/printable.php?file=<?= $file ?>"><img src="/articles/images/printer.gif"/> Printer-friendly version</a>
-	</div>
-
-	<div style="clear:both;"/>
-
-	<?php include ("parts/notices.php"); ?>
-	<?php include ("parts/versions.php"); ?>
- 	
-	<br/>
-
-	<div class="article">
-		<?php readfile($article_path); ?>		
-	</div>
-	
 <?php
-	$html = ob_get_contents();
-	ob_end_clean();
-	$App->generatePage($theme, $Menu, null, $pageAuthor, $pageKeywords, $pageTitle, $html);
-?>
+/*******************************************************************************
+ * Copyright (c) 2007,2021 Eclipse Foundation and others.
+ * 
+ * This program and the accompanying materials are made available under 
+ * the terms of the Eclipse Public License v2.0 which accompanies this 
+ * distribution, and is available at http://www.eclipse.org/legal/epl-2.0
+ *******************************************************************************/
+require_once ($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
+require_once ($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php");
+require_once ($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php");
+$App = new App();
+$Nav = new Nav();
+$Menu = new Menu();
+include ($App->getProjectCommon());
 
-<? 
-function get_info_for_article($article_path) {
-	
-	
+require_once dirname(__FILE__) . "/../projects/classes/debug.php";
+require_once dirname(__FILE__) . "/parts/functions.php";
+
+$host = $_SERVER['HTTP_HOST'];
+$root = $_SERVER['DOCUMENT_ROOT'] . '/articles';
+$file = $_GET['file'];
+
+// If the requested article does not exist as a file in this directory
+// structure, then we bail. The is_valid_article_file should protect us
+// from an injection attack.
+if (! is_valid_article_file($file)) {
+    header("Location: /articles");
+    exit();
 }
 
+$article_path = "$root/$file";
+$pageTitle = "An Eclipse Corner Article";
+$pageKeywords = "article, articles, tutorial, tutorials, how-to, howto, whitepaper, whitepapers, white, paper";
+$pageAuthor = "Wayne Beaton";
+
+$App->ExtraHtmlHeaders = "<link rel=\"stylesheet\" type=\"text/css\" href=\"layout.css\" media=\"screen\" />\n<base href=\"http://$host/articles/$file\"/>\n";
+
+ob_start();
+?>
+<div>
+	<a href="/articles/index.php"><img src="/articles/images/back.gif" />
+		Back to Eclipse Corner Articles</a>
+</div>
+
+<div class="article">
+		<?php readfile($article_path); ?>		
+</div>
+
+<?php
+$html = ob_get_contents();
+ob_end_clean();
+$App->generatePage($theme, $Menu, null, $pageAuthor, $pageKeywords, $pageTitle, $html);
 ?>
\ No newline at end of file
diff --git a/parts/functions.php b/parts/functions.php
index 15e00b1..7ad8af9 100644
--- a/parts/functions.php
+++ b/parts/functions.php
@@ -1,4 +1,4 @@
-<? 
+<?php 
 /*******************************************************************************
  * Copyright (c) 2007 Eclipse Foundation and others.
  * All rights reserved. This program and the accompanying materials
@@ -52,48 +52,4 @@
 	}
 	closedir($dir_handle);
 	return false;
-}
-	
-function get_title_from_html_document(&$file_name) {
-	$header = get_header_from_html_document($file_name);
-	
-	/*
-	 * Break the header up into multiple lines. Handle the
-	 * case where line breaks are lf, crlf, or cr.
-	 */
-	
-	$lines = preg_split("/\r?\n|\r/", $header); 
-	
-	/*
-	 * Merge the lines into a single line so that eregi
-	 * can find the title even if it is split over multiple
-	 * lines
-	 */
-	$one_line = implode(" ", $lines); 
-	
-	/*
-	 * If we can match a title tag, extract it.
-	 */
-	if (preg_match("/<title>(.*)<\/title>/i", $one_line, $title)) {
-    	return "Eclipse Corner Article: $title[1]";
-	}
-	
-	return "Eclipse Corner Article";
-}
-
-function get_header_from_html_document(&$file_name) {
-	$handle = @fopen($file_name, "r");
-	$content = "";
-    while (!feof($handle)) {
-        $part = fread($handle, 1024);
-        $content .= $part;
-        
-        /*
-         * Only read up to the part that includes the
-         * end tag for the header area.
-         */
-        if (preg_match("/<\/head>/i", $part)) break;
-    }
-    fclose($handle);
-    return $content;
 }
\ No newline at end of file
diff --git a/parts/notices.php b/parts/notices.php
deleted file mode 100755
index 2a034de..0000000
--- a/parts/notices.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<? 
-/*******************************************************************************
- * Copyright (c) 2007 Eclipse Foundation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Wayne Beaton (Eclipse Foundation)- initial API and implementation
- *******************************************************************************/
-if (strtotime("now") < strtotime("March 17, 2008")) { ?>
-<br/>
-<div style="width:480px;display:block;margin-left:auto;margin-right:auto"><a href="http://www.eclipsecon.org/2008/"><img border="0" 
- src="http://www.eclipsecon.org/2008/image/480x60.jpg" 
- width="480" height="60" alt="EclipseCon 2008"/></a></div>
-<? } ?>
\ No newline at end of file
diff --git a/parts/versions.php b/parts/versions.php
deleted file mode 100755
index 3a8b327..0000000
--- a/parts/versions.php
+++ /dev/null
@@ -1,75 +0,0 @@
- <? 
- /*******************************************************************************
- * Copyright (c) 2007 Eclipse Foundation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Wayne Beaton (Eclipse Foundation)- initial API and implementation
- *******************************************************************************/
- 
- if ($info != null) { 
- 	require_once(dirname(__FILE__) ."/../../projects/classes/Project.class.php");
- 	?>
- 
- <style>
- 	.info-box {width:600px;display:block;margin-left:auto;margin-right:auto;margin-top:10px;margin-bottom:10px;border-style:solid;border-width:1px;padding:5px}
- 	.info-bullet {margin-left:50px}
- </style>
- 
- <div class="info-box">
- 
- <?
- 	if (isset($info->outdated)) $App->setOutDated();
- 	if ($info->project) {
-		echo "<p>This article is known to apply to the following Eclipse project";
- 		if (count($info->project) > 1) echo "s";
- 		echo ":</p>";
- 		echo "<ul>";
- 		$separator = "";
- 		foreach($info->project as $project) {
- 			echo "<li class=\"info-bullet\">";
- 			$id = (string)$project['id'];
- 			$name = $id;
-			if ($project_info = getProject($id))
-				$name = $project_info->getName();
- 			echo "<a href=\"http://www.eclipse.org/projects/project_summary.php?projectid=$id\">$name</a>";
- 			
- 			if ($project->release) {
- 				echo ", release";
- 				if (count ($project->release) > 1) echo "s";
- 				$separator = " ";
- 				foreach ($project->release as $release) {
- 					echo $separator . $release;
- 					$separator = ", ";
- 				}
- 			}
- 			
- 			echo "</li>";
- 		}
- 		echo "</ul>";
- 		
- 		echo "<p>Help us keep this information up-to-date: let us know if this information applies to other projects or releases.";
- 	}
- ?>
- 
- <?
- 	if ($info->bug) {
- 		echo "<p>To comment on this article, ask questions, or propose corrections, please see ";
- 		$separator = "";
- 		foreach($info->bug as $bug) {
- 			$id = $bug['id'];
- 			echo $separator . "<a href=\"https://bugs.eclipse.org/bugs/show_bug.cgi?id=$id\">bug $id</a>";
- 			$separator = ", ";
- 		}
- 		echo ".<p>";
- 	} else {
- 		echo "<p>To comment on this article, ask questions, or propose corrections, please <a href\"https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Articles\">open a bug</a>.</p>";
- 	}
- 	
- ?>
-
-</div>
-<? } ?>