<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2117597481687734563</id><updated>2011-07-30T17:02:53.084-07:00</updated><category term='xtext'/><category term='Eclipse Sweden'/><category term='eclipse'/><category term='b3'/><category term='buckminster'/><category term='eclipse spaces publishing xdrive plugin bundle OSGi'/><category term='cloudsmith'/><title type='text'>Eclipse by Planetary Transits</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-3462068600400267225</id><published>2010-05-19T14:59:00.000-07:00</published><updated>2010-05-19T15:22:23.290-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='xtext'/><category scheme='http://www.blogger.com/atom/ns#' term='b3'/><title type='text'>Implementing Date Support with Quickfix using Xtext</title><content type='html'>&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;Now that Xtext is at 1.0 RC1 I thought it was time to start using more of all the new features for Eclipse b3. One of the features I wanted to add was to support time stamps in a nice way in the editor. Internally, a time stamp is naturally stored as a &lt;code&gt;java.util.Date&lt;/code&gt; so there is never a question about the exact UTC it is representing. When editing however, you may want to use some other format (if not copying an actual timestamp, you may want to use something like 'feb 10, 11:00:00am' .&lt;/p&gt;
&lt;p&gt;The issue is that the reference to 'feb 10, 11:00:00am' in the source text has no time zone information, and the name of the month may not be in english etc. In order for the source to be valid everywhere, it would be required to fully specify the date format used, as well as the timezone and store this in the source. I choose a middle ground where the editor understands the more human friendly formats and offers to help to convert it to a format that is always possible to parse.&lt;/p&gt;
&lt;p&gt;All of this may not be all that interesting, but it gave me opportunity to try some features of Xtext that I had not used. The rest of this blog is about my first iteration of the implementation, and it shows some Xtext techniques like:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Using an ecore data type in the grammar&lt;/li&gt;

  &lt;li&gt;A Date value converter&lt;/li&gt;

  &lt;li&gt;Overriding the SyntaxErrorMessageProvider&lt;/li&gt;

  &lt;li&gt;Providing a quick fix for a ValueConverterException&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;The Grammar&lt;/h2&gt;
&lt;p&gt;First step is to define the grammar that involves a time stamp&lt;/p&gt;
&lt;pre&gt;
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
Entity : "timestamp" '=' TIMESTAMP ;
TIMESTAMP returns ecore::EDate : STRING ;
&lt;/pre&gt;This simply declares that a language element 'Entity' has a 'timestamp'. The TIMESTAMP rule declares that it returns an &lt;code&gt;ecore:EDate&lt;/code&gt;. Luckily we don't have to state more than the import of ecore to make use of it in our language. Also in our favour is that EDate is declared in ecore. If this was for a datatype not in ecore, we would need to create a model containing the definition of the data type. As this was not the case here, we can move on to the data converter.

&lt;p&gt;Date Value Converter&lt;/p&gt;This is almost boiler plate code, but there are some interesting details. Here is the converter method.

&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#808080"&gt;01&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#646464"&gt;@ValueConverter&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;rule =&lt;/font&gt; &lt;font color="#2A00FF"&gt;"TIMESTAMP"&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;02&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;IValueConverter&amp;lt;java.util.Date&amp;gt; TimestampValue&lt;/font&gt;&lt;font color="#000000"&gt;() {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;03&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;AbstractNullSafeConverter&amp;lt;Date&amp;gt;&lt;/font&gt;&lt;font color="#000000"&gt;() {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;04&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;05&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#646464"&gt;@Override&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;06&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;protected&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;String internalToString&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;Date value&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;07&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SimpleDateFormat fmt =&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SimpleDateFormat&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"yyyyMMddHHmmssZ"&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;08&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;fmt.setTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;TimeZone.getTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"UTC"&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;09&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; &lt;font color="#990000"&gt;'"'&lt;/font&gt; &lt;font color="#000000"&gt;+ fmt.format&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;value&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#000000"&gt;+&lt;/font&gt; &lt;font color="#990000"&gt;'"'&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;10&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;11&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;12&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#646464"&gt;@Override&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;13&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;protected&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Date internalToValue&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;String string, AbstractNode node&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;throws&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;ValueConverterException&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;14&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;string = string.substring&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;, string.length&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt; &lt;font color="#000000"&gt;-&lt;/font&gt; &lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;15&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;16&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// First choice, if a timestamp string, use it.&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;17&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;18&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// Allow non UTC strings since they are fully qualified with offset and can thus&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;19&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// be parsed by anyone.&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;20&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SimpleDateFormat fmt =&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SimpleDateFormat&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"yyyyMMddHHmmssZ"&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;21&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;fmt.setTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;TimeZone.getTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"UTC"&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;22&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;fmt.parse&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;string&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;23&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;24&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;ParseException e&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;25&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// ignore and try timestamp format&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;26&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;27&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// Second choice - if using java default for the locale&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;28&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// Needs special processing as it probably does not contain TZ in the string)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;29&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;30&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// try the default locale style of Date Time and see if it parses&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;31&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;DateFormat.getDateTimeInstance&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;.parse&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;string&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;32&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// if this parsed, it is not likely that the default is the full&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;33&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// format with timezone offset, so flag this as a special error :)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;34&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// that is fixable&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;35&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// Although simple, it makes sense from a user perspective, a time in&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;36&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// local format can be entered and transformed to a timestamp.&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;37&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;throw new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;ValueConverterException&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"Not in timestamp format"&lt;/font&gt;&lt;font color="#000000"&gt;, node,&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;NonUTCTimestampException&lt;/font&gt;&lt;font color="#000000"&gt;())&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;38&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;39&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;catch&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;ParseException e&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;40&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;DateFormat fmt = DateFormat.getDateTimeInstance&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;41&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;String defaultFormat =&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;fmt&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SimpleDateFormat&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;42&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;?&lt;/font&gt; &lt;font color="#000000"&gt;((&lt;/font&gt;&lt;font color="#000000"&gt;SimpleDateFormat&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#000000"&gt;fmt&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;.toLocalizedPattern&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;43&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;:&lt;/font&gt; &lt;font color="#2A00FF"&gt;"Default format for the locale"&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;44&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;throw new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;ValueConverterException&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"Not in valid format: Use 'yyyyMMddHHmmssZ' or "&lt;/font&gt; &lt;font color="#000000"&gt;+ defaultFormat +&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;45&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#2A00FF"&gt;"Parse error:"&lt;/font&gt; &lt;font color="#000000"&gt;+ e.getMessage&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;, node,&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;null&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;46&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;47&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;48&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;49&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;50&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The code first tries to convert the string entered by the user using the wanted timestamp format. If this fails, an attempt is made to use the default format. If this works, we know we have source text that (most likely) does not have the correct time zone information in it, and we want to offer a quick fix to convert the format. But how can that be done — the ValueConverterException does not allow us to specify a 'diagnostic code' that allows a quick fix to detect the particular problem. The &lt;code&gt;ValueConverterException&lt;/code&gt; is also final (in the 1.0RC1 release at least), so the only option is to use a marker Exception as the cause (In this case &lt;code&gt;NonUTCTimestampException&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;The final attempt to convert (again using the preferred timestamp format) is there simply to catch the error (it could have been remembered from the first attempt).&lt;/p&gt;
&lt;p&gt;As you will see later, the design can be improved further by supplying the actual format that was used to successfully parse the entered timestamp in the marker exception, but I left that for a later iteration.&lt;/p&gt;
&lt;p&gt;Note that the error message includes the two valid formats as feedback to the user in case the entered text was unparsable. It would be easy to try several formats.&lt;/p&gt;
&lt;h2&gt;Overriding the Syntax Error Message Provider&lt;/h2&gt;
&lt;p&gt;The default SyntaxErrorMessageProvider is a class that hands out &lt;code&gt;SyntaxError&lt;/code&gt; instances describing a problem occuring in a particular context. In my case I just wanted to add handling of the ValueConverterException with my special non-UTC cause Exception.&lt;/p&gt;
&lt;p&gt;Here it is&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#808080"&gt;1&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;public class&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;BeeLangSyntaxErrorMessageProvider&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;extends&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SyntaxErrorMessageProvider&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;2&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#646464"&gt;@Override&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;3&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SyntaxErrorMessage getSyntaxErrorMessage&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IValueConverterErrorContext context&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;4&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;!&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;context.getValueConverterException&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;.getCause&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;instanceof&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;NonUTCTimestampException&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;5&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return super&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;.getSyntaxErrorMessage&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;context&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;6&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SyntaxErrorMessage&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;context.getDefaultMessage&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;, IBeeLangDiagnostic.ISSUE_TIMESTAMP__NON_UTC&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;7&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;8&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;As you can see, this is straight forward, simply return a &lt;code&gt;SyntaxErrorMessage&lt;/code&gt; with a diagnostic code (a static string) that I called &lt;code&gt;IBeeLangDiagnostic.ISSUE_TIMESTAMP__NON_UTC&lt;/code&gt;. At this point, non of the new code (except the data value conversion is in effect, and a bit of magic is needed to make it kick in.&lt;/p&gt;
&lt;p&gt;Xtext makes good use of &lt;a href="http://code.google.com/p/google-guice/"&gt;google guice&lt;/a&gt; dependency injection. In addition to the standard guice, there is also advanced so called 'polymorphic dispatching'. This means, that even if it is not apparent in the guice module Xtext generates for a DSL that something can be bound to a specialized class, it is still just as easy to bind almost anything by simply adding a method.&lt;/p&gt;
&lt;p&gt;Here is the part that was added to the guice module for my DSL&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#808080"&gt;1&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Class&amp;lt;?&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;extends&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;ISyntaxErrorMessageProvider&amp;gt; bindISyntaxErrorMessageProvider&lt;/font&gt;&lt;font color="#000000"&gt;() {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;2&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;BeeLangSyntaxErrorMessageProvider.&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;class&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;3&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This means that whenever the Xtext runtime wants an implementation of the &lt;code&gt;ISyntaxErrorMessageProvider&lt;/code&gt;, it will now get an instance of the specialized class shown earlier.&lt;/p&gt;
&lt;h2&gt;The Quick Fix&lt;br /&gt;
&lt;br /&gt;&lt;/h2&gt;
&lt;p&gt;The final part of the puzzle is to provide the quick fix. There really is not much to say but to show the code:&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#808080"&gt;01&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#646464"&gt;@Fix&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IBeeLangDiagnostic.ISSUE_TIMESTAMP__NON_UTC&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;02&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;transformDate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;final&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Issue issue, IssueResolutionAcceptor acceptor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;03&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;acceptor.accept&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;04&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;issue,&lt;/font&gt; &lt;font color="#2A00FF"&gt;"Convert to timestamp"&lt;/font&gt;&lt;font color="#000000"&gt;,&lt;/font&gt; &lt;font color="#2A00FF"&gt;"Converts the valid Date/Time to a fully specified time"&lt;/font&gt;&lt;font color="#000000"&gt;, null,&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;05&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;IModification&lt;/font&gt;&lt;font color="#000000"&gt;() {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;06&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;apply&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IModificationContext context&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;throws&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;Exception&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;07&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;IXtextDocument xtextDocument = context.getXtextDocument&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;08&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;String dateString;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;09&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;dateString = xtextDocument.get&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;issue.getOffset&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;, issue.getLength&lt;/font&gt;&lt;font color="#000000"&gt;())&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;10&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;dateString.length&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt; &lt;font color="#000000"&gt;&amp;lt;=&lt;/font&gt; &lt;font color="#990000"&gt;2&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;11&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt; &lt;font color="#3F7F5F"&gt;// something is wrong, it should be at least ""&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;12&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;dateString = dateString.substring&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;, dateString.length&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt; &lt;font color="#000000"&gt;-&lt;/font&gt; &lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;13&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// try to convert and throw exception if it fails.&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;14&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;Date date = DateFormat.getDateTimeInstance&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;.parse&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;dateString&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;15&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;16&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// reformat as timestamp using UTC&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;17&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SimpleDateFormat fmt =&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;new&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;SimpleDateFormat&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"yyyyMMddHHmmssZ"&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;18&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;fmt.setTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;TimeZone.getTimeZone&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#2A00FF"&gt;"UTC"&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;19&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;dateString =&lt;/font&gt; &lt;font color="#990000"&gt;'"'&lt;/font&gt; &lt;font color="#000000"&gt;+ fmt.format&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;date&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt; &lt;font color="#000000"&gt;+&lt;/font&gt; &lt;font color="#990000"&gt;'"'&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;20&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;21&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;xtextDocument.replace&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;issue.getOffset&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;, issue.getLength&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;, dateString&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;22&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;23&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;})&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#808080"&gt;24&lt;/font&gt; &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;This is pretty much bolier plate code for a quick fix (when generating a DSL with Xtext, there is a sample that shows ow it is done). The code above simply converts the source string using the default format in the value converter, turning it into a timestamp in the correct format. It the replaces the string in the input text.&lt;/p&gt;
&lt;p&gt;An improvement would be to pass the date format used in the 'Issue' (it is possible to pass data with a diagnostic code), but I did not look into how to do this with the SyntaxError class yet.&lt;/p&gt;
&lt;p&gt;A big thank you to Sebastian Zarnekow at Itemis for pointing me in the right direction&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-3462068600400267225?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/3462068600400267225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=3462068600400267225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3462068600400267225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3462068600400267225'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/05/implementing-date-support-with-quickfix.html' title='Implementing Date Support with Quickfix using Xtext'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-4369168270873336930</id><published>2010-05-09T16:31:00.000-07:00</published><updated>2010-05-09T16:39:08.617-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='b3'/><category scheme='http://www.blogger.com/atom/ns#' term='cloudsmith'/><title type='text'>The b3 aggregator</title><content type='html'>&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;The Eclipse b3 Aggregator is based on and part of the &lt;i&gt;Eclipse b3&lt;/i&gt; project. Eclipse b3 provides a versatile and adaptable framework supporting build, assembly and deployment processes. It supports a rich set of use cases. One of those - the aggregation of repositories - is the focus of the &lt;i&gt;b3 Aggregator&lt;/i&gt; tool.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;The Eclipse b3 Aggregator combines repositories from various sources into a new aggregated p2 repository. It can also be configured to produce a hybrid p2/Maven2 repository. There are many situations where using aggregated repositories is a good solution, here are some examples:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ol style="line-height: 1.5em; margin-top: 0.3em; margin-right: 0px; margin-bottom: 0px; margin-left: 3.2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: none;"&gt;
  &lt;li style="margin-bottom: 0.1em; list-style-image: none !important; list-style-type: decimal;"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 15px;"&gt;&lt;b&gt;Projects want to provide convenient access to their products&lt;/b&gt; - Installation instructions requiring the user to visit several repos for a complete install are not uncommon. An aggregated repo for all those locations provides a convenient one-stop-shop strategy. The aggregation can perform mirroring of all consumed p2 repos or selectively provide indirection via a composite repo.&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em; list-style-image: none !important; list-style-type: decimal;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;&lt;b&gt;Organizations or teams want control over internally used components&lt;/b&gt; - It may be necessary to have gated access to relevant/"blessed" p2 repos where an organizational "healthcheck" has been performed prior to internal distribution. Furthermore, internally used aggregated repos can provide a common basis for all organizational users (i.e. for both IDE distribution as well as for content used when building internal applications).&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em; list-style-image: none !important; list-style-type: decimal;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;&lt;b&gt;Increase repository availability&lt;/b&gt; - by aggregating and mirroring what is used from multiple update sites into internally controlled servers.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em; list-style-image: none !important; list-style-type: decimal;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;&lt;b&gt;Distributed Development Support&lt;/b&gt; - an overall product repository is produced by aggregating contributions from multiple teams.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em; list-style-image: none !important; list-style-type: decimal;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;&lt;b&gt;Owners of a p2 repo for a given project may not be in position to host all required or recommended components due to licensing issues&lt;/b&gt; - Buckminster's SVN support can serve as an example here, as it requires components available in the main Eclipse p2 repo as well as third-party components. Hence users have to visit several repos for a complete install.&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-size: small; line-height: 15px;"&gt;The b3 Aggregator is focused on supporting these specific requirements, and it plays an important role in the full scope of the b3 project. The Aggregator is however used in scenarios outside of the traditional "build domain" and this has been reflected in the user interface which does not delve into the details of "building" and should therefore be easy to use by non build experts.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;/p&gt;
&lt;h2&gt;&lt;font face="Arial, sans-serif"&gt;Functional Overview&lt;/font&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 15px;"&gt;The b3 Aggregator performs aggregation and validation of repositories. The input to the aggregator engine (that tells it what to do) is a &lt;i&gt;b3aggr&lt;/i&gt; EMF model. Such a model is most conveniently created by using the b3 Aggregator editor. This editor provides both editing and interactive execution of aggregation commands. The editor is based on a standard EMF "tree and properties view" style editor where nodes are added and removed to form a tree, and the details of nodes are edited in a separate properties view. Once a b3aggr model has been created it is possible to use the command line / headless aggregator to perform aggregation (and other related commands). (Note that since the b3aggr is "just and EMF model", it can be produced via EMF APIs, transformation tools, etc. and thus support advanced use cases).&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;img width="70%" src="http://wiki.eclipse.org/images/e/e9/B3_aggregator_sample_1.png" /&gt;
&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;The model mainly consists of &lt;i&gt;Contributions&lt;/i&gt;; specifications of what to include from different repositories, and Validation Repositories; repositories that are used when validating, but that are not included in the produced aggregation (i.e. they are not copied). The model also contains specification of various processing rules (exclusions, transformation of names, etc.), and specification of &lt;i&gt;Contacts&lt;/i&gt;; individuals/mailing-lists to inform when processing fails.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 1.5em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;Here are some of the important features supported by the b3 Aggregator in Eclipse 3.6M7:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;ul style="margin-top: 0.3em; margin-right: 0px; margin-bottom: 0px; margin-left: 1.5em; line-height: 1.5em; list-style-type: square; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-image: url(http://wiki.eclipse.org/skins/eclipsenova/bullet.gif);"&gt;
  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;p2&lt;/b&gt; and &lt;b&gt;maven2&lt;/b&gt; support — the aggregator can aggregate from and to both p2 and maven2 repositories.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Maven2 name mapping support&lt;/b&gt; — names in the p2 domain are automatically mapped to maven2 names using built in rules. Custom rules are also supported.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Mirroring&lt;/b&gt; — artifacts from repositories are mirrored/downloaded/copied to a single location&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Selective mirroring&lt;/b&gt; — an aggregation can produce an aggregation consisting of a mix of references to repositories and mirrored repositories.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Cherry picking&lt;/b&gt; — it is possible to pick individual items when the entire content of a repository is not wanted. Detailed picking is supported as well as picking transitive closures like a product, or a category to get everything it contains/requires.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Pruning&lt;/b&gt; — it is possible to specify mirroring based on version ranges. This can be used to reduce the size of the produced result when historical versions are not needed in the aggregated result.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Categorization&lt;/b&gt; — categorization of installable units is important to the consumers of the aggregated repository. Categories are often choosen by repository publishers in a fashion that makes sense when looking at a particular repository in isolation, but when they are combined with others it can be very difficult for the user to understand what they relate to. An important task for the constructor of an aggregation is to be able to organize the aggregated material in an easily consumable fashion. The b3 aggregator has support for category prefixing, category renaming, addition of custom categories, as well as adding and removing features in categories.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Validation&lt;/b&gt; — the b3 aggregator validates the aggregated result to ensure that everything in the repository is installable.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li style="margin-bottom: 0.1em;"&gt;&lt;font face="Arial, sans-serif"&gt;&lt;span style="font-family: Arial, sans-serif; font-size: small; line-height: 19px;"&gt;&lt;b&gt;Blame Email&lt;/b&gt; — when issues are found during validation the aggregator supports sending emails describing the issue. This is very useful when aggregating the result of many different projects. Advanced features include specifying contacts for parts of the aggregation which is useful in large multi layer project structures where issues may related to the combination of a group of projects rather than one individual project - someone responsible for the aggregation itself should be informed about these cross-project issues. The aggregator supports detailed control over email generation including handling of mock emails when testing aggregation scripts.&lt;/span&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;font face="Arial, sans-serif"&gt;Documentation&lt;/font&gt;&lt;/h2&gt;&lt;font face="Arial, sans-serif"&gt;The b3 aggregator documentation is &lt;a href="http://wiki.eclipse.org/Eclipse_b3/aggregator/manual" title="aggregator documentation"&gt;available here&lt;/a&gt; on the Eclipse Wiki.&lt;/font&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-4369168270873336930?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/4369168270873336930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=4369168270873336930' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/4369168270873336930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/4369168270873336930'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/05/b3-aggregator.html' title='The b3 aggregator'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-6538246049230411245</id><published>2010-05-05T06:59:00.000-07:00</published><updated>2010-05-05T16:24:56.946-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xtext'/><title type='text'>Migrating b3 from Xtext 0.8 to 1.0 nightly &gt; M6</title><content type='html'>&lt;p&gt;Until there is migration documentation, my experiences of migrating the Eclipse b3 project from Xtext 0.8 (~M4) to 1.0 nightly (&amp;gt; M6) may be of value to others. I did this by first migrating to M6, and then using the nightly - this so I had a state to roll back to in case the nightly would fail me completely.&lt;/p&gt;
&lt;p style="font-size: 15px;"&gt;&lt;b&gt;Migrating to 1.0 M6 version&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Merge of o.e.xtext.ui.common and o.e.xtext.ui.core into o.e.xtext.ui&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Almost everything that was either in ui.common, or ui.core is now in just ui - all that is needed is to change the imports, and update any dependencies to the two merged bundles with the new bundle. (See below for some additional changes).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Label Provider&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The label provider changed more than just being moved to ui.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Monaco; font-size: 11px; color: #000080;"&gt;&lt;font color="#7F0055"&gt;&lt;span style="margin-left:20px;"&gt;&lt;b&gt;import&lt;/b&gt; &lt;font color="#003F82"&gt;org.eclipse.xtext.ui.common.DefaultLabelProvider;&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;changed to&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font color="#7F0055"&gt;&lt;span style="margin-left:20px;"&gt;&lt;b&gt;import&lt;/b&gt; &lt;font color="#003F82"&gt;org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider&lt;/font&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#000000"&gt;&lt;br /&gt;
and my label provider is now derived from this class instead&lt;/font&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Proposal Provider&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;References to&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;font color="#7F0055" face="Monaco" size="3"&gt;&lt;span style="font-size: 11px;"&gt;&lt;span style="margin-left:20px;"&gt;&lt;b&gt;import&lt;/b&gt; &lt;font color="#003F82"&gt;org.eclipse.b3.ui.AbstractBeeLangProposalProvider&lt;/font&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;changed to&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;font color="#7F0055"&gt;&lt;span style="margin-left:20px;"&gt;&lt;b&gt;import&lt;/b&gt; &lt;font color="#003F82"&gt;org.eclipse.b3.ui.contentassist.AbstractBeeLangProposalProvider&lt;/font&gt;;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;br /&gt;
&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;New Structure&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;&lt;span style="font-weight: normal;"&gt;After running the mwe workflow, I got 4 new packages in my dsl project with the suffix ".ui". These packages contained the corresponding classes found in the existing packages without the ".ui" suffix. I moved/merged my code over to the new packages and deleted the old packages.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="font-family: Monaco; font-size: 11px; color: #000080;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;UI Module change&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="font-family: Monaco; font-size: 11px; color: #000080;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;The UIModule for my DSL had to change to the following signature and constructor:&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font face="Helvetica"&gt;&lt;font color="#7F0055" face="monospace"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="margin-left:20px;"&gt;public class BeeLangUiModule extends org.eclipse.b3.ui.AbstractBeeLangUiModule {&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font face="Helvetica"&gt;&lt;font color="#7F0055" face="monospace"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="margin-left:20px;"&gt;public BeeLangUiModule(AbstractUIPlugin plugin) {&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font face="Helvetica"&gt;&lt;font color="#7F0055" face="monospace"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="margin-left:20px;"&gt;super(plugin);&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font face="Helvetica"&gt;&lt;font color="#7F0055" face="monospace"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="margin-left:20px;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font color="#7F0055" face="monospace"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: 11px Monaco;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="background-color: transparent;"&gt;The new structure has the UIModule in a new package (with ."ui" suffix), and the Activator (also in a new package "...ui.internal") uses the UIModule in this new package.&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;span style="color: #000080;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Mwe workflow change&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;span style="color: #000080;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;I had to replace the JavaScopingFragment with ImportURIScopingFragment:&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;span style="margin-left:20px;"&gt;&lt;font color="#003F82"&gt;fragment class="org.eclipse.xtext.generator.scoping.JavaScopingFragment"&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;span style="margin-left:20px;"&gt;&lt;font color="#003F82"&gt;fragment class="org.eclipse.xtext.generator.scoping.ImportURIScopingFragment"&lt;/font&gt;&lt;/span&gt;&lt;font color="#003F82"&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#003F82"&gt;&lt;span style="color: #000000; font-family: Helvetica; font-size: 12px;"&gt;since the JavaScopingFragment no longer exist. Don't know if the ImportURIScopingFragment is what I want, but I had to pick one.&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#800000"&gt;&lt;font color="#000080"&gt;&lt;span style="color: #000000;"&gt;&lt;br /&gt;
&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Converting Java Strings&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#800000"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;Strings.convertFromJavaString now has an extra boolean argument useUnicode which should be set to true to process \\uXXXX escapes. (I did set it to true). I use this method in some terminal converters.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#800000"&gt;&lt;font color="#000080"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Changes in plugin.xml&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;A manual merge of all changes in plugin.xml_gen to my plugin.xml (basically changes related to use of "ui" in package names) was required.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#800000"&gt;&lt;font color="#000080"&gt;&lt;font color="#000000"&gt;&lt;br /&gt;&lt;/font&gt;&lt;span style="color: #800000;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Manifest change&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;Manifest file needed update as the activator is in a different package:&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#800000"&gt;&lt;span style="margin-left:20px;"&gt;&lt;b&gt;Bundle-Activator&lt;/b&gt;: &lt;font color="#003F82"&gt;org.eclipse.b3.ui.internal.BeeLangActivator&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#000000"&gt;&lt;span style="background-color: transparent;"&gt;(using "ui" in the package name)&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;
&lt;span style="color: #800000;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;div style="font-size: 15px;"&gt;
  &lt;span style="color: #800000;"&gt;&lt;font color="#000000" face="Helvetica"&gt;&lt;b&gt;Migrating to latest nightly&lt;/b&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;p style="font: 11px Monaco;"&gt;&lt;font color="#800000"&gt;&lt;font color="#000080"&gt;&lt;span style="color: #800000;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;The 42 Easter Egg&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;The method&lt;br /&gt;
&lt;p style="font: 11.0px Monaco; color: #3f7f5f"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="margin-left:20px;"&gt;&lt;font color="#800200" face="Monaco" size="3"&gt;&lt;span style="background-color: transparent; font-size: 11px;"&gt;&lt;b&gt;protected&lt;/b&gt; void &lt;font color="#003F82"&gt;configureImportantInformation&lt;/font&gt;(IEditStrategyAcceptor acceptor)&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;has been dropped from &lt;font color="#800200" face="Monaco" size="3"&gt;&lt;span style="background-color: transparent; font-size: 11px;"&gt;DefaultAutoEditStrategy.&lt;/span&gt;&lt;/font&gt; It was only there to block an easteregg (typing 42 displays a funny comment about 'the meaning of life' - but the easter egg and method seems to both be gone in the nightly).&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco;"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Serialization&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco; color: #3f7f5f"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;I have not done much with b3 serialization yet, so required changes were small. I needed to add a single method:&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco; color: #3f7f5f"&gt;&lt;font color="#7F0055"&gt;&lt;span style="margin-left:20px;"&gt;public class BeeLangGrammarSerialization implements ITransientValueService&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco;"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;needs an implementation of the method&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco;"&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#7F0055"&gt;&lt;span style="margin-left:20px;"&gt;public boolean isCheckElementsIndividually(EObject owner, EStructuralFeature feature)&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;I added one that returns false, which hopefully is the same as the default.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;&lt;b&gt;Guice from Orbit&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;com.google.guice (from itemis) changed to com.google.inject from orbit (dependencies changed, and my launch configurations needed to be changed).&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco; font-size: 14px;"&gt;&lt;font face="Helvetica" size="4"&gt;&lt;span style="font-size: 15px;"&gt;&lt;b&gt;&lt;span style="text-decoration:line-through"&gt;Open Issues&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font color="#000080"&gt;&lt;span style="color: #800000;"&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;font size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="text-decoration:line-through"&gt;I had attached commands to the popup menu that should appear (and they did in 0.8 M4) over the editor's outline. But this stopped working. I am waiting on some wisdom from the Xtext gurus on this...&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;This was a temporary issue with plugin.xml changes not taking effect. After a restart and clean build it now works just like before.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font face="Helvetica"&gt;&lt;span style="font-size: medium;"&gt;&lt;span style="font-size: 12px;"&gt;&lt;span style="text-decoration:line-through"&gt;Syntax highlight has changed, and I am trying to figure out how it works now...&lt;/span&gt;&lt;/span&gt; &lt;font color="#000000" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;It stopped working because I forgot to move things over to the new UIModule (as described above).&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11px Monaco; font-size: 14px;"&gt;&lt;font face="Helvetica"&gt;&lt;span style="font-size: 15px;"&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;All in all, the migration was quite painless. Knowing that changes were to take place in several of the services, I only have minimal implementations (the default, or just a few lines to fix something glaring) in many places (in wait for the 1.0 release and new documentation). If you have a lot of code and using everything "to the hilt" in 0.7.2, you may want to wait for the official release and the documentation.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="font: 11.0px Monaco"&gt;&lt;font&gt;&lt;font color="#000000" face="Helvetica" size="3"&gt;&lt;span style="background-color: transparent; font-size: 12px;"&gt;I will update this article as I find more things that needs to be changed, or if I changed something in error.&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font color="#3F7F5F"&gt;&lt;br /&gt;&lt;/font&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-6538246049230411245?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/6538246049230411245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=6538246049230411245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6538246049230411245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6538246049230411245'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/05/migrating-b3-from-xtext-08-to-10.html' title='Migrating b3 from Xtext 0.8 to 1.0 nightly &amp;gt; M6'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-6052205879893185993</id><published>2010-05-04T09:47:00.000-07:00</published><updated>2010-05-04T09:48:07.827-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='buckminster'/><category scheme='http://www.blogger.com/atom/ns#' term='cloudsmith'/><title type='text'>Buckminster 3.6 New &amp; Noteworthy</title><content type='html'>&lt;p&gt;&lt;b&gt;The Helios release of Buckminster has the following new and noteworthy features available in 3.6M7&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Support for Git - uses, updates, or clones git repository as needed&lt;/li&gt;

  &lt;li&gt;Headless JUnit and EclEmma (code coverage) support&lt;/li&gt;

  &lt;li&gt;Comprehensive documentation available - introduction, examples, and reference. Download PDF, 250 pages, includes descriptions of the new features described here.&lt;/li&gt;

  &lt;li&gt;Graphical dependency visualizer - resolutions can be viewed and navigated/filtered with a Zest based viewer&lt;/li&gt;

  &lt;li&gt;Much improved target platform support - using new features in PDE to automatically manage/materialize target platform config&lt;/li&gt;

  &lt;li&gt;Provisioning and management of API baseline&lt;/li&gt;

  &lt;li&gt;New EMF based editors for MSPEC and RMAP - much easier to use than editing XML&lt;/li&gt;

  &lt;li&gt;Reader type for Project Set (.psf) files - makes it easy to integrate or migrate projects that are using .psf files to describe where the source is&lt;/li&gt;

  &lt;li&gt;p2 repository size reduction to 1/3 using improved pack200 support&lt;/li&gt;

  &lt;li&gt;OmniVersion support - the support for non OSGi version has been changed to use the p2 OmniVersion implementation for increased flexibility - backwards compatible with Buckminster version-type, version scheme used in earlier versions.&lt;/li&gt;

  &lt;li&gt;Qualifier generator using Build Identifier - use a property to control the content of a version qualifier&lt;/li&gt;

  &lt;li&gt;LDAP style filters on RMAP providers, CQUERY advisors, and MSPEC nodes - makes it possible to parameterize more things, reduces the need for multiple slightly different copies of these files.&lt;/li&gt;

  &lt;li&gt;Smart version range generation for feature 'includes' - heuristics result in natural choices&lt;/li&gt;

  &lt;li&gt;Support for category.xml files - the new PDE mechanism for categorizing result in p2 repository is supported&lt;/li&gt;

  &lt;li&gt;Headless 'install JRE' support&lt;/li&gt;

  &lt;li&gt;Better defaults often renders the MSEPC unnecessary - automatic materialization to Target Platform for binaries often removes the need to use a MSPEC.&lt;/li&gt;

  &lt;li&gt;Using new p2 API, p2 'pure' reader, and using separate p2 agent - reduces risk of contamination of the running instance's p2 data.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-6052205879893185993?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/6052205879893185993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=6052205879893185993' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6052205879893185993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6052205879893185993'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/05/buckminster-36-new-noteworthy.html' title='Buckminster 3.6 New &amp;amp; Noteworthy'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-8734941537778999829</id><published>2010-04-26T15:49:00.000-07:00</published><updated>2010-04-27T05:28:32.128-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='b3'/><category scheme='http://www.blogger.com/atom/ns#' term='cloudsmith'/><title type='text'>Eclipse Build Systems in Perspective</title><content type='html'>&lt;p&gt;It is easy to get confused over the "build system options" available when developing with Eclipse - there is JDT and ANT, PDE (interactive), and PDE/Build (headless) - to start with the "classics". Then there is Athena, an elaboration on the also classic 'releng' system used to build Eclipse itself, then the newer Buckminster. The two latest additions to the family of build related projects at Eclipse are Eclipse b3 (2009), and Tycho (proposal 2010).&lt;/p&gt;
&lt;p&gt;With this blog post I want to put eclipse build technology in perspective.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;So, what does all these technologies do?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;The classics&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;JDT - builds java source, interactively, under control of the project and workspace preferences.&lt;/p&gt;
&lt;p&gt;PDE - builds OSGi components and the Eclipse specific extensions (features, products, etc.) under the control of PDE preferences. PDE consists of both the interactive parts (incremental builds, export commands, dialogs etc.), and the headless logic that performs the actual work. This logic is also made available as ANT tasks.&lt;/p&gt;
&lt;p&gt;PDE/Build - generates ANT scripts that are then executed in headless fashion to build. The generated ANT scripts makes use of the same ANT tasks used by the interactive PDE.&lt;/p&gt;
&lt;p&gt;If we stop there for a moment - this was the level of support for building provided by Eclipse a few years back. Although PDE does a very good job of building things interactively, it is fair to say that the headless PDE/Build has been the source of much pain and frustration. To complete the picture; at this time there was also the "releng" system in use at Eclipse, which only ran on the Eclipse servers.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Improving on PDE&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;While PDE/Build has more or less remained unchanged there has been many different approaches to how to provide good support for headless builds. Some took the scripting route - improving on releng base builder (Athena), some wrote their own scripts, other started modeling PDE &lt;a href="http://blog.benjamin-cabe.com/2009/07/29/model-my-pde" title="PDE incubator PDE model"&gt;like this project in PDE incubator&lt;/a&gt;, and some wrote better/easier to use script generators like &lt;a href="http://www.pluginbuilder.org"&gt;pluginbuilder&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Eclipse Buckminster&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;When the Eclipse Buckminster project was introduced in 2005 it focused on additional things — when using generated scripts and technologies external to the IDE there are often issues caused by differences in how things are built i.e. it works just fine in the IDE but breaks in the build. An important goal for Buckminster was (and still is) to provide exactly the same build interactively as on the servers. This means that Buckminster has a tight integration with the builders running in a workspace made available in an efficient packaging for headless execution. Another important design decision was to use the existing information (i.e. the meta data used by PDE in the IDE) without generation of scripts and without roundtrip engineering, instead using advice/decoration to modify discovered metadata when the original information is not enough.&lt;/p&gt;
&lt;p&gt;In addition to the important philosophical difference, Buckminster also provides unique support for materialization of a workspace, automatic provisioning of a target platform, running JUnit tests, EclEmma code coverage, Hudson integration, and much more.&lt;/p&gt;
&lt;p&gt;Note that when Buckminster builds PDE related material (Buckminster can build other things as well), it calls on the same PDE logic that is used when building with interactive PDE.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Tycho&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.eclipse.org/proposals/tycho/" title="Tycho"&gt;Tycho&lt;/a&gt; is a set of Maven plugins that provide building of OSGi and Eclipse related components (features, plugins, RCP products, etc.) and is an &lt;i&gt;alternative&lt;/i&gt; to PDE suitable for those that have a Maven centric setup. Tycho does not use the original PDE logic.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Eclipse b3&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The b3 project is about making it easy to work with build systems — discovering and modernizing or integrating existing build systems should be just as easy as building meta data rich components interactively or in continuos integration fashion. Eclipse b3 starts at the very other end of the spectrum than "which compiler to use" or which meta data dialect is used to describe components.&lt;/p&gt;
&lt;p&gt;Eclipse b3 does this by providing EMF based models for &lt;b&gt;build&lt;/b&gt; (i.e. components, their relationships, versions, types, etc.), &lt;b&gt;expressions&lt;/b&gt; (i.e. the processing in form of tasks, builders, compilers, etc.), and &lt;b&gt;p2&lt;/b&gt; (with support for aggregation, re-categorization, mirroring, maven meta data publishing, and more), as well as a concrete syntax in form of a DSL implemented with Xtext that provides a rich text editing environment, and an evaluator that makes it possible to run b3 scripts.&lt;/p&gt;
&lt;p&gt;As an example - there is nothing in Eclipse b3 that restrict it to using the original PDE logic to build the PDE related artifacts, it can just as well make use of Tycho's alternate way of building the same things.&lt;/p&gt;
&lt;p&gt;The very first way Eclipse b3 will be building things is to use Buckminster as the execution engine. A small, and easy to understand b3 script will drive the entire build — combining the ease of use in the b3 DSL with the proven stable builds provided by Buckminster.&lt;/p&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-8734941537778999829?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/8734941537778999829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=8734941537778999829' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8734941537778999829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8734941537778999829'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/04/eclipse-build-systems-in-perspective.html' title='Eclipse Build Systems in Perspective'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-7547065304903392060</id><published>2010-04-19T04:58:00.000-07:00</published><updated>2010-04-19T12:32:52.877-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='b3'/><title type='text'>Eclipse b3 - a success at Eclipsecon</title><content type='html'>&lt;p&gt;As you may have seen, the Eclipse b3 project is about creating &lt;span style="font-family: Arial, sans-serif; line-height: 16px;"&gt;a new generation of Eclipse technology to simplify software build and assembly. There has been lots of activity since the project was created, and there was much interest in b3 at Eclipsecon - so, here is a status update.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Arial, sans-serif; line-height: 16px;"&gt;In case you did not know; a seminar on b3 was held at Eclipse Summit Europe 09 where the initial ideas were presented and discussed. &lt;span style="font-family: Helvetica; line-height: normal;"&gt;A lot of new ideas about how people want to work with builds were generated, and there was lots of positive feedback on the original ideas. As always, some darlings were also completely killed in the process (the message that XPath queries are anything but easy to understand was received).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Arial, sans-serif; line-height: 16px;"&gt;&lt;span style="font-family: Helvetica; line-height: normal;"&gt;The feedback told us that these things are important:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Ease of use&lt;/li&gt;

  &lt;li&gt;Based on Modeling&lt;/li&gt;

  &lt;li&gt;Debuggable&lt;/li&gt;

  &lt;li&gt;Flexible / Extensible&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Armed with all that input the time between ESE and Eclipsecon 2010 was devoted to developing a version of b3 that demonstrates the ideas, with a focus on Ease of Use, while not sacrificing flexibility or capability of dealing with real world complexities when building. At Eclipsecon we reached the first milestone of b3 consisting of:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;A build ecore model&lt;/li&gt;

  &lt;li&gt;A process/expression ecore model&lt;/li&gt;

  &lt;li&gt;A p2 ecore model with aggregation and rewrite support&lt;/li&gt;

  &lt;li&gt;A concrete syntax implemented with XText (i.e. a feature rich eclipse editor and much more).&lt;/li&gt;

  &lt;li&gt;An evaluator (i.e. making it possible to run the build scripts).&lt;/li&gt;

  &lt;li&gt;Documentation of the concrete syntax&lt;/li&gt;

  &lt;li&gt;A &lt;a href="http://www.eclipse.org/modeling/emft/b3/" title="website"&gt;website&lt;/a&gt; with links to all b3 related information (documentation, for developers, etc).&lt;/li&gt;
&lt;/ul&gt;The b3 interest at Eclipsecon 2010 was huge - the room was packed, not everyone could get in, and of those that did, close to 80% liked the presentation (i.e. voted +1). To the two individuals who voted -1; I am hoping you put some comments on your votes so I know what you did not like (it simply has to be 'lack of chairs' :)).

&lt;p&gt;For the next milestone (around Helios release) we are adding concrete things to b3:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Use a b3 script to drive a buckminster build&lt;/li&gt;

  &lt;li&gt;Publish b3 build units to a p2 repository - i.e. author installable units&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As always - love to hear your questions and comments. I have already received quite a few questions regarding the relationship between b3 and other eclipse related build technologies (buckminster, athena, PDE build, and now the Tycho proposal), and that will be the topic of my next blog post about b3.&lt;/p&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-7547065304903392060?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/7547065304903392060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=7547065304903392060' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7547065304903392060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7547065304903392060'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2010/04/eclipse-b3-success-at-eclipsecon.html' title='Eclipse b3 - a success at Eclipsecon'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-3893578668790547835</id><published>2009-05-11T08:21:00.000-07:00</published><updated>2009-05-11T08:22:03.111-07:00</updated><title type='text'>"Chester the test-data molester" comes to town</title><content type='html'>&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;&lt;em&gt;"Chester the test-data molester" is a http test server that delivers various error scenarios consistently.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In the p2 project we have the need to test various communication error scenarios, such as when a web server reports illegal last modified dates, reports the wrong file size, endlessly redirects, hits internal server errors, when connection is made via a "hotel style" payment service etc. This was a real pain to set up in an ad-hoc manner, so I decided to create a small equinox based http testserver that is now ready for use.&lt;/p&gt;
