<?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>Kumasi Blogger</title>
	<atom:link href="http://www.kumasi.net/wordpress/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.kumasi.net/wordpress</link>
	<description>a software developer&#039;s perspective</description>
	<lastBuildDate>Mon, 14 May 2012 19:00:01 +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>Issues with locale under Ubuntu 10.04 Server</title>
		<link>http://www.kumasi.net/wordpress/?p=197</link>
		<comments>http://www.kumasi.net/wordpress/?p=197#comments</comments>
		<pubDate>Mon, 14 May 2012 19:00:01 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=197</guid>
		<description><![CDATA[After a new install of Ubuntu 10.04 in our production environment I encountered strange issues with the locale not being set (warning msg like: gl-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8)) . To solve the problem I followed this &#8230; <a href="http://www.kumasi.net/wordpress/?p=197">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a new install of Ubuntu 10.04 in our production environment I encountered strange issues with the locale not being set (warning msg like: gl-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8)) . To solve the problem I followed this post: http://ubuntuforums.org/showthread.php?t=1784922 &#8211;   which recommended issuing these commands:</p>
<p>UPDATE: I fixed it by doing the following in order to get the reconfigure to run</p>
<p>Code:</p>
<p>export LANGUAGE=en_US.UTF-8<br />
export LANG=en_US.UTF-8<br />
export LC_ALL=en_US.UTF-8<br />
locale-gen en_US.UTF-8<br />
sudo dpkg-reconfigure locales</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=197</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tip: Add audit triggers to your tables</title>
		<link>http://www.kumasi.net/wordpress/?p=194</link>
		<comments>http://www.kumasi.net/wordpress/?p=194#comments</comments>
		<pubDate>Tue, 01 May 2012 21:33:53 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[MySQL Replication]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=194</guid>
		<description><![CDATA[A good DB design practice is to include createOn and modifiedOn columns in your Relational tables. When doing that life is simplier if you use Triggers to manage the population of the table columns by doing something like the following: &#8230; <a href="http://www.kumasi.net/wordpress/?p=194">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A good DB design practice is to include createOn and modifiedOn columns in your Relational tables. When doing that life is simplier if you use Triggers to manage the population of the table columns by doing something like the following:</p>
<p>CREATE TRIGGER story_creation_timestamp BEFORE INSERT ON story<br />
FOR EACH ROW<br />
SET NEW.createdOn = NOW();</p>
<p>CREATE TRIGGER story_update_timestamp BEFORE INSERT ON story<br />
FOR EACH ROW<br />
SET NEW.modifiedOn = NOW();</p>
<p>stay salty my friends&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=194</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create new program launcher</title>
		<link>http://www.kumasi.net/wordpress/?p=192</link>
		<comments>http://www.kumasi.net/wordpress/?p=192#comments</comments>
		<pubDate>Mon, 30 Apr 2012 14:56:14 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=192</guid>
		<description><![CDATA[You can add a custom launcher in Ubuntu 11.10 by typing this in a Terminal gnome-desktop-item-edit ~/Desktop/ &#8211;create-new Once you have customized the item on your Desktop, drag it to the Launcher. Reference: http://askubuntu.com/questions/78730/how-do-i-add-a-custom-launcher]]></description>
			<content:encoded><![CDATA[<p>You can add a custom launcher in Ubuntu 11.10 by typing this in a Terminal</p>
<p>gnome-desktop-item-edit ~/Desktop/ &#8211;create-new</p>
<p>Once you have customized the item on your Desktop, drag it to the Launcher.</p>
<p>Reference: </p>
<p>http://askubuntu.com/questions/78730/how-do-i-add-a-custom-launcher</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=192</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vaadin Custom Layouts</title>
		<link>http://www.kumasi.net/wordpress/?p=167</link>
		<comments>http://www.kumasi.net/wordpress/?p=167#comments</comments>
		<pubDate>Mon, 26 Mar 2012 14:00:01 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Vaadin Framework]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=167</guid>
		<description><![CDATA[Sometimes it may be more convenient to create a layout using traditional HTML rather than using the Vaadin components. This could be due to the complexity of the form layout or simply a personal perference, either way Vaadin allows the &#8230; <a href="http://www.kumasi.net/wordpress/?p=167">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it may be more convenient to create a layout using traditional HTML rather than using the Vaadin components. This could be due to the complexity of the form layout or simply a personal perference, either way Vaadin allows the developer to create a &#8220;Wicket-style&#8221; layout in which the actual presentation view is an HTML file containing placeholders for the page components (HTML input fields, checkboxes, submit buttons, etc.). These placeholders are mapped to a POJO datasource. In my experiences the HTML file is always associated with a form created in Vaadin (so the datasource is assigned to the Vaadin form).</p>
<p>The process is very much like creating view pages in Wicket, and is also analagous to a JSf page where the HTML is a template file and the JSF tags replace components such as Input, Select, etc.</p>
<p><strong>The steps required to produce an HTML template to act as a Vaadin view is as follows:</strong></p>
<p>1. Create a Form class instance and assign it a BeanItem datasource containing the POJO that the form fields will map to and from.<br />
2. Create an HTML file containing the complex form layout required by the business entities (do not add the FORM tag to the html file).<br />
3. Use DIV as the placeholders for the html file&#8217;s html component tags (Text Input, Selects, etc.).<br />
4. Use the customLayout.addComponent(, ) method to bind the Vaadin components to the html template file fields.<br />
5.Bind a Vaadin Button to the HTML file&#8217;s submit button and create an anon listener that contains the method to call for data persistence or updates.<br />
6. Use a FormFIeldFactory class to assign Ajaxable behaviour to html field components (remember to set fieldFactory on Form instance).</p>
<p><strong>Things to consider and/or remember:</strong><br />
1. You still have to set the fields that you want to be visable using a collection or object array.<br />
2. You still need to add a submit button with an &#8220;addListener(&#8230;) &#8221; listener attached.<br />
3. Basically you have just replaced the normal FormLayout class with an CustomLayout class and provided an external template file.</p>
<p>In most cases this is a very simple process, and again if you have Wicket exposure or experience you will find it strikingly similar to wicket development (for the most part).</p>
<p>Stay salty my friends.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=167</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vaadin Spring/JPA multiple persistenceUnits</title>
		<link>http://www.kumasi.net/wordpress/?p=155</link>
		<comments>http://www.kumasi.net/wordpress/?p=155#comments</comments>
		<pubDate>Mon, 05 Mar 2012 00:29:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Vaadin Framework]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=155</guid>
		<description><![CDATA[While mixing my home development efforts with professional development (re-writing apps at work) using Vaadin as the UI framework I hit the point where I needed more than one database connection (persistenceUnit) in JPA. I am using Spring 3.0/JPA2.0 (Hibernate &#8230; <a href="http://www.kumasi.net/wordpress/?p=155">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While mixing my home development efforts with professional development (re-writing apps at work) using Vaadin as the UI framework I hit<br />
the point where I needed more than one database connection (persistenceUnit) in JPA. I am using Spring 3.0/JPA2.0 (Hibernate implementation) as<br />
the persistence layer in my Vaadin applications, oh and AspectJ load-time weaving.</p>
<p>After googling around I came across lots of old threads (2007 &#8211; 2009) that did not work for me before I found something more current<br />
(2010) http://it-essence.xs4all.nl/roller/technology/entry/configuration_of_multiple_jpa_persistence, however I also found another link<br />
with a slightly different approach that I chose to use (unfortunately I cannot find the link again so I writing down the steps here).</p>
<p>&#8211; persistence.xml &#8211;<br />
1. Create several persistent units</p>
<p>2. Create 2 entityManagerFactory stanzas(1 per persistenceUnit) and specify a different PU for each</p>
<p>3. Create two transactionManager(s)<br />
Since I am using AspectJ I also have to add multiple tx:annotation-driven stanzas</p>
<p>Add the appropriate the EntityManagerFactory to the DAO bean</p>
<p>4. Add both persistenceManagerFactory variables to my DAO base class:<br />
        private EntityManagerFactory entityManagerFactorySC;<br />
	private EntityManagerFactory entityManagerFactoryKH;</p>
<p>   Explicitly specify the persistentUnit name for each EntityManager:<br />
	@PersistenceContext (unitName = &#8220;stacyPU&#8221;)<br />
	private EntityManager emStacy;</p>
<p>	@PersistenceContext (unitName = &#8220;keyhealthPU&#8221;)<br />
	private EntityManager emKeyhealth;</p>
<p>5. Since I am using OpenEntityManagerInViewFilter in web.xml I have to create 1 for<br />
each EntityManagerFactory:</p>
<p>This approach is a little more involved than the 2010 approach above but it works really well.<br />
I may try the 2010 approach on another test project to determine if it would work as well as the one I have chosen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=155</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Faulty email Server</title>
		<link>http://www.kumasi.net/wordpress/?p=153</link>
		<comments>http://www.kumasi.net/wordpress/?p=153#comments</comments>
		<pubDate>Mon, 27 Feb 2012 02:09:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=153</guid>
		<description><![CDATA[Apologies to those who registered on this site &#8211; the email script was faulty and did not send out the email registration containing generated passwords. For this reason I have deleted all previously registered users so that those who wish &#8230; <a href="http://www.kumasi.net/wordpress/?p=153">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Apologies to those who registered on this site &#8211; the email script was faulty and did not send out the email registration containing generated passwords. </p>
<p>For this reason I have deleted all previously registered users so that those who wish too may re-register and receive an email with the proper password assignments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Vaadin TwinColSelect widget</title>
		<link>http://www.kumasi.net/wordpress/?p=146</link>
		<comments>http://www.kumasi.net/wordpress/?p=146#comments</comments>
		<pubDate>Sun, 26 Feb 2012 17:20:08 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Vaadin Framework]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=146</guid>
		<description><![CDATA[Vaadin has a nice UI widget called TwinColSelect that is basically two combo boxes, one on the left for listing unassigned data, and one on the right for listing data previously assigned. It also has a couple of buttons between &#8230; <a href="http://www.kumasi.net/wordpress/?p=146">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Vaadin has a nice UI widget called TwinColSelect that is basically two combo boxes, one on the left for listing unassigned data, and one on the right for listing data previously assigned. It also has a couple of buttons between the two combo boxes used to move data either left-to-right or right-to-left.</p>
<p>For those reading this post who do not know what Vaadin is, its a Java and JavaScript framework that is fully ajaxable out-of-the-box. Anyway, while Vaadin doc is really outstanding most of the time there are some places where the doc does not go far enough, although to be honest in this case its not Vaadin at fault as I am using a 3rd party add-on (TwinColSelect). Below is a snippet of code for using the add-on in a Vaadin Form (via a FieldFactory subclass):</p>
<p>@Override<br />
public Field createField(Item item, Object propertyId, Component uiComponent) {<br />
	Field field = super.createField(item, propertyId, uiComponent);<br />
	if(&#8220;stories&#8221;.equals(propertyId)) {<br />
		TwinColSelect tselect = new TwinColSelect(&#8220;Sprint Story Selection&#8221;);<br />
		tselect.setLeftColumnCaption(&#8220;Available&#8221;);<br />
		tselect.setRightColumnCaption(&#8220;Assigned&#8221;);<br />
		tselect.setWidth(&#8220;500px&#8221;);<br />
		// This is how we set the fields to display in our twin combo boxes<br />
		tselect.setItemCaptionMode(tselect.ITEM_CAPTION_MODE_PROPERTY);<br />
		tselect.setItemCaptionPropertyId(&#8220;title&#8221;);<br />
		// get the  data we want to show in the left combo box<br />
		List stories = persistenceHelper.getStoryDAO().findAll();<br />
		// set the left (available) combo box<br />
		BeanItemContainer container = new BeanItemContainer(Story.class, stories);<br />
		tselect.setContainerDataSource(container);<br />
		// now set the right (assigned) combo box<br />
		BeanItem bi = (BeanItem)item;<br />
		Sprint bean = (Sprint) bi.getBean();<br />
		tselect.setValue(bean.getStories());</p>
<p>		field = tselect;<br />
	}<br />
	return field;<br />
}</p>
<p>The above code was taken from a class that subclasses the Vaadin DefaultFieldFactory class. The DefaultFieldFactory is a class that allows the developer to specify the kind of UI widget Vaadin should create for the properties of Java POJO assigned to the Vaadin Form class  created for the view under construction. Within the createField(&#8230;) method (show above) the developer tells Vaadin to create a UI component other than its default (which is a TextField) by overriding he Vaadin choice based on the field name (propertyId) of the POJO. Since I have a JPA many-to-many property (its a Set of stories I want to assign to a Sprint) I chose to implement the TwinColSelect combo boxes.</p>
<p>In order for this code to work the Sprint and Story entity classes need to correctly implement the hashCode() and equals() methods.</p>
<p>Another point is that when persisting the user selections the stories selected need to be iterated over and the opposite side (the Sprint) needs to be inserted into each selected Story&#8217;s sprint collection.</p>
<p>-</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=146</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring Jpa/Hibernate Persistence</title>
		<link>http://www.kumasi.net/wordpress/?p=129</link>
		<comments>http://www.kumasi.net/wordpress/?p=129#comments</comments>
		<pubDate>Wed, 22 Feb 2012 21:15:56 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=129</guid>
		<description><![CDATA[I encountered a problem that cost me several hours having to do with jpa transaction not persisting the save/update/delete to the database. In my case I use MyEclipse to generate my Hibernate/JPA DAO and Model beans. MyEclipse subclass&#8217;s the JpaDaoSupport &#8230; <a href="http://www.kumasi.net/wordpress/?p=129">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I encountered a problem that cost me several hours having to do with jpa transaction not persisting  the save/update/delete to the database. In my case I use MyEclipse to generate my Hibernate/JPA DAO and Model beans. MyEclipse subclass&#8217;s the JpaDaoSupport class and uses EntityManagerFactory to create the EntityManager &#8211; this is bad because the EntityManager created cannot participate in the Spring declarative transaction management.</p>
<p>Further complications arise as I am developing with Vaadin and using AspectJ for load-time weaving of the J2EE components. Strangely in some cases the JPA DAO&#8217;s accept annotations such as @Transactional and in this recent case attempts to deploy the App would causes many different exceptions to be thrown (as I constantly tweaked the code moving the annotations from DAO to Service Layer all to no avail).<br />
 To solve the problem I removed the JpaDaoSupport subclassing from my DAOs and injected the EntityManager directly into each DAO using:</p>
<p>@PersistenceContext<br />
private EntityManager em;</p>
<p>Now I can use the  &#8220;@Transactional&#8221; annotation with errors being thrown.</p>
<p>However, there was still one more mountain to climb:<br />
Upon deployment I began receiving an error somthing like &#8220;Post-processor tried to replace bean instance of type [Blah] with (proxy) object of type [org.springframework.beans.factory.aspectj.$Proxy52] &#8211; not supported for aspect-configured classes!&#8221;.</p>
<p>After a little creative &#8220;googling&#8221; I found the fix was to simply change my Spring applicationContext.xml stanza<br />
from:<br />
tx:annotation-driven transaction-manager=&#8221;transactionManager&#8221;<br />
to:<br />
tx:annotation-driven transaction-manager=&#8221;transactionManager&#8221; mode=&#8221;aspectj&#8221;</p>
<p>Its a relief to have that out of the way so I can get back to Vaadin development!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating an SVN Repo</title>
		<link>http://www.kumasi.net/wordpress/?p=127</link>
		<comments>http://www.kumasi.net/wordpress/?p=127#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:32:44 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[Project Management]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=127</guid>
		<description><![CDATA[This post is a note for me that I found at this site: http://www.techiecorner.com/175/how-to-migrate-svn-repository/ Basically, it lists how to move your svn repository from one remote server to another. From a command prompt start your terminal console, then enter the &#8230; <a href="http://www.kumasi.net/wordpress/?p=127">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post is a note for me that I found at this site: http://www.techiecorner.com/175/how-to-migrate-svn-repository/</p>
<p>Basically, it lists how to move your svn repository from one remote server to another.<br />
From a command prompt start your terminal console, then enter the following linux commands:</p>
<p>$ svnadmin dump /path/to/your/repo &gt; yourreporname.dump<br />
$ scp yourreponame.dump username@new.machine.ip:/path/to/your/new/repo<br />
    Now your SVN dump file should be in new machine<br />
    Login to your new machine</p>
<p>    cd /path/to/your/new/repo</p>
<p>    svnadmin create reponame</p>
<p>    svnadmin load reponame &lt; yourreponame.dump</p>
<p>    Done, you just just migrated your svn repository</p>
<p>* If you dump file is too big for transfer, you can compress it using tar before sending over thru network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Reports in Vaadin</title>
		<link>http://www.kumasi.net/wordpress/?p=125</link>
		<comments>http://www.kumasi.net/wordpress/?p=125#comments</comments>
		<pubDate>Mon, 19 Dec 2011 17:21:56 +0000</pubDate>
		<dc:creator>saltyDog</dc:creator>
				<category><![CDATA[OOA/OOD/OOP]]></category>

		<guid isPermaLink="false">http://www.kumasi.net/wordpress/?p=125</guid>
		<description><![CDATA[I spent the weekend working/studying the Vaadin framework. The goal was to add some simple reporting capabilities to the Vaadin app (aTac!) I am developing. This weekend&#8217;s specific objective was to develop the beginnings of a series of data extracts &#8230; <a href="http://www.kumasi.net/wordpress/?p=125">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spent the weekend working/studying the Vaadin framework. The goal was to add some simple reporting capabilities to the Vaadin app (aTac!) I am developing. This weekend&#8217;s specific objective was to develop the beginnings of a series of data extracts to be formatted as PDF documents. The PDF portion was a snap using the Java iText API (a java API for PDF generation). However there is still work to be done presenting the generated doc to the User for review; currently the docs are stuck on the app server and cannot be viewed &#8211; there&#8217;s always next week!<br />
BTW, Vaadin is really fun o develop with&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kumasi.net/wordpress/?feed=rss2&#038;p=125</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

