<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Adrian Smith's Blog</title>
	
	<link>http://www.17od.com</link>
	<description />
	<pubDate>Thu, 04 Sep 2008 19:44:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/AdrianSmithsBlog" type="application/rss+xml" /><item>
		<title>How to Create a Remote Paging Listview Using GWT-Ext</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/344868307/</link>
		<comments>http://www.17od.com/2008/07/24/how-to-create-a-remote-paging-listview-using-gwt-ext/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 18:05:36 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[gwt]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.17od.com/?p=73</guid>
		<description><![CDATA[Creating a remote paging listview isn&#8217;t particularly difficult but getting to the point of knowing how all the pieces fit together can be tricky first time round. This post describes how I created a very simple remote paging listview that retrieves each page of data from an Oracle database table. As well as describing the [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a remote paging listview isn&#8217;t particularly difficult but getting to the point of knowing how all the pieces fit together can be tricky first time round. This post describes how I created a very simple remote paging listview that retrieves each page of data from an Oracle database table. As well as describing the listview I&#8217;ve also included the code for the server side that actually fetches and returns each page of data to the client.</p>
<p><strong>Deploying GWT-Ext</strong><br />
If you&#8217;ve not used <a href="http://www.gwt-ext.com/" onclick="javascript:urchinTracker ('/outbound/article/www.gwt-ext.com');">GWT-Ext</a> before then here&#8217;s how to include it in your GWT application. First you&#8217;ll need to download GWT-Ext itself. At the time of writing 2.0.4 is the latest release, you can get it <a href="http://code.google.com/p/gwt-ext/downloads/list" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">here</a>. The real workhorse behind GWT-Ext is the Javascript library <a href="http://extjs.com/" onclick="javascript:urchinTracker ('/outbound/article/extjs.com');">ExtJS</a>. GWT-Ext 2.0.4 requires ExtJS 2.0.2 which you can download from <a href="http://yogurtearl.com/ext-2.0.2.zip" onclick="javascript:urchinTracker ('/outbound/article/yogurtearl.com');">here</a>.</p>
<p>If you don&#8217;t already have a GWT application then GWT&#8217;s <a href="http://code.google.com/docreader/#p(google-web-toolkit-doc-1-5)s(google-web-toolkit-doc-1-5)t(GettingStartedBasics)" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">The Basics</a> guide is a good place to start.</p>
<p>With your application up and running here are the steps required to deploy GWT-Ext within it.</p>
<p>1. Create the directory <strong>js/ext</strong> under your application&#8217;s <strong>public</strong> folder and copy the following files and directories from ExtJS into it,</p>
<pre>
 /adapter
 /resources
 ext-all.js
 ext-all-debug.js
 ext-core.js
 ext-core-debug.js
</pre>
<p>2. Edit your module file and add these lines to it,</p>
<pre name="code" class="xml">
  &lt;inherits name='com.gwtext.GwtExt'/&gt;
  &lt;stylesheet src="js/ext/resources/css/ext-all.css"/&gt;
  &lt;script src="js/ext/adapter/ext/ext-base.js" /&gt;
  &lt;script src="js/ext/ext-all.js" /&gt;
</pre>
<p>3. The final step it to add the GWT-Ext jar, gwtext.jar, to your application&#8217;s classpath.</p>
<p><strong>The Client Side Code</strong><br />
GWT-Ext refers to a listview as a Grid so to avoid confusion I&#8217;ll use that term throughout the rest of this post. I used the term listview up to this point because it&#8217;s probably a more generally accepted description.</p>
<p>Before going into the code it&#8217;s worth spending a little time understanding the various objects that are needed to support the Grid object. The first thing worth pointing out is that GWT-Ext doesn&#8217;t use standard <a href="http://code.google.com/docreader/#p(google-web-toolkit-doc-1-5)s(google-web-toolkit-doc-1-5)t(DevGuideRemoteProcedureCalls)" onclick="javascript:urchinTracker ('/outbound/article/code.google.com');">GWT Remote Procedure Calls</a> to fetch the data needed in the Grid. What you do instead is provide it with a HTTP URL from which to retrieve the data. To do this you use a <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/DataProxy.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">DataProxy</a> object. There are three types of DataProxy, the <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/HttpProxy.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">HttpProxy</a>, the <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/MemoryProxy.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">MemoryProxy</a> and the <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/ScriptTagProxy.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">ScriptTagProxy</a>. The MemoryProxy is just a static in memory data source and the ScriptTagProxy is the same as HttpProxy except that it retrieves data from a site other than the one where your Grid is hosted. So what format should the data coming back from this URL be in? Two formats are supported, JSON and XML. In order to understand the structure of this JSON or XML we need to use a <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/RecordDef.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">RecordDef</a>. This object contains <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/FieldDef.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">FieldDef</a> objects each of which describe a particular field in the data feed. Once you&#8217;ve described you data structure using a RecordDef you create either a <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/JsonReader.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">JsonReader</a> or an <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/XmlReader.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">XmlReader</a> and give it a reference to your RecordDef. Finally, to tie all these objects together you create a <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/data/Store.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">Store</a>. The Store is the object you present to the Grid. It uses the DataProxy to retrieve the data and and the Reader to parse it.</p>
<p>With the Store defined we can turn our attention to the Grid. To define what columns the Grid should have and where the data for each column should come from we use a <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/widgets/grid/ColumnModel.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">ColumnModel</a> object. This object contains a number of <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/widgets/grid/ColumnConfig.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">ColumnConfig</a> objects, one for each column. A ColumnConfig contains the column title, the name of the record in the RecordDef to populate the column with, it&#8217;s width, weather it&#8217;s sortable and how the data should be rendered. To create the Grid itself we use the <a href="http://gwt-ext.com/docs/2.0.4/com/gwtext/client/widgets/grid/GridPanel.html" onclick="javascript:urchinTracker ('/outbound/article/gwt-ext.com');">GridPanel</a> object. You can link it to the Store and ColumnModel using either the constructor or the setter methods.</p>
<p>The final point to note is that you&#8217;ll need to add an <strong>onRender</strong> event handler to the Grid so that the first page of data is loaded when the Grid is displayed.</p>
<p>Bringing all that together here&#8217;s the class I ended up with,</p>
<pre name="code" class="java"></code>
package com._17od.gwtexamples.client;

import java.util.Date;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.gwtext.client.core.SortDir;
import com.gwtext.client.data.DateFieldDef;
import com.gwtext.client.data.FieldDef;
import com.gwtext.client.data.HttpProxy;
import com.gwtext.client.data.IntegerFieldDef;
import com.gwtext.client.data.JsonReader;
import com.gwtext.client.data.Record;
import com.gwtext.client.data.RecordDef;
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StringFieldDef;
import com.gwtext.client.util.DateUtil;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.PagingToolbar;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
import com.gwtext.client.widgets.grid.CellMetadata;
import com.gwtext.client.widgets.grid.ColumnConfig;
import com.gwtext.client.widgets.grid.ColumnModel;
import com.gwtext.client.widgets.grid.GridPanel;
import com.gwtext.client.widgets.grid.GridView;
import com.gwtext.client.widgets.grid.Renderer;
import com.gwtext.client.widgets.grid.RowSelectionModel;

public class PersonGrid implements EntryPoint {

	public void onModuleLoad() {

		Panel panel = new Panel();
		panel.setBorder(false);
		panel.setPaddings(15);

		HttpProxy dataProxy = new HttpProxy("http://localhost:8888/persons");

        final RecordDef recordDef = new RecordDef(new FieldDef[]{
                new StringFieldDef("class"),
                new DateFieldDef("dateOfBirth", "Y-m-d"),
                new StringFieldDef("firstname"),
                new IntegerFieldDef("id"),
                new StringFieldDef("lastname"),
        });

        JsonReader reader = new JsonReader(recordDef);
        reader.setRoot("persons");
        reader.setTotalProperty("totalPerons");
        reader.setId("id");

        final Store store = new Store(dataProxy, reader, true);
        store.setDefaultSort("id", SortDir.ASC);

        ColumnConfig firstNameColumn = new ColumnConfig("First Name", "firstname", 45, true);
        ColumnConfig lastNameColumn = new ColumnConfig("Last Name", "lastname", 45, true);
        ColumnConfig dateOfBirthColumn = new ColumnConfig("Date of Birth", "dateOfBirth", 45, true, dateRender);

        ColumnModel columnModel = new ColumnModel(new ColumnConfig[] {
        		firstNameColumn,
        		lastNameColumn,
        		dateOfBirthColumn});
        columnModel.setDefaultSortable(true);

        GridPanel grid = new GridPanel();
        grid.setWidth(700);
        grid.setHeight(300);
        grid.setTitle("People");
        grid.setStore(store);
        grid.setColumnModel(columnModel);
        grid.setTrackMouseOver(true);
        grid.setLoadMask(true);
        grid.setSelectionModel(new RowSelectionModel());
        grid.setStripeRows(true);
        grid.setIconCls("grid-icon");
        grid.setEnableColumnResize(true);

        GridView view = new GridView();
        view.setForceFit(true);
        grid.setView(view);

        PagingToolbar pagingToolbar = new PagingToolbar(store);
        pagingToolbar.setPageSize(15);
        pagingToolbar.setDisplayInfo(true);

        grid.setBottomToolbar(pagingToolbar);

        grid.addListener(new PanelListenerAdapter() {
            public void onRender(Component component) {
                store.load(0, 15);
            }
        });
        panel.add(grid);

        RootPanel.get().add(panel);

  	}

    private Renderer dateRender = new Renderer() {
        public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum, Store store) {
            return DateUtil.format((Date) value, "d-m-Y");
        }
    };

}
</pre>
<p><strong>Where Does the Data Come From?</strong><br />
The code below is the servlet I developed to return each page of data to the Grid. It retrieves the data from an Oracle database table called “person”. It&#8217;s not particularly complicated but it does demonstrate some challenges that are worth pointing out.</p>
<pre name="code" class="java"></code>
package com._17od.gwtexamples.servlets;

import java.io.IOException;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Enumeration;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import oracle.jdbc.pool.OracleDataSource;

import org.json.JSONArray;
import org.json.JSONObject;

public class GetPersonsServlet extends HttpServlet {

	private Connection connection;

	public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
		doPost(req, res);
	}

	public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException {

		// Display the parameters we're passed in for debugging purposes
		printParameters(req);

		// Get the limit and sort parameters off the request
		int start = req.getParameter("start") == null ? 1 : Integer.parseInt(req.getParameter("start"));
		int numberToReturn = req.getParameter("limit") == null ? 10 : Integer.parseInt(req.getParameter("limit"));
		String sortBy = req.getParameter("sort") == null ? "id" : req.getParameter("sort");
		String sortOrder = req.getParameter("dir") == null ? "asc" : req.getParameter("dir");

		// Create the SQL query used to retrieve the persons
		String sql = createMainSQLQuery(sortBy, sortOrder);

		ArrayList persons = null;
		try {

			// Get a connection to the Oracle database and put it on the object so that it's easily accessible
			connection = getConnection();

			// Execute the query to return the exact records requested
			persons = queryForPersonsUsingLimits(sql, start, numberToReturn);

			// Convert the list of persons into a JSON string
			JSONObject jsonDataToReturn = new JSONObject();
			JSONArray jsonPersons = new JSONArray(persons, true);
			jsonDataToReturn.put("totalPerons", getTotalNumberOfPersons(sql));
			jsonDataToReturn.put("persons", jsonPersons);

			// Write everything back to the requestor
			res.getWriter().print(jsonDataToReturn.toString(1));

		} catch (Exception e) {
			e.printStackTrace();
			throw new IOException(e);
		} finally {
			if (connection != null) {
				try {
					connection.close();
				} catch (SQLException e) {
					e.printStackTrace();
					throw new IOException(e);
				}
			}
		}

	}

	/**
	 * Create the query used to retrieve the persons from the database.
	 * @param sortBy
	 * @param sortOrder
	 * @return
	 */
	private String createMainSQLQuery(String sortBy, String sortOrder) {

		StringBuffer sql = new StringBuffer("SELECT id, firstname, lastname, dateofbirth FROM person");
		sql.append(" ORDER BY ");
		sql.append(sortBy);
		sql.append(" ");
		sql.append(sortOrder);

		return sql.toString();

	}

	/**
	 * Wrap the query passed in with some extra SQL that pulls out the exact
	 * page of persons requested, i.e. starting at record number 10 return 20
	 * records.
	 * It's vital that the query given in 'sql' has an 'order by' clause.
	 * If it didn't then the persons could be returned in a random order
	 * making it impossible to order them into pages.
	 * @param sql
	 * @param start
	 * @param numberToReturn
	 * @return
	 * @throws SQLException
	 */
	private ArrayList queryForPersonsUsingLimits(String sql, int start, int numberToReturn) throws SQLException {

		StringBuffer sqlBuffer = new StringBuffer("SELECT * FROM (SELECT a.*, ROWNUM rnum from (");
		sqlBuffer.append(sql);
		sqlBuffer.append(") a WHERE ROWNUM <= ");
		sqlBuffer.append(start + numberToReturn);
		sqlBuffer.append(") WHERE rnum > ");
		sqlBuffer.append(start);

		Statement statement = null;
		ResultSet rs = null;

		ArrayList<Person> persons = new ArrayList<Person>();

		try {

			statement = connection.createStatement();
			rs = statement.executeQuery(sqlBuffer.toString());

			while (rs.next()) {
				Person person = new Person();
				person.setId(rs.getInt("id"));
				person.setFirstname(rs.getString("firstname"));
				person.setLastname(rs.getString("lastname"));
				person.setDateOfBirth(rs.getDate("dateofbirth"));
				persons.add(person);
			}

		} finally {
			if (rs != null) {
				rs.close();
			}
			if (statement != null) {
				statement.close();
			}
		}

		return persons;

	}

	/**
	 * Return the total numbner of records that the given query will return.
	 * @param sql
	 * @return
	 * @throws SQLException
	 */
	private int getTotalNumberOfPersons(String sql) throws SQLException {

		int count = 0;

		StringBuffer sqlBuffer = new StringBuffer("SELECT COUNT(*) count FROM (");
		sqlBuffer.append(sql);
		sqlBuffer.append(")");

		Statement statement = null;
		ResultSet rs = null;

		try {

			statement = connection.createStatement();
			rs = statement.executeQuery(sqlBuffer.toString());

			while (rs.next()) {
				count = rs.getInt("count");
			}

		} finally {
			if (rs != null) {
				rs.close();
			}
			if (statement != null) {
				statement.close();
			}
		}

		return count;

	}

	/**
	 * Return a database connection from the connection poll that's stored on the servlet/application context
	 * @return
	 * @throws SQLException
	 */
	private Connection getConnection() throws SQLException {
		OracleDataSource ods = (OracleDataSource) getServletContext().getAttribute("CONNECTION_POOL");
		if (ods == null) {
			ods = createConnectionPool();
			getServletContext().setAttribute("CONNECTION_POOL", ods);
		}
		return ods.getConnection();
	}

	/**
	 * Create a database connection pool
	 * @return
	 * @throws SQLException
	 */
	private OracleDataSource createConnectionPool() throws SQLException {
        String username = "replace with db username";
        String password = "replace with db password";
        String url = "jdbc:oracle:thin:@localhost:1521:XE";

        OracleDataSource ods = new OracleDataSource();
        ods.setURL(url);
        ods.setUser(username);
        ods.setPassword(password);
        ods.setConnectionCachingEnabled(true);

        return ods;
	}

	private void printParameters(HttpServletRequest req) {
		Enumeration parameterNames = req.getParameterNames();
		System.out.println("\nRequest Parameters:");
		while (parameterNames.hasMoreElements()) {
			String parameterName = (String) parameterNames.nextElement();
			System.out.println(" " + parameterName + "=" + req.getParameter(parameterName));
		}
	}

}
</pre>
<p>The first point of interest in doPost() is the code that takes the ordering and limit parameters off the request. This servlet is requested when the grid is first drawn or when the user clicks on the “Next Page” or “Previous Page” buttons. For the paging to work the data needs to be ordered. The <strong>sort</strong> parameter indicates what column to sort the data by. It uses the name you give the column in the RecordDef when creating the Grid. The <strong>dir</strong> parameter says what direction the ordering should be in, ascending or descending. The <strong>start</strong> parameter is the number of the first record to return and <strong>limit</strong> is the number of records to return.</p>
<p>Now that we know what the user is asking for it&#8217;s time to build the SQL query that will fetch that data. The method createMainSQLQuery() creates a query string to select the required columns and order the ResultSet.</p>
<p>In the next section we call getConnection(). This method (and createConnectionPool()) demonstrate how to create an Oracle connection pool using OracleDataSource and it&#8217;s method setConnectionCachingEnabled().</p>
<p>The method queryForPersonsUsingLimits() is where we actually execute the query. In the first section the query is wrapped in some SQL that fetches only the rows we want starting at row start and returning only numberToReturn records. I picked this up from <a href="http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html" onclick="javascript:urchinTracker ('/outbound/article/www.oracle.com');">this Ask Tom article</a>. It&#8217;s well worth a read if you&#8217;re interested in how the ROWNUM pseudocolumn works.</p>
<p>The next section takes the query ResultSet, creates a Person object for each row and puts each on an ArrayList.</p>
<p>Back in doPost() the ArrayList of Persons is serialized to JSON text using the JSON classes freely availabe <a href="http://www.json.org/java/index.html" onclick="javascript:urchinTracker ('/outbound/article/www.json.org');">here</a>. The method getTotalNumberOfPersons() is called to retrieve the total number of rows the query would return if we weren&#8217;t limiting the results. The reason we need this is because the Grid will have a message at the bottom saying like “Displaying 1 to 20 of 100”. The  getTotalNumberOfPersons() method reuses the SQL we created earlier and simply wraps it in a SELECT COUNT(*).</p>
<p>Finally we write the JSON text to the output stream which is sent back to the browser.</p>
<p>Deploying the servlet into a web application is simply a matter of adding <strong>servlet</strong> and <strong>servlet-mapping</strong> entries to the application&#8217;s web.xml. For testing purposed I chose to use the web application created by GWT. By default this application is located in the <strong>&lt;project dir&gt;\tomcat\webapps\ROOT</strong>. Here are the entries I added&#8230;</p>
<pre name="code" class="xml"></code>
	<servlet>
		<servlet-name>GetPersonsServlet</servlet-name>
		<servlet-class>com._17od.GetPersonsServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>GetPersonsServlet</servlet-name>
		<url-pattern>/persons</url-pattern>
	</servlet-mapping>
</pre>
<p>Here&#8217;s a sample of the JSON returned from the URL http://localhost:8888/persons?start=2&#038;limit=3.</p>
<pre>
{
 "persons": [
  {
   "class": "class com._17od.servlets.Person",
   "dateOfBirth": "1901-01-17",
   "firstname": "Laurel",
   "id": 3,
   "lastname": "Davis"
  },
  {
   "class": "class com._17od.servlets.Person",
   "dateOfBirth": "1892-05-16",
   "firstname": "Ted",
   "id": 4,
   "lastname": "Schoenberger"
  },
  {
   "class": "class com._17od.servlets.Person",
   "dateOfBirth": "2001-05-19",
   "firstname": "Rebecca",
   "id": 5,
   "lastname": "Taylor"
  }
 ],
 "totalPerons": 20
}
</pre>
<p>The JSON implementation I&#8217;m using includes the name of the class being serialized, hence the class attribute.</p>
<p>Since I&#8217;ve included all the other code here&#8217;s the Person class,</p>
<pre name="code" class="java"></code>
package com._17od.gwtexamples.servlets;

import java.util.Date;

public class Person {

	private int id;
	private String firstname;
	private String lastname;
	private Date dateOfBirth;

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public int getId() {
		return id;
	}

	public void setId(int personId) {
		this.id = personId;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;

	}

}
</pre>
<p>To finish off here&#8217;s a screenshot of the Grid,<br />
<a href="http://www.17od.com/wordpress/wp-content/uploads/2008/07/screenshot-persongrid.png" ><img src="http://www.17od.com/wordpress/wp-content/uploads/2008/07/screenshot-persongrid.png" alt="Grid Screenshot" title="screenshot-persongrid" width="500" height="226" class="size-full wp-image-90" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2008/07/24/how-to-create-a-remote-paging-listview-using-gwt-ext/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2008/07/24/how-to-create-a-remote-paging-listview-using-gwt-ext/</feedburner:origLink></item>
		<item>
		<title>UPC DVR Review</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/297925698/</link>
		<comments>http://www.17od.com/2008/05/25/upc-dvr-review/#comments</comments>
		<pubDate>Sun, 25 May 2008 20:11:45 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[dvr]]></category>

		<category><![CDATA[review]]></category>

		<category><![CDATA[upc]]></category>

		<guid isPermaLink="false">http://www.17od.com/?p=72</guid>
		<description><![CDATA[After getting myself a new flat screen TV recently I decided to splash out get UPC&#8217;s DVR. I&#8217;ve had a MythTV setup in the past so I was keen to get back the features I got use to (pause live TV, easy to setup recordings, recording library, etc). Before I critize the DVR too much [...]]]></description>
			<content:encoded><![CDATA[<p>After getting myself a new <a href="http://www.sony.ie/view/ShowProduct.action?product=KDL-40V3000&#038;site=odw_en_IE&#038;imageType=Main&#038;category=TVP+32-40+Sony+BRAVIA+TV" onclick="javascript:urchinTracker ('/outbound/article/www.sony.ie');">flat screen TV</a> recently I decided to splash out get <a href="http://www.upc.ie/television/digitaltv/extras/dvr/" onclick="javascript:urchinTracker ('/outbound/article/www.upc.ie');">UPC&#8217;s DVR</a>. I&#8217;ve had a <a href="http://www.mythtv.org/" onclick="javascript:urchinTracker ('/outbound/article/www.mythtv.org');">MythTV</a> setup in the past so I was keen to get back the features I got use to (pause live TV, easy to setup recordings, recording library, etc). Before I critize the DVR too much I should start by saying that it is a good product. It does what it says on the box and for the price (€5 per month) it&#8217;s well worth it.</p>
<p>With the niceties out of the was I&#8217;ll start off with my biggest complaint, UPC&#8217;s inability to deliver when they say they will. I&#8217;ve been itching to get their DVR for a while but I&#8217;ve been let down badly in the past. No doubt several readers will have had the experience of waiting in for a full day for the engineers to arrive. It&#8217;s extremely frustrating and after the the last episode I had with them I went so far as so cancel my broadband and move to a different provider. I had hoped that was a once off but my experience with them this time around was no different. I was told it would be delivered between 9am and 1pm on a Thursday. After about 10 calls they finally arrived at 6pm on Friday. Luckily my wife&#8217;s at home these days so she could stay in. I don&#8217;t know how anyone who has to wait home from work would cope. Needless to say my wife wasn&#8217;t very happy and after speaking to a supervisor she managed to convince them to credit our account with €160. I haven&#8217;t received our next bill yet to confirm weather we actually got it or not.</p>
<p>Anyway that&#8217;s enough complaining, on to the box itself.</p>
<p>The first thing I noticed was that the menu system is a bit slow. It takes a good two or three seconds from when you press the menu button until it actually appears. That mightn&#8217;t seem like much but when you&#8217;re watching a program and you just want to flick into the full EPG quickly it&#8217;s a little bit annoying (note, you can easily and quickly see what&#8217;s on now and next for every channel by hitting the OK and bringing up the mini-guide).</p>
<p>One of the main advantages of having a DVR is that you can fast-forward through the ads. This  box does have fast-forward (and rewind obviously) but it&#8217;s very restrictive. MythTV has a really useful feature where you can key in the number of minutes you want to forward and then hit the fast-forward button. This means that when you get to an ad break you could just hit 4 and then ff and you&#8217;d be right up to the next part of your program. With this DVR you&#8217;ve only got five speeds of forward and rewind and the fastest is still very slow. It&#8217;s not too bad for ad breaks I suppose but if you&#8217;re watching a movie and you want to skip the first hour even the fastest fast forward speed will take about 5 minutes to get there.</p>
<p>The final criticism I&#8217;ll make is around recurring/repeat recordings. Setting one up is relatively easy, the only minor problem being that you have to know the channel number you want to set the recording up on, e.g. 101 for RTE1. The problems really start after you&#8217;ve setup the repeat recording. In the Digital Video Recorder menu there are two sub-menus, one called &#8220;My Recordings&#8221; where you can see everything you&#8217;ve recorded and one called &#8220;My Planner&#8221; where you can see what&#8217;s scheduled to be recorded. For standard recordings you see the program name, channel, date and time. For repeat recordings the channel name is given for the program name as well as the channel name. What that means is that when you look in your Planner or Recordings you can&#8217;t tell what the program is unless you know from the time or you start playing it.</p>
<p>Another two problems with repeat recordings is that you can&#8217;t edit one after you&#8217;ve created it and you can&#8217;t tell the difference between a repeat recording and a once off recording in the Planner. Not big problems but they do take away from the experience.</p>
<p>Aside from the negatives I do like this DVR. Given the choice I&#8217;d still prefer MythTV but the hassle of setting it up and keeping it up to date is just more time that I&#8217;m prepared to invest. UPC&#8217;s DVR does what it says on the box and it is relatively cheap. If you&#8217;re prepared to go through the hassle of getting it installed I would definately recommend it.</p>
<p>For a more indepth review have a look at <a href="http://www.adammaguire.com/blog/2007/08/24/review-upcs-new-dvr-mediabox/" onclick="javascript:urchinTracker ('/outbound/article/www.adammaguire.com');">this blog entry</a> from Adam Maguire.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2008/05/25/upc-dvr-review/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2008/05/25/upc-dvr-review/</feedburner:origLink></item>
		<item>
		<title>Installing Mercurial with Apache</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/262831148/</link>
		<comments>http://www.17od.com/2008/04/02/installing-mercurial-with-apache/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 18:34:14 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mercurial]]></category>

		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.17od.com/?p=71</guid>
		<description><![CDATA[If you&#8217;ve been following one of these guides explaining how to configure Mercurial with Apache you may have encountered the following error&#8230;

   TypeError: 'hgwebdir' object is not callable

There may be a number of scenarios under which this error can happen but in my case it was because I was using an incompatible version [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following <a href="http://www.selenic.com/mercurial/wiki/index.cgi/PublishingRepositories" onclick="javascript:urchinTracker ('/outbound/article/www.selenic.com');">one</a> of <a href="http://www.selenic.com/mercurial/wiki/index.cgi/HgWebDirStepByStep" onclick="javascript:urchinTracker ('/outbound/article/www.selenic.com');">these</a> <a href="http://digitalspaghetti.me.uk/2007/11/setting-up-a-mercurial-repository-from-svn-for-dummies-like-me/" onclick="javascript:urchinTracker ('/outbound/article/digitalspaghetti.me.uk');">guides</a> explaining how to configure Mercurial with Apache you may have encountered the following error&#8230;<br />
<code>
   TypeError: 'hgwebdir' object is not callable
</code><br />
There may be a number of scenarios under which this error can happen but in my case it was because I was using an incompatible version hgwebdir.cgi. After installing Mercurial 0.9.4 I downloaded hgwebdir.cgi from <a href="http://www.selenic.com/repo/hg-stable/raw-file/tip/hgwebdir.cgi" onclick="javascript:urchinTracker ('/outbound/article/www.selenic.com');">here</a> (which at the time of writing was for Mercurial 1.0). To fix the problem I had to use the version of hgwebdir.cgi that came with the Mercurial 0.9.4 install. On Ubuntu you&#8217;ll find it here /usr/share/doc/mercurial/examples/hgwebdir.cgi.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2008/04/02/installing-mercurial-with-apache/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2008/04/02/installing-mercurial-with-apache/</feedburner:origLink></item>
		<item>
		<title>Accessing the NIB &amp; ROS Websites Using Linux</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/179666353/</link>
		<comments>http://www.17od.com/2007/11/04/accessing-the-nib-ros-websites-using-linux/#comments</comments>
		<pubDate>Sun, 04 Nov 2007 17:49:27 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[banking]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[irish]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[ros]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/11/04/accessing-the-nib-ros-websites-using-linux/</guid>
		<description><![CDATA[Flexible and all as the Linux operating system is there are a few drawbacks that make the experience less than perfect. One of the main reasons I didn&#8217;t go Linux 100% of the time was that there was always one or two applications that I couldn&#8217;t live without that only ran on Windows. The main [...]]]></description>
			<content:encoded><![CDATA[<p>Flexible and all as the Linux operating system is there are a few drawbacks that make the experience less than perfect. One of the main reasons I didn&#8217;t go Linux 100% of the time was that there was always one or two applications that I couldn&#8217;t live without that only ran on Windows. The main one was Internet Explorer, or more specifically a few websites that I use that were designed to only work with Internet Explorer. The websites in question are my bank&#8217;s, <a href="https://ebanking.nationalirishbank.ie" onclick="javascript:urchinTracker ('/outbound/article/ebanking.nationalirishbank.ie');">NIB</a> and the Irish revenue website <a href="http://www.ros.ie" onclick="javascript:urchinTracker ('/outbound/article/www.ros.ie');">ROS</a>. In fairness to NIB they do offer a workaround but it involves using an a calculator like device to generate a unique token each time you logon to their website.</p>
<p>As it happens, getting Internet Explorer to work in Linux is relatively straightforward. The tricky bit it pulling the various pieces of the puzzle together. </p>
<p><strong>Install Wine and Internet Explorer</strong><br />
Because the problem of not having access to IE within Linux is such a common problem, some nice people have put together an install process that installs both Wine and IE with minimal fuss. It&#8217;s called <a href="http://www.tatanka.com.br/" onclick="javascript:urchinTracker ('/outbound/article/www.tatanka.com.br');">IEs4Linux</a>. To make the process as painless as possible there&#8217;s a step by step guide available <a href="http://www.howtoforge.com/ubuntu_internet_explorer" onclick="javascript:urchinTracker ('/outbound/article/www.howtoforge.com');">here</a>. The most important thing to remember is to carry out the install as a normal user, i.e. NOT the root user.</p>
<p>If you&#8217;re running Ubuntu Gutsy then for step 2 add the following lines to <code>/etc/apt/sources.list</code><br />
<code>
deb http://de.archive.ubuntu.com/ubuntu gutsy universe
deb http://wine.budgetdedicated.com/apt gutsy main
</code></p>
<p>When asked if I wanted to install IE5.5 or IE5.0 I said no. That meant that only IE 6 was installed. Installing all three isn&#8217;t a problem but I had no need for 5.0 and 5.5.</p>
<p>Once the process has finished you should have an Internet Explorer icon on your desktop.</p>
<p><strong>Installing the Java Runtime Environment Plug-in for IE</strong><br />
This was the part that I was a little unsure about. I thought getting IE to run was an achievement but I never thought the IE JRE plug-in would work. As luck would have it I came across <a href="http://rmathew.blogspot.com/2007/04/running-java-applets-in-internet.html" onclick="javascript:urchinTracker ('/outbound/article/rmathew.blogspot.com');">this post</a> by Ranjit Mathew that was exactly what I needed.</p>
<p>Following Ranjit&#8217;s post here are the steps I carried out&#8230;</p>
<p>i) Go to the Sun website and download the latest version of the Windows 1.5 JRE. The reason for using 1.5 and not the latest 1.6 is that the <a href="http://www.ros.ie/PublisherServlet/requirements" onclick="javascript:urchinTracker ('/outbound/article/www.ros.ie');">ROS website</a> states that they only support Sun 1.5 on IE6. The 1.6 version may work but I didn&#8217;t want to tempt faith.</p>
<p>ii) Open a command prompt and execute the following lines,<br />
<code>
export WINEPREFIX=$HOME/.ies4linux/ie6
wine jre-1_5_0_13-windows-i586-p.exe
</code></p>
<p>iii) I was having some problems with the entire screen blacking out when I&#8217;d visit a page with a Java applet on it. If you have the same problem open a command prompt and execute these commands&#8230;<br />
<code>
export WINEPREFIX=$HOME/.ies4linux/ie6
regedit
</code><br />
Go to the key HKEY_CURRENT_USER\Software\JavaSoft\Java2D\1.5.0_13 and set the property &#8220;DXAcceleration&#8221; to 0.</p>
<p><strong>Installing The ROS Software</strong><br />
When you visit the ROS website for the first time you&#8217;ll have to install the KCrypto software. KCrypto is the Java code that handles the secure transfer of data between your browser and the NIB servers. The first time I tried to install it it failed. The second time it worked fine.</p>
<p><strong>Installing your ROS Certificates</strong><br />
Your ROS security certificates are held in the folder <code>C:\ROS</code> on your Windows machine. Copy this entire folder from your Windows machine into the folder <code>$HOME/.ies4linux/ie6/drive_c</code>. When you restart your IE browser you should see your user id appear on the ROS logon page.</p>
<p><strong>Installing you NIB UserID File</strong><br />
i) Logon to your NIB account on your Windows machine<br />
ii) Click on &#8220;Settings&#8221; at the top of the page and then &#8220;Security&#8221; in the left hand menu<br />
iii) Select the function &#8220;Back up user ID&#8221; and click OK<br />
iv) On the next screen click OK. Take the file that&#8217;s downloaded and go back to your Linux machine<br />
v) Start up IE and go to the logon page<br />
vi) Select &#8220;Search for user id&#8221; just under the userid and password fields. Browse to where you have the file downloaded in step iv, select the second radio button (i.e. copy to a local location) and click OK</p>
<p>That&#8217;s it. One step closer to going Linux full time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/11/04/accessing-the-nib-ros-websites-using-linux/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/11/04/accessing-the-nib-ros-websites-using-linux/</feedburner:origLink></item>
		<item>
		<title>Installing Mythbuntu 7.10</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/175582642/</link>
		<comments>http://www.17od.com/2007/10/26/installing-mythbuntu-710/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 22:52:43 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mythtv]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/10/26/installing-mythbuntu-710/</guid>
		<description><![CDATA[Mythbuntu is &#8220;an Ubuntu derivative focused upon setting up a standalone MythTV system similar to Knoppmyth or Mythdora&#8221;. The last time I installed MythTV I did it on a standard Ubuntu desktop installation. The problem with this is that as well as ending up with a load of software you don&#8217;t really need you have [...]]]></description>
			<content:encoded><![CDATA[<p>Mythbuntu is &#8220;an Ubuntu derivative focused upon setting up a standalone MythTV system similar to Knoppmyth or Mythdora&#8221;. The last time I installed MythTV I did it on a standard Ubuntu desktop installation. The problem with this is that as well as ending up with a load of software you don&#8217;t really need you have to go through the pain of installing and configuring your TV card, graphics card, remote control and so on. Mythbuntu on the other hand takes care of absolutely everything. I won&#8217;t go into the details of the installation (because it&#8217;s pretty much next, next, next&#8230;) but suffice to say, Mythbuntu makes the whole process extremely simple. There were just two areas I had problems with, configuring XMLTV and configuring my wireless card.</p>
<p>The last time I installed MythTV I had the same problem with XMLTV. I don&#8217;t know if it&#8217;s something that I keep missing but after the installation <code>mythfilldatabase</code> never seems to works properly. The problem is that the XMLTV file containing the list of channels to fetch program information for never gets created. Luckily it&#8217;s easy enough to fix. What you do is take the name of the Video Source you setup in the MythTV Backend Setup program (in my case NTL) and then create a file in the directory <code>$HOME/.mythtv</code> called <code>&amp;lt;video source name&amp;gt;.xmltv</code> (e.g. <code>NTL.xmltv</code> in my case). When I refer to $HOME here I&#8217;m referring to the home directory of the user that you&#8217;re asked to create during the Mythbuntu installation. Within that file you list the XMLTV channel ids you want to retrieve program information for. Here&#8217;s what I have&#8230;</p>
<pre>
channel northern-ireland.bbc1.bbc.co.uk
channel northern-ireland.bbc2.bbc.co.uk
channel channel4.com
channel discoveryeurope.com
channel e4.channel4.com
channel livingtv.co.uk
channel mtv.co.uk
channel paramountcomedy.com
channel rte-1.rte.ie
channel rte2.rte.ie
channel 1.setanta.com
channel sky-news.sky.com
channel sky-one.sky.com
channel tg4.ie
channel tv3.ie
channel utvlive.com
channel nickelodeon.co.uk
</pre>
<p>This is the program listing for NTL&#8217;s analogue network in Dublin. Unfortunately (I suppose) Channel 6 isn&#8217;t available from the Radio Times XMLTV feed.</p>
<p>The second problem I had was configuring my wireless network card. The card I have is a Linksys WMP54G (version 4, PCI id 1814:0201). What I did was follow the instructions on this page <a href="https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper" onclick="javascript:urchinTracker ('/outbound/article/help.ubuntu.com');">https://help.ubuntu.com/community/WifiDocs/Driver/Ndiswrapper</a>. When it comes to installing the windows drivers I used the files from the directory <code>/Drivers/WMP54Gv4/2KXP</code> on the installation CD that I got with the card. At the end of the process the card still wasn&#8217;t working. The problem was that a kernel module shipped with Ubuntu, namely <code>rt2500pci</code>, was getting loaded before (and hence interfering with) the module I wanted to load, i.e. <code>ndiswrapper</code>. To fix the problem I blacklisted <code>rt2500pci</code> and rebooted. The line I added to <code>/etc/modprobe.d/blacklist</code> was <code>blacklist rt2500pci</code>.</p>
<p>That&#8217;s it, a relatively easy install and nowhere near as timeconsuming or complicated as perfoming a MythTV installation from scratch.</p>
<p>P.S. another useful resource if you&#8217;re stuck is <a href="https://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide" onclick="javascript:urchinTracker ('/outbound/article/help.ubuntu.com');">https://help.ubuntu.com/community/WifiDocs/WirelessTroubleShootingGuide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/10/26/installing-mythbuntu-710/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/10/26/installing-mythbuntu-710/</feedburner:origLink></item>
		<item>
		<title>Mashup Camp 5 - Dublin</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/173796099/</link>
		<comments>http://www.17od.com/2007/10/23/mashup-camp-5-dublin/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 12:39:14 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[amazon]]></category>

		<category><![CDATA[dublin]]></category>

		<category><![CDATA[mashup]]></category>

		<category><![CDATA[mashupcamp]]></category>

		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/10/23/mashup-camp-5-dublin/</guid>
		<description><![CDATA[Mashup Camp Dublin is coming up and IBM are running a Business Mashup Challenge.
Amazon&#8217;s Web Services are very appealing so I was thinking of putting together a mashup that shows you the price of a book from each of Amazon&#8217;s international sites in your own local currency and with postage included. Unfortunately (well for me [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mashupcamp.com/" onclick="javascript:urchinTracker ('/outbound/article/www.mashupcamp.com');">Mashup Camp Dublin</a> is coming up and IBM are running a <a href="http://contest.sitapps.net/wiki_web_app/page/show" onclick="javascript:urchinTracker ('/outbound/article/contest.sitapps.net');">Business Mashup Challenge</a>.</p>
<p>Amazon&#8217;s Web Services are very appealing so I was thinking of putting together a mashup that shows you the price of a book from each of Amazon&#8217;s international sites in your own local currency and with postage included. Unfortunately (well for me anyway)  after a bit of searching on <a href="http://www.programmableweb.com" onclick="javascript:urchinTracker ('/outbound/article/www.programmableweb.com');">ProgrammableWeb.com</a> I found that it&#8217;s already been done, <a href="http://www.pricenoia.com" onclick="javascript:urchinTracker ('/outbound/article/www.pricenoia.com');">Pricenoia</a> - and very nicely too.</p>
<p>Anyone got any ideas for a mashup that would be interesting/fun/useful/all three?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/10/23/mashup-camp-5-dublin/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/10/23/mashup-camp-5-dublin/</feedburner:origLink></item>
		<item>
		<title>Meteor WebSMS</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/168059532/</link>
		<comments>http://www.17od.com/2007/10/10/meteor-websms/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 19:01:46 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[irish]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[junit]]></category>

		<category><![CDATA[maven]]></category>

		<category><![CDATA[meteor]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[sms]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/10/10/meteor-websms/</guid>
		<description><![CDATA[As a Java5/JUnit4/Maven2 learning exercise I&#8217;ve written a simple little SMS command line utility called Meteor WebSMS. It allows you to bypass Meteor&#8217;s website and send the free web SMS messages they offer from your command line (you have to be a Meteor customer of course).
The API is completely separate from the the command line [...]]]></description>
			<content:encoded><![CDATA[<p>As a Java5/JUnit4/Maven2 learning exercise I&#8217;ve written a simple little SMS command line utility called <a href="http://www.17od.com/meteor-websms" >Meteor WebSMS</a>. It allows you to bypass <a href="http://www.mymeteor.ie" onclick="javascript:urchinTracker ('/outbound/article/www.mymeteor.ie');">Meteor&#8217;s website</a> and send the free web SMS messages they offer from your command line (you have to be a Meteor customer of course).</p>
<p>The API is completely separate from the the command line tool so it&#8217;s available if you want to use it in your own Java programs. Javadocs are <a href="http://www.17od.com/meteor-websms/apidocs/index.html" >here</a>.</p>
<p>Since this is a learning exercise full source code and Maven pom.xml are included in the distribution. The URL is <a href="http://www.17od.com/meteor-websms" >http://www.17od.com/meteor-websms</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/10/10/meteor-websms/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/10/10/meteor-websms/</feedburner:origLink></item>
		<item>
		<title>Comparing Maven to Ant</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/149779016/</link>
		<comments>http://www.17od.com/2007/08/29/comparing-maven-to-ant/#comments</comments>
		<pubDate>Wed, 29 Aug 2007 19:56:38 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ant]]></category>

		<category><![CDATA[maven]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/08/29/comparing-maven-to-ant/</guid>
		<description><![CDATA[Maven is one of them tools that I always felt I should be using but for some reason I could never quite get into it. over the years I&#8217;ve made several attempts at reading their getting started guide but for some reason I was never really able to grasp what it was that made it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://maven.apache.org/guides/"title="Maven"  onclick="javascript:urchinTracker ('/outbound/article/maven.apache.org');">Maven</a> is one of them tools that I always felt I should be using but for some reason I could never quite get into it. over the years I&#8217;ve made several attempts at reading their <a href="http://maven.apache.org/guides/getting-started/index.html"title="getting started"  onclick="javascript:urchinTracker ('/outbound/article/maven.apache.org');">getting started</a> guide but for some reason I was never really able to grasp what it was that made it better or more worthwhile than <a href="http://ant.apache.org/"title="Ant"  onclick="javascript:urchinTracker ('/outbound/article/ant.apache.org');">Ant</a>.</p>
<p>The itch finally got to me again the other day so I had another go at it. This time round everything seemed to make much more sense. I don&#8217;t know weather it was because the documentation was more complete or because I was more familiar with the problems it was trying to solve but either way it seems be to finally starting to sink in.</p>
<p>The first feature I read about was the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html"title="Standard Directory Structure"  onclick="javascript:urchinTracker ('/outbound/article/maven.apache.org');">Standard Directory Structure</a>. How many times have you created an Ant build file with the same targets again and again, i.e. clean, compile, test, jar, etc? Maven takes the very sensible approach that if you have the same directory structure for each of your projects then why bother with a build file at all. By accepting Maven&#8217;s Standard Directory Structure (which is pretty much your average project directory structure) it will automatically give you all these standard targets (or goals as Maven calls them).</p>
<p>The next feature that caught my attention was the default inclusion of resources. Resources here are things like properties files, basically anything that isn&#8217;t a JAR file. In the Ant world you&#8217;d normally keep these in your src folder and then copy then over to your build folder as part of the compile target. Well in Maven the Standard Directory Structure saves you having to do any extra configuration. All you need to do is drop your resource files into a special &#8220;resources&#8221; directory alongside your source code directory. The contents of this directory will be automatically included in any classpath or JAR file that&#8217;s created during the development cycle.</p>
<p>One of the Maven&#8217;s biggest features is it&#8217;s ability to automatically import external dependencies (JAR files) into your project. I&#8217;ve always questioned the logic of including or not including JAR files within a project&#8217;s source control system. One part of says that source control is for source only and that external dependencies don&#8217;t change so they shouldn&#8217;t go into source control. Over the past few years though the realist in me has come to appreciate the simplicity of using source control to hold JAR files as well. You don&#8217;t need to give each developer instructions on where to go to get all the dependent JAR files (and risk the introduction of incorrect versions). Maven&#8217;s solution to this problem gives you the best of both worlds. Basically, rather than including your JAR files in source control you just tell Maven what JAR files your project depends on. This is done in a file called pom.xml (Project Object Model). It&#8217;s like a build.xml file but really it&#8217;s more of a description of your project that Maven can use to carry out it&#8217;s goals. When you run Maven it will automatically go to a given URL (http://www.ibiblio.org/maven2 by default), download all the JAR files your project needs and include them in your classpath. It&#8217;s that simple. Oh and it caches the JARs locally so the next time you run Maven on your project it won&#8217;t have to download them again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/08/29/comparing-maven-to-ant/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/08/29/comparing-maven-to-ant/</feedburner:origLink></item>
		<item>
		<title>Binary Marble Adding Machine</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/128440967/</link>
		<comments>http://www.17od.com/2007/06/27/binary-marble-adding-machine/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 19:39:46 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[gadget]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[woodwork]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/06/27/binary-marble-adding-machine/</guid>
		<description><![CDATA[Just came across this amazing marble adding machine today. It&#8217;s so simple it&#8217;s beautiful. I loved woodwork and engineering in school. Seeing this makes me want to make something. Full details of it&#8217;s construction can be found here.

]]></description>
			<content:encoded><![CDATA[<p>Just came across this amazing marble adding machine today. It&#8217;s so simple it&#8217;s beautiful. I loved woodwork and engineering in school. Seeing this makes me want to make something. Full details of it&#8217;s construction can be found <a href="http://www.woodgears.ca/marbleadd/index.html" onclick="javascript:urchinTracker ('/outbound/article/www.woodgears.ca');">here</a>.</p>
<p><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/GcDshWmhF4A"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/GcDshWmhF4A" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/06/27/binary-marble-adding-machine/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/06/27/binary-marble-adding-machine/</feedburner:origLink></item>
		<item>
		<title>Interview with Hans Reiser</title>
		<link>http://feeds.feedburner.com/~r/AdrianSmithsBlog/~3/128104560/</link>
		<comments>http://www.17od.com/2007/06/26/interview-with-hans-reiser/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 15:57:11 +0000</pubDate>
		<dc:creator>Adrian</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[interview]]></category>

		<guid isPermaLink="false">http://www.17od.com/2007/06/26/interview-with-hans-reiser/</guid>
		<description><![CDATA[There&#8217;s a really good article over on Wired with Hans Reiser, the fella behind ReiserFS (a very populate linux filesystem).
Basically his estranged wife, Nina Reiser, went missing a few years back. Following an investigation some overwhelming evidence was found that would seem to suggest he murdered her. His defense is that his ex-wife framed him, [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a really good <a href="http://www.wired.com/techbiz/people/magazine/15-07/ff_hansreiser" onclick="javascript:urchinTracker ('/outbound/article/www.wired.com');">article</a> over on <a href="http://www.wired.com/" onclick="javascript:urchinTracker ('/outbound/article/www.wired.com');">Wired</a> with <a href="http://en.wikipedia.org/wiki/Hans_Reiser" onclick="javascript:urchinTracker ('/outbound/article/en.wikipedia.org');">Hans Reiser</a>, the fella behind <a href="http://www.namesys.com/" onclick="javascript:urchinTracker ('/outbound/article/www.namesys.com');">ReiserFS</a> (a very populate linux filesystem).</p>
<p>Basically his estranged wife, Nina Reiser, went missing a few years back. Following an investigation some overwhelming evidence was found that would seem to suggest he murdered her. His defense is that his ex-wife framed him, embezzled his company&#8217;s money and then fled back to Russia. On top of this he seems to be trying to get a sort of geek defense behind him because he claims that society today hates people like him, i.e. geeks with strange ideas who spend their time playing violent video games.</p>
<p>There&#8217;s no doubt he&#8217;s a strange character but from the sounds of his best friend and wife he&#8217;s in good company.</p>
<p>It&#8217;ll be interesting to see how this story pans out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.17od.com/2007/06/26/interview-with-hans-reiser/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.17od.com/2007/06/26/interview-with-hans-reiser/</feedburner:origLink></item>
	</channel>
</rss>