&lt;p&gt;The testserver has already been invaluable in finding trasport related issues. I thought it was worth writing this short introduction as it may help others test and fix error reporting issues in RCP apps with custom p2 user interface, for those that need to be able to replicate p2 problems where for security/practical reasons it is not possible to access the real repositories, as well as for those that simply need a http server that can create various error scenarios consistently.&lt;/p&gt;
&lt;h3&gt;How to get it&lt;/h3&gt;
&lt;p&gt;The testserver resides in the p2 CVS repository - org.eclipse.equinox.p2.testserver. To use it you need to check it out, as well as the org.eclipse.equinox.http bundle. (If you use the p2 team project sets in the p2 releng project you will get everything you need). There is a launch configuration in the testserver project that starts the testserver on "localhost:8080". (You can change the port in the launch configuration if you want).&lt;/p&gt;
&lt;h3&gt;Basic Services&lt;/h3&gt;
&lt;p&gt;The testserver starts some basic testing services on the following paths:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;/timeout&lt;/strong&gt;[/anything] - will wait 10 minutes and then produce no response&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/status/&lt;em&gt;&lt;span style="font-weight: normal;"&gt;nnn&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;[/anything] - returns html content with the http response status code set to &lt;em&gt;nnn&lt;/em&gt;, e.g. /status/500 for an internal server error&lt;/li&gt;

  &lt;li&gt;
    &lt;strong&gt;/redirect&lt;/strong&gt;/&lt;em&gt;nnn&lt;/em&gt;[/&lt;em&gt;location&lt;/em&gt;] - redirects &lt;em&gt;nnn&lt;/em&gt; times and then redirects to location (a path on testserver). If no &lt;em&gt;location&lt;/em&gt; given, a html page with a message is generated as the final redirect. Examples:

    &lt;ul&gt;
      &lt;li&gt;/redirect/3/status/500 - redirects 3 times and then generates a 500 - internal error.&lt;/li&gt;

      &lt;li&gt;/redirect/3 - redirects 3 times and produces a message&lt;/li&gt;

      &lt;li&gt;/redirect/30 - redirects 30 times, and will trigger "too many redirects error" in most configurations&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/never&lt;/strong&gt;[/anything] - has basic authentication turned on, but will not accept any username/password as valid.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;h3&gt;Content Delivery&lt;br /&gt;&lt;/h3&gt;The testserver also has content available - there is an index.html in the project, as well as some p2 repository test data. The testserver has also "mounted" the eclipse updates 3.4 repository on different paths with different types of wrappers/"molestors" in place.&lt;br /&gt;
This set of paths goes to the testserver bundle's web content - i.e. index.html and some p2 test data:&lt;br /&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;/public/&lt;/strong&gt;... - normal access&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/private/.&lt;/strong&gt;.. - same as public but requires login with "Aladdin" and password "open sesame"&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/truncated/&lt;/strong&gt;... - truncates files by delivering less content than stated in length e.g. /truncated/index.html&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/molested/&lt;/strong&gt;... - returns garbage instead of real content in the later part of the file e.g. /molested/index.html&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;/decelerate/&lt;/strong&gt;... - delivers content chopped up in small packets with delay, e.c. /decelerate/index.html (interesting to watch in firefox which delivers content as it comes in).&lt;/li&gt;
&lt;/ul&gt;This set of paths has mounted http://download.eclipse.org/eclipse/updates/3.4 with various "molestors":

&lt;ul&gt;
  &lt;li&gt;&lt;b&gt;/proxy/private/&lt;/b&gt;... - requires login with "Aladdin" and password "open sesame"&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;/proxy/public/&lt;/b&gt;... - unmolested access (useful in redirects)&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;/proxy/decelerate/&lt;/b&gt;... - chops up content and delays delivery&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;/proxy/decelerate2/&lt;/b&gt;.... - chops up content and delays the last 20% of the delivery&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;/proxy/truncated/&lt;/b&gt;... - truncates all files&lt;/li&gt;

  &lt;li&gt;&lt;b&gt;/proxy/molested/&lt;/b&gt;... - generates gibberish for later part of all files&lt;/li&gt;

  &lt;li&gt;
    &lt;b&gt;/proxy/modified/&lt;/b&gt;... - delivers various errors in "last modified" (see below)&lt;br /&gt;

    &lt;ul&gt;
      &lt;li&gt;...&lt;b&gt;/zero/&lt;/b&gt;... - all times are returned as 0&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/old/&lt;/b&gt;... - all times are very old&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/now/&lt;/b&gt;... - all times are the same as the request time&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/future/&lt;/b&gt;... - all times are in the future (which is illegal in HTTP)&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/bad/&lt;/b&gt;... - the time is not a date at all - the client should throw an error&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;
    &lt;b&gt;/proxy/length/&lt;/b&gt;... - delivers various content length errors (see below)

    &lt;ul&gt;
      &lt;li&gt;...&lt;b&gt;/zero/&lt;/b&gt;... - length is reported as 0 (but all content written to stream)&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/less/&lt;/b&gt;... - less than the correct size is reported (all content written)&lt;/li&gt;

      &lt;li&gt;...&lt;b&gt;/more/&lt;/b&gt;... - double the correct size is reported (but only available content is written)&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Get in touch&lt;/h3&gt;I had fun writing this - I mean, how often do you get to write classes called "Molestor" :). I hope you find the testserver useful, and that if you would like it to perform other forms of content maiming and mutilation that you contribute by submitting patches to the "p2" project marking issues with the text [testserver].&lt;br /&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-3893578668790547835?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/3893578668790547835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=3893578668790547835' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3893578668790547835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3893578668790547835'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2009/05/test-data-molester-comes-to-town.html' title='&amp;quot;Chester the test-data molester&amp;quot; comes to town'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-592893488242114420</id><published>2009-05-09T10:41:00.001-07:00</published><updated>2009-05-10T06:42:54.810-07:00</updated><title type='text'>Progress Monitor Patterns</title><content type='html'>&lt;p style="margin: 0.0px 0.0px 14.0px 0.0px; font: 18.0px Helvetica"&gt;&lt;b&gt;Are you working with Progress Monitors, and wish you did not have too?&lt;/b&gt;&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;I recently got to investigate issues in p2 why the progress bar did not move while it was very clear that things where happening as subtasks changed the text. Looking into what was going on made me find a new Progress Monitor anti pattern.&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;The problem is how to handle a case where you need to do something like this:&lt;/p&gt;
&lt;div align="left" class="java"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt; candidates.length; i++&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;loadCandidate1&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;i&lt;/font&gt;&lt;font color="#000000"&gt;))&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;!-- =       END of automatically generated HTML code       = --&gt;
&lt;!-- ======================================================== --&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;Where a call to &lt;span style="font: 12.0px Monaco"&gt;loadCandidate&lt;/span&gt; is potentially a long running task. The first loaded candidate means we are done.&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 15.0px 0.0px; font: 14.0px Helvetica"&gt;&lt;b&gt;Antipattern&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 12px; margin-left: 0px; font: 12px Helvetica;"&gt;&lt;span style="font-size: 12px; font-weight: normal;"&gt;Here is an implementation of the above example using the antipattern - i.e. "don't do this:&lt;/span&gt;&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;!-- start source code --&gt;

        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;antiPattern&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor, candidates.length&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt; candidates.length; i++&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;loadCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;i, sub.newChild&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)))&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;loadCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;index, IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt;&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;; i++&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.worked&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// ...&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return true&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;finally&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;monitor.done&lt;/font&gt;&lt;font color="#000000"&gt;()&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return false&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;!-- =       END of automatically generated HTML code       = --&gt;
&lt;!-- ======================================================== --&gt;&lt;br /&gt;
&lt;p style="margin: 0.0px 0.0px 15.0px 0.0px; font: 14.0px Helvetica"&gt;&lt;span style="font-size: 12px;"&gt;Well, what is wrong with this, you may ask… Well, the length of the progress bar will be divided into as many slots as there are candidates, and if the first candidate succeeds and uses its 1000 ticks, and the remaining candidates are never considered, we will end up reporting the 1000 ticks on a fraction of the overall progress bar. This means that for 10 candidates, you will see the progress-bar slowly go to about 10% of the overall length, to suddenly jump to 100%.&lt;/span&gt;&lt;/p&gt;
&lt;p style="font: 14.0px Helvetica"&gt;&lt;b&gt;Good pattern&lt;/b&gt;&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;Here is the good pattern that makes use of the full progress bar:&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;goodPattern&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt; candidates.length; i++&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.setWorkRemaining&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;goodLoadCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;i, sub.newChild&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)))&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;goodLoadCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;index, IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.beginTask&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;null,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// … code that loads&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt;&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;; i++&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.worked&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return true&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;finally&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// ignore errors&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return false&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;!-- =       END of automatically generated HTML code       = --&gt;
&lt;!-- ======================================================== --&gt;
&lt;p style="font: 12.0px Helvetica"&gt;Notice how “setWorkRemaining” is called each time in the loop. This reallocates the remaining ticks, but there is no need to compute how many that actually remains, the child allocation of 1000 ticks will always give the child 1000 ticks to report, even if there were not enough ticks left in the parent. All the scaling is performed by the SubMonitor, so you don’t have to worry about it.&lt;/p&gt;
&lt;p style="font: 12.0px Helvetica; min-height: 14.0px"&gt;Now, let’s say that the routine you are calling do need to perform a bit of work even if it does not need all of its ticks. Don’t worry, that will work too as long as it is a small portion of the allocation. If you risk consuming a larger part, you may be better off doing a true partitioning of the progress-bar as shown in the next section.&lt;/p&gt;
&lt;p style="font: 14.0px Helvetica"&gt;&lt;b&gt;Good pattern - regular loop&lt;/b&gt;&lt;/p&gt;
&lt;p style="margin: 0.0px 0.0px 12.0px 0.0px; font: 12.0px Helvetica"&gt;Here is the good pattern for a regular loop where each iteration does consume ticks&lt;/p&gt;
&lt;p style="font: 12.0px Monaco"&gt;&lt;/p&gt;
&lt;div align="left" class="java" style="overflow:scroll;"&gt;
  &lt;table border="0" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF"&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td nowrap="nowrap" valign="top" align="left"&gt;&lt;code&gt;&lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;void&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;goodLoopPattern&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor, candidates.length*&lt;/font&gt;&lt;font color="#990000"&gt;100&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt; candidates.length; i++&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;if&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;goodLoopCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;i, sub.newChild&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;100&lt;/font&gt;&lt;font color="#000000"&gt;)))&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;break&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;public&lt;/b&gt;&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;boolean&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;goodLoopCandidate&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;index, IProgressMonitor monitor&lt;/font&gt;&lt;font color="#000000"&gt;) {&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;SubMonitor sub = SubMonitor.convert&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;monitor,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.beginTask&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#000000"&gt;null,&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;try&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// … code that loads&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;for&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;int&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;i =&lt;/font&gt; &lt;font color="#990000"&gt;0&lt;/font&gt;&lt;font color="#000000"&gt;; i &amp;lt;&lt;/font&gt; &lt;font color="#990000"&gt;1000&lt;/font&gt;&lt;font color="#000000"&gt;; i++&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;sub.worked&lt;/font&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;font color="#990000"&gt;1&lt;/font&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return true&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt; &lt;font color="#7F0055"&gt;&lt;b&gt;finally&lt;/b&gt;&lt;/font&gt; &lt;font color="#000000"&gt;{&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#3F7F5F"&gt;// ignore errors&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#7F0055"&gt;&lt;b&gt;return false&lt;/b&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;
        &lt;font color="#FFFFFF"&gt;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/code&gt;&lt;/td&gt;&lt;!-- end source code --&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;&lt;!-- =       END of automatically generated HTML code       = --&gt;
&lt;!-- ======================================================== --&gt;
&lt;p style="font: 12.0px Helvetica"&gt;Here I simply use SubMonitor’s &lt;span style="font: 12.0px Monaco"&gt;newChild,&lt;/span&gt; this works without calling “done” because the next call to newChild (or “done” for that matter) will consume the ticks allocated for the child.&lt;/p&gt;
&lt;p style="font: 14.0px Helvetica"&gt;&lt;b&gt;Rules of Thumb&lt;/b&gt;&lt;/p&gt;
&lt;ol style="list-style-type: decimal"&gt;
  &lt;li style="font: 12.0px Helvetica"&gt;Use SubMonitor&lt;/li&gt;

  &lt;li style="font: 12.0px Helvetica"&gt;Always begin by converting the monitor you get to a SubMonitor&lt;/li&gt;

  &lt;li style="font: 12.0px Helvetica"&gt;Use newChild(n) to create a sub monitor to pass to methods that take an IProgressMonitor as argument.&lt;/li&gt;

  &lt;li style="font: 12.0px Helvetica"&gt;Never call “done” - but document that the caller must do so unless they used a SubMonitor&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-592893488242114420?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/592893488242114420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=592893488242114420' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/592893488242114420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/592893488242114420'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2009/05/progress-monitor-patterns.html' title='Progress Monitor Patterns'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-7002533558488140410</id><published>2009-01-11T14:19:00.001-08:00</published><updated>2009-01-11T14:19:25.943-08:00</updated><title type='text'>Presentation in Stockholm Jan 27 - p2 provisioning your world</title><content type='html'>&lt;p&gt;&lt;span style="font-family: verdana; font-size: 13px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"&gt;Everyone in Stockholm with an interest in Eclipse and provisioning with p2 are welcome to the Scandic Anglais Hotel at Humlegården 23, Stockholm, Sweden on January 27 - 6 pm.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: verdana; font-size: 13px; -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px;"&gt;A p2 presentation and demo will be presented to the Swedish Eclipse user group. If you are interested, you should register (it is free) &lt;a href="http://www.eclipseusers.se/forum/showthread.php?t=114" title="link to eclipseusers.se forum"&gt;here.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-7002533558488140410?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/7002533558488140410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=7002533558488140410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7002533558488140410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7002533558488140410'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2009/01/presentation-in-stockholm-jan-27-p2.html' title='Presentation in Stockholm Jan 27 - p2 provisioning your world'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-5048317885726054021</id><published>2008-05-13T16:09:00.001-07:00</published><updated>2008-05-13T16:09:37.389-07:00</updated><title type='text'>How to include RSS feeds into your components using OPML</title><content type='html'>&lt;p&gt;It is really easy to include RSS feeds and links in your components - all you have to do is to place a buckminster.opml file in the root of your component (or tweak the properties if you want to call it something else, and place it elsewhere).&lt;/p&gt;The OPML file itself has a very simple XML syntax. You start of with the usual xml declaration and declaring that you are using OPML 2.0.

&lt;blockquote&gt;
  &lt;p style="font: 9.0px Monaco"&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;br /&gt;
  &amp;lt;opml version="2.0"&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is followed by a head declaration where some information about the content of the OPML file is kept.&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p style="font: 9.0px Monaco"&gt;&amp;lt;head&amp;gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;title&amp;gt;Component information for org.demo.exampleComponent&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;dateCreated&amp;gt;Mon, 14 Apr 2008 14:18:51 GMT&amp;lt;/dateCreated&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;ownerName&amp;gt;Your name, or name of project&amp;lt;/ownerName&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;ownerEmail&amp;gt;contact.us@somewhere.com&amp;lt;/ownerEmail&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And after the head comes the body part that consists of a sequence of outline elements - they can be nested if you want to use "subfolders".&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p style="font: 9.0px Monaco"&gt;&amp;lt;body&amp;gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;!-- outline elements --!&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A regular link (non feed) is expressed in an outline element like this:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;span style="font-family: Monaco; font-size: 9px;"&gt;&amp;lt;outline text="Cloudsmith" description="Cloudsmith's site" url="http://www.cloudsmith.com" language="unknown" title="Cloudsmith" type="link" /&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And a feed is just as simple:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;span style="font-family: Monaco; font-size: 9px;"&gt;&amp;lt;outline text="My Feed" description="This is my feed" htmlUrl="http://www.somewhere.org" language="unknown" title="My Example Feed" type="rss" version="RSS2" xmlUrl="http://feeds.somewhere.org/examplefeed"/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In both of the above examples - the "&lt;span style="font-style: italic;"&gt;text&lt;/span&gt;" attribute is the label typically used in the RSS reader's bookmarks. Some OPML viewers use the &lt;span style="font-style: italic;"&gt;title&lt;/span&gt; instead, and the reader may or may not show the &lt;span style="font-style: italic;"&gt;description&lt;/span&gt;. Regular links (&lt;span style="font-style: italic;"&gt;type="link"&lt;/span&gt;) should use the "&lt;span style="font-style: italic;"&gt;url&lt;/span&gt;" attribute for the link, and a feed (&lt;span style="font-style: italic;"&gt;"type="rss")&lt;/span&gt; should use the "&lt;span style="font-style: italic;"&gt;xmlUrl&lt;/span&gt;" attribute for the feed, but also add a link to a human readable web page - this is done by using the "&lt;span style="font-style: italic;"&gt;htmlUrl&lt;/span&gt;" attribute, and it is often a link to the page where it is possible to subscribe to the feed, or read its content online.&lt;/p&gt;
&lt;p&gt;In the feed example above, the feed type is "rss" - and the version "RSS2". A feed should always have the type set to "rss" (including atom feeds, but for atom feeds, the OPML spec is vague - I use "atom" as the version and it works just fine). These tags are mainly for a processor of the OPML itself, a feed reader will look at the actual feed to determine its type anyway. You can read more about the OPML 2.0 standard &lt;a href="http://www.opml.org/spec2"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And then finally, a subfolder is very simple to create:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;span style="font-family: Monaco; font-size: 9px;"&gt;&amp;lt;outline text="A Subfolder"&amp;gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;outline .... /&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &lt;span style="margin-left:30px;"&gt;&amp;lt;outline .... /&amp;gt;&lt;/span&gt;&lt;br /&gt;
  &amp;lt;/outline&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Even if the creation of a component's OPML (at least for now) is done via manual editing of XML, I hope the examples above show that it is really quite easy.&lt;/p&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-5048317885726054021?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/5048317885726054021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=5048317885726054021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/5048317885726054021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/5048317885726054021'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/05/how-to-include-rss-feeds-into-your.html' title='How to include RSS feeds into your components using OPML'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-3909461727968303635</id><published>2008-05-12T14:31:00.000-07:00</published><updated>2008-05-12T16:37:30.281-07:00</updated><title type='text'>Feed your Buckminster</title><content type='html'>&lt;p&gt;Did you know that Buckminster can deliver RSS feeds and links that appear in the Eclipse UI?&lt;/p&gt;
&lt;p&gt;We wanted to make it possible to share content that relates to a component, such as a links to wiki, bugzilla, and documentation, and to RSS feeds like a version feed, open and closed issues in bugzilla, examples feed, why not a "checkin feed", or why not a feed with the lastest available plugins...&lt;/p&gt;
&lt;p&gt;We selected the &lt;a href="http://www.opml.org/" title="OPML 2.0"&gt;OPML 2.0&lt;/a&gt; XML definition for Outline Processing - essentially describing a structure of links and feeds - or bookmarks if you like. And we decided to include this into the Buckminster model. This means that a component type can auto generate meta data from components that have extra "community" information and make this available in the form of OPML. Buckminster recognizes that a component can have an OPML file embedded in the component (by default it is called buckminster.opml and is placed in the root of the component, but it is possible to have it in some other directory and give it a different name by setting properties).&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Buckminster includes two new views that makes use of the new OPML feature, a &lt;span style="font-style: italic;"&gt;Component Explorer&lt;/span&gt; that shows all components known to Buckminster, and a &lt;span style="font-style: italic;"&gt;Component Outline&lt;/span&gt; that follows the current selection showing the related component information.&lt;/p&gt;
&lt;p&gt;Here is a screenshot of the Component Outline, which also shows Buckminster's integration with the &lt;a href="http://www.rssowl.org/"&gt;RSS Owl&lt;/a&gt; Reader.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;img src="http://farm4.static.flickr.com/3188/2488098280_95a8a51b3d_o.jpg" width="425" height="508" alt="200805122051.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;If you want to try out the RSS OWL integration - there is a preview available at our update site http://dev.cloudsmith.com/updates3_4 - it is based on RSS OWL 2.0 M7 but with some patches applied.&lt;/p&gt;
&lt;p&gt;And here is a screenshot of RSS OWL showing the example feed:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;a href="http://www.flickr.com/photos/23325425@N00/2487311287/"&gt;&lt;img src="http://farm4.static.flickr.com/3022/2487311287_eb2ef6f66a.jpg" height="393" width="500" alt="rssowlbuckyexample1" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Clicking on the links in RSS OWL will start buckminster materialization, or open the cquery editor!&lt;/p&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-3909461727968303635?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/3909461727968303635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=3909461727968303635' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3909461727968303635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/3909461727968303635'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/05/feed-your-buckminster.html' title='Feed your Buckminster'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3022/2487311287_eb2ef6f66a_t.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-8464189109117010158</id><published>2008-03-21T14:10:00.000-07:00</published><updated>2008-03-20T16:20:00.264-07:00</updated><title type='text'>Murphy and OSGi services</title><content type='html'>On Tuesday we gave our talk on Cloudsmith, Buglabs, Spaces, and AOL Xdrive - titled "Building OSGi services out of the cloud" - We had about a 100 people (my quick count), and everything was going really smoothly until we switched over to the demo part where we showed taking a picture with the &lt;a href="http://buglabs.net/"&gt;BugLabs BUG device&lt;/a&gt; (a plug and play hardware device running Linux, and OSGi), storing the picture on an AOL Open Xdrive, and then retrieving and showing the image on an Android device using a Felix OSGi runtime to obtain an Xdrive image viewer from the Cloudsmith OBR repository. We also showed all the steps how to get the SDK's for the BUG, and for Andorid using Cloudsmith "one click materialization".

There was one thing we had not tested before we started the demo; what happens if you leave the laptops on for 15-20 minutes while presenting from a third laptop....? And naturally, the one scenario we had not anticipated did bite us bad.

The power supply in Ballroom E decided it did not want to deliver any power. At the very moment with took the picture with the BUG, the laptop that served as a router decided to hibernate - so the picture taking app hanged on the BUG - but somewhere in the process something did work because at the end we discovered that Ken had managed to take a picture of Ballroom E's ceiling :) (There was much laughing in the room).

The laptop for showing the Android part (where we had everything prepared with preconfigured workspaces, and even a spare cloudsmith site server (in case we we should loose the wifi connection)), was at the end of its battery life, and the 15 minutes without power at the beginning of the presentation caused it to shut down!  So audience got to see a boot and startup of a whole bunch of services. At a critical moment, a slight tremble of hand caused two Android emulator instances to be started, and unfortunately, the first one that appeared on the screen did so, because it was really the second instance started, and this instance did not have anything to start up, so hence started much faster. So when the second instance started, we killed it (big mistake). So, big surprise when we tried to run the demo on a completely empty Android...

Michal did a great job starting things again and typing long URL's into the android device emulator's user interface (it does not have copy paste) to get it all going again, while, as someone in the audience commented afterwards - looked like a confused C3PO
&lt;img src="http://www.cs.bris.ac.uk/outreach/Seminars/Images/C3PO.jpg" /&gt;

I hope the glitches in the technical parts did not overshadow the main message about how Cloudsmith supports "building OSGi services out of the cloud".

Murphy was right - "if it can happen, it will..."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-8464189109117010158?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/8464189109117010158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=8464189109117010158' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8464189109117010158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8464189109117010158'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/03/murphy-and-osgi-services.html' title='Murphy and OSGi services'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-6565936085009991579</id><published>2008-03-12T09:58:00.001-07:00</published><updated>2008-03-12T11:26:26.672-07:00</updated><title type='text'>Scramling to get your update site ready for EclipseCon?</title><content type='html'>Creating an update site to share your sample code and tutorials is a good way of distributing your talk material to your audience. In the Eclipse Spaces project we are providing a way to quickly create an update site in an AOL Xdrive. 

A cool feature (we think) in Spaces is that it also publishes links to source for the bundles you publish. The Spaces "Importer" can import binaries and source and can look up missing bundles without the user having to enter the right remote update sites. The dependencies as they are set up when publishing is saved and used when importing. We think it is pretty neat, and hope this will help you deliver your matieral in a convenient way for your audience.

Some speakers have tried this out already. The instructions for how to use spaces are found at http://www.eclipse.org/spaces/ (and you can also see my earlier blog posting on the spaces topic). There is however one problem - AOL has fraud detection turned on that checks the validity of the phone number and zip code which makes it difficult for non US users (and anyone that does not care to reveal their phone number). Instead of going to http://eclipse.xdrive.com, or http://www.xdrive.com to register,  you can go to  http://www.bluestring.com as it does not require a phone number.  As an alternative, here is a phone number that works 310 123 456, and you can use the zip code 90120.

Also, if you like to try out spaces and need some help (with xdrive signup or anything else) you find us at irc.mainloop.net, channel "spaces" - we try to be online there as much as possible.

See you at EclipseCon...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-6565936085009991579?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/6565936085009991579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=6565936085009991579' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6565936085009991579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/6565936085009991579'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/03/scramling-to-get-your-update-site-ready.html' title='Scramling to get your update site ready for EclipseCon?'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-8539659793653581239</id><published>2008-03-11T07:21:00.001-07:00</published><updated>2008-03-11T07:21:20.369-07:00</updated><title type='text'></title><content type='html'>I got some questions about publishing to an update site using Eclipse Spaces and that the produced site seems to be broken as the URL produces a 404 not found. And since others may hit the same snag, I thought it best to explain. 

This is caused by the update site URL not being  browseable. To see something in a browser you must append a "/" (or /index.html, depending on our browser) - you should then see an index page. Also, if feeding the URL to the Update Manager, or to "Import &amp;gt; Spaces" - it should work fine.



The AOL xdrive HTTP publishing does not allow browsing of folders, you have to know the exact URLs. But this is enough for the update manager and imports to find what it needs. You can also try THEURL/site.xml to see the URLs to the other files.



If anyone wants to talk live, you can contact the spaces team on irc.mainloop.net channel #spaces, or skype me at henrik.lindberg.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-8539659793653581239?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/8539659793653581239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=8539659793653581239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8539659793653581239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8539659793653581239'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/03/i-got-some-questions-about-publishing.html' title=''/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-7603625792920952128</id><published>2008-03-10T21:40:00.000-07:00</published><updated>2008-03-10T14:42:06.318-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='eclipse spaces publishing xdrive plugin bundle OSGi'/><title type='text'>Eclipse Spaces - one step closer to code blogging</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;Wouldn't it be nice to be able to "blog your code" directly from inside Eclipse?&lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Envision being able to share  what you just implemented with others. Sometimes it is easy to post a few lines of example code in a blog, but a lot of the time a more elaborate configuration is needed to make it valuable for others.  You would perhaps have to create an update site, or point the user to several source locations and let the user create a workable environment.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Why isn't it as simple as just pressing "publish"?&lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;This was the fundamental question when we started the spaces project. The Eclipse Spaces project is now making a 0.1 version available where both "immediate publishing" and convenient consumption is available. &lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;h2 style="font-family: arial; font-size: 100%;"&gt;Here is how it works&lt;/h2&gt;
&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Eclipse Spaces manages Publishing Areas of different types (such as an Update Site, or a flat list of files) inside a Space. A space is provided by a Space Provider such as AOL's Xdrive, SourceForge, or something generic like a File System Provider. &lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;To publish plugins to an Update Site, all that is needed is to select "&lt;span style="font-weight: bold;"&gt;Spaces &lt;/span&gt;&gt; &lt;span style="font-weight: bold;"&gt;Publish&lt;/span&gt;" and then select the Space and Area where the plugin should be published. This will add the plugin to the update site with all update site meta data automatically generated.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;The update site is a normal Eclipse Update Site, and can be consumed with the normal Update Manager. But, Eclipse Spaces does more - when publishing is done, spaces also produces information in the update site for the Spaces Import Wizard which makes it possible to import not only the binaries bundles, but also the source (if it is publicly available), and to control if bundles should be installed in the target platform, or placed in the workspace. In addition to this, the Spaces Import Wizard can consult a mapping service and resolve and install bundles that are missing in the user's target platform.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;

&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;If you want to try this out here are some simple steps:&lt;/span&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;h2   style=";font-family:arial;font-size:100%;"&gt;Preparation:&lt;/h2&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Install Eclipse Spaces - you need Eclipse 3.3, and enter this remote site URL: &lt;a href="http://www.cloudsmith.com/updates"&gt;http://dev.cloudsmith.com/updates&lt;/a&gt;
&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Sign up for a free AOL Xdrive account (you get 5GB or free space) - note that AOL gives you an AOL email account when you do this, and this is the 'login' that you will be using later. Go to &lt;a href="http://eclipse.xdrive.com/"&gt;AOL Xdrive for Eclipse&lt;/a&gt; to sign up.
&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;h2 face="arial" size="3" style=""&gt;Publishing a plugin for the first time:&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;ol&gt;&lt;li style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select "&lt;span style="font-weight: bold;"&gt;Spaces &lt;/span&gt;&gt; &lt;span style="font-weight: bold;"&gt;Publish&lt;/span&gt;" in the context menu for a plugin project - this opens the space publishing wizard.

&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_B1I_kFLDeIs/R7yeH3cAIkI/AAAAAAAAAAM/ju3FGZtf4G0/s1600-h/PublishSelectSpace.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_B1I_kFLDeIs/R7yeH3cAIkI/AAAAAAAAAAM/ju3FGZtf4G0/s320/PublishSelectSpace.png" alt="" id="BLOGGER_PHOTO_ID_5169180330292159042" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Add the location to a new space by pressing "Add Space Location..." (then enter the address to your Xdrive account (i.e. your AOLemail, and the Xdrive host) + a name you select e.g . '&lt;span style="font-style: italic;"&gt;MyEclipseSpace&lt;/span&gt;')

&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7ye9HcAIlI/AAAAAAAAAAU/IMWxFdN9uN4/s1600-h/AddSpaceLocation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7ye9HcAIlI/AAAAAAAAAAU/IMWxFdN9uN4/s320/AddSpaceLocation.png" alt="" id="BLOGGER_PHOTO_ID_5169181245120193106" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select 'Update Site Publishing' (currently the only publishing operation available)

&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yhEHcAIoI/AAAAAAAAAAs/drHCmtNw_oE/s1600-h/SelectPublishingOperation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yhEHcAIoI/AAAAAAAAAAs/drHCmtNw_oE/s320/SelectPublishingOperation.png" alt="" id="BLOGGER_PHOTO_ID_5169183564402532994" border="0" /&gt;

&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Add an Update Site by entering a name (e.g. '&lt;span style="font-style: italic;"&gt;MyUpdateSite&lt;/span&gt;') and pressing "Add Update Site"

&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yfIXcAImI/AAAAAAAAAAc/4EMA5S6a04U/s1600-h/AddUpdateSite.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yfIXcAImI/AAAAAAAAAAc/4EMA5S6a04U/s320/AddUpdateSite.png" alt="" id="BLOGGER_PHOTO_ID_5169181438393721442" border="0" /&gt;

&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Press Next and publishing is performed&lt;/span&gt;
&lt;/div&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;
&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yf-XcAInI/AAAAAAAAAAk/NjEcjEcl2N0/s1600-h/PublishingInOperation.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yf-XcAInI/AAAAAAAAAAk/NjEcjEcl2N0/s320/PublishingInOperation.png" alt="" id="BLOGGER_PHOTO_ID_5169182366106657394" border="0" /&gt;

&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;The URL to the update site is presented (and copied to the clipboard if you want)

&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_B1I_kFLDeIs/R7yhOncAIpI/AAAAAAAAAA0/G6NPemQyA_M/s1600-h/PublishingSuccessful.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_B1I_kFLDeIs/R7yhOncAIpI/AAAAAAAAAA0/G6NPemQyA_M/s320/PublishingSuccessful.png" alt="" id="BLOGGER_PHOTO_ID_5169183744791159442" border="0" /&gt;

&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Use the URL in the update manager, or Spaces Import Wizard (explained below)
&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;h2 face="arial" size="3" style=""&gt;Publishing a plugin again:&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select "Spaces &gt; Publish"&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select "Republish using previously used settings"&lt;/span&gt;
&lt;/div&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;
&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_B1I_kFLDeIs/R7yilncAIqI/AAAAAAAAAA8/09zSJAhF2sw/s1600-h/Republish.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_B1I_kFLDeIs/R7yilncAIqI/AAAAAAAAAA8/09zSJAhF2sw/s320/Republish.png" alt="" id="BLOGGER_PHOTO_ID_5169185239439778466" border="0" /&gt;

&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Press Finish&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;h2 face="arial" size="3" style=""&gt;Adding a second plugin to '&lt;span style="font-style: italic;"&gt;MyUpdateSite&lt;/span&gt;':&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select "&lt;span style="font-weight: bold;"&gt;Spaces &lt;/span&gt;&gt; &lt;span style="font-weight: bold;"&gt;Publish&lt;/span&gt;"&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select the space, then the Update Site Publishing, and then the '&lt;span style="font-style: italic;"&gt;MyUpdateSite&lt;/span&gt;' publishing area.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Press Next and publishing is done&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;h2 style="font-family: arial; font-size: 100%;"&gt;Importing the Update Site:&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;
&lt;/span&gt;&lt;ol&gt;&lt;li style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Select "&lt;span style="font-weight: bold;"&gt;File &lt;/span&gt;&gt; &lt;span style="font-weight: bold;"&gt;Import &lt;/span&gt;"&lt;/span&gt;
&lt;/div&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;
&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yi6HcAIrI/AAAAAAAAABE/uUxjSL5fgdo/s1600-h/ImportFromUpdateSite.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yi6HcAIrI/AAAAAAAAABE/uUxjSL5fgdo/s320/ImportFromUpdateSite.png" alt="" id="BLOGGER_PHOTO_ID_5169185591627096754" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Enter the update site URL and Select where you want bundles to go&lt;/span&gt;
&lt;/div&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;
&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yjEXcAIsI/AAAAAAAAABM/H5GCw0tUj50/s1600-h/ImportOptions.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_B1I_kFLDeIs/R7yjEXcAIsI/AAAAAAAAABM/H5GCw0tUj50/s320/ImportOptions.png" alt="" id="BLOGGER_PHOTO_ID_5169185767720755906" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;Press Finish.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;h2 style="font-size: 100%;"&gt;Spaces View&lt;/h2&gt;&lt;span style="font-size:100%;"&gt;There is also a Spaces View, where it is possible to look at address information, reset password, discard a location, add a space location etc. Here is a screen shot

&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size:100%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yj8HcAIuI/AAAAAAAAABc/cVgQhhfphjg/s1600-h/SpacesView.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_B1I_kFLDeIs/R7yj8HcAIuI/AAAAAAAAABc/cVgQhhfphjg/s400/SpacesView.png" alt="" id="BLOGGER_PHOTO_ID_5169186725498462946" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/div&gt;&lt;span style="font-size:100%;"&gt;For more info on spaces visit &lt;a href="http://www.eclipse.org/spaces/"&gt;Spaces at Eclipse.org&lt;/a&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-7603625792920952128?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/7603625792920952128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=7603625792920952128' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7603625792920952128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7603625792920952128'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/03/eclipse-spaces-one-step-closer-to-code.html' title='Eclipse Spaces - one step closer to code blogging'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_B1I_kFLDeIs/R7yeH3cAIkI/AAAAAAAAAAM/ju3FGZtf4G0/s72-c/PublishSelectSpace.png' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-8417536350133764446</id><published>2008-02-04T04:25:00.000-08:00</published><updated>2008-03-10T14:00:48.132-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse Sweden'/><title type='text'>Eclipse User Group Sweden Formed</title><content type='html'>I am happy to announce that a Swedish Eclipse User Group has been formed, and that there is a site where Eclipse users and developers can share ideas and experiences in Swedish.  So, if you can communicate in Swedish you are very welcome to &lt;a href="http://eclipseusers.se/"&gt;The Swedish Eclipse User Group&lt;/a&gt; - membership is free.

The idea to start this group grew out of the Stockholm Eclipse Demo Camp in December.  This especially for developers that develop plug-ins for Eclipse, or write RCP applications.  After Eclipse Demo Camp, the word started to spread, and we (myself and Peer Törngren) got in touch with other groups (or rather other individuals) that also had been thinking about forming a Swedish Eclipse User group.

We decided to have very low formality, open to all attitude, no membership fees, etc.  as none of the involved was particularly keen on handling the administration.

Thanks to &lt;a href="http://www.cloudsmith.com/"&gt;Cloudsmith&lt;/a&gt; for donating time to set this up, &lt;a href="http://www.mainloop.se/"&gt;Mainloop AB&lt;/a&gt;, for donating the hosting of the site, and  the &lt;a href="http://www.eclipse.dk/"&gt;Danish User Group&lt;/a&gt; for valuable input regarding running a user group. Special thanks to Peer Törngren (Cognos) for actively spreading the word - the group would not have formed without his initiative, and Patrik Tennberg (Nordea)
for more contacts, ideas, and last but not least a promise to supply the conferencing facilities for the groups next meeting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-8417536350133764446?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/8417536350133764446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=8417536350133764446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8417536350133764446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/8417536350133764446'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/02/eclipse-user-group-sweden-formed.html' title='Eclipse User Group Sweden Formed'/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2117597481687734563.post-7441974195030369208</id><published>2008-02-01T17:34:00.000-08:00</published><updated>2008-03-10T14:01:16.091-07:00</updated><title type='text'></title><content type='html'>&lt;span style="font-family:arial;"&gt;I just added Context Sensitive Help to a Dialog window in the Spaces project and since I at first could not find the information how to do this, I thought it may be of value to share some pointers to get others started.&lt;/span&gt;

&lt;span style="font-family:arial;"&gt;The first step if you are writing a Dialog and want to have the same nice integrated help system as provided in the Eclipse IDE Wizards - is to derive your Dialog from the TrayDialog class instead of from the (plain) Dialog. The TrayDialog should perhaps have been called something related to help, because 'support for help' is what it is adding. After having derived the dialog from TrayDialog, the dialog gets the (?) in the lower left corner, and you click that, or press F1 to get context sensitive help. Super simple.&lt;/span&gt;

&lt;span style="font-family:arial;"&gt;Now you need to do a couple of things to make it work:&lt;/span&gt;
&lt;ul style="font-family: arial;"&gt;&lt;li&gt;registering help contexts for the controls (either the entire dialog, or the dialog and all the individual controls in it). To do this you need to get the WorkbenchHelpSystem, and call setHelp(aControl, aContext) for each control.
&lt;/li&gt;&lt;li&gt;make your plugin extend "org.eclipse.help.contexts" and specify that this is a context extension for some plugin and point to a contexts.xml file which defines what will be popped up as context help. This definition can be very simple, but may contain links into the rest of the help system.&lt;/li&gt;&lt;li&gt;Write the help topics that the context sensitive help links to. You do this by having html files in your plugin.&lt;/li&gt;&lt;li&gt;To make  context sensitive help inside your dialog (in a tray to the right) instead of as an "infopop" you must also make sure that you set up the dialog area correctly (see below).&lt;/li&gt;&lt;li&gt;Once you see the context senitive help, you may be surprised that you also see a search result of help topics below the context sensitive things you added. The help system searches for help topics that match the title of your dialog shell. In my case, I used the project name "Spaces", and there where quite a few help articles with the term "spaces" in them. So select your dialog title carefully.
&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:85%;"&gt;&lt;pre&gt;
@Override
protected Control createDialogArea(Composite parent)
{
 Composite dialogArea = (Composite)super.createDialogArea(parent);
 Composite container = new Composite(dialogArea, SWT.NONE);
 container.setLayoutData(
     new GridData(GridData.FILL, GridData.FILL, true, true));
 // then add your content to the Composite container...
}
&lt;/pre&gt;&lt;/span&gt;
&lt;span style="font-family:arial;"&gt;The best information I found on how to get started with the Eclipse help system, and context sensitive help was in the book "Eclipse -
building commercial quality plug-ins" - it is available on Safari.
Chapter 15.3 (second edition) covers the help system. Here is a &lt;/span&gt;&lt;a style="font-family: arial;" href="http://my.safaribooksonline.com/032142672X/ch20#X2ludGVybmFsX1NlY3Rpb25Db250ZW50P3htbGlkPTAzMjE0MjY3MlgvY2gxNWxldjFzZWMz"&gt;direct link&lt;/a&gt;&lt;span style="font-family:arial;"&gt;
to the chapter where extension points for context sensitive help and
formats of files are described.

&lt;/span&gt;&lt;span style="font-family:arial;"&gt;If you are interested in the full source, take a look at the "AddSpaceDialog" in "org.eclipse.spaces.ui" project (in Eclipse SVN under technology/spaces). Bare in mind that right now this is work in progress...&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2117597481687734563-7441974195030369208?l=henrik-eclipse.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://henrik-eclipse.blogspot.com/feeds/7441974195030369208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2117597481687734563&amp;postID=7441974195030369208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7441974195030369208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2117597481687734563/posts/default/7441974195030369208'/><link rel='alternate' type='text/html' href='http://henrik-eclipse.blogspot.com/2008/02/i-just-added-context-sensitive-help-to.html' title=''/><author><name>Henrik</name><uri>http://www.blogger.com/profile/18131140901733897033</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
