The AADL Developer's Blog. Technical info about what new features we're working on, releasing, and playing with.

Drupal Development Tricks

Last week I was privileged to attend the drupal4lib camp at Darien Library. I was prepared to give a lightning talk on my development environment for drupal but we ran out of time. I thought I'd share a couple of tricks I've found here. Nothing earth shattering, but they've become very helpful to me in my day-to-day code monkeying.

1) Use SSHFS to access remote files

Greetsaver Update

GreetsaverQC
As requested by superpatron Ed Vielmetti, here's a fresh link to the latest and greatest version of our "GreetSaver", which welcomes patrons and visitors to various locations of the Library.

This should work on any Mac running OSX Leopard, but there's a bit of additional configuration that must be done. You need to subscribe to the AADL video podcast, and you need to put some awesome library pictures into a new folder called "GreetPics" inside your Pictures folder (~/Pictures/GreetPics for you terminal geeks out there).

*UPDATE* I forgot I used a custom patch to grab the video files on the welcome page. If you want them to show up follow these instructions:

  1. Download the latest Folder Movies patch from Kineme: http://kineme.net/QuartzComposerPatches/FolderMoviesPatch
  2. Create a new folder in /Library/Graphics called "Quartz Composer Patches" (there should already be a folder there called "Quartz Composer Plug-Ins", don't use that folder)
  3. Copy the FolderMoviesPatch.plugin file into this new folder "Quartz Composer Patches"

This should make a random movie from the AADL video podcast display on the welcome screen.

Enjoy, and throw me a note if you have questions or want to mash it up.

You want to Ubuntu?

I'm sure many of you have seen Jessamyn's awesome video installing Ubuntu on a couple of donated library PCs. I made the switch to Ubuntu for my primary desktop workstation here at AADL after we had a windows virus get loose on our network and I was fed up. I never looked back, even after the virus was summarily squashed.

If you're looking to jump into or even experiment with Ubuntu, this week might be the time to go for it. The latest version of Ubuntu, code named Hardy Heron, is scheduled to be released April 24. Ubuntu releases new major versions about every 6 months, but only once every two years do they label a release as Long Term Support (LTS), which means it will be supported for 3 years for the desktop (5 years for the server edition). The last LTS release was code named Dapper Drake, released in 2006. This version also includes tools that makes it even easier to try Ubuntu, letting you install it like an application inside Windows to try it out.

Ubuntu 8.04 Long Term Support (LTS) provides a stable platform for software and hardware vendors, developers and users. With three years of support and maintenance on the desktop, 8.04 LTS is a great choice for large-scale deployment. A substantial and growing ecosystem of free and commercial software built for Ubuntu provides a rich set of choices for desktop users. This is the eighth desktop release of Ubuntu. Ubuntu's track record in delivering - on a precise schedule every six months - a commercial operating system that is free, stable, secure and fully supported, remains unique. (read more...)

Specific to my geekly duties at AADL, here are some of the applications I use on Ubuntu:

  • Gimp: Great image editor, perfect for quick crops and resizes as well as multi-layer intensive editing. (included in Ubuntu)
  • Firefox: not only works with flash, but all the great Firefox plugins like Adblock plus, firebug, and greasemonkey. (note Firefox 3 beta 5 is included in Hardy)
  • OpenOffice: able to open and edit MS Office docs, still a necessity in this day. (included in Ubuntu)
  • Komodo Edit: a free PHP editor with code completion and syntax highlighting. (Download linux version here).
  • VMWare Server: I've been unable to find a email client that can establish a consistent and stable connection with our Exchange server for email, so I installed XP and Outlook2003 in a virtual machine in VMWare Server. Also nice when I need to test something in Internet Explorer or another Windows-only app. (Download linux version here)
  • Flex Builder: Adobe has an alpha of their Eclipse-based Flex editor for linux. Unfortunately it doesn't include the Design view, but the code completion and compiler work just right. (Install info here)
  • Innovative Millennium: Yes, because the Millennium client is Java based, it works just as well on Linux as any other platform. (download from csdirect)

So give Ubuntu a shot. You might never look back.

PHP Class Notes

Below is the sample code I created during a PHP class on Tuesday. I'm planning to cover storing and retrieving data from MySQL on Thursday, plus some more practical examples of web applications. If you have any questions or suggestions, log in and comment or send me an email.

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
    <form action="test.php" method="post">
    First Name:  <input type="text" name="first" /><br />
    Last Name: <input type="text" name="last" /><br />
    <input type="submit" name="submit" value="Submit me!" />
		</form>
        <?php
        echo "<p>" . date('l dS \of F Y h:i:s A', time()) . "</p>";
        
        if ($_POST)
        {
        	$first_name = $_POST['first'];
        	$last_name = $_POST['last'];
        
        	if ($first_name == "Eric")
        	{
        		echo "Authorized User: ";
        	}
        	else
        	{
        		echo "Unauthorized User: ";
        	}
        	echo $first_name . " " . $last_name ;
        
        	echo "<pre>";
        	var_dump($_POST);
        	echo "</pre>";
        
        	echo "<table border=1>";
        	foreach($numbers as $number)
        	{
        		echo "<tr><td>" . $number . "</td></tr>";
        	}
        	echo "</table>";
        }
        ?>
    </body>
</html>

Events, Twitter and iCal

We recently redid the backend for out events here at AADL. While you probably haven't seen many changes on the public site, we now have the backbone that will allow us to create all kinds of cool things and improved events. Online registration, My Events, reminders. All kinds of things will be possible.

Twitter

To test out the new system we made a few quick applications to take advantage of it. The first is a Twitter feed at http://twitter.com/aadl which gives announcements of events 30 minutes before they begin, among other things. Within a couple days there was already over a dozen followers. The twitter feed utilizes a PHP5 class that can be found at http://groups.google.com/group/twitter-development-talk/files which was coupled with a few simple calls to our events API. With our class and the Twitter class it took very little time to get up an running. A cron takes care of the rest.

iCal

Another big feature is iCal feeds that can be subscribed to for out events. This is still under active development so you may experience some occasional issues. Feel free to comment if you have any suggestions or problems. Here are the URLs currently available. I'll update the list as I add them. Only the Exhibits feed shows exhibits until I can fix some of the all day events so they don't clutter up your calendar.

  • All Events : http://api.aadl.org/ical/all
  • Exhibits: http://api.aadl.org/ical/exhibits
  • Downtown Events: http://api.aadl.org/ical/all/downtown
  • Malletts Events: http://api.aadl.org/ical/all/malletts
  • Pittsfield Events: http://api.aadl.org/ical/all/pittsfield
  • West Events: http://api.aadl.org/ical/all/west
  • Northeast Events: http://api.aadl.org/ical/all/northeast

To get events for a specific keyword you can do the following (replace keyword with your word of choice)

http://api.aadl.org/ical/search/keyword

Again, send any comments, suggestions or problems. Once the iCal becomes more stable you should see easy links on out website.

Showcasing Video Content

A number of our locations include large screens near the entrance which run a screensaver we have dubbed the Greetsaver. It displays information about the library, upcoming events, new and popular books and more. I am currently enhancing the Greetsaver we use for the purpose of a new launch in time for our new Traverwood Branch opening, but hopefully much sooner.

In the current version of the Greetsaver, the welcome screen has a static movie displayed along the bottom. It's nice to show video, but it's the same one every single day. As I was wondering about how to pick one video to use in each location, I thought of our new Video-on-Demand page, and if I could use it in the Screen Saver. Thanks to our video podcast functionality, I was able to do just that. Now we have dynamic, automatically updated video content on display at every location where we have a screen.

Ann Arbor Cooks: behind the project

Now that the Ann Arbor Cooks project has been officially launched, I thought I would post a wrap up some of the cool pieces of the project.

As discussed before, I created a new custom node type to store the recipe data. This was an ideal solution because it allowed us to use drupal's existing security and content creation functionality. Plus, tags, categories, and comments are a snap!

Implementing Drupal Presentation at Google

A presentation that might interest those who are looking at Drupal. As many probably know, Drupal is what powers the AADL site.

Geoff Butterfield, Senior Technical Producer at The George Lucas Educational Foundation, and Angie Byron of Lullabot will talk aboout Drupal development and implementation.

Creating custom content types in Drupal

While working on an upcoming feature on the site, I faced an initial dilemma: How do I want to store the custom content? I'm creating a system that will manage multiple records of content which contain more information than a standard drupal page or story node would provide. But I'd love to be able to use the established drupal functionality for creating, editing, tagging and protecting content.

The solution? Create my own custom node type. I found this article on drupal.org very helpful. (Note: this is written for drupal 4.7, which is a generation behind the latest release. So check out this article if you're using drupal 5.)

The best part is that I can add a new "free tagging" vocabulary that applies only to this new custom content type, and it uses drupal's built in AJAX suggesting auto complete on the tags already applied in that vocabulary.

Gaming in Libraries? Definitely.

Eli talking trash

While AADL has had gaming for some time it still remains just a possibility for most libraries. However, interest is growing and this year even ALA put on a Gaming, Libraries and Learning Symposium featuring non-other then our own Eli. You can listen to his talk about choosing games for your library here.

Syndicate content