<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bonita open source BPM community blog &#187; mickael.istria.eclipse</title>
	<atom:link href="http://www.bonitasoft.org/blog/author/mickael-istria-eclipse/?feed=rss_eclipse" rel="self" type="application/rss+xml" />
	<link>http://www.bonitasoft.org/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 24 May 2013 11:36:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Comparing Eclipse and NetBeans RCPs</title>
		<link>http://www.bonitasoft.org/blog/eclipse/comparing-eclipse-and-netbeans-rcps/</link>
		<comments>http://www.bonitasoft.org/blog/eclipse/comparing-eclipse-and-netbeans-rcps/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 10:39:18 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=3452</guid>
		<description><![CDATA[I recently had the opportunity to see a presentation about NetBeans RCP given by Geertjan Wielenga at AlpesJUG, and to chat with the speaker afterwards. We had an interesting discussion about how NetBeans RCP and Eclipse RCP compare to each other. DISCLAIMER: Before you start reading this article, I have to tell you that I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the opportunity to see a presentation about NetBeans RCP given by <a href="http://blogs.sun.com/geertjan/">Geertjan Wielenga</a> at <a href="http://www.alpesjug.fr/?p=802">AlpesJUG</a>, and to chat with the speaker afterwards. We had an interesting discussion about how NetBeans RCP and Eclipse RCP compare to each other.</p>
<div id="attachment_3471" class="wp-caption aligncenter" style="width: 399px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2011/04/versus.jpeg"><img class="size-full wp-image-3471 " title="versus" src="http://www.bonitasoft.org/blog/wp-content/uploads/2011/04/versus.jpeg" alt="" width="389" height="173" /></a><p class="wp-caption-text">Some food for the trolls</p></div>
<p style="text-align: center;">
<p><span id="more-3452"></span></p>
<p><em>DISCLAIMER: Before you start reading this article, I have to tell you that I am an Eclipse fanboy, a contributor on several Eclipse.org projects, developer of an Eclipse RCP app, and have been developing Eclipse plug-ins since I left school. Although I try to be objective in the following article, you may feel it is too Eclipse-oriented. If this is the case, I am sorry&#8230;but Eclipse is better <img src='http://www.bonitasoft.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </em></p>
<h3>RCP applications are developed exactly the same way with NetBeans or Eclipse</h3>
<p>Most of differences between Eclipse RCP and NetBeans RCP development are just in terminology. In NetBeans we speak of <em>modules,</em> in Eclipse, of <em>plugins</em>; we use <em>the NetBeans Platfor</em>m instead of <em>Equinox</em>, we have <a href="http://netbeans.org/features/java/swing.html"><em>Matisse</em></a> instead of <a href="http://www.eclipse.org/windowbuilder/"><em>Window Builder</em></a>. We also have an extension registry with extension points on both platforms, to contribute extensions, and an RCP application is a set of provided modules/plugins + some of your own extensions.</p>
<p>It is the same thing; we can develop them the same way with either Netbeans or Eclipse.</p>
<h3>Eclipse RCP vs NetBeans RCP starts with&#8230; SWT vs Swing</h3>
<p>When getting started with RCP development, here is the main thing encountered, and this is technically the main difference between both Platforms: Netbeans uses Swing as a widget library, whereas Eclipse uses SWT. In my opinion, that&#8217;s not a big difference, but when it comes to choosing between Netbeans and Eclipse, there is a bigger impact when you start a new application or migrate a legacy one. People will probably choose the product with their favorite widget API.</p>
<p>This is the main technical difference, but it is really minor. In my opinion, this difference is not important enough to make a distinction.  Let&#8217;s look deeper, to see what these solutions provide as extensions and so on.</p>
<h3>NetBeans is not an OSGi platform, but&#8230;</h3>
<p>It provides exactly the same necessary features as what is used when developing Eclipse RCP plugins. MANIFEST has different keywords, but there are still <em>modules</em> (<em>or plugins</em> in Eclipse terminology) with their own classloaders and so on.</p>
<p>Additionally, there are a lot of integrations with OSGi. The NetBeans platform can run along with an OSGi container, and it can handle OSGi Bundles. For RCP development, the NetBeans platform provides all the necessary OSGi stuff RCP developers use. During his presentation, Geertjan highlighted some NetBeans OSGi integration by <a href="http://platform.netbeans.org/tutorials/nbm-osgi-quickstart.html">starting Netbeans over Equinox</a> and <a href="http://platform.netbeans.org/tutorials/nbm-emf.html">loading EMF bundles in NetBeans</a>.</p>
<h3>NetBeans has an publisher, Eclipse has an ecosystem</h3>
<p>That&#8217;s probabably one of the key arguments in the debate, and it has a very strong influence on both products. The entire NetBeans roadmap is piloted by Oracle which is wholly responsible for it. At Eclipse, there is no such single pilot. The Eclipse Fundation oversees Eclipse development, but there is not <a href="http://www.oracle.com/">ONE single publisher</a>, there are lots of contributors from <a href="http://www.eclipse.org/membership/showAllMembers.php">different companies</a>. Eclipse is not only modular technically, it is also modular in term of organization. There are several projects that are developed by independent groups. There might be some dependencies between them, but in the end, you have different teams developing different projects.</p>
<p>NetBeans is a single project developed by a company, whereas Eclipse is an amalgamation of different projects developed by a community of individuals and companies. Then&#8230;</p>
<h3>NetBeans is homogeneous, Eclipse is heterogeneous</h3>
<p>Eclipse developers must admit this: NetBeans is much more homogeneous than Eclipse. And this is true in several domains: UI, ergonomics, code quality (which by the way is quite good, according to NetBeans users who find it less buggy than Eclipse code). This is a plus for NetBeans since users who know how to do one task with NetBeans will easily figure out how to do another. It is pretty user-friendly, especially for users who are new to the Java IDEs world.  They can easily leverage most of the IDE and the platform; thanks to its high consistency (standardization). Thus NetBeans rapidly becomes straightforward to use and leverage.</p>
<p>Compared to NetBeans, Eclipse seems difficult to fully manipulate. There can be a lot of differences between 2 projects, in term of usability (creating a web project is quite different than creating a plug-in project, as you often need to learn how to do something), and also in term of quality. The Eclipse platform quality is very good, and so are most of the mature projects, but there are some others are more buggy and makes the IDE less comfortable. Also, when you reuse some code from other projects, you often have to tweak it to get it working well. For Eclipse developers like me, that&#8217;s no big deal; but for new users or for people coming from NetBeans, that can be a major issue.</p>
<p>and&#8230;</p>
<h3>NetBeans has some tools, Eclipse has a lot of projects</h3>
<p>The openness of Eclipse provides something very different from NetBeans. NetBeans is <a href="http://netbeans.org/downloads/index.html">one product with different tools</a>. Eclipse is one platform with <a href="http://www.eclipse.org/projects/listofprojects.php">different projects</a>. These projects are much more numerous than NetBeans components, and they allow you to take several roads at the same time. Eclipse has a kind of wide usefulness that can handle <a href="http://www.eclipse.org/downloads/">classic IDE problems, Mobile-Development problems, Model-Driven problems, Rich Internet Application problems, and so on.</a></p>
<p>Two years ago when it was time to choose a name for the 2010 &#8220;Helios&#8221; Eclipse release, I especially liked the proposal for <em>Hydra</em>, because it is made of one body and several heads. This is a metaphor that fits Eclipse well. To go further with the <em>Hydra</em> comparison, it is considered to be a monster by many people, though a very powerful one&#8230;</p>
<div class="wp-caption aligncenter" style="width: 366px"><img title="hydra" src="http://www.theoi.com/image/img_hydra.jpg" alt="" width="356" height="247" /><p class="wp-caption-text">Eclipse projects - so many, so powerful</p></div>
<p>I see in NetBeans something more under control, more cohesive, and less scattered. Great tools are provided with NetBeans (<a href="http://netbeans.org/features/java/swing.html">Matisse</a>, Installer Framework, and more) to facilitate the development of RCP apps. Getting started with RCP is probably easier with NetBeans since things are more consistent, but I sense a lack of opportunity to find and reuse some very cool things from other projects &#8211; one of the great things you get used to in developing Eclipse RCPs. (I remember how tickled we were to discover and reuse the wiki capabilities of <a href="http://www.eclipse.org/mylyn/">Mylyn</a>.)</p>
<p>If I had to use a mythological metaphor, I think I would compare NetBeans to a Minotaur: a strong and nice-looking beast, but with only a single head <img src='http://www.bonitasoft.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 337px"><img class="     " src="http://edtech2.boisestate.edu/whitel/Images/minotaur.jpg" alt="" width="327" height="327" /><p class="wp-caption-text">The &quot;simpler&quot; NetBeans: good-looking isn&#39;t everything</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/eclipse/comparing-eclipse-and-netbeans-rcps/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Bonita is the Best Eclipse-based Modeling Application !</title>
		<link>http://www.bonitasoft.org/blog/announcement/bonita-is-the-best-eclipse-based-modeling-application/</link>
		<comments>http://www.bonitasoft.org/blog/announcement/bonita-is-the-best-eclipse-based-modeling-application/#comments</comments>
		<pubDate>Mon, 02 May 2011 07:11:19 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=3314</guid>
		<description><![CDATA[As you may know, the BonitaSoft R&#38;D team was honoured to receive the award of Best Eclipse Modeling Application during EclipseCon last month. We are very proud of that recognition. Although the R&#38;D team is considered the &#8220;winner&#8221; in this success, we are very aware that there are a lot of people who have been [...]]]></description>
			<content:encoded><![CDATA[<p>As you may know, the BonitaSoft R&amp;D team was honoured to receive the award of Best Eclipse Modeling Application during EclipseCon last month. We are very proud of that recognition.</p>
<p style="text-align: center;"><img class="aligncenter" title="communityAwardsLogo" src="http://www.eclipse.org/org/foundation/eclipseawards/images/EclipseAwardsLogo.png" alt="" width="150" height="150" /></p>
<p>Although the R&amp;D team is considered the &#8220;winner&#8221; in this success, we are very aware that there are a lot of people who have been involved in the development of Bonita Open Solution. Maybe some of them do not even know it!</p>
<p>So, we want to thank a lot of people who really deserve it:</p>
<ul>
<li> Thanks to the R&amp;D team, who developed this product well enough to get attention from the Eclipse community.</li>
<li>Thanks to the BonitaSoft officers, who are driving the product to ensure it is succeeding in the world of BPM, and that it is really democratizing BPM.</li>
<li>Thanks to all the BonitaSoft employees who provide a lot of feedback and help to ensure that the product meets the expectations of day-to-day users.</li>
<li>Thanks to the entire community of BonitaSoft users and contributors, who provide feedback, report bugs, and suggest new ideas. They may not be really aware enough of how much their input helps make the product better and better.</li>
<li>And also thanks to the Eclipse community, and the other open-source communities we depend on, who very often solve our problems. There are lots and lots of people who helped us to develop Bonita Open Solution and even if they are not aware of it, they deserve a piece of this award.</li>
</ul>
<p>And here it is:</p>
<p style="text-align: center;"><img class="aligncenter" title="Award" src="http://www.bonitasoft.org/blog/wp-content/uploads/2011/04/BestModelingTool2011Award.png" alt="Best Modeling Tool Award" /></p>
<p>This award is not only for a team or a company, it is also for a community of users and was earned because we had access to the knowledge of several communities of technical experts. Once again, a great example of how Open Source leads to great things!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/announcement/bonita-is-the-best-eclipse-based-modeling-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pimp your Intro !</title>
		<link>http://www.bonitasoft.org/blog/uncategorized/pimp-your-intro/</link>
		<comments>http://www.bonitasoft.org/blog/uncategorized/pimp-your-intro/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 15:25:33 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[intro]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[welcome]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=2740</guid>
		<description><![CDATA[What is the first thing you see when you start an RCP product? The splash screen. What is the second thing you see when you start an Eclipse RCP product? The intro page. This page is the first interaction that the user has with your product. It deserves real effort to ensure that your users [...]]]></description>
			<content:encoded><![CDATA[<p>What is the first thing you see when you start an RCP product? The splash screen.</p>
<p>What is the second thing you see when you start an Eclipse RCP product? <strong>The intro page</strong>. This page is the first <em>interaction</em> that the user has with your product. It deserves real effort to ensure that your users feel comfortable when opening the product. Also, you can leverage this page to add dynamic content, that can be used, for example, for direct communication between your company and your users. Then it can become a tool for both <strong>user-friendliness</strong> and <strong>marketing</strong>, with a relatively low effort. It&#8217;s worth it!</p>
<p>In this post we will describe how we leverage the intro page extensibility and API to develop a more ergonomic and marketing-friendly intro page. Everything you will read here can be found or taken directly from the <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_intro_minimal.htm">Eclipse Help contents</a>, but I&#8217;ll try to explain it more practically.<br />
<span id="more-2740"></span><br />
The intro page can also be defined using SWT, but in this post we will focus only on using (X)HTML to define intro pages, since it is more appropriate to the use case of &#8220;out-sourcing&#8221; the intro page to design or marketing.</p>
<h2>What can you expect from your (X)HTML intro page</h2>
<p>While using (X)HTML, you can also use JavaScript. Although most Java developers are not fond of JavaScript, we must admit that it is a very powerful language when it comes to playing with the content of a web page. <strong>JavaScript makes your page dynamic</strong>, and is something that most web-oriented people can tweak to create nice effects on your page (feedback, images in a carousel, powerful widgets&#8230;).</p>
<p>You also can expect 2-way communication between your intro page and your application:</p>
<p>That means that you&#8217;ll be able to <strong>trigger actions in your application from your intro page</strong>, for instance to create a new file, or open a wizard, or anything your application can do.</p>
<p>And you can also <strong>populate your page with data coming from your application</strong>. A use-case we chose for Bonita Studio is to show the &#8220;Recently opened&#8221; files on the intro page. This requires the page to look at the files in the workspace and show the ones last modified. We also use it to show the content of some RSS streams.</p>
<p>With all this stuff, you can create a highly dynamic page well integrated into your application! Here is a video of what we&#8217;ve got for the current release of Bonita Open Solution &#8211; 5.4.1:</p>
<p><iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/Dir2iwJBCtk?rel=0" frameborder="0" allowfullscreen></iframe></p>
<p>Here is the recipe:</p>
<h2>Define an intro for your product</h2>
<p>This step is just about overriding the default Eclipse intro page for your product and defining contents for the intro. Since we want the intro page to be easily maintained by the design and marketing teams, we chose to use XHTML to define it. XHTML is much more accessible than Java and SWT for them <img src='http://www.bonitasoft.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . In this post, we will only focus only on using HTML or XHTML, skipping SWT.</p>
<p>In one of your plugin.xml files (for instance in the plugin that contains your html page), add:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extension</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">point</span>=<span style="color: #ff0000;">&quot;org.eclipse.ui.intro&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Declare intro page --&gt;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intro</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.eclipse.ui.intro.config.CustomizableIntroPart&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">icon</span>=<span style="color: #ff0000;">&quot;icons/bonitasoft-icon-16-16-transparent.png&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.application.intro&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">label</span>=<span style="color: #ff0000;">&quot;%openWelcomePage_label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intro<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- bind it to your product --&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;introProductBinding</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">introId</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.application.intro&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">productId</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.product&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/introProductBinding<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extension<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;extension</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">point</span>=<span style="color: #ff0000;">&quot;org.eclipse.ui.intro.config&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;">&lt;!-- Define its content --&gt;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;config</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;content/introContent.xml&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.application.configId&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">introId</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.application.intro&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;presentation</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066;">home-page-id</span>=<span style="color: #ff0000;">&quot;root&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;implementation</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">kind</span>=<span style="color: #ff0000;">&quot;html&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">os</span>=<span style="color: #ff0000;">&quot;win32,linux,macosx&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/implementation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/presentation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/config<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/extension<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>This means that for <em>org.bonitasoft.studio.product</em>, you&#8217;ll show the intro as defined in <em>content/introContent.xml</em>, starting from the page with id <em>root</em>, in <em>html</em> mode (you can use <em>swt</em> if you want).</p>
<p>As you can see, this extension binds an introContent.xml file to your product. Now, add it to your bundle, along with the html file of the page. Note that the page that will be displayed as intro is the one with id <em>root</em>:</p>
<div id="attachment_2751" class="wp-caption aligncenter" style="width: 530px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/12/screenshotintro.png"><img class="size-large wp-image-2751" title="screenshotintro" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/12/screenshotintro-1024x418.png" alt="" width="512" height="209" /></a><p class="wp-caption-text">Intro plugin tree, and introContent.xml</p></div>
<h2>Contents of the file</h2>
<h3>XHTML or HTML</h3>
<p>In your introContent.xml, you have 2 ways to reference the file you want to show, depending on the attribute you use to locate the page in the <em>page</em> element of introContent.xml:</p>
<h4>url=&#8221;myPage.html&#8221;</h4>
<p>With a <em>url</em>, you will be able to show any HTML or JavaScript you want. Everything will be simply displayed in a web browser. You&#8217;ll be able to call some of your application code by clicking links. (See &#8220;Links to actions in your application&#8221;), however you won&#8217;t be able to add contents to that page at runtime depending on your application state. This method is preferable when you don&#8217;t need to fill the page with data from your application, since it provides full support for JavaScript.</p>
<p><strong>content=&#8221;myPage.html&#8221;</strong></p>
<p>The content of your HTML must be valid XHTML. Thus your file can have the same content as any HTML file, except that it has to start with the XHTML header (<em>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;> &lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;></em>) and all your tags must be closed. If you are generally using Java, you probably often edit XML, then nothing shocking here. (By the way, I do not understand why XHTML is not the de facto standard nowadays&#8230;)</p>
<p>Your file must conform to the W3C specification. The <a href="http://validator.w3.org/#validate_by_upload">W3C validator</a> is very helpful while debugging it.</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">http-equiv</span>=<span style="color: #ff0000;">&quot;Content-Type&quot;</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Welcome to Bonita Studio<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/style.css&quot;</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
function setClass(elementId,cssclass)<br />
{<br />
&nbsp; &nbsp; var e = document.getElementById(elementId);<br />
&nbsp; &nbsp; if(e != null)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; e.className = cssclass;<br />
&nbsp; &nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; return false;<br />
}<br />
...<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body</span> <span style="color: #000066;">onload</span>=<span style="color: #ff0000;">&quot;initCarrousel();&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;body_custom&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;template-gen&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;containerCenter&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;left&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;left&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;col-top&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;col-top&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;img</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;images/design.png&quot;</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;200&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;60&quot;</span> <span style="color: #000066;">alt</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;col-mid&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;col-mid&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;col-mid-bg&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;col-mid-bg&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;actions&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
...<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
...<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
...<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Since your XHTML intro page will be displayed in the internal Browser of Eclipse, there is obviously support for JavaScript! Except if you use contentProviders in your page, you have to use the <em>content</em> XML attribute in your <em>introConent.xml</em> instead of the <em>url</em> attribute, and there is currently a<strong> limitation for JavaScript</strong> support that is reported on bug <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=332416">332416</a>, that makes impossible to execute JS code that contains &#8220;&lt;&#8221; or &#8220;&amp;&#8221;, and possibly others.</p>
<p>However, only the <em>content</em> mode allows you to use contentProviders.</p>
<h3>Links to actions in your application</h3>
<p>This is well described in the <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_intro_minimal.htm">Eclipse help</a>, and is pretty easy to set up. For each action you want to call from your intro page, implement your action as a class that extends <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/ui/intro/config/IIntroAction.html">IIntroAction</a>. Then, whenever the internal intro web browser reaches the URL<em> http://org.eclipse.ui.intro/runAction?pluginId=org.bonitasoft.studio.intro&amp;amp;class=org.bonitasoft.studio.intro.actions.NewProcessAction</em>, the NewProcessAction will be executed.</p>
<p>Then simply add links from your HTML page to your actions:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">&lt;!-- Simple anchor --&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;http://org.eclipse.ui.intro/runAction?pluginId=org.bonitasoft.studio.intro&amp;amp;amp;class=org.bonitasoft.studio.intro.actions.NewProcessAction&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>click me<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #808080; font-style: italic;">&lt;!-- JavaScript--&gt;</span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">&quot;location.href='http://org.eclipse.ui.intro/runAction?pluginId=org.bonitasoft.studio.intro&amp;amp;amp;class=org.bonitasoft.studio.intro.actions.NewProcessAction'&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>click me<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<h3>Content depending on your application state (contentProvider)</h3>
<p>This only works when you reference your page using the <em>content </em>attribute, in your introConfig.xml. The official documentation is <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ua_intro_minimal.htm">here</a>.</p>
<p>The key is to create a class that implements <a href="IIntroXHTMLContentProvider">IIntroXHTMLContentProvider</a>. With XHTML, it is generally more comfortable to implement the <em>createContent(String id, Element parent) </em>method. Here is the content provider we use for internationalization of messages in our intro page:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* Copyright (C) 2010 BonitaSoft S.A.<br />
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble<br />
*<br />
* This program is free software: you can redistribute it and/or modify<br />
* it under the terms of the GNU General Public License as published by<br />
* the Free Software Foundation, either version 2.0 of the License, or<br />
* (at your option) any later version.<br />
*<br />
* This program is distributed in the hope that it will be useful,<br />
* but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br />
* GNU General Public License for more details.<br />
*<br />
* You should have received a copy of the GNU General Public License<br />
* along with this program.  If not, see &amp;lt;http://www.gnu.org/licenses/&amp;gt;.<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.bonitasoft.studio.intro.content</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.PrintWriter</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.bonitasoft.studio.intro.Messages</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.widgets.Composite</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.forms.widgets.FormToolkit</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.intro.config.IIntroContentProviderSite</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.intro.config.IIntroXHTMLContentProvider</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.w3c.dom.Document</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.w3c.dom.Element</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.w3c.dom.Text</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* @author Mickael Istria<br />
*<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> I18NContentProvider <span style="color: #000000; font-weight: bold;">implements</span> IIntroXHTMLContentProvider <span style="color: #009900;">&#123;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/* (non-Javadoc)<br />
* @see org.eclipse.ui.intro.config.IIntroContentProvider#init(org.eclipse.ui.intro.config.IIntroContentProviderSite)<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>IIntroContentProviderSite site<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/* (non-Javadoc)<br />
* @see org.eclipse.ui.intro.config.IIntroContentProvider#createContent(java.lang.String, java.io.PrintWriter)<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> createContent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> id, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aprintwriter+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PrintWriter</span></a> out<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/* (non-Javadoc)<br />
* @see org.eclipse.ui.intro.config.IIntroContentProvider#createContent(java.lang.String, org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> createContent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> id, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acomposite+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Composite</span></a> parent, FormToolkit toolkit<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/* (non-Javadoc)<br />
* @see org.eclipse.ui.intro.config.IIntroContentProvider#dispose()<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> dispose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">/* (non-Javadoc)<br />
* @see org.eclipse.ui.intro.config.IIntroXHTMLContentProvider#createContent(java.lang.String, org.w3c.dom.Element)<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> createContent<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> id, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Element</span></a> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocument+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Document</span></a> dom <span style="color: #339933;">=</span> parent.<span style="color: #006633;">getOwnerDocument</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Text text <span style="color: #339933;">=</span> dom.<span style="color: #006633;">createTextNode</span><span style="color: #009900;">&#40;</span>Messages.<span style="color: #006633;">getMessage</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
parent.<span style="color: #006633;">appendChild</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></div>
<p>And then, we can include a message from our NLS messages class in the XHTML page using:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;contentProvider</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;myMessageKey&quot;</span> <span style="color: #000066;">pluginId</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.intro&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;org.bonitasoft.studio.intro.content.I18NContentProvider&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<h2>Examples</h2>
<p>All this stuff, and much more, can be found in our <a href="http://www.bonitasoft.org/websvn/listing.php?repname=Bonita+Open+Solution&#038;path=%2Fbonita-studio%2Fbranches%2Fbonita-studio-5.4.1%2Fplugins%2Forg.bonitasoft.studio.intro%2F#path_bonita-studio_branches_bonita-studio-5.4.1_plugins_org.bonitasoft.studio.intro_">SVN repo</a>. You&#8217;ll hopefully find some clues and ideas if you&#8217;re stuck <img src='http://www.bonitasoft.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/uncategorized/pimp-your-intro/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Release engineer vs dependency management: Basing RCP Product and headless build from plugins to features</title>
		<link>http://www.bonitasoft.org/blog/uncategorized/release-engineer-vs-dependency-management-basing-rcp-product-and-headless-build-from-plugins-to-features/</link>
		<comments>http://www.bonitasoft.org/blog/uncategorized/release-engineer-vs-dependency-management-basing-rcp-product-and-headless-build-from-plugins-to-features/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 08:52:55 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[engineering]]></category>
		<category><![CDATA[headless]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[releng]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=2283</guid>
		<description><![CDATA[A year and a half after the first draft of Bonita Studio, we decided to move our product build from plugins to features, in order to better handle internationalization, and with the hope to better factorize the build of our 2 products: BOS and BOS-SP (which is a set of extensions on top of BOS). [...]]]></description>
			<content:encoded><![CDATA[<p>A year and a half after the first draft of Bonita Studio, we decided to move our product build from plugins to features, in order to better handle internationalization, and with the hope to better factorize the build of our 2 products: BOS and BOS-SP (which is a set of extensions on top of BOS).</p>
<p>Our build still uses the highly customized headless PDE-build wrapped in a master script responsible for packaging and testing the application as we deliver it. Here are the steps we followed:<br />
<!-- more --></p>
<h2>Create the feature from the product definition</h2>
<p>This was not a trivial task, since there is no tool to transform a product definition to a feature. The solution we chose was to use <em>Run Configuration</em> to  create the feature. This is an intermediate step that is useful to turn a product definition into a feature:</p>
<ul>
<li>Right-click on your *.product, and <em>Run as Eclipse application</em></li>
<li>The Run Configuration matching the definition of your .product (and then the set of plugins that it contains) is created</li>
<li>Create a new feature, and use the magic <em>Create from Run Configuration </em>button</li>
<li>Remove the launchers (org.eclipse.equinox.launcher*) from this feature</li>
</ul>
<p>This method is inspired from blog posts written by <a href="http://manuelselva.wordpress.com/2010/07/07/plugin-product-vs-feature-product/">Manuel Selva</a>.</p>
<h2>Redefine your *.product</h2>
<p>From there, you can redefine your .product to include only 2 features: the one you just created, and the org.eclipse.rcp feature.</p>
<h2>Quickly validate it</h2>
<p>You can make a first validation of your product. The steps are easy:</p>
<ul>
<li>Create a launch configuration for your product by clicking on the<em> Run As Eclipse application</em> or the <em>Synchronize</em> entry
<div id="attachment_2329" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/launch.png"><img class="size-medium wp-image-2329" title="launch" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/launch-300x188.png" alt="" width="300" height="188" /></a><p class="wp-caption-text">Launch product from product editor</p></div></li>
<li>Open the launch configuration wizard, and click on the validate button
<p><div id="attachment_2330" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/validate.png"><img class="size-medium wp-image-2330" title="validate" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/validate-300x166.png" alt="" width="300" height="166" /></a><p class="wp-caption-text">The validate button will give you some hints to fix deps</p></div></li>
<li>It tells you about some static missing dependencies. Correct your feature according to its advices.</li>
<li>Be patient and keep retrying when you get errors. I think I needed more than a dozen iterations before getting the happy button telling me all is well.</li>
</ul>
<h2>Add the feature to your map</h2>
<p>This step is only mandatory if you have a headless build that uses map files. If you usually build using UI, just skip it.</p>
<p><div id="attachment_2368" class="wp-caption aligncenter" style="width: 245px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/300_370932.jpg"><img class="size-medium wp-image-2368" title="300_370932" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/300_370932-235x300.jpg" alt="" width="235" height="300" /></a><p class="wp-caption-text">Happy HEADLESS Halloween !</p></div>
<p>Everything is in the title: you just created a new feature, and you&#8217;ll need it at build time. Simply add an entry for the feature to your map:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">!** Features<br />
feature@org.bonitasoft.studio=SVN,url=http://svn.bonitasoft.org/,tag=bonita-studio,path=XXX_TAG_XXX/releng/org.bonitasoft.studio-feature</div></div>
<h2>Try, see and troubleshoot</h2>
<p>Once you&#8217;ve done all that, try to build your product. Using the UI entry should be enough.</p>
<div id="attachment_2332" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/wizard.png"><img class="size-medium wp-image-2332" title="wizard" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/wizard-300x275.png" alt="" width="300" height="275" /></a><p class="wp-caption-text">The export product wizard</p></div>
<h3>Fixing startup</h3>
<p>After that, you can give a first try to your bundled product. Run it. It may fail to start. In this case, analyze the startup log that you will find in <em>YourProduct/config/[timestamp].log</em>. You&#8217;ll probably see some lines such as these:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">!ENTRY org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Bundle reference:file:plugins/org.eclipse.jdt.junit.runtime_3.4.200.v20100526-0800.jar was not resolved.<br />
!SUBENTRY 2 org.eclipse.jdt.junit.runtime 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing required bundle org.junit_3.8.2.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Bundle reference:file:plugins/javax.servlet.jsp_2.0.0.v200806031607.jar was not resolved.<br />
!SUBENTRY 2 javax.servlet.jsp 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing imported package javax.servlet.http_2.4.0.<br />
!SUBENTRY 2 javax.servlet.jsp 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing imported package javax.servlet.resources_2.4.0.<br />
!SUBENTRY 2 javax.servlet.jsp 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing imported package javax.servlet_2.4.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Bundle reference:file:plugins/org.bonitasoft.studio.common_1.0.0.20101021-0701.jar was not resolved.<br />
!SUBENTRY 2 org.bonitasoft.studio.common 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing required bundle org.codehaus.groovy_1.7.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Bundle reference:file:plugins/org.mortbay.jetty.util_6.1.23.v201004211559.jar was not resolved.<br />
!SUBENTRY 2 org.mortbay.jetty.util 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing imported package javax.servlet.http_0.0.0.<br />
!SUBENTRY 2 org.mortbay.jetty.util 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing imported package javax.servlet_0.0.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Bundle reference:file:plugins/org.bonitasoft.studio.simulation_1.0.0.20101021-0701.jar was not resolved.<br />
!SUBENTRY 2 org.bonitasoft.studio.simulation 2 0 2010-10-21 09:17:50.299<br />
!MESSAGE Missing required bundle org.codehaus.groovy_1.7.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.bonitasoft.studio.console.libs_1.0.0.20101021-0701 was not resolved.<br />
!SUBENTRY 2 org.bonitasoft.studio.console.libs 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle javax.servlet_0.0.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.eclipse.pde.core_3.6.0.v20100601.jar was not resolved.<br />
!SUBENTRY 2 org.eclipse.pde.core 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle org.eclipse.equinox.p2.touchpoint.eclipse_[2.0.0,3.0.0).<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.codehaus.groovy.eclipse.core_2.0.2.e36-special20100412-1500-e36-special.jar was not resolved.<br />
!SUBENTRY 2 org.codehaus.groovy.eclipse.core 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle org.codehaus.groovy_0.0.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.eclipse.pde.build_3.6.0.v20100603 was not resolved.<br />
!SUBENTRY 2 org.eclipse.pde.build 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle org.eclipse.equinox.p2.director.app_1.0.200.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.mortbay.jetty.server_6.1.23.v201004211559.jar was not resolved.<br />
!SUBENTRY 2 org.mortbay.jetty.server 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing imported package javax.servlet.http_2.5.0.<br />
!SUBENTRY 2 org.mortbay.jetty.server 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing imported package javax.servlet_2.5.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.codehaus.groovy.eclipse.refactoring_2.0.2.e36-special20100412-1500-e36-special.jar was not resolved.<br />
!SUBENTRY 2 org.codehaus.groovy.eclipse.refactoring 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle org.codehaus.groovy_0.0.0.<br />
!SUBENTRY 1 org.eclipse.osgi 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Bundle reference:file:plugins/org.eclipse.ocl_3.0.0.v201005061704.jar was not resolved.<br />
!SUBENTRY 2 org.eclipse.ocl 2 0 2010-10-21 09:17:50.300<br />
!MESSAGE Missing required bundle lpg.runtime.java_[2.0.17,3.0.0).<br />
...</div></div>
<p>This simply tells you the missing bundles in your feature. Then, for each <em>Missing required bundle</em> entry, you will need to add it to your feature, take a look at its dependency tree, add some its dependencies if you missed them, and&#8230; Retry !</p>
<h3>Fixing runtime</h3>
<p>It can easily happen that one of your plugins does not start without crashing the whole product. In such case, you silently lose the features provided by the code of your plugin. Then you can use the OSGi console to get insight about what&#8217;s going wrong.</p>
<p>In this example, the log tells me that it cannot load the test plugin, but I don&#8217;t really know why. So I can try the following:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mistria@mistri-laptop:~/BonitaStudio-20101021$ ./BonitaStudio -console<br />
[... Some more or less useful stuff ...]<br />
osgi&amp;gt; start org.bonitasoft.studio.tests<br />
org.osgi.framework.BundleException: The bundle &quot;org.bonitasoft.studio.tests_1.0.0.20101021-2140 [1449]&quot; could not be resolved. Reason: Missing Constraint: Require-Bundle: org.bonitasoft.studio.repository.test; bundle-version=&quot;0.0.0&quot;<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:585)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)<br />
at java.lang.Thread.run(Thread.java:595)<br />
<br />
osgi&amp;gt; start org.bonitasoft.studio.repository.test<br />
org.osgi.framework.BundleException: The bundle &quot;org.bonitasoft.studio.repository.test_1.0.0.20101021-2140 [1340]&quot; could not be resolved. Reason: Missing Constraint: Require-Bundle: org.bonitasoft.studio.util.tests; bundle-version=&quot;1.0.0&quot;<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:585)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)<br />
at java.lang.Thread.run(Thread.java:595)<br />
<br />
osgi&amp;gt; start org.bonitasoft.studio.util.tests<br />
org.osgi.framework.BundleException: The bundle &quot;org.bonitasoft.studio.util.tests_1.0.0.20101021-2140 [1371]&quot; could not be resolved. Reason: Missing Constraint: Require-Bundle: org.eclipse.swtbot.eclipse.finder; bundle-version=&quot;2.0.0&quot;<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:585)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)<br />
at java.lang.Thread.run(Thread.java:595)<br />
org.osgi.framework.BundleException: The bundle &quot;org.eclipse.swtbot.eclipse.finder_2.0.0.568-dev-e36 [1301]&quot; could not be resolved. Reason: Missing Constraint: Require-Bundle: org.eclipse.swtbot.swt.finder; bundle-version=&quot;2.0.0&quot;<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)<br />
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)<br />
at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:585)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141)<br />
at org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105)<br />
at java.lang.Thread.run(Thread.java:595)<br />
<br />
[... And so on, until ...]<br />
<br />
osgi&amp;gt; start org.hamcrest.library<br />
Cannot find bundle org.hamcrest.library</div></div>
<p>Thanks to the console, I can figure out that the missing bundle is org.hamcrest library. I just add it to my feature, and everything works better. Using the console is a general method to resolve dependencies issues. The console is often your best friend!</p>
<h2>Conclusion</h2>
<p>As you can see, switching from a plugins-based product to a feature-based is not immediate. Features do not provide the fantasically useful <em>Add Required Plug-ins </em>button that you can find on a plugin-based product, and so this move will probably lead to errors in dependency management.</p>
<div id="attachment_2333" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/Edit.png"><img class="size-medium wp-image-2333" title="Edit" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/10/Edit-300x188.png" alt="" width="300" height="188" /></a><p class="wp-caption-text">The &quot;Add Required Plug-ins&quot; button is only available for plugin-based products</p></div>
<p>That&#8217;s why, once you have your feature, you need to tweak it to get your product working, since you can easily miss a bundle. Moreover, the bundles you ship may have a different version after a feature-based build. You&#8217;ll need to test it well to ensure that this move did not break some features of your product because of bundle versioning. I opened bugs <a title="NEW - [Product/Feature Editor] Add a right-click &gt; Add dependencies on bundles" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=328323">328323</a> and <a title="NEW - Set up tools to facilitate creation of features for feature-based products" href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=319085"> 319085</a> to ask for improvments on this topic.</p>
<p>As always, automated non-regression tests are your very best friend for such a move.</p>
<p>Our feature-based build has now been working for a few days, and I can already tell I am quite happy with it. The build of our 2 products is easier to understand and maintain, and now looks like a simple composition of features. Also, adding a language does not require us to modify the .product any more, and it helps us to get closer to the ability to provide &#8220;language packs&#8221; as extensions of the product.</p>
<p>Next step, moving to p2&#8230;but that will be another story!</p>
<h2>By the way&#8230;</h2>
<p><img class="alignleft" style="margin-left: 30px; margin-right: 30px;" title="EclipseSummit" src="http://www.eclipsecon.org/summiteurope2010/static/image/friends/100x100_going.gif" alt="" width="100" height="100" />Aurélien and I will be at Eclipse Summit in Ludwigsburg. Aurélien will  have the opportunity to present to the Eclipse community how we leverage  the Modeling projects in our product.<br />
If you want to have a chat with us, about anything, feel free to drop us  an email to plan a meeting, or grab us during the event!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/uncategorized/release-engineer-vs-dependency-management-basing-rcp-product-and-headless-build-from-plugins-to-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How target platforms helped me to fix old bugs</title>
		<link>http://www.bonitasoft.org/blog/uncategorized/how-target-platforms-helped-me-to-fix-old-bugs/</link>
		<comments>http://www.bonitasoft.org/blog/uncategorized/how-target-platforms-helped-me-to-fix-old-bugs/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 17:02:09 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[Plug-ins]]></category>
		<category><![CDATA[target]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=1817</guid>
		<description><![CDATA[I&#8217;ve used target platforms to ensure that I only add dependencies that are available in our build platform. Until now, I found them useful, but I did not understand how powerful they really are. Here is a story that convinced me that target platforms are a master feature of RCP development. A few days ago, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used target platforms to ensure that I only add dependencies that are available in our build platform. Until now, I found them useful, but I did not understand how powerful they really are. Here is a story that convinced me that target platforms are a master feature of RCP development.<br />
<span id="more-1817"></span></p>
<p>A few days ago, I had to fix a bug on the 5.2.3 branch version of the Studio/RCP part of <a href="http://www.bonitasoft.com/products/BPM_download.php">Bonita Open Solution</a>. The classes I needed to modify had been strongly refactored in trunk (5.3), so that the fix would be different on the trunk than on the branch, and it was impossible to simply propagate a fix.</p>
<p>So I had to edit old code. But my workspace only contained trunk code, and the old code was not compiling because of several refactorings. I was wondering how the heck I would be able to easily work on code from the past&#8230;!<br />
But I found an answer and it&#8217;s simple&#8230; <a href="http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/concepts/target.htm">TARGET PLATFORMS</a> !</p>
<p>Here is what I suggest to isolate the branch fix from trunk development:</p>
<ol>
<li> Create a new workspace (workspaceBranch).</li>
<li> Set the old version of your product (here the 5.2.2 version) as the target platform. This must be the version containing the bug.
<p><div id="attachment_1828" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/target.png"><img class="size-medium wp-image-1828" title="target" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/target-300x266.png" alt="" width="300" height="266" /></a><p class="wp-caption-text">The target platform is made up of all bundles of the product containing the bug</p></div></li>
<li> Check out ONLY your old bugged bundle from the branch.
<p><div id="attachment_1829" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/ws.png"><img class="size-medium wp-image-1829" title="ws" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/ws-300x188.png" alt="" width="300" height="188" /></a><p class="wp-caption-text">A minimal and easy-to-use workspace</p></div></li>
<li> Create your launch configuration which is made up of the product and your buggy bundle project from workspace.
<p><div id="attachment_1831" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/launch.png"><img class="size-medium wp-image-1831" title="launch" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/launch-300x236.png" alt="" width="300" height="236" /></a> <a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/launch2.png"><img class="size-medium wp-image-1832" title="launch2" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/08/launch2-300x238.png" alt="" width="300" height="238" /></a><p class="wp-caption-text">Configure your launch to use your product, with the patched bundle from your workspace</p></div></li>
<li> Run and test your product to see the bug.</li>
<li> Fix your old code.</li>
<li> Test your fix.</li>
<li> Commit your fix on the branch.</li>
</ol>
<p>With this trick, I avoided the headaches of mixing trunk and branch code. It made my work much easier and less risky.</p>
<p>The only annoying thing is that you lose all your workspace preferences and Mylyn contexts during the time it takes to finish the fix, so this is not critical.</p>
<p>I can now say it: I ♥ target platforms!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/uncategorized/how-target-platforms-helped-me-to-fix-old-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Our EclipseCon</title>
		<link>http://www.bonitasoft.org/blog/uncategorized/our-eclipsecon/</link>
		<comments>http://www.bonitasoft.org/blog/uncategorized/our-eclipsecon/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 09:08:16 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[EclipseCon]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=561</guid>
		<description><![CDATA[Charles and I were at EclipseCon last week. It was an incredible opportunity to learn things and meet a lot of people. Here is the summary of our conference. BonitaSoft presentations On Wednesday afternoon, Charles presented a short talk in which he explained the SWT « no more handles » error and how to get rid of [...]]]></description>
			<content:encoded><![CDATA[<p>Charles and I were at EclipseCon last week. It was an incredible opportunity to learn things and meet a lot of people. Here is the summary of our conference.</p>
<p><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0116.jpg"><img class="aligncenter size-medium wp-image-578" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0116-300x225.jpg" alt="" width="300" height="225" /></a><span id="more-561"></span></p>
<h2>BonitaSoft presentations</h2>
<p>On Wednesday afternoon, Charles presented <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1266">a short talk in which he explained the SWT « no more handles » error and how to get rid of it</a>. This was an error we encountered right away while developing <a href="http://www.bonitasoft.com/products/BPM_download.php">Bonita Open Solution</a>, and EclipseCon was an opportunity to share the knowledge we acquired as we resolved it. The presentation was dynamic, pragmatic and concrete (Charles&#8217; style). He got some positive feedback from people who were currently struggling with handle leaks, and who learned a few tips from us. Charles&#8217; slides are available <a href="http://www.slideshare.net/souillac/eclipsecon2010-no-more-handles">here</a>.</p>
<p>In the evening, while everyone was scarfing burgers at the reception-poster session, <a href="http://www.eclipsecon.org/2010/sessions/sessions?id=1628">we presented our poster</a> which shows how Bonita Open Solution leverages Eclipse. Since it was during dinnertime, the buffet was very busy and there were not a whole lot of people paying attention to the posters, but there were several curious people who came to discuss parts of the solution. We were able to describe the product to people according to their interest, and we had some good discussions about the power of Eclipse behind the RCP part of the solution. Some visitors also gave us some interesting ideas that may turn into upcoming features.</p>
<div id="attachment_597" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.com/ressources/poster-eclipse-v4.pdf"><img class="size-medium wp-image-597" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/poster-300x211.jpg" alt="" width="300" height="211" /></a><p class="wp-caption-text">Bonita Open Solution poster</p></div>
<p style="text-align: center;">
<h2>Modeling</h2>
<p>Since Bonita Studio is mainly about modeling processes and forms, one of the topics we followed closely was modeling, and more specifically diagram modeling. We were very pleased that our process editor was cited by <a href="http://www.obeo.fr">Obeo</a>&#8216;s Etienne Juliot as <strong>« one of the most beautiful GMF-based editors »</strong> during his talk, in which he <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1420">showcased several use cases</a> of <a href="http://www.eclipse.org/modeling/gmf/">GMF</a>.</p>
<p>Another very interesting thing to keep in mind about diagram modeling is the <a href="http://www.eclipse.org/proposals/graphiti/">Graphiti</a> project. We spent some time in the Graphiti introduction talk and had an interesting discussion with Michael Wenz.  It seems that Graphiti is a real alternative to semantic-unaware <a href="http://www.eclipse.org/gef/">GEF</a> and generation-based <a href="http://www.eclipse.org/modeling/gmf/">GMF</a>, since it offers a natural mapping between graphical elements and semantic models and makes customization of diagrams easier. It seems to be very useful for editors that rely on an EMF model and that are very tricky to implement with GMF generation. I personally think that it could be adapted to our form editor, if it should have to be re-written one day&#8230;</p>
<h2>Build and continuous integration</h2>
<p>Let&#8217;s start with the <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1327">p2 tutorial</a> of the Monday morning. Here we picked up a lot of tips about how to leverage p2 in product builds. Currently our studio does not use p2 because we were not able to merge platform-specific product distributions into a single zip, but this will be changed soon thanks to Pascal Rapicault and Kim Moir&#8217;s advice during the tutorial. I hope to tell you more about a « bundlepool » p2 director property soon, in this blog or in the <a href="http://www.eclipse.org/forums/index.php?t=thread&amp;frm_id=31&amp;">Equinox newsgroup</a>.</p>
<div id="attachment_577" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0113.jpg"><img class="size-medium wp-image-577" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0113-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">My favourite EclipseCon T-shirt</p></div>
<p>Another interesting thing in the Build World is the rise of <a href="http://www.eclipse.org/proposals/tycho/">Tycho</a>, which allows you to <strong>build Eclipse plugins or OSGi bundles using Maven</strong>. This seems to be very easy to adopt and a good way of thinking:  bundles as Maven artifacts, and p2 repositories as Maven bundle repositories. There are already a lot of <a href="http://divby0.blogspot.com/2010/03/im-in-love-with-tycho-08-and-maven-3.html">enthusiastic people talking</a> about this, and it is something I&#8217;d like to try soon.</p>
<p>Something else that really enouraged me is the growing interest for <a href="http://www.eclipse.org/swtbot/">SWTBot</a> in the Eclipse community (<a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1258">1 dedicated tutorial</a>, <a href="http://www.eclipsecon.org/2010/sessions?id=1279">1 talk</a>, and a recurring subject in <a href="http://www.eclipsecon.org/2010/sessions?id=1442">build-related</a> <a href="http://www.eclipsecon.org/2010/sessions?id=1439">talks</a>). As you may know, we already use it extensively here for integration tests, and knowing that the community of users is growing ensures that the project will keep on improving! At EclipseCon, we spent some time with Charles and <a href="http://www.obeo.fr/">Obeo</a>&#8216;s Goulwen le Fur talking with Ketan Padegaonkar (SWTBot project lead) about the status of <strong>an experimental Test Recorder</strong> that you can find on the SWTBot codebase. Such a feature would be very powerful since<strong> it would allow your user to generate a TestCase simply by reproducing a scenario</strong> as you would normally with your product. This would for sure reduce test writing costs, make tests closer to real use cases and facilitate bug reports. However, according to Ketan, there is still some development work before it becomes really usable.  So, if you have the resources and the motivation, please contribute by giving it a try, <a href="http://www.eclipse.org/forums/index.php?t=thread&amp;frm_id=74&amp;">asking questions on the forum</a> and opening bugs for it!</p>
<div id="attachment_575" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0136.jpg"><img class="size-medium wp-image-575" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0136-300x224.jpg" alt="" width="300" height="224" /></a><p class="wp-caption-text">The Hudson sticker we got in Build Panel on our IC machines</p></div>
<h2>Emerging technologies: e4, RAP &amp; Egit</h2>
<p>We arrived at EclipseCon with some specific questions about emerging technologies, and we got our answers!</p>
<p>The first one is about e4: <em>should we migrate Bonita Open Solution to e4? Why? When?</em> Here the talk of Boris Bokowski and Paul Webster <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1450">« Migrating to e4 »</a> gave us a concrete answer. That answer is yes, we should migrate to e4, but not before other projects we use (such as GMF) have migrated to e4, and this represents a real investment of resources for us. Our conclusion is that <strong>we have still at least one year to wait</strong>&#8230;</p>
<p>I also attended the very good tutorial <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1464">« Single Sourcing RCP and RAP applications »</a> and spent some time speaking with some <a href="http://eclipsesource.com/">EclipseSource</a> guys working on RAP (Benjamin Muskalla and Elias Volanakis), to find possible obstacles to port Bonita Studio to the web using <a href="http://www.eclipse.org/rap/">RAP</a>. We concluded that there are 2 main things that are not implemented yet in RAP that are critical for us: <strong>user-session workspace</strong> (currently there is a single workspace for the whole RAP application, whereas it would make sense to have one workspace per user), and <strong>diagramming capabilities</strong>. If you are interested in user-workspace in RAP, you can follow and comment to this <a href="http://www.eclipse.org/forums/index.php?t=msg&amp;th=165398&amp;start=0&amp;">thread</a>.</p>
<p>And also we wanted to learn more about Git and how it interacts with Eclipse, since a lot of people have been evangelizing about it for a few months. We are currently using SVN here, and it seems that <strong>Git is not adapted to our 8-people-located-in-the-same-room R&amp;D team</strong> organization. Indeed, the system of review-and-merge seems to be very time-consuming and not so easy to understand. However, Git becomes very interesting when the product developers/contributors are distributed all over the world and when there are lot of contributors to a product.</p>
<h2>Other conference things</h2>
<p>Some other talks we attended and enjoyed a lot:</p>
<ul>
<li>Andrew Eisenberg, <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1340">Getting Groovy with Eclipse</a>: this talk left no doubt that Groovy-Eclipse deserves its Community Award.</li>
<li>Boris Bokowski, <a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1418">Embedding web UI components in Eclipse</a>: learn how powerful the Eclipse web browser is!</li>
<li>Phil Quitslund,<a href="http://www.eclipsecon.org/2010/sessions/?page=sessions&amp;id=1256"> UI Testing Patterns and Best Practices</a>: A set of concrete tips to improve your tests, and a very good speaker.</li>
<li>The incredibly amazing keynote of Jeff Norris! (<a href="http://ianskerrett.wordpress.com/2010/03/26/clip-from-jeff-norris-keynote/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+IanSkerrett+%28Ian+Skerrett%29">See</a> <a href="http://ianskerrett.wordpress.com/2010/03/25/best-keynote-ever/">some</a> <a href="http://aniszczyk.org/2010/03/24/eclipse-nasa-and-rocket-science-and-the-republic/">descriptions</a>)</li>
</ul>
<p>Charles and I also took part in the <a href="http://relengofthenerds.blogspot.com/2010/03/eclipsecon-exercise-tuesday-310k-and.html">EclipseCon exercise</a> (actually only the two first days; after what we got a bit lazy). It was a very good way to start the day! Thanks to Kim for organizing it.</p>
<p>Something else we paticipated in was the <a href="http://www.eclipsecon.org/2010/trivia/">Trivia game</a>, and we are happy to say that we were quite successful!  I won on Monday, and Charles won on Thursday. We worked hard to win these phones, but it was fun and a great opportunity to talk with some new people.</p>
<div id="attachment_583" class="wp-caption aligncenter" style="width: 235px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_01121.jpg"><img class="size-medium wp-image-583" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_01121-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">We were very lucky with Trivia game</p></div>
<h2>Other things in California</h2>
<p>Just some pictures to share&#8230;</p>
<div id="attachment_612" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0072.jpg"><img class="size-thumbnail wp-image-612" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0072-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Amazing Stanford univerity campus</p></div>
<div id="attachment_613" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0147.jpg"><img class="size-thumbnail wp-image-613" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0147-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Golden Gate and the Bay</p></div>
<div id="attachment_614" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0162.jpg"><img class="size-thumbnail wp-image-614" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/CIMG0162-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">San Francisco&#39;s Lombard Street</p></div>
<div id="attachment_616" class="wp-caption aligncenter" style="width: 160px"><a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0111.jpg"><img class="size-thumbnail wp-image-616" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/03/IMG_0111-150x150.jpg" alt="" width="150" height="150" /></a><p class="wp-caption-text">Sharks vs Canucks</p></div>
<h2>And in conclusion&#8230;</h2>
<p>EclipseCon was great! Congrats and thanks to everyone involved in its organization!</p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/uncategorized/our-eclipsecon/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SWTBot: My New friend</title>
		<link>http://www.bonitasoft.org/blog/eclipse/swtbot-my-new-friend/</link>
		<comments>http://www.bonitasoft.org/blog/eclipse/swtbot-my-new-friend/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 17:38:12 +0000</pubDate>
		<dc:creator>mickael.istria.eclipse</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[headless]]></category>
		<category><![CDATA[SWTBot]]></category>
		<category><![CDATA[Test]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://www.bonitasoft.org/blog/?p=335</guid>
		<description><![CDATA[Preamble: This is the first post of the new Eclipse category of BonitaSoft&#8217;s community blog. As soon as we find something interesting to talk about when developing Bonita Studio, we will try to share what we learnt with our communities: BonitaSoft and Eclipse. We are also pleased to see this category aggregated to Planet Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p><em>Preamble: This is the first post of the new Eclipse category of <a href="http://www.bonitasoft.org/blog/">BonitaSoft&#8217;s community blog</a>. As soon as we find something interesting to talk about when developing <a href="http://www.bonitasoft.com/products/downloads.php">Bonita Studio</a>, we will try to share what we learnt with our communities: <a href="http://www.bonitasoft.org">BonitaSoft</a> and <a href="http://www.eclipse.org">Eclipse</a>. We are also pleased to see this category aggregated to <a href="http://planeteclipse.org">Planet Eclipse</a> knowledge feed. We hope you&#8217;ll enjoy reading these posts!<br />
The <a href="http://www.bonitasoft.com/products/downloads.php">Bonita Studio</a> developers crew</em></p>
<p>I found some time recently to take a look at <a href="http://www.eclipse.org/swtbot/">SWTBot</a> to check whether we should use it while developing <a href="http://www.bonitasoft.com/products/downloads.php">Bonita Studio</a> (part of <a href="http://www.bonitasoft.com/products/downloads.php">Bonita Open Solution</a>, based on <a href="http://www.eclipse.org/downloads/">Eclipse Gelileo 3.5.1</a>). After a few minutes of reading <a href="http://wiki.eclipse.org/SWTBot">wiki pages</a> and trying it, I was convinced that <a href="http://www.eclipse.org/swtbot/index.php">SWTBot</a> (and its <a href="http://www.eclipse.org/gef">GEF</a> extension, that also works for <a href="http://www.eclipse.org/gmf">GMF</a>) is a must-use project for anyone who has ever it found difficult and time-consuming to write plugin tests.</p>
<p>Only a few hours later our continuous integration build welcomed our first <a href="http://www.eclipse.org/swtbot/index.php">SWTBot</a> based test!</p>
<p><span id="more-335"></span></p>
<p>Here is the step-by-step of this awesome encounter:</p>
<ol class="small-line">
<li><a href="http://www.eclipse.org/swtbot/downloads.php">Install SWTBot</a> on your development platform by installing SWTBot from updatesite: <a href="http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site">http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site<br />
</a></li>
<li>Create a new plugin to host your test. Add these dependencies to your plugin.<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-deps2.png"><img class="size-full wp-image-400" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-deps2.png" alt="Dependencies for SWTBot test" width="500" height="277" /></a></li>
<li>Write your test
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;height:400px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">org.bonitasoft.diagram.test</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.bonitasoft.studio.model.process.diagram.part.ProcessDiagramEditor</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEditor</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swtbot.eclipse.gef.finder.SWTBotGefTestCase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.IEditorPart</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Assert</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runner.RunWith</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
* @author Mickael Istria<br />
*<br />
*/</span><br />
@RunWith<span style="color: #009900;">&#40;</span>SWTBotJunit4ClassRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DiagramTests <span style="color: #000000; font-weight: bold;">extends</span> SWTBotGefTestCase <span style="color: #009900;">&#123;</span><br />
<br />
@Test<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testDiagramTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> <span style="color: #009900;">&#123;</span><br />
SWTBotMenu menu <span style="color: #339933;">=</span> bot.<span style="color: #006633;">menu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Process&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
menu.<span style="color: #006633;">menu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// simulate a click on Process &amp;gt; New menu entry</span><br />
SWTBotEditor botEditor <span style="color: #339933;">=</span> bot.<span style="color: #006633;">activeEditor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
IEditorPart editor <span style="color: #339933;">=</span> botEditor.<span style="color: #006633;">getReference</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getEditor</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertTrue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New process should open a process editor&quot;</span>, editor <span style="color: #000000; font-weight: bold;">instanceof</span> ProcessDiagramEditor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
</li>
<li>Configure your test run<br />
<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf0.png"><img class="aligncenter size-full wp-image-402" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf0.png" alt="swtbot-conf0" width="243" height="264" /></a></p>
<ol>
<li>Use JUnit4 as launcher, and don&#8217;t use UIThread (<a href="http://wiki.eclipse.org/SWTBot/FAQ#Why_do_tests_run_on_a_non-UI_thread.3F">SWTBot tests won&#8217;t run in a UIThread</a>)<br />
<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf1.png"><img class="aligncenter size-full wp-image-401" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf1.png" alt="swtbot-conf1" width="500" height="360" /></a></li>
<li>Set the product you want to test (leave default org.eclipse.platform.ide for &#8220;simple&#8221; plugins)<br />
<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf2.png"><img class="aligncenter size-full wp-image-404" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf2.png" alt="swtbot-conf2" width="500" height="360" /></a></li>
<li>Increase memory and set a language<br />
<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf3.png"><img class="aligncenter size-full wp-image-405" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-conf3.png" alt="swtbot-conf3" width="500" height="360" /></a></li>
</ol>
</li>
<li>Run and enjoy the high code coverage that you get with so few lines of code!</li>
<li>Ok, now let&#8217;s try the <a href="http://www.eclipse.org/gef">GEF</a> extension of <a href="http://www.eclipse.org/swtbot">SWTBot</a> to check some tricky behavior in a diagram editor. This test creates a new process and then activates a tool in the design palette to create a new step, and then does some checks (and all in about a dozen lines <img src='http://www.bonitasoft.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> :
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@RunWith<span style="color: #009900;">&#40;</span>SWTBotJunit4ClassRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DiagramTests <span style="color: #000000; font-weight: bold;">extends</span> SWTBotGefTestCase <span style="color: #009900;">&#123;</span><br />
<br />
@Test<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testDiagramTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ExecutionException <span style="color: #009900;">&#123;</span><br />
SWTBotMenu menu <span style="color: #339933;">=</span> bot.<span style="color: #006633;">menu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Process&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
menu.<span style="color: #006633;">menu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;New&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
SWTBotEditor botEditor <span style="color: #339933;">=</span> bot.<span style="color: #006633;">activeEditor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
SWTBotGefEditor gmfEditor <span style="color: #339933;">=</span> bot.<span style="color: #006633;">gefEditor</span><span style="color: #009900;">&#40;</span>botEditor.<span style="color: #006633;">getTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
gmfEditor.<span style="color: #006633;">activateTool</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Step&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
gmfEditor.<span style="color: #006633;">mouseMoveLeftClick</span><span style="color: #009900;">&#40;</span>200, 200<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
menu.<span style="color: #006633;">menu</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Save&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
IGraphicalEditPart part <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>IGraphicalEditPart<span style="color: #009900;">&#41;</span>gmfEditor.<span style="color: #006633;">mainEditPart</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">part</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
MainProcess model <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>MainProcess<span style="color: #009900;">&#41;</span>part.<span style="color: #006633;">resolveSemanticElement</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
Pool pool <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Pool<span style="color: #009900;">&#41;</span>model.<span style="color: #006633;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertEquals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Pool should contain 3 nodes&quot;</span>, 3, pool.<span style="color: #006633;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
</li>
<li>Run again, and enjoy even more: SWTBot for GEF provides a lot of very high-level Methods to manipulate your diagram. Without it, writing tests for a <a href="http://www.eclipse.org/gmf">GMF</a> based editor was quite difficult, and did not mimic user actions very well. With this, you can test real usage scenarios with very little code.</li>
<li>The return on investment with SWTBot looks very good, so let&#8217;s adopt it and automate test execution in a continuous integration build, leveraging the <a href="http://wiki.eclipse.org/SWTBot/Ant">SWTBot headless framework</a>. The following requires you to be familiar with <a href="http://www.eclipse.org/articles/Article-PDE-Automation/automation.html">automated PDE or RCP build and testing.</a>
<ol class="small-line" type="a">
<li>Install swtbot in the platform you use to build your plugins or your RCP app. For instance, you can use the <a href="http://wiki.eclipse.org/Equinox_p2_director_application">P2 director commandline application</a> to install it from updatesite:
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">java -jar plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar -application org.eclipse.equinox.p2.director -artifactRepository http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site -metadataRepository http://download.eclipse.org/technology/swtbot/galileo/dev-build/update-site -installIU org.eclipse.swtbot.eclipse.feature.group -installIU org.eclipse.swtbot.eclipse.gef.feature.group -consoleLog</div></div>
</li>
<li>Install SWTBot headless test framework in your build platform: Download it from <a href="http://www.eclipse.org/swtbot/downloads.php">SWTBot download page</a>, and expand it in your build platform directory.</li>
<li>Add the SWTBot runtime and headless plugins and your new test plugin to your test feature.<br />
<a href="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-tests1.png"><img class="aligncenter size-full wp-image-407" src="http://www.bonitasoft.org/blog/wp-content/uploads/2010/02/swtbot-tests1.png" alt="swtbot-tests" width="500" height="265" /></a><br />
In our case, we prefered keeping only the org.eclipse.ant.optional.junit fragment and using <a href="http://wiki.eclipse.org/Eclipse/Testing/JUnit4_Changes">new junit bundles</a> to avoid conflicts between classes from org.junit and org.junit4 bundles. However, SWTBot provides some alternative fragments to support either junit3 or junit4 if you prefer.You can add the following entries in your <a href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tasks/pde_fetch_phase.htm">map file</a> for <a href="http://wiki.eclipse.org/Eclipse/Testing/JUnit4_Changes">new junit bundles</a>:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">!** Use newer JUnit as described in http://wiki.eclipse.org/Eclipse/Testing/JUnit4_Changes<br />
!** Should facilitate integration with SWTBot headless<br />
plugin@org.junit,4.8.1=GET,http://download.eclipse.org/tools/orbit/downloads/drops/S20100120144102/bundles/org.junit_4.8.1.v4_8_1_v20100114-1600.zip,unpack=true<br />
plugin@org.junit4=v20100104,:pserver:anonymous:@dev.eclipse.org:/cvsroot/eclipse,,org.junit4<br />
plugin@org.eclipse.jdt.junit.runtime=v20091201-0800,:pserver:anonymous:@dev.eclipse.org:/cvsroot/eclipse,,org.eclipse.jdt.junit.runtime</div></div>
</li>
<li>In the piece of script that runs your test, add the following <a href="http://wiki.eclipse.org/SWTBot/Ant">test invocation command</a>:
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:620px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SWTBot test<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/echo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;java</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${eclipse.test.home}&quot;</span> <span style="color: #000066;">fork</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;${eclipse.test.home}/output.txt&quot;</span> <span style="color: #000066;">logError</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #000066;">classname</span>=<span style="color: #ff0000;">&quot;org.eclipse.core.launcher.Main&quot;</span> <span style="color: #000066;">failonerror</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${eclipse.test.home}/plugins&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;org.eclipse.equinox.launcher_*.jar&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/classpath<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-application org.eclipse.swtbot.eclipse.junit4.headless.swtbottestapplication&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-testPluginName org.bonitasoft.studio.diagram.test&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-testApplication org.bonitasoft.studio.application.application&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-className org.bonitasoft.studio.diagram.test.DiagramTests&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,junit-results.xml&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-nl fr&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-consoleLog&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;jvmarg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;-Xms40m -Xmx348m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/java<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></td></tr></tbody></table></div>
</li>
</ol>
</li>
<li>At this point, when everything is working, you should be one of the happiest people in the world: You have not only reduced the difficulty and cost of writing tests, but also increased the coverage and the realism of your tests</li>
</ol>
<p>Congrats and thanks to SWTBot developers for making this possible! We love playing with it when developing <a href="http://www.bonitasoft.com/products/downloads.php">Bonita Open Solution</a>!</p>
<p>If someone has a better solution for this integration, please tell me!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bonitasoft.org/blog/eclipse/swtbot-my-new-friend/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
