<?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>The eflow blog &#187; openmrs</title>
	<atom:link href="http://blog.eflow.org/archives/tag/openmrs/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eflow.org</link>
	<description>Insert some amazingly witty tagline here</description>
	<lastBuildDate>Fri, 09 Dec 2011 18:59:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Script to Find Unused Message Keys in Message.properties Files</title>
		<link>http://blog.eflow.org/archives/325</link>
		<comments>http://blog.eflow.org/archives/325#comments</comments>
		<pubDate>Thu, 06 Jan 2011 19:55:44 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[openmrs]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[messages]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=325</guid>
		<description><![CDATA[Over time the messages in our Spring message.properties files grow stale. When a developer updates/changes code he/she doesn&#8217;t necessarily go to the messages.properties and remove all the keys that they removed from code. This has not detrimental effect on code, it just means that when translating into a new language the translator is potentially more [...]]]></description>
			<content:encoded><![CDATA[<p>Over time the messages in our Spring message.properties files grow stale.  When a developer updates/changes code he/she doesn&#8217;t necessarily go to the messages.properties and remove all the keys that they removed from code.  This has not detrimental effect on code, it just means that when translating into a new language the translator is potentially more work than they need to.</p>
<p>I wrote this quick shell script to loop over the file and do a recursive grep for that key.  The key is considered &#8220;used&#8221; if it exists in the current directory with quotes around it (single or double).  This WILL NOT find keys if they are only used programmatically. (e.g. VAR + &#8220;.started&#8221;)</p>
<blockquote><p>
#!/bin/sh</p>
<p># Loops over all the keys in the given messages.properties file<br />
# and looks in the current directory for the string in quotes.<br />
# Results are printed to stdout<br />
#<br />
# use: (from the &#8220;web&#8221; dir in openmrs)<br />
# sh ./findunusedmessages.sh WEB-INF/messages.properties</p>
<p>propfile=$1<br />
props=`awk -F= &#8216;{print $1}&#8217; $propfile`<br />
count=0<br />
total=0</p>
<p>echo &#8220;These property keys were not found in the code base:&#8221;<br />
for prop in $props<br />
do<br />
 #echo &#8220;Looking for property: $prop&#8221;<br />
 if [ ! -z "$prop" ];<br />
 then<br />
   total=`expr $total + 1`<br />
   output=`grep &#8211;exclude-dir=&#8221;.svn&#8221; -re &#8220;[\'\"]$prop[\'\"]&#8221; *`<br />
   if [ -z "$output" ];<br />
   then<br />
     echo &#8220;$prop&#8221;<br />
     count=`expr $count + 1`<br />
   fi<br />
 fi<br />
done</p>
<p>echo &#8220;done! Found $count possibly uneeded message keys in $propfile (out of $total total keys)&#8221;
</p></blockquote>
<p>Download the file here: <a href='http://blog.eflow.org/wp-content/uploads/2011/01/findunusedmessages.sh'>findunusedmessages.sh</a><br />
<br/><br />
<br/></p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=325" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/325/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenMRS Training Wrap-up</title>
		<link>http://blog.eflow.org/archives/305</link>
		<comments>http://blog.eflow.org/archives/305#comments</comments>
		<pubDate>Fri, 02 Apr 2010 02:42:59 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[openmrs]]></category>
		<category><![CDATA[training]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=305</guid>
		<description><![CDATA[We held a training here in Indianapolis in February. Darius Jazayeri and I led the talks that walked through all development aspects of OpenMRS. You can see the agenda here: http://openmrs.org/wiki/OpenMRS_Developer_Training_Week_8-February-2010 Overall I was quite pleased with how the training went. There were more people involved that I expected: 40+ were in attendance physically at [...]]]></description>
			<content:encoded><![CDATA[<p>We held a training here in Indianapolis in February.  Darius Jazayeri and I led the talks that walked through all development aspects of OpenMRS.  You can see the agenda here: <a href="http://openmrs.org/wiki/OpenMRS_Developer_Training_Week_8-February-2010">http://openmrs.org/wiki/OpenMRS_Developer_Training_Week_8-February-2010</a></p>
<p>Overall I was quite pleased with how the training went.  There were more people involved that I expected: 40+ were in attendance physically at the Regenstrief building at some point during the week and another 10-15 that participated via the online web casts!  One very positive outcome from the week was that Darius and I created a lot of wiki pages directly from the content we were talking about. This gave us a blueprint from which to talk while preserving the content for future users to see.  I am still waiting to hear from Michael about the long-term availability of daily recordings.</p>
<p>I really see these types of trainings being a good long term revenue stream for OpenMRS.  Obviously it won&#8217;t be able to be the only source, but if we had 3-4 trainings a year at various locations around the globe we would be able to hit a large number of developers.  (Doing an implementer-centered training is a whole other matter)  We learned a lot through this training: get the word out earlier, give out pre-training required reading, and write the entire week&#8217;s lesson plans prior to starting the training!</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=305" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/305/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenMRS Database Creation Error &#8211; Errcode 17</title>
		<link>http://blog.eflow.org/archives/268</link>
		<comments>http://blog.eflow.org/archives/268#comments</comments>
		<pubDate>Mon, 19 Oct 2009 09:12:31 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[liquibase]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[openmrs]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=268</guid>
		<description><![CDATA[A programmer here at AMPATH (Gilbert Tuwei) had some issues installing mysql. The error message was very unhelpful and the solution was equally puzzling, so I want to put here to for the mighty google to find. Tuwei was running v5.0.17 of MySQL. Upgrading to version 5.1.31 made the problem disappear. WARN &#8211; InitializationFilter$InitializationCompletion$1.run(823) &#124;2009-10-02 [...]]]></description>
			<content:encoded><![CDATA[<p>A programmer here at AMPATH (Gilbert Tuwei) had some issues installing mysql.  The error message was very unhelpful and the solution was equally puzzling, so I want to put here to for the mighty google to find.</p>
<p>Tuwei was running v5.0.17 of MySQL.  Upgrading to version 5.1.31 made the problem disappear.</p>
<blockquote><p>WARN &#8211; InitializationFilter$InitializationCompletion$1.run(823) |2009-10-02 15:24:21,000| Error while trying to update to the latest database version<br />
org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-update-to-latest.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::2::upul:<br />
     Reason:<br />
          java.sql.SQLException: Can&#8217;t create/write to file &#8216;C:\WINDOWS\TEMP\#sql_fe4_0.MYI&#8217; (Errcode: 17):<br />
          Caused By: Precondition Error<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:145)<br />
	at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:817)<br />
	at java.lang.Thread.run(Unknown Source)<br />
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::2::upul:<br />
     Reason:<br />
          java.sql.SQLException: Can&#8217;t create/write to file &#8216;C:\WINDOWS\TEMP\#sql_fe4_0.MYI&#8217; (Errcode: 17):<br />
          Caused By: Precondition Error<br />
	at liquibase.ChangeSet.execute(ChangeSet.java:204)<br />
	at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)<br />
	at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:177)<br />
	at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:201)<br />
	at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:142)<br />
	&#8230; 2 more<br />
Caused by: liquibase.exception.PreconditionErrorException: Precondition Error<br />
	at liquibase.preconditions.ForeignKeyExistsPrecondition.check(ForeignKeyExistsPrecondition.java:36)<br />
	at liquibase.preconditions.NotPrecondition.check(NotPrecondition.java:18)<br />
	at liquibase.preconditions.AndPrecondition.check(AndPrecondition.java:21)<br />
	at liquibase.ChangeSet.execute(ChangeSet.java:169)<br />
	&#8230; 7 more</p></blockquote>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=268" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/268/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy SVN Conflict Resolution</title>
		<link>http://blog.eflow.org/archives/239</link>
		<comments>http://blog.eflow.org/archives/239#comments</comments>
		<pubDate>Mon, 29 Jun 2009 20:07:14 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[openmrs]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=239</guid>
		<description><![CDATA[Our method for merging branches back to trunk: branch> svn merge from trunk [rev_last_merged_from_trunk]:[HEAD] branch> (resolve conflicts, deploy, test) branch> commit (at this point, the branch should be exactly what trunk has plus all changes done in the branch) trunk> svn merge from branch [rev_first_branched_from_trunk]:[HEAD] For some reason svn still sees a ton of conflicts [...]]]></description>
			<content:encoded><![CDATA[<p>Our method for merging branches back to trunk:</p>
<ul>
<li>branch> svn merge from trunk [rev_last_merged_from_trunk]:[HEAD]
<li>branch> (resolve conflicts, deploy, test)
<li>branch> commit<br />
(at this point, the branch should be exactly what trunk has plus all changes done in the branch)</p>
<li>trunk> svn merge from branch [rev_first_branched_from_trunk]:[HEAD]
</ul>
<p>For some reason svn still sees a ton of conflicts when doing that last step.  In the past I would have to manually go through each file and just copy what was in the branch on top of trunk and then &#8220;mark resolved&#8221;.  However, now there is a faster way:  Using at least SVN v1.5 at command line:</p>
<blockquote><pre>svn resolve -R --accept theirs-full *</pre>
</blockquote>
<p>Thats it!  Its a life saver.  Or at least a time saver.</p>
<p>(This can be dangerous.  Make sure you have resolved all true conflicts in the branch before doing the &#8220;resolve all&#8221;)</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=239" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/239/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Java URLConnection Redirects Between http and https</title>
		<link>http://blog.eflow.org/archives/174</link>
		<comments>http://blog.eflow.org/archives/174#comments</comments>
		<pubDate>Thu, 26 Mar 2009 03:18:06 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[babble]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[openmrs]]></category>

		<guid isPermaLink="false">http://blog.eflow.org/?p=174</guid>
		<description><![CDATA[For some reason Java doesn&#8217;t like to obey http forwards if the protocol is changing. It has been this way for a while: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4620571.  So when I was trying to load https://modules.openmrs.org that had an apache redirectMatch to http://modules.openmrs.org, I would get the html for the 301 redirect instead of the source of http://modules.openmrs.org. I [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason Java doesn&#8217;t like to obey http forwards if the protocol is changing.  It has been this way for a while: <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4620571">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4620571</a>.  So when I was trying to load https://modules.openmrs.org that had an apache redirectMatch to http://modules.openmrs.org, I would get the html for the 301 redirect instead of the source of http://modules.openmrs.org.</p>
<p>I was lucky that I have control over the server and could change the http/https to a simply proxy instead of redirecting.  If I didn&#8217;t, I would have had to catch the protocol change and refetch the new url.</p>
<p>It took me a while to find an answer for this because these keywords didn&#8217;t give many results on google: URLConnection HttpURLConnection openConnection() connect() getInputStream() Apache redirectMatch 301 302.</p>
 <img src="http://blog.eflow.org/wp-content/plugins/feed-statistics.php?view=1&post_id=174" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://blog.eflow.org/archives/174/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

