<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Project Examples Creation and Strategy
</h3>
<span style="margin-bottom: 10px;">
modified by <a href="http://community.jboss.org/people/admin">Administrator Administrator</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/docs/DOC-15834">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>(THIS IS A WORK IN PROGRESS STARTED SEPTEMBER 14, 2010)</p><h2></h2><h2>Overview</h2><p>JBoss Tools and JBDS provide access to numerous zipped project examples via the Help->Project Examples menu. Each project example appears in a category that organizes them into broad groups for ESB, Seam, BPEL, and so on. When the user selects one of the examples and clicks Finish, the example is imported into their workspace and (if the "Show the Quick Fix dialog" box is checked) work through some of the available quick fixes to help the example work in their environment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>There are three criteria for each project example...</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol><li>The zip for the project example is essentially the exported archive file for an Eclipse project.</li><li>A project examples XML file registered for JBoss Tools or JBDS using the org.jboss.tools.project.examples.projectExamplesXml extension point.</li><li>An entry in the XML file describing the project and any special requirements.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3>Project Example Zip File</h3><p>The project example zip file is created by right-clicking on a project in the Package Explorer or Project Explorer and selecting Export on the popup menu. In the Export dialog, select General -> Archive File and click Next. Provide a path and file name for the archive file, specify which files should be in the archive, and click Finish.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>These project example zip files may be contained in the SVN repository in a workspace directory such as "</span><a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/myworkspace/myexamplefile.zip" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/myworkspace/myexamplefile.zip</a><span>" or it may be found in the </span><a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/examples" target="_blank">http://download.jboss.org/jbosstools/examples</a><span> directory on the server.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>NOTE: WE NEED TO SPECIFY WHERE THE EXAMPLE ZIP SHOULD BE LOCATED - JBT vs. JBDS.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3>Registered Project Examples XML File</h3><p>There are a few project examples xml files that exist today. When adding a new example, it should be added to the lowest possible project example xml version it can work with. If it's a new example that doesn't work in an existing version, a new example xml is created and that is added as an additional example file.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>For instance, if you are adding a new ESB example that will run on JBoss Tools version 3.1 (i.e. ESB 4.7 is supported), go ahead and add it to <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml</a>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>However, if you're adding a new example for Teiid Designer, which didn't exist before JBoss Tools version 3.2, you would create a new project-examples-3.2.xml file if it didn't already exist. So the file would become <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.2.xml</a>. Or if we end up with a version 3.3 and add new functionality there, we'd create <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.3.xml</a>. And so on and so forth... This is an additive process.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Knowing what the target tooling platform will be is important, as what a project will "work with" is different between JBDS and JBoss Tools. For example, JBDS examples cannot use Maven since we don't have Maven plug-ins installed, but Maven can be used for JBoss Tools examples because Maven works in that environment.</p><p><br/>Examples for JBDS should try and use jars from the actual supported runtimes instead of bundling them - JBoss Tools can be more liberal here.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>If you add a new project example file, it needs to be registered so it can be found when the user uses the Project Examples wizard.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>How Do I Publish A New XML File?</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>Once your file is ready to be published on download.jboss.org (rather than anonsvn.jboss.org), contact </span><a class="jive-link-email-small" href="mailto:nboldt@redhat.com" target="_blank">nboldt@redhat.com</a><span> or open a JIRA assigned to Nick Boldt. You can also ping him on IRC (freenode channel #jbosstools or Red Hat channel #devstudio). Publishing the file is done via this script: </span><a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/trunk/download.jboss.org/jbosstools/examples/publishExample.sh">http://anonsvn.jboss.org/repos/jbosstools/trunk/download.jboss.org/jbosstools/examples/publishExample.sh</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h4>Registering a new Project Examples XML File</h4><p><span>We currently register example xml files in the org.jboss.tools.community.project.examples plug-in in SVN. You can find it at </span><a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/trunk/examples/plugins/org.jboss.tools.community.project.examples" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/trunk/examples/plugins/org.jboss.tools.community.project.examples</a><span>.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Currently there are two file URLs registered in org.jboss.tools.community.project.examples...</p><ul><li><a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml</a></li><li><a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/examples/project-examples-bpel-3.1.xml" target="_blank">http://download.jboss.org/jbosstools/examples/project-examples-bpel-3.1.xml</a></li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To add another file, simply add a new instance of the "org.jboss.tools.project.examples.projectExamplesXml" extension point.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>   <extension<br/>        point="org.jboss.tools.project.examples.projectExamplesXml"<br/>        name="My New Example File"><br/>        <url>MY-EXAMPLE-XML-FILE-URL</url><br/>        <experimental>false</experimental><br/>   </extension></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3>New Entry in Project Examples XML File</h3><p>Once you know which file to add your new example to, you can create a new entry for your example. Each of these files follows the same pattern - the root is <projects> and each new entry is a <project>. For example:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <projects>    <br/>      <project><br/>          <category>My Category Display Name</category><br/>          <name>My Project Example Name</name><br/>          <included-projects>NAME-OF-THE-PROJECT-EXPORTED-IN-THE-ZIP-FILE</included-projects>        <br/>          <shortDescription>Brief Description</shortDescription><br/>          <description>Long Description</description><br/>          <size>22645</size> <!-- size of the zip file --><br/>          <url>MY-ZIP-FILE-URL</url><br/>      </project><br/>  </projects></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Let's break this down a little.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li>The <category> tags are used to provide the high-level grouping in the tree of the Project Examples wizard. For instance, if you have "My Category" as the category and "My Example" as the <name> of the project, you should see "My Category -> My Example" appear in the tree. </li><li>The <name> tags are used to provide the display name for the Project Example. This does not need to be the same as what is included in the file itself as the actual project name. </li><li>The <included-projects> tags contain the actual names of the projects in the zip file. It is important to get the name exactly right or the Project Examples wizard will not be able to successfully import the project. </li><li>NOTE: I don't know where the <shortDescription> is actually used in the wizard. </li><li>The <description> tags contain the description text displayed on the Project Examples wizard page when the project is selected.</li><li>The <size> tags are used to display the file size of the example zip to give the user an idea of how big a file it is.</li><li>The <url> tags contain the actual URL to the project example zip. The project example engine uses Eclipse ECF Framework so the URLs can be ftp, http, https (with and without authentication), a local file, etc.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>NOTE: WE ALSO NEED TO DOCUMENT HOW TO USE THE <fixes> TAGS:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>     <fixes><br/>            <fix type="wtpruntime"><br/>                <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.42</property><br/>                <property name="eclipse-projects">registration,registration-ejb,registration-ear</property><br/>                <property name="description">This project example requires the JBoss EAP 4.3 or JBoss AS 4.2.x</property><br/>            </fix><br/>            <br/>            <fix type="seam"><br/>                <property name="allowed-versions">2.0.0, 2.0.1, 2.0.2</property><br/>                <property name="eclipse-projects">registration</property><br/>                <property name="description">This project example requires Seam version 2.0</property><br/>            </fix><br/>            <br/>            <fix type="plugin"><br/>                <property name="id">org.testng.eclipse</property><br/>                <property name="versions">5.8.0, 5.9.0</property><br/><span>                <property name="description">The TestNG plugin is required if you want to run Seam tests. You can install it using the following update site: </span><a class="jive-link-external-small" href="http://beust.com/eclipse" target="_blank">http://beust.com/eclipse</a><span></property></span><br/>            </fix><br/>        </fixes></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2>General Tips</h2><p>Here are some general tips for how to setup the examples:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li>Don't require users to download multiple examples, if one can suffice (i.e. initially one example = one project, that is not the case anymore. one example can contain multiple examples. Many of the ESB examples suffers from this)</li><li>Do not refer to specific named JDK's, use Execution environments (this removes the need for any quickfixing when it comes to jdk and java runtime matching)</li><li>Server runtimes do not have execution environments so use the names our installer/runtimesetup will most likely give them so it will be found automatically. </li><li>Make sure to use the quickfix options to express what range of servers/runtimes it will work with.</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h2>Still to Work In:</h2><p>> My second set of questions goes back to JBIDE-5645 and the issue I was seeing where the versions of the files in <a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/examples" target="_blank">http://download.jboss.org/jbosstools/examples</a> doesn't match what's in SVN. <br/>> <br/>> If we're pointing the community examples file at <a class="jive-link-external-small" href="http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml" target="_blank">http://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-examples-3.1.xml</a> instead of <a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/example/project-examples-3.1.xml" target="_blank">http://download.jboss.org/jbosstools/example/project-examples-3.1.xml</a>, that explains the differences.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We should not be pointing to any examples in svn since svn locations are not stable. If we are that is a bug.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>> As we add more and more examples, we really need to standardize a process for getting new ones into the mix and how we migrate the older ones forward. <br/>> <br/>> Do we have a strategy in place? If not, we seriously need to develop one quickly. Each time we release and add more examples, this mess will get bigger.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>No strategy beyond above and yes we should get it written down since so many seem to think svn is a great place to store this even though it will constantly break.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Optimally we would push these to the maven repo instead and get them from there but right now download.jboss.org is where it is at.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-15834">going to Community</a></p>
        <p style="margin: 0;">Create a new document in JBoss Tools at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2128">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>