2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2020

10/19/2005: NTEN One Day Conference - Answering the call - Lessons learned from the Global ICT responses

I spent this past Monday at a one-day conference devoted to how Information Technology responded to the humanitarian responses of the past year (Katrina, the Tsunami, Darfur, and Afghanistan). For me, the best aspect of the conference was listening to the success stories. One memorable story involves using PDAs to collect information which could be easily collected by the main office.

I re-learned that field conditions are vastly inferior to the conditions under which applications are developed. It's extremely difficult to get *any* kind of staff in locations such as Darfur and even when staff is hired, turnover is very high which pushing training costs higher.

As expected, Data Sharing and Data Standards are a big concern. Yahoo is starting to analyze the existing standards with an eye towards how they can be used for First Responders and other aid workers.

There are fledging open-source applications that are being written (such as Sahana at http://sahana.sourceforge.net/). Plone (http://plone.org/) is being used as a content-management system by several organizations.

In conclusion, at $150 for the day the conference was well worth my time. I highly suggest attending such a conference just to get exposed to how another set of people (non-profit, disaster response teams) do their work.

09/07/2005: Using a CustomEditorConfigurer to Specify a Lucene FSDirectory Using Spring

When I started to use Spring with my Lucene application, I searched for an easy way to specify the directory name where the Lucene repository is stored. Since the FSDirectory class is not instantiated directly (you need to call FSDirectory.getDirectory), I couldn't see how to configure Spring to create the object for me.

Then I discovered that the JavaBeans api has the ability to automatically convert from a String to any other class using a configurator object. With this ability, specifying a bean that uses an FSDirectory can be done in the following way:

<bean id="serverDatabase" class="com.server.DB" method="setup">
  <property name='directory'><value>data/LuceneRepsitory</value></property>
</bean>

The idea is that when Spring wired beans together some configurer object would convert that String into a Lucune FSDirectory object. This conversion is done by the following Java class:

public class FileSystemLuceneDirectoryEditor extends PropertyEditorSupport {
    public void setAsText(final String textValue) {
        try {
            final boolean fileExists = new File(textValue).exists();
            final boolean createDirectory = fileExists == true ? false : true;
            setValue(FSDirectory.getDirectory(textValue, createDirectory));
        } catch (IOException e) {
            throw new CriteriaWatchException(e);
        }
    }
}

The configurer class needs to be introduced to Spring through its XML configuration file:

  <bean id='customEditorConfigurer' class='org.springframework.beans.factory.config.CustomEditorConfigurer'>
    <property name='customEditors'>
      <map>
        <entry key='org.apache.lucene.store.Directory'>
          <bean id='luceneDirectoryEditor' class='FileSystemLuceneDirectoryEditor'/>
        </entry>
      </map>
    </property>
  </bean>

After the above work is done, Spring automatically converts any String values that are destined to be Directory parameters.