Gregor Purdy - Software - Platen - Version 0.1

Home : Gregor : Software : Platen : Version 0.1

Java Classes for working with a Movable Type 2.63 MySQL database


Do you have a Movable Type blog? Do you wish you had the ability to write your own software to work with your data? Would you like to migrate away from the Perl- and filesystem- based Movable Type software, and generate the HTML for the pages of your blog on the fly, possibly using technologies like Cocoon?

If you answered "yes" to any of the above questions, then Platen may be of interest to you. At this time, Platen is very simple, and just a proof of concept for using Hibernate to access a MySQL database backend for a Movable Type blog with Java. But, the intent is to eventually be able to write an alternative front-end to that database so it is not necessary to use the Perl-based Movable Type software to render the blog web pages.

Read some history:

Get the right software:

  1. Download and install JRE 1.4.1 or newer.
  2. Download and install Eclipse 3.0.
  3. Download and install the MySQL Connector/J (JDBC) driver 3.0.
  4. Download and install Hibernate 2.1.
  5. Download and install Hibernate Synchronizer.

There is an O'Reilly Network articleabout working with Hibernate in Eclipse that talks about Hibernate Synchronizer. It refers to the version for Eclipse 2.1, but it is interesting reading nonetheless:

Configure the Platen development environment:

  1. Determine the values for the following configuration variables, which you will need to use in the next three steps:
         Variable    Example      Description
         ----------  -----------  ------------------------------------------------
         {host}      crimson      Name of the computer serving the MySQL database
         {port}      3306         Port on which MySQL is listening for connections
         {database}  movabletype  MySQL database name
         {user}      movabletype  MySQL user to log into the database as
         {password}  foobarsplee  Password for {user} and {database} on {host} and
                                  {port}
         {author}    1            A value to match mt_author.author_id in the
                                  database.
         {blog}      2            A value to match mt_blog.blog_id in the database.
         {entry}     3            A value to match mt_entry.entry_id in the database.
    
  2. Make a copy of the .hibernateSynchronizer.tmpl file, naming it .hibernateSynchronizer, and making the above variable replacements.
  3. Make a copy of the src/hibernate.cfg.xml.tmpl file, naming it src/hibernate.cfg.xml, and making the above variable replacements.
  4. Make a copy of the src/TestIt.properties.tmpl file, naming it src/TestIt.properties, and making the above variable replacements.
    NOTE: You'll need to symlink bin/TestIt.properties to this file (or make a copy of it in bin) for it to be found at run time.

Fire up Eclipse and have some fun!

NOTE: You may have to tinker with the project properties' build path since it is likely you've installed the above software in locations other than those used in my setup. And, the MySQL ODBC driver is likely a different point release than I'm using. I could *really* use some help from a Java / Eclipse person to get this stuff set up to be easier for someone to just download and start playing...

And, don't forget to contribute your enhancements back to the project.

LICENSE

Platen is subject to the GNU General Public License (GPL):

    Platen is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Platen is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Platen; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

: 2005-12-03 16:31:39 -0800 (Sat, 03 Dec 2005) $