[299402] Extract properties files from Eclipse project update sites for translation
diff --git a/babel-setup.sql b/babel-setup.sql
index 664d214..8261b95 100644
--- a/babel-setup.sql
+++ b/babel-setup.sql
@@ -103,11 +103,25 @@
   `filename` varchar(100) NOT NULL,
   `location` varchar(255) NOT NULL,
   `is_active` tinyint(3) unsigned NOT NULL default '1',
+  `is_map_file` tinyint(3) unsigned NOT NULL default '1',
   PRIMARY KEY  (`project_id`, `version`, `filename`),
   CONSTRAINT `map_files_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 --
+-- Table structure for table `plugin_exclude_patterns`
+--
+
+DROP TABLE IF EXISTS `plugin_exclude_patterns`;
+CREATE TABLE `plugin_exclude_patterns` (
+  `project_id` varchar(100) NOT NULL,
+  `version` varchar(64) NOT NULL,
+  `pattern` varchar(128) NOT NULL,
+  PRIMARY KEY  (`project_id`, `version`, `pattern`),
+  CONSTRAINT `plugin_exclude_patterns_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`project_id`) ON UPDATE CASCADE ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
 -- Table structure for table `profiles`
 --
 
@@ -509,32 +523,32 @@
 insert into release_train_projects values ('helios',   'webtools',      '3.2');
 
 /* MAP INPUTS */
-insert into map_files values ("eclipse", "3.4", "ant.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ant.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "base.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/base.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "compare.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/compare.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "core-hpux.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-hpux.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "core-macosx.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-macosx.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "core-qnx.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-qnx.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "core-variables.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-variables.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "core.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "doc.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/doc.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "equinox-incubator.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/equinox-incubator.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "feature.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/feature.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "jdtapt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtapt.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "jdtcore.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtcore.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "jdtdebug.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtdebug.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "jdtui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtui.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "orbit.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/orbit.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "pde.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/pde.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "rcp.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/rcp.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "releng.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/releng.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "swt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/swt.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "team.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/team.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "testframework.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/testframework.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "text.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/text.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "ui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ui.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "update.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/update.map?view=co", 1);
-insert into map_files values ("eclipse", "3.4", "userassist.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/userassist.map?view=co", 1);
+insert into map_files values ("eclipse", "3.4", "ant.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ant.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "base.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/base.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "compare.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/compare.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "core-hpux.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-hpux.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "core-macosx.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-macosx.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "core-qnx.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-qnx.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "core-variables.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core-variables.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "core.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "doc.map","http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/doc.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "equinox-incubator.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/equinox-incubator.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "feature.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/feature.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "jdtapt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtapt.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "jdtcore.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtcore.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "jdtdebug.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtdebug.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "jdtui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/jdtui.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "orbit.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/orbit.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "pde.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/pde.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "rcp.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/rcp.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "releng.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/releng.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "swt.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/swt.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "team.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/team.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "testframework.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/testframework.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "text.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/text.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "ui.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/ui.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "update.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/update.map?view=co", 1, 1);
+insert into map_files values ("eclipse", "3.4", "userassist.map", "http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/userassist.map?view=co", 1, 1);
 
 /* populate file_progress table  */
 /* See also: dbmaintenance_15min.php */
diff --git a/html/callback/getExcludePatterns.php b/html/callback/getExcludePatterns.php
new file mode 100644
index 0000000..f5607f8
--- /dev/null
+++ b/html/callback/getExcludePatterns.php
@@ -0,0 +1,31 @@
+<?php
+/*******************************************************************************
+ * Copyright (c) 2010 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:
+ *    Eclipse Foundation - Initial API and implementation
+ *    Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation
+*******************************************************************************/
+require_once("cb_global.php");
+
+$return = array();
+
+$project_id = getHTTPParameter("project_id", "POST");
+$version 	= getHTTPParameter("version", "POST");
+
+$query = "SELECT pattern FROM plugin_exclude_patterns WHERE project_id = " . returnQuotedString(sqlSanitize($project_id, $dbh)) .
+	" AND version = " . returnQuotedString(sqlSanitize($version, $dbh));
+
+$res = mysql_query($query, $dbh);
+if (mysql_affected_rows($dbh) > 0) {
+	while ($line = mysql_fetch_array($res, MYSQL_ASSOC)) {
+		echo $line['pattern'] . "\n";
+	}
+} else {
+	echo "No plugin exclude patterns found for $project_id $version.";
+}
+?>
\ No newline at end of file
diff --git a/html/callback/getMapFiles.php b/html/callback/getMapFiles.php
index b5ae240..e7f12d6 100644
--- a/html/callback/getMapFiles.php
+++ b/html/callback/getMapFiles.php
@@ -8,6 +8,7 @@
  *
  * Contributors:
  *    Eclipse Foundation - initial API and implementation
+ *    Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation
 *******************************************************************************/
 require_once("cb_global.php");
 
@@ -23,12 +24,11 @@
 	AND m.version = " . returnQuotedString(sqlSanitize($version, $dbh));
 
 $res = mysql_query($query,$dbh);
-if(mysql_affected_rows($dbh) > 0) {
-	while($line = mysql_fetch_array($res, MYSQL_ASSOC)){
+if (mysql_affected_rows($dbh) > 0) {
+	while ($line = mysql_fetch_array($res, MYSQL_ASSOC)) {
 		echo $line['location'] . "\n";
 	}
+} else {
+	echo "No map files or update sites found for $project_id $version.";
 }
-else {
-	echo "No map files found for $project_id $version.";
-}
-?>
\ No newline at end of file
+?>
diff --git a/html/callback/getUrlType.php b/html/callback/getUrlType.php
new file mode 100644
index 0000000..0e4844c
--- /dev/null
+++ b/html/callback/getUrlType.php
@@ -0,0 +1,31 @@
+<?php
+/*******************************************************************************
+ * Copyright (c) 2010 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:
+ *    Eclipse Foundation - Initial API and implementation
+ *    Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation
+*******************************************************************************/
+require_once("cb_global.php");
+
+$return = array();
+
+$project_id = getHTTPParameter("project_id", "POST");
+$version 	= getHTTPParameter("version", "POST");
+
+$query = "SELECT is_map_file FROM map_files WHERE project_id = " . returnQuotedString(sqlSanitize($project_id, $dbh)) .
+	" AND version = " . returnQuotedString(sqlSanitize($version, $dbh)) . " LIMIT 1";
+
+$res = mysql_query($query, $dbh);
+if (mysql_affected_rows($dbh) > 0) {
+	while ($line = mysql_fetch_array($res, MYSQL_ASSOC)) {
+		echo $line['is_map_file'];
+	}
+} else {
+	echo "No plugin exclude patterns found for $project_id $version.";
+}
+?>
diff --git a/html/content/en_map_files.php b/html/content/en_map_files.php
index f35fbfa..cc35006 100644
--- a/html/content/en_map_files.php
+++ b/html/content/en_map_files.php
@@ -1,29 +1,14 @@
 <script src="js/mapFiles.js" type='text/javascript'></script>
 <script src="js/train.js" type='text/javascript'></script>
 <div id="maincontent">
-<div id="rightcolumn">
-		<div class="sideitem">
-			<h6>Committer checklist</h6>
-			<ul>
-				<li>Externalize strings to .properties files</li>
-				<br />
-				<li>Maintain your map files on the Babel server (this page) with every release</li>
-				<br />
-				<li>Tell your community about Babel, how to help translate, link to the <a href="http://www.eclipse.org/babel/downloads.php">Babel download page</a></li>
-			</ul>
-		</div>
-</div>
-
 <div id="midcolumn">
-
 <h1><?= $pageTitle ?></h1>
-<p>Use this form to define the map files for your project. The map files are read nightly, and any .properties files (except build.properties) contained in the plugins they reference will be parsed and imported into Babel, allowing the community to translate the externalized strings.</p>  
-<p>This page is only accessible by Eclipse committers.</p>
+<p>Use this form to define the map files or update sites for your project. The map files or update sites are read nightly. Any .properties files except those listed in the plugin exclude patterns will be parsed and imported into Babel, allowing the community to translate the externalized strings.</p>
 <form name="form1" method="post">
 <table cellspacing=4 cellpadding=0 border=0>
-<tr><td></td><td colspan=2 style="color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr>
+<tr><td "width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][0] ?></td></tr>
 <tr>
-  <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();">
+  <td>Project:</td><td><select name="project_id" onchange="fnSetVersionList();" style="width:100px">
 <?php
 	while($myrow = mysql_fetch_assoc($rs_project_list)) {
 		$selected = "";
@@ -33,16 +18,16 @@
 		echo "<option value='" . $myrow['project_id'] . "' $selected>" . $myrow['project_id'] . "</option>";
 	}
  ?></select></td>
-  <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][1] ?></td>
+  <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][1] ?></td>
 </tr>
 <tr>
-  <td>Release Version</td><td><select name="version" onchange="fnUpdateFileList();">
-</select> * Indicates map files present</td> 
+  <td>Release Version:</td>
+  <td><select name="version" onchange="fnUpdateFileList();" style="width:100px"></select> * Indicates map files or update sites present</td> 
   <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][4] ?></td>
 </tr>
 <tr>
-  <td>Release Train</td><td><select name="train_id">
-  <?php
+  <td>Release Train:</td>
+  <td><select name="train_id" style="width:100px"><?php
 	while($myrow = mysql_fetch_assoc($rs_train_list)) {
 		$selected = "";
 		if($myrow['train_id'] == $TRAIN_ID) {
@@ -50,34 +35,32 @@
 		}
 		echo "<option value='" . $myrow['train_id'] . "' $selected>" . $myrow['train_id'] . "</option>";
 	}
- ?>
-</select></td>
+  ?></select></td>
   <td></td>
 </tr>
 <tr>
-	<td>&#160;</td><td>Babel builds one update site per Train.  Even if your project does not participate in the actual train, please pick the Train that your project is targetting.</td>
+  <td>URLs to Map Files or Update Sites:</td>
+  <td>
+    <input id="urlType-mapFiles" name="urlType" type="radio" value="mapFiles" checked>Map Files</input>
+    <input id="urlType-updateSites" name="urlType" type="radio" value="updateSites">Update Sites</input>
+  </td>
+  <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
 </tr>
 <tr>
-	<td>&#160;</td><td><b>NOTE: </b>The Release Train applies to all map files for the selected Project Release Version.</td>
+  <td colspan=3><textarea id="files-area" name="fileFld" onclick="fnClickTextFilesArea();" rows=5 cols="100"></textarea></td>
 </tr>
 <tr>
-	<td>&#160;</td><td></td>
-</tr>
-
-<tr>
-  <td colspan="2"><a href="<?php echo imageRoot() ?>/viewcvs/index.cgi">ViewCVS</a> download URLs to map files (one per line):</td><td></td>
-  <td style='width:100px; color:red;'><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
+  <td colspan=2>Plugin Exclude Patterns:</td>
+  <td style="width:100px; color:red;"><?= $GLOBALS['g_ERRSTRS'][2] ?></td>
 </tr>
 <tr>
-	<td colspan="3"><textarea id="files-area" name="fileFld" onclick="fnClickText();" rows="14" cols="120"></textarea></td>
+  <td colspan=3><textarea id="patterns-area" name="patterns" onclick="fnClickTextPatternsArea();" rows="5" cols="100"></textarea></td>
 </tr>
 <tr>
-  <td colspan="2"><b>NOTE: </b>If you're defining map files for a Release, you must use the download link to the CVS TAG of that release.  This is the pathrev=R3_4 parameter in this example:<br />
-  <a href="<?php echo imageRoot() ?>/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=R3_4">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=R3_4</a><br />
-  <a href="<?php echo imageRoot() ?>/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=HEAD">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.releng/maps/core.map?view=co&pathrev=HEAD</a>  </td>
+  <td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td>
+  <td></td>
+  <td></td>
 </tr>
-<tr>
-  <td></td><td><input type="submit" name="submit" value="Save" style="font-size:14px;" /></td></tr>
 </table>
 </form>
 <script language="javascript">
@@ -109,14 +92,24 @@
 		return _value.replace(/^\* /, "");
 	}
 
-	function fnClickText() {
-		if(document.form1.fileFld.value.substr(0,18) == "No map files found") {
+	function fnClickTextFilesArea() {
+		if(document.form1.fileFld.value.substr(0,12) == "No map files") {
 			document.form1.fileFld.value = "";
 		}
 	}
 	
+	function fnClickTextPatternsArea() {
+		if(document.form1.patterns.value.substr(0,26) == "No plugin exclude patterns") {
+			document.form1.patterns.value = "";
+		}
+	}
+
 	function fnUpdateFileList() {
-		showMapFiles(document.form1.project_id.value, cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value));		
+        var project_id = document.form1.project_id.value;
+		var version = cleanVersion(document.form1.version.options[document.form1.version.selectedIndex].value);
+		showMapFiles(project_id, version);		
+		showPluginExcludePatterns(project_id, version);		
+		setUrlType(project_id, version);		
 		fnSetTrain();
 	}
 	
@@ -192,4 +185,4 @@
 	echo "};";
  ?>
 	fnSetVersionList();
- </script>
\ No newline at end of file
+ </script>
diff --git a/html/js/mapFiles.js b/html/js/mapFiles.js
index e37165f..7c56a6d 100644
--- a/html/js/mapFiles.js
+++ b/html/js/mapFiles.js
@@ -7,6 +7,7 @@
  *
  * Contributors: 
  *    Eclipse Foundation - initial API and implementation
+ *    Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation
 *******************************************************************************/
 
 function showMapFiles(project_id, version){
@@ -26,7 +27,49 @@
 	this.setupCB();
 }
 
+function showPluginExcludePatterns(project_id, version){
+	var callback = 
+	{ 
+		start:function(eventType, args){ 
+		},
+		success: function(o) {
+			var domNode = document.getElementById('patterns-area');
+			domNode.innerHTML = o.responseText;		
+		},
+		failure: function(o) {
+			YAHOO.log('failed!');
+		}
+	} 
+	YAHOO.util.Connect.asyncRequest('POST', "callback/getExcludePatterns.php", callback, "project_id="+project_id+"&version="+version);
+	this.setupCB();
+}
+
+function setUrlType(project_id, version){
+	var callback = 
+	{ 
+		start:function(eventType, args){ 
+		},
+		success: function(o) {
+			var domNodeMapFiles = document.getElementById('urlType-mapFiles');
+			var domNodeUpdateSites = document.getElementById('urlType-updateSites');
+			// o.responseText contains is_map_file for the project version
+			if (o.responseText == "0") {
+				domNodeMapFiles.checked = false;
+				domNodeUpdateSites.checked = true;
+			} else {
+				domNodeMapFiles.checked = true;
+				domNodeUpdateSites.checked = false;
+			}
+		},
+		failure: function(o) {
+			YAHOO.log('failed!');
+		} 
+	} 
+	YAHOO.util.Connect.asyncRequest('POST', "callback/getUrlType.php", callback, "project_id="+project_id+"&version="+version);
+	this.setupCB();
+}
+
 function setupCB(){
 	// document.onmouseup = null;
 	// YAHOO.util.Event.addListener("clear-btn","click",clearHints);
-}
\ No newline at end of file
+}
diff --git a/html/map_files.php b/html/map_files.php
index 3411e2b..efc113c 100644
--- a/html/map_files.php
+++ b/html/map_files.php
@@ -9,6 +9,7 @@
  * Contributors:
  *    Eclipse Foundation - Initial API and implementation
  *    Kit Lo (IBM) - patch, bug 266010, Map file table does not show release train and file name info
+ *    Kit Lo (IBM) - Bug 299402, Extract properties files from Eclipse project update sites for translation
 *******************************************************************************/
 include("global.php");
 
@@ -28,7 +29,7 @@
 require(dirname(__FILE__) . "/../classes/file/file.class.php");
 
 
-$pageTitle 		= "Babel - Define Map Files";
+$pageTitle 		= "Babel - Define Map Files or Update Sites";
 $pageKeywords 	= "";
 $incfile 		= "content/en_map_files.php";
 
@@ -36,6 +37,7 @@
 $VERSION	= getHTTPParameter("version");
 $TRAIN_ID 	= getHTTPParameter("train_id");
 $FILE_FLD	= getHTTPParameter("fileFld");
+$PATTERNS	= getHTTPParameter("patterns");
 $FILENAME	= getHTTPParameter("filename");
 $SUBMIT 	= getHTTPParameter("submit");
 
@@ -43,12 +45,19 @@
 
 if($SUBMIT == "Save") {
 	if($PROJECT_ID != "" && $VERSION != "" && $FILE_FLD != "") {
+		# Set URL type
+		$is_Map_file = 1;
+		if ($_POST["urlType"] == "updateSites") {
+			$is_Map_file = 0;
+		}
+
+		# Delete old map files for this project version
 		$sql = "DELETE FROM map_files WHERE project_id = "
 			. returnQuotedString(sqlSanitize($PROJECT_ID, $dbh)) 
 			. " AND version = " . returnQuotedString(sqlSanitize($VERSION, $dbh));
 		mysql_query($sql, $dbh);
 
-		# loop
+		# Insert new map files for this project version
 		$list = explode("\n", $FILE_FLD);
 		foreach ($list as $file) {
 			$file = str_replace("\r", "", $file);
@@ -58,11 +67,30 @@
 					. "," . returnQuotedString(sqlSanitize($VERSION, $dbh))
 					. "," . returnQuotedString(sqlSanitize(md5($file), $dbh))
 					. "," . returnQuotedString(sqlSanitize($file, $dbh))
-					. ", 1)";
+					. ", 1, $is_Map_file)";
 				mysql_query($sql, $dbh);
 			}
 		}
-		
+
+		# Delete old plugin exclude patterns for this project version
+		$sql = "DELETE FROM plugin_exclude_patterns WHERE project_id = "
+			. returnQuotedString(sqlSanitize($PROJECT_ID, $dbh)) 
+			. " AND version = " . returnQuotedString(sqlSanitize($VERSION, $dbh));
+		mysql_query($sql, $dbh);
+
+		# Insert new plugin exclude patterns for this project version
+		$list = explode("\n", $PATTERNS);
+		foreach ($list as $pattern) {
+			$pattern = str_replace("\r", "", $pattern);
+			if (strlen($pattern) > 0) {
+				$sql = "INSERT INTO plugin_exclude_patterns VALUES ("
+					. returnQuotedString(sqlSanitize($PROJECT_ID, $dbh))
+					. "," . returnQuotedString(sqlSanitize($VERSION, $dbh))
+					. "," . returnQuotedString(sqlSanitize($pattern, $dbh)) . ")";
+				mysql_query($sql, $dbh);
+			}
+		}
+
 		# Save the project/train association
 		$sql = "DELETE FROM release_train_projects WHERE project_id = "
 			. returnQuotedString(sqlSanitize($PROJECT_ID, $dbh)) 
@@ -106,4 +134,4 @@
 include($incfile);
 $addon->callHook("footer");
 
-?>
\ No newline at end of file
+?>
diff --git a/html/process_update_sites.php b/html/process_update_sites.php
index 3b42878..29238dc 100644
--- a/html/process_update_sites.php
+++ b/html/process_update_sites.php
@@ -13,15 +13,6 @@
 /*
  * Extract properties files from update sites 
  */
-# To-do: hard-coding the Eclipse, BIRT, & Webtools update sites for now; need to create an UI for project committers to enter their update sites
-$eclipse = array("http://download.eclipse.org/eclipse/updates/3.6milestones/S-3.6M4-200912101301", "eclipse", "3.6");
-$birt = array("http://download.eclipse.org/birt/update-site/2.6-interim", "birt", "2.6.0");
-$webtools = array("http://download.eclipse.org/webtools/updates", "webtools", "3.2");
-
-# BIRT 2.6.0 & Webtools 3.2 are not defined yet, cannot test on staging server
-#$update_sites = array($eclipse, $birt, $webtools);
-$update_sites = array($eclipse);
-
 $temp_dir = "/tmp/tmp-babel/";
 $debug = TRUE;
 $files = array();
@@ -54,10 +45,13 @@
   $rsync_host = "rsync.osuosl.org::eclipse/";
 }
 
-foreach ($update_sites as $update_site) {
-  $site_url = $update_site[0];
-  $project_id = $update_site[1];
-  $version = $update_site[2];
+# Get all active update sites
+$sql = "SELECT * FROM map_files WHERE is_active = 1 AND is_map_file = 0";
+$rs_maps = mysql_query($sql, $dbh);
+while($update_site = mysql_fetch_assoc($rs_maps)) {
+  $site_url = $update_site['location'];
+  $project_id = $update_site['project_id'];
+  $version = $update_site['version'];
   # Sample dirs:
   # $site_url         http://download.eclipse.org/eclipse/updates/3.6milestones/S-3.6M4-200912101301
   # $site_dir         eclipse/updates/3.6milestones/S-3.6M4-200912101301/
@@ -147,6 +141,7 @@
 }
 
 # Deactivate the rest of the files
+echo "Start deactivating inactive properties files in all projects above...\n";
 foreach ($files as $file) {
   $file->is_active = 0;
   if (!$file->save()) {
@@ -156,6 +151,7 @@
     echo "  " . $file->name . "\n";
   }
 }
+echo "Done deactivating " . sizeof($files) . " inactive properties files in all projects above\n\n";
 
 if ($headless) {
   $User = null;