<!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;">
    Forging of the Forge Tools
</h3>
<span style="margin-bottom: 10px;">
    modified by <a href="http://community.jboss.org/people/koen.aers%40jboss.com">Koen Aers</a> in <i>JBoss Tools</i> - <a href="http://community.jboss.org/community/tools/blog/2011/01/27/forging-of-the-forge-tools">View the full blog post</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p style="text-align: left;">Over the past few weeks, I have started the integration of <a class="jive-link-external-small" href="http://seamframework.org/Documentation/SeamForge">Seam Forge</a> into <a class="jive-link-external-small" href="http://www.jboss.org/tools">JBoss Tools</a>. Today I am happy to present the first results of this work. </p><h1>Installation</h1><p>If you are familiar with the Eclipse platform the installation should be a breeze for you. The easiest way is to <a class="jive-link-external-small" href="http://www.eclipse.org/downloads/">download</a> a recent Eclipse version and use the 'Help-&gt;Install New Software...' wizard to install the latest and greatest JBoss Tools from the <a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/updates/development/">update site</a>. Don't forget to include the Maven integration for Eclipse as we will need it later on. After this, use the same mechanism to install the forge tools from <a class="jive-link-external-small" href="http://download.jboss.org/jbosstools/extras/forge-tools.zip">this update archive</a>. Restart Eclipse and you should be set to go.</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11210/Install+Forge.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11210/449-488/Install+Forge.png </span></a></p><h1>Starting and Stopping</h1><p>Now that the installation is dealt with, let's have a look whether everything went ok. You can bring up the "Forge Console View" by selecting 'Window-&gt;Show View-&gt;Other...' and then 'Seam Forge-&gt;Forge Console'. </p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11212/Forge+Console.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11212/450-76/Forge+Console.png </span></a>As you can see the Forge Console View has a toolbar and a dropdown menu that allow you to start and stop Forge. The initial message pane indicates that Forge is not running. Let's get going and push the 'Start Forge' button.</p><p style="text-align: center;"><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11213/Forge+Started.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11213/450-121/Forge+Started.png </span></a></p><p style="text-align: left;">After a while, the Forge welcome banner appears and you are invited to enter forge commands. The very convenient tab completion suggesting the list or possible commands does not work yet, but you can get the suggestions anyway by pressing tab followed by a return. Also, the coloring is not yet enabled like when using Forge directly in a terminal window. When you're done working you can stop Forge by pushing the 'Stop Forge' button.</p><h1>Create a Project</h1><p>To make things a bit more interesting, let's try the tutorial from <a class="jive-link-blog-small" href="http://community.jboss.org/people/lincolnthree/blog/2010/12/31/forge-100alpha1-kitten-released--rad-java">Lincoln's blog</a>. We create a new project called 'foo' with top level package 'org.foo':</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[no project] workspace $ <span style="color: #339966;">new-project --named foo --topLevelPackage org.foo</span></span></p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11214/Foo+Created.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11214/450-118/Foo+Created.png </span></a>Now the project is created but unfortunately, we cannot see it in our workspace. This is one of the obvious features that need to be added. For now, we have to import the project in the workspace. Here is where the Maven plugins come into play. For Forge projects are indeed Maven projects too. Select 'File-&gt;Import...' and then 'Maven-&gt;Existing Maven Project'. Point the wizard at the workspace root and the 'foo' project should show up in the list of projects to import. After importing the project shows up in the package explorer.</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11215/Package+Explorer+Foo.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11215/258-210/Package+Explorer+Foo.png </span></a>We enter the next few commands from the tutorial:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] foo $ <span style="color: #339966;">install forge.scaffold</span></span></p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] foo $ <span style="color: #339966;">new-entity --named Person</span></span></p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] Person.java $ <span style="color: #339966;">new-field string --fieldName firstName</span></span></p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] Person.java $ <span style="color: #339966;">new-field string --fieldName lastName</span></span></p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] Person.java $ <span style="color: #339966;">cd ..</span></span></p><p style="padding-left: 30px;"><span style="font-family: terminal, monaco;">[foo] domain $ <span style="color: #339966;">scaffold generate-metawidget-jsf *.java</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>To see which changes are performed in the project by these commands we need to refresh the project. </p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/38-3555-11216/Complete+Workbench.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/38-3555-11216/450-384/Complete+Workbench.png </span></a></p><p>Again, it would be good if after issuing each command the relevant changes would be highlighted by setting the relevant folder, file or file element selected. This is more work for the future.</p><h1>The Future</h1><p>As suggested, a lot more work is waiting... Some of the features that are on the list are:</p><ul><li>Adding a preference page to be able to add and select Forge runtimes. </li><li>Support for tab completion suggesting the list of possible commands.</li><li>Support for command history.</li><li>Support for colors in the Eclipse Forge Console.</li><li>Show appropriate feedback after each command.</li><li>etc.</li></ul><p>If you are interested in helping out implementing some of these features or if you just want to view the code implementing the current console, you can find the sources in the <a class="jive-link-external-small" href="https://anonsvn.jboss.org/repos/jbosstools/trunk/forge/">JBoss Tools SVN</a>.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Happy forging!</p><p>Koen</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Comment by <a href="http://community.jboss.org/community/tools/blog/2011/01/27/forging-of-the-forge-tools">going to Community</a></p>

</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>