hudson builds feed
diff --git a/.project b/.project
index 8418e4b..ae27059 100644
--- a/.project
+++ b/.project
@@ -5,7 +5,18 @@
<projects>
</projects>
<buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.dltk.core.scriptbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
+ <nature>org.eclipse.php.core.PHPNature</nature>
</natures>
</projectDescription>
diff --git a/images/failed.png b/images/failed.png
new file mode 100644
index 0000000..c8b2152
--- /dev/null
+++ b/images/failed.png
Binary files differ
diff --git a/images/success.png b/images/success.png
new file mode 100644
index 0000000..f132672
--- /dev/null
+++ b/images/success.png
Binary files differ
diff --git a/images/unstable.png b/images/unstable.png
new file mode 100644
index 0000000..dad77be
--- /dev/null
+++ b/images/unstable.png
Binary files differ
diff --git a/indexTest.php b/indexTest.php
new file mode 100644
index 0000000..31edeec
--- /dev/null
+++ b/indexTest.php
@@ -0,0 +1,69 @@
+<?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());
+
+require($_SERVER["DOCUMENT_ROOT"] . "/modeling/includes/db.php");
+
+ob_start();
+?>
+
+<div id="midcolumn">
+ <h1>Textual Modeling Framework</h1>
+ <?php
+ include($_SERVER["DOCUMENT_ROOT"] . "/modeling/includes/index-common.php");
+ ?>
+</div>
+
+<div id="rightcolumn">
+
+
+ <div class="sideitem">
+ <h6><a href="https://hudson.eclipse.org/xtext/view/Xtext-Xtend/job/xtext-xtend/rssAll"><img style="float:right" alt="Build Feeds" src="/modeling/images/rss-atom10.gif"/></a>Build News</h6>
+ <?php
+ include($_SERVER["DOCUMENT_ROOT"] . "/modeling/tmf/scripts/build-status.php");
+
+ $feed = new BuildFeed ( "https://hudson.eclipse.org/xtext/view/Xtext-Xtend/job/xtext-xtend/rssAll" );
+ $builds = array_slice($feed->posts, 0, 7);
+ foreach ( $builds as $build ) {
+ $clDate = gmdate('d.M.Y H:i:s', date($build->ts));
+ print "<p><img src=\"/modeling/tmf/images/$build->status.png\" alt=\"$build->status\"/><a href=\"$build->link\">#$build->num $clDate </a></p>\n";
+ }
+ ?>
+ </div>
+ <div class="sideitem">
+ <h6>News on Twitter</h6>
+ <a class="twitter-timeline" href="https://twitter.com/xtext" data-widget-id="509687897004318720">@xtext Tweets</a>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
+ </div>
+ <div class="sideitem">
+ <h6>Modeling Corner</h6>
+ <p>Want to <a href="http://wiki.eclipse.org/index.php/Modeling_Corner">contribute</a> models, projects, files, ideas, utilities, or code to
+ <a href="http://www.eclipse.org/modeling/tmf/">TMF</a> or any other part of the <a href="http://www.eclipse.org/modeling/">Modeling Project</a>?
+ Now you can!</p>
+ <p>Have a look, post your comments, submit a link, or just read what others have written. <a href="http://wiki.eclipse.org/index.php/Modeling_Corner">Details here</a>.</p>
+ </div>
+
+ <div class="sideitem" id="related">
+ <h6>Related links</h6>
+ <ul>
+ <li><a href="http://www.eclipse.org/modeling/">Eclipse Modeling</a></li>
+ <li>Web: <a href="http://www.eclipse.org/emf/">EMF</a>,
+ <a href="http://www.eclipse.org/modeling/m2t/">M2T</a></li>
+ <li>Wiki: <a href="http://wiki.eclipse.org/index.php/Category:EMF">EMF</a>,
+ <a href="http://wiki.eclipse.org/index.php/Category:GMF">GMF</a>,
+ <a href="http://wiki.eclipse.org/index.php/Category:M2T">M2T</a></li>
+ <li><a href="http://www.eclipse.org/modeling/emf/docs/misc/UsingUpdateManager/UsingUpdateManager.html">Using Update Manager</a></li>
+ <li><a href="http://www.eclipse.org/newsgroups/">Eclipse newsgroups</a></li>
+ </ul>
+ </div>
+</div>
+<?php
+$html = ob_get_contents();
+ob_end_clean();
+
+$pageTitle = "Eclipse Modeling - TMF - Home";
+$pageKeywords = "Xtext Textual Modeling Domain-specific language DSL"; // TODO: add something here
+$pageAuthor = "Sven Efftinge, Dennis Huebner";
+
+$App->AddExtraHtmlHeader('<link rel="stylesheet" type="text/css" href="/modeling/includes/index.css"/>' . "\n");
+$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
+?>
diff --git a/scripts/build-status.php b/scripts/build-status.php
new file mode 100644
index 0000000..a9127fd
--- /dev/null
+++ b/scripts/build-status.php
@@ -0,0 +1,75 @@
+<?php
+class Build {
+ var $date;
+ var $ts;
+ var $link;
+ var $title;
+ var $text;
+ var $status;
+ var $num;
+
+}
+class BuildFeed {
+ var $posts = array ();
+ function __construct($file_or_url) {
+ $file_or_url = $this->resolveFile ( $file_or_url );
+ if (! ($x = simplexml_load_file ( $file_or_url )))
+ return;
+
+ foreach ( $x->entry as $item ) {
+ $post = new Build ();
+ $post->date = ( string ) $item->published;
+ $post->ts = strtotime ( $item->published );
+ $post->link = ( string ) $item->link['href'];
+ $post->title = ( string ) $item->title;
+
+ $match = array();
+ preg_match('/\#(?P<num>\d+) \((?P<message>.+)\)/', $item->title, $match);
+ $post->num = ( string ) $match['num'];
+
+ $message = $match['message'];
+ $post->text = ( string ) $message;
+ $post->status = ( string ) $this->parseStatus ($message);
+
+ // Create summary as a shortened body and remove images,
+ // extraneous line breaks, etc.
+ #$post->summary = $this->summarizeText ( $post->text );
+ $this->posts [] = $post;
+ }
+ }
+ private function resolveFile($file_or_url) {
+ if (! preg_match ( '|^https?:|', $file_or_url ))
+ $feed_uri = $_SERVER ['DOCUMENT_ROOT'] . '/shared/xml/' . $file_or_url;
+ else
+ $feed_uri = $file_or_url;
+
+ return $feed_uri;
+ }
+ private function summarizeText($summary) {
+ $summary = strip_tags ( $summary );
+
+ // Truncate summary line to 100 characters
+ $max_len = 100;
+ if (strlen ( $summary ) > $max_len)
+ $summary = substr ( $summary, 0, $max_len ) . '...';
+
+ return $summary;
+ }
+
+ private function parseStatus($text) {
+ $status = "success";
+ if (strpos($text, 'fail') !== false) {
+ $status = 'unstable';
+ }
+ if (strpos($text, 'broken') !== false) {
+ $status = 'failed';
+ }
+
+ return $status;
+ }
+
+ private function parseBuildNumber($text) {
+
+ }
+}
+?>
\ No newline at end of file