<?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>Devon Hillard&#039;s Digital Sanctuary &#187; eclipse</title>
	<atom:link href="http://www.digitalsanctuary.com/tech-blog/tag/eclipse/feed" rel="self" type="application/rss+xml" />
	<link>http://www.digitalsanctuary.com/tech-blog</link>
	<description>Java, ATG, Seam, and related Technologies</description>
	<lastBuildDate>Mon, 30 Jan 2012 23:04:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eclipse Auto Complete Templates for ATG</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/eclipse-auto-complete-templates-for-atg.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/eclipse-auto-complete-templates-for-atg.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 16:40:47 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/?p=480</guid>
		<description><![CDATA[Eclipse has an often under-utilized feature called Templates. You&#8217;ve probably used the built in templates when Eclipse auto-completes for loops or try-catch blocks, etc&#8230; However, you can create your own templates for commonly used chunks of code. This can save &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/eclipse-auto-complete-templates-for-atg.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Eclipse has an often under-utilized feature called Templates.  You&#8217;ve probably used the built in templates when Eclipse auto-completes for loops or try-catch blocks, etc&#8230;  However, you can create your own templates for commonly used chunks of code.  This can save you a lot of time, and more importantly can facilitate you writing better quality code.</p>
<div id="attachment_483" class="wp-caption alignleft" style="width: 560px"><a href="http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2009/09/Picture-5.png"><img src="http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2009/09/Picture-5-550x274.png" alt="ATG Eclipse Templates" title="ATG Eclipse Templates" width="550" height="274" class="size-medium wp-image-483" /></a><p class="wp-caption-text">ATG Eclipse Templates</p></div>
<p>By making commonly used code blocks available with a couple of keystrokes it is much easier to write best practices code, that otherwise you might shortcut around.</p>
<p>You can view, import, and create new templates by going to Eclipse&#8217;s Preferences, then opening Java->Editor->Templates.  Each Template has a Name, this is what triggers it for auto-complete so making this simple and unique is good, a Description, a Context, a checkbox to Automatically insert, and then the Pattern which is the code that will get inserted for you.  Within the Pattern you have access to a substantial number of variables, such as the current class or method name, variables, method arguments, dates, etc&#8230; which allow you do some very useful things.</p>
<p>For ATG coding I&#8217;ve created nine Templates for common code blocks.</p>
<p>My templates isBlank and isNotBlank create if blocks based on ATG&#8217;s StringUtils.isBlank method, which checks for null, empty, or blank Strings.  Checking Strings is something that I do all the time (validating user input, query params, etc&#8230;) so being able to do it in a few keystrokes is very useful.</p>
<pre class="brush: java; title: ; notranslate">
ls.isBlank(${cursor})) {

}
</pre>
<p>I have three templates for ATG Performance Monitor operations.  Adding in ATG Performance Monitor hooks when you&#8217;re coding can make diagnosing performance problems later much easier.  Using templates means you don&#8217;t have to remember the syntax or even type in the class and method names:</p>
<pre class="brush: java; title: ; notranslate">
PerformanceMonitor.startOperation(&quot;${enclosing_type}&quot;, &quot;${enclosing_method}&quot;);
</pre>
<p>I also have four templates for the primary ATG logging methods with the respective if blocks needed to prevent unnecessary String concatenations.</p>
<pre class="brush: java; title: ; notranslate">
if(isLoggingDebug()) {
	logDebug(&quot;${enclosing_type}.${enclosing_method}:&quot; + &quot;${cursor}&quot;);
}
</pre>
<p>I&#8217;ve exported these nine ATG templates so you can easily import and start to use them.<br />
<a href='http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2009/09/ATG-Templates.xml'>Eclipse ATG Coding Templates</a>.</p>
<p>What templates have you created?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/eclipse-auto-complete-templates-for-atg.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>&#8220;No repository found containing&#8221; Error when update Eclipse</title>
		<link>http://www.digitalsanctuary.com/tech-blog/general/no-repository-found-containing-error-when-update-eclipse.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/general/no-repository-found-containing-error-when-update-eclipse.html#comments</comments>
		<pubDate>Wed, 22 Apr 2009 01:23:26 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/?p=390</guid>
		<description><![CDATA[A couple of days ago I started having issues updating my Eclipse plugins. I&#8217;d get a &#8220;No repository found containing&#8221; error for several of the repositories that it was trying to update from. Here is a quick fix: Go to &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/general/no-repository-found-containing-error-when-update-eclipse.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I started having issues updating my Eclipse plugins.  I&#8217;d get a &#8220;No repository found containing&#8221; error for several of the repositories that it was trying to update from.  Here is a quick fix:</p>
<ol>
<li>Go to Help->Software Updates, then select the Available Software tab and click the Manage Sites button</li>
<li>Use the Export button to export the sites to a bookmarks.xml file</li>
<li>Open the bookmarks.xml file in your favorite text editor, and add a trailing &#8220;/&#8221; to any of the site urls which are missing the &#8220;/&#8221; on the end.  Save the changes.</li>
<li>Back in the Manage Sites window within Eclipse, select all of the sites and click the Remove button</li>
<li>Now, click Import and load in the edited bookmarks.xml file</li>
</ol>
<p>Now try your import again, and it should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/general/no-repository-found-containing-error-when-update-eclipse.html/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Why I Love Having 8 Gigs of RAM</title>
		<link>http://www.digitalsanctuary.com/tech-blog/apple/why-i-love-having-8-gigs-of-ram.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/apple/why-i-love-having-8-gigs-of-ram.html#comments</comments>
		<pubDate>Tue, 17 Mar 2009 22:51:20 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/?p=312</guid>
		<description><![CDATA[I recently upgraded my primary computer from a 15&#8243; MacBookPro with 4 GB of RAM to a 17&#8243; MacBookPro with 8 GB of RAM. That probably sounds gratuitous. Here&#8217;s why it&#8217;s not: I&#8217;m currently running: Mac OS 10.5.6 Adium (IM &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/apple/why-i-love-having-8-gigs-of-ram.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my primary computer from a 15&#8243; MacBookPro with 4 GB of RAM to a 17&#8243; MacBookPro with 8 GB of RAM.  That probably sounds gratuitous.  Here&#8217;s why it&#8217;s not:</p>
<p><img src="http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2009/03/picture-3.png" alt="picture-3" title="picture-3" width="608" height="161" class="aligncenter size-full wp-image-313" /></p>
<p>I&#8217;m currently running:</p>
<ul>
<li>Mac OS 10.5.6</li>
<li>Adium (IM chat client)</li>
<li>Mail.app (e-mail client)</li>
<li>iCal (calendar application)</li>
<li>iTunes (music)</li>
<li>OmniFocus (GTD todo list)</li>
<li>TextMate (text editor)</li>
<li>Preview (image viewer &#8211; for looking at screenshots, scanned requirements docs)</li>
<li>PostgreSQL (CouponEngine database)</li>
<li>pgAdmin (postgreSQL client and admin app)</li>
<li>Terminal</li>
<li>Safari 4 (primary browser)</li>
<li>Firefox 3 (for testing look and feel)</li>
<li>Eclipse (development environment)</li>
<li>Windows XP (running in Parallels-for testing and Oracle)</li>
<li>Oracle 10G (ATG database)</li>
<li>JBoss 4.0 + ATG 2006.3 with full Commerce stack</li>
<li>JBoss 4.2 + Seam application</li>
<li>ANT JVMs for running builds</li>
</ul>
<p>This is what I need to run to do my job, and it takes more than 4 GB of RAM. </p>
<p>Now that I have 8 GB, I&#8217;m not longer running into swapping and paging delays, and I&#8217;m much more productive.</p>
<p>Having close to twice the screen real estate (~70% more I think), a faster CPU, and 8 hours of battery life don&#8217;t hurt either.  This is the perfect machine for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/apple/why-i-love-having-8-gigs-of-ram.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse, Subversion, and SSH_OPEN_ADMINISTRATIVELY_PROHIBITED</title>
		<link>http://www.digitalsanctuary.com/tech-blog/general/eclipse-subversion-and-ssh_open_administratively_prohibited.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/general/eclipse-subversion-and-ssh_open_administratively_prohibited.html#comments</comments>
		<pubDate>Wed, 19 Nov 2008 19:12:40 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subclipse]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/?p=168</guid>
		<description><![CDATA[If you use the Subclipse plugin to access subversion repositories from Eclipse using the ssh+svn protocol, you may see errors like this: SSH_OPEN_ADMINISTRATIVELY_PROHIBITED when you try to do too many things at once. When I tried switching to JavaHL instead &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/general/eclipse-subversion-and-ssh_open_administratively_prohibited.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use the Subclipse plugin to access subversion repositories from Eclipse using the ssh+svn protocol, you may see errors like this:</p>
<p>SSH_OPEN_ADMINISTRATIVELY_PROHIBITED</p>
<p>when you try to do too many things at once.</p>
<p>When I tried switching to JavaHL instead of SVNKit, I got different errors, so that was out.</p>
<p>Adding this line to my eclipse.ini file fixed it though:</p>
<p>-Dsvnkit.ssh2.persistent=false</p>
<p>It prevents the SVNKit adapter from issuing multiple sessions through a persistent SSH connection, which seems to trigger the error on some SSH servers at least.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/general/eclipse-subversion-and-ssh_open_administratively_prohibited.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse StartOnFirstThread Error (and fix!)</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html#comments</comments>
		<pubDate>Thu, 24 Jan 2008 23:22:12 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html</guid>
		<description><![CDATA[This appears to be an issue with the JVM under Leopard (Mac OS X 10.5), but I started getting the following error within Eclipse when using the ResourceBundleEditor plugin: It also apparently happens with other plugins/apps and is an issue &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This appears to be an issue with the JVM under Leopard (Mac OS X 10.5), but I started getting the following error within Eclipse when using the ResourceBundleEditor plugin:</p>
<p><img src='http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2008/01/startonfirstthread-error.jpg' alt='StartOnFirstThread Error Message' /></p>
<p>It also apparently happens with other plugins/apps and is an issue with the AWT kit in the new JVM.  After pouring through all of my Eclipse config files and determining that I definitely was NOT specifying StartOnFirstThread anywhere, I found this fix:</p>
<p>Within the Eclipse application bundle, in the file Contents/MacOS/eclipse.ini, add this line:</p>
<p>-Djava.awt.headless=true</p>
<p>Save the file, and restart Eclipse.  Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/eclipse-startonfirstthread-error-and-fix.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Top Ten Tools</title>
		<link>http://www.digitalsanctuary.com/tech-blog/general/top-ten-tools.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/general/top-ten-tools.html#comments</comments>
		<pubDate>Sat, 06 Oct 2007 21:30:54 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[adium]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[gtd]]></category>
		<category><![CDATA[igtd]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[postgres]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/general/top-ten-tools.html</guid>
		<description><![CDATA[I was surfing around today, and saw this article about the top ten tools you use. As far as getting work done on the computer (I&#8217;m taking the computer for granted and not counting it as a tool, although for &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/general/top-ten-tools.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was surfing around today, and saw <a href="http://www.cogniview.com/convert-pdf-to-excel/post/top-10-tools-i-cant-live-without/" title="Top Ten Tools" target="_blank">this article</a> about the top ten tools you use.</p>
<p>As far as getting work done on the computer (I&#8217;m taking the computer for granted and not counting it as a tool, although for it all to come together it&#8217;s worth noting I use an Apple MacBookPro with 4GB of RAM) my top applications are:</p>
<ol>
<li><a href="http://www.eclipse.org/" title="Eclipse" target="_blank">Eclipse</a>: my favorite Java IDE with a good set of plugins (JBoss Tools, MyEclipseIDE, WTP, Mylyn, and others)</li>
<li><a href="http://bargiel.home.pl/iGTD/" title="iGTD" target="_blank">iGTD</a>:  a great GTD task manager for the Mac.  I use it for work, personal projects, home errands, etc&#8230;  I used to use KinklessGTD in OmniOutliner, but now I swear by iGTD.  The upcoming Omni Focus will have to bring something amazing to the table to get to me to pay to switch.</li>
<li><a href="http://www.openssh.com/" title="SSH" target="_blank">SSH/SCP</a>/Terminal: I manage and deploy to many servers.  Being able to SSH into them and move files securely is critical.  I&#8217;m handy with the command line, bash scripting, and all that, so I end up doing things that way often.</li>
<li><a href="http://www.gnu.org/software/emacs/" title="Emacs" target="_blank">Emacs</a>: I can handle vi, but when I&#8217;m on a remote server making changes or looking through files trying to figure something out, Emacs is my favorite tool for the job.</li>
<li><a href="http://www.apple.com/safari/" title="Safari" target="_blank">Safari</a>: I spend a lot of time on the web researching, reading, and looking at the applications I&#8217;m building.  I also use <a href="http://caminobrowser.org/" title="Camino" target="_blank">Camino</a>, but Safari 3 is my favorite browser and is always open.</li>
<li><a href="http://www.adiumx.com/" title="Adium" target="_blank">Adium</a>: I love staying in touch with my friends, family, and co-workers.  Adium lets me keep in touch on AIM, Yahoo, MSN, GTalk, and more in a very nice application.</li>
<li><a href="http://www.apple.com/itunes/" title="iTunes" target="_blank">iTunes</a>: Music helps me get into the zone and keeps me happy.  Plus I like to watch the occasional TV show:)</li>
<li><a href="http://www.apple.com/iwork/pages/" title="Pages" target="_blank">Pages</a>: as an architect I often have to generate documentation around projects.  I also write letters (yes the non-e-mail kind).  Pages is a great word processor and making professional looking easy to read documents is a snap.</li>
<li><a href="http://www.jboss.org/" title="JBoss" target="_blank">JBoss</a>: JBoss is a fantastic application server.  It&#8217;s free, open source, fast, and powerful.</li>
<li><a href="http://www.postgresql.org/" title="Postgres" target="_blank">Postgres</a>: Postgres is a database with all the great attributes I listed for JBoss.  I used to use MySQL but at the time I switched it was lacking many critical features (sub-selects, foreign keys, etc..).  After using postgres for a while, I haven&#8217;t looked back.</li>
</ol>
<p>Those are the applications that I have running on my laptop basically 24/7 and I use each of them every single day.</p>
<p>What are yours?  I&#8217;m not trying to get into an emacs versus vi flamewar, but I&#8217;d like to hear about what applications get you through your day a little easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/general/top-ten-tools.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBoss Tools Properties Editor Surprise</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/jboss/jboss-tools-properties-editor-surprise.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/jboss/jboss-tools-properties-editor-surprise.html#comments</comments>
		<pubDate>Mon, 20 Aug 2007 05:12:50 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[JBoss]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/java/jboss/jboss-tools-properties-editor-surprise.html</guid>
		<description><![CDATA[No, not the kind of surprise with cake. The latest JBoss Tools Eclipse plugin, which if like me you are running on a platform that they haven&#8217;t released RedHat Developer Studio for is a pretty good option, which can be &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/jboss/jboss-tools-properties-editor-surprise.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>No, not the kind of surprise with cake.</p>
<p>The latest JBoss Tools Eclipse plugin, which if like me you are running on a platform that they haven&#8217;t released RedHat Developer Studio for is a pretty good option, which can be installed through Eclipse using this update URL:</p>
<p>http://download.jboss.org/jbosstools/updates/development</p>
<p>Sets up your default editor of .properties files to be the new Red Hat Properties Editor.  It looks very snazzy.  However, at least on my machine (Eclipse 3.3, JDK 1.5, OS X 10.4.10), whenever it opens a properties file, it happily strips out all of the equals signs separating property names from their values.  They still look good in the graphical portion of the Red Hat Editor, but of course don&#8217;t work very well anywhere else.</p>
<p>You can fix this by going into the Eclipse Preferences, General, Editors, File Associations, scrolling down until you see the &#8220;*.properties&#8221; entry and choosing the &#8220;Properties File Editor&#8221; as your default.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/jboss/jboss-tools-properties-editor-surprise.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>seam-gen and multiple projects part two</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects-part-two.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects-part-two.html#comments</comments>
		<pubDate>Sun, 19 Aug 2007 20:28:27 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[seam-gen]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/seam-gen-and-multiple-projects-part-two.html</guid>
		<description><![CDATA[This is a follow-up from my post two days ago &#8220;seam-gen and multiple projects&#8220;. After some feedback from &#8220;atao&#8221; in this thread on the JBoss Seam forum, I have taken a different approach to the problem, and have enhanced seam-gen &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects-part-two.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is a follow-up from my post two days ago &#8220;<a href="http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/seam-gen-and-multiple-projects.html" title="seam-gen and multiple projects" target="_blank">seam-gen and multiple projects</a>&#8220;.</p>
<p>After some feedback from &#8220;atao&#8221; in <a href="http://www.jboss.com/index.html?module=bb&amp;op=viewtopic&amp;t=116435" title="JBoss Seam Forum" target="_blank">this thread</a> on the JBoss Seam forum, I have taken a different approach to the problem, and have enhanced seam-gen to generate targets within the generated project&#8217;s ant build script, which in turn call the related seam-gen tasks.  This is more elegant for two reasons.  Firstly, the projects are independent and don&#8217;t rely on special configs kept outside of the project.  Secondly, you can run those tasks from within your IDE (Eclipse for me) while doing development.  You don&#8217;t have to fire up a command prompt, navigate to your seam installation, and run the seam-gen commands there.  All in all a much better solution.  Thank you very much &#8220;atao&#8221; for the better approach.</p>
<p>The changes made to the seam-gen related files are slightly more extensive than the previous approach, but well worth it.</p>
<p><span id="more-31"></span></p>
<p>First: in $SEAM_HOME/seam-gen/build-scripts you need to change build.properties to contain this:</p>
<p><code>jboss.home=@jbossHome@<br />
seamgen.home=@seamGenHome@</code></p>
<p>Second: in $SEAM_HOME/seam-gen/build-scripts you need to add the following block at the bottom of the build file (just before the  tag):</p>
<p><code><!-- Seam Gen Targets --><br />
&lt;target name="update-project" description="Update project dependencies"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="update-project" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;</p>
<p>&lt;property file="seamgen.properties"&gt;&lt;/property&gt; &lt;target name="new-action" description="Create a new action"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="new-action" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;<br />
&lt;property file="seamgen.properties"&gt;&lt;/property&gt; &lt;target name="new-form" description="Create a new form action"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="new-form" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;<br />
&lt;property file="seamgen.properties"&gt;&lt;/property&gt; &lt;target name="new-conversation" description="Create a new conversation"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="new-conversation" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;<br />
&lt;property file="seamgen.properties"&gt;&lt;/property&gt; &lt;target name="new-entity" description="Create a new entity"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="new-entity" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;<br />
&lt;property file="seamgen.properties"&gt;&lt;/property&gt; &lt;target name="generate-entities" description="Reverse engineer entities from the database"&gt;<br />
&lt;ant antfile="${seamgen.home}/build.xml" target="generate-entities" dir="${seamgen.home}"&gt;&lt;/ant&gt;&lt;/target&gt;<br />
&lt;property file="seamgen.properties"&gt;&lt;/property&gt;</code></p>
<p>Finally, in $SEAM_HOME/seam-gen you need to make a few edits to build.xml:</p>
<p>in the definition of the &#8220;project&#8221; filterset, within the &#8220;init-properties&#8221; target, you need to add the following filter (I put mine right after line 97 of revision 1.90):</p>
<p><code>&lt;filter token="seamGenHome" value="${basedir}"&gt;<br />
&lt;/filter&gt;</code></p>
<p>Then, in the &#8220;file-copy&#8221; target, you need to add the following task call (I put mine on line 632 of revision 1.90):</p>
<p><code>&lt;copy file="build.properties" tofile="${project.home}/seamgen.properties"&gt;<br />
&lt;/copy&gt;</code></p>
<p>If you want to just download the enhanced files here they are (based on the current head as of today):</p>
<p><a href="http://digitalsanctuary.com/tech-files/seamgen/build-scripts/build.properties" target="_new">$SEAM_HOME/seam-gen/build-scripts/build.properties</a><br />
<a href="http://digitalsanctuary.com/tech-files/seamgen/build-scripts/build.xml" target="_new">$SEAM_HOME/seam-gen/build-scripts/build.xml</a><br />
<a href="http://digitalsanctuary.com/tech-files/seamgen/build.xml" target="_new">$SEAM_HOME/seam-gen/build.xml</a></p>
<p>Enjoy!</p>
<p>Devon</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects-part-two.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>seam-gen and multiple projects</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects.html#comments</comments>
		<pubDate>Sat, 18 Aug 2007 06:37:22 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[seam-gen]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech-blog/archives/28</guid>
		<description><![CDATA[Enhancing seam-gen to support multiple projects. <a href="http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>seam-gen is a command line tool (although the new JBoss Tools eclipse plugin supports an Eclipse driven version as well) which can be used to create new Seam projects with a basic set of files, configs, and templates.  It can also update the Seam jars in the project, do deployments, echo settings, create new actions, new forms, new entities, and so on.  It is very handy, not only for developers who are just starting out with Seam, but also for experienced Seam developers (who might have customized the template resources which seam-gen uses to create the project framework).</p>
<p>The one big gap with seam-gen is that it keeps it&#8217;s project settings in a build.properties file in the seam-gen directory of the seam project (which I checkout from CVS as an Eclipse project, making it easy to update).  What this means is that there is only one project supported.  If I use seam-gen to create a new project called shoestore, then I create another project called yourspace, now I can&#8217;t use seam-gen to create a new form in shoestore, or update shoestore to the latest Seam jars.</p>
<p>Obviously if you&#8217;re only working on one project at a time, this isn&#8217;t a problem, but I tend to have multiple projects going at once.  A couple existing applications in maintenance mode, a couple projects under development, and maybe a project or two to test something out in.   So tonight I&#8217;ve made a couple of tiny changes to to the seam-gen tool, and the ant build.xml file it uses, which allow you to create, and continue to work with, any number of projects using seam-gen.</p>
<p>The two files to change are the seam (or seam.bat if you are using Windows) executable file (found in the root directory of your Seam downloaded (or checked-out) project) and the build.xml ant build file found inside the seam-gen directory, within the Seam project.</p>
<p><span id="more-28"></span></p>
<p>In the seam file you will want to replace lines 33-35 (at revision 1.20 at least) which look like this:</p>
<p><code>java -cp "${JAVA_HOME}\lib\tools.jar;..\lib\ant-launcher.jar;..\lib\ant-nodeps.jar;..\lib\ant.jar" -Dant.home=..\lib org.apache.tools.ant.launch.Launcher ${*}<br />
else<br />
java -cp "${JAVA_HOME}/lib/tools.jar:../lib/ant-launcher.jar:../lib/ant-nodeps.jar:../lib/ant.jar" -Dant.home=../lib org.apache.tools.ant.launch.Launcher ${*}</code></p>
<p>with the following lines:</p>
<p><code>if [ "${2}" = "" ]<br />
then<br />
java -cp "${JAVA_HOME}\lib\tools.jar;..\lib\ant-launcher.jar;..\lib\ant-nodeps.jar;..\lib\ant.jar" -Dant.home=..\lib org.apache.tools.ant.launch.Launcher ${*}<br />
else<br />
java -cp "${JAVA_HOME}\lib\tools.jar;..\lib\ant-launcher.jar;..\lib\ant-nodeps.jar;..\lib\ant.jar" -Dant.home=..\lib org.apache.tools.ant.launch.Launcher -propertyfile ${1}-build.properties ${2}<br />
fi<br />
else<br />
if [ "${2}" = "" ]<br />
then<br />
java -cp "${JAVA_HOME}/lib/tools.jar:../lib/ant-launcher.jar:../lib/ant-nodeps.jar:../lib/ant.jar" -Dant.home=../lib org.apache.tools.ant.launch.Launcher ${*}<br />
else<br />
java -cp "${JAVA_HOME}/lib/tools.jar:../lib/ant-launcher.jar:../lib/ant-nodeps.jar:../lib/ant.jar" -Dant.home=../lib org.apache.tools.ant.launch.Launcher -propertyfile ${1}-build.properties ${2}<br />
fi</code></p>
<p>As I don&#8217;t have a Windows machine, I have not been able to test changes to the seam.bat version, but they should be similar.</p>
<p>Basically, what we are doing here, is if a second argument has been passed in (i.e. &#8216;seam myproject new-form&#8217; instead of &#8216;seam new-form&#8217;) we use the first argument, assume it is the project name, and load up that project&#8217;s build.properties file when we call the actual seam-gen ant tasks.</p>
<p>The second part is to modify the actual build.xml ant build file to create project specific properties file when using &#8216;seam setup&#8217;.</p>
<p>Replace line 355 (on revistion 1.90) which looks like this:</p>
<p><code>&lt;propertyfile file="build.properties"&gt;&lt;/propertyfile&gt;</code></p>
<p>with this:</p>
<p><code>&lt;propertyfile file="${project.name.new}-build.properties"&gt;&lt;/propertyfile&gt;</code></p>
<p>Then replace line 381, which looks like this:</p>
<p><code>        &lt;echo message="Type 'seam new-project' to create the new project"&gt;&lt;/echo&gt;</code></p>
<p>with this:</p>
<p><code>    	&lt;echo message="Type 'seam ${project.name.new} new-project' to create the new project"&gt;<br />
&lt;/echo&gt;</code></p>
<p>That is all there is to it.  Now, by prefacing a seam command with a project name, you can manage multiple projects with seam-gen.</p>
<p>Missing features include the windows seam.bat edit (I don&#8217;t have a Windows machine to test this on), and a list target to list available projects based on the XXXXX-build.properties files present (my Ant-fu is not strong enough).</p>
<p>The Eclipse generated patch file for the build.xml edits is here:  <a href="http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2007/08/buildxml-patch.txt" title="build.xml patch file" target="_new">build.xml patch file</a></p>
<p>The Eclipse generated patch file for the seam edits is here: <a href="http://www.digitalsanctuary.com/tech-blog/wp-content/uploads/2007/08/seam-patch.txt" title="seam patch file" target="_new">seam patch file</a></p>
<p>Enjoy!</p>
<p>Devon</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/seam-gen-and-multiple-projects.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Seam example project structure</title>
		<link>http://www.digitalsanctuary.com/tech-blog/java/seam-example-project-structure.html</link>
		<comments>http://www.digitalsanctuary.com/tech-blog/java/seam-example-project-structure.html#comments</comments>
		<pubDate>Mon, 06 Nov 2006 03:17:23 +0000</pubDate>
		<dc:creator>Devon</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.digitalsanctuary.com/tech/archives/6</guid>
		<description><![CDATA[For me, one of the hardest things about getting started with developing with Seam was getting a project setup that I could work with. The examples that ship with Seam only build within the whole Seam super-project, which doesn&#8217;t work &#8230; <a href="http://www.digitalsanctuary.com/tech-blog/java/seam-example-project-structure.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For me, one of the hardest things about getting started with developing with Seam was getting a project setup that I could work with.  The examples that ship with Seam only build within the whole Seam super-project, which doesn&#8217;t work for developing your own projects.  Most of the other guides on setting up a project (using Eclipse WTP, or other things) either didn&#8217;t work for me, or seemed overly complicated, or used a structure that just seemed odd to me.</p>
<p>If they work for you, that&#8217;s great.  If they don&#8217;t, I&#8217;ve posted up a zipped up version of the base seam project that I use.  I use <a target="_blank" title="Eclipse 3.2 Downloads" href="http://download.eclipse.org/eclipse/downloads/drops/R-3.2.1-200609210945/">Eclipse 3.2</a> and <a target="_blank" title="MyEclipseIDE" href="http://myeclipseide.com/">MyEclipseIDE</a> as my development environment, so you may need to make a few tweaks.  You have to configure your JBoss installation location, and the ant script will build and deploy an exploded ear file as it&#8217;s default target.  The project I used for the base structure is the Seam Booking example, so just replace things as you like.</p>
<p>Get the base seam project <a target="_blank" title="SeamBaseProject" href="http://www.digitalsanctuary.com/tech-files/BaseSeamProject.zip">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalsanctuary.com/tech-blog/java/seam-example-project-structure.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/50 queries in 0.010 seconds using disk: basic
Object Caching 777/903 objects using disk: basic

Served from: www.digitalsanctuary.com @ 2012-02-07 00:01:04 -->
