Press enter after choosing selection

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

Graphic for events post

Blog Post

Ann Arbor's community images

by jaimonr

Have you ever wanted to start a local digital image archive, so that all your library images are stored locally on your library servers? Gallery 2 might be the solution you are looking for.

Gallery works in two ways embedded with your CMS or as a single installation. Gallery's ability to seamlessly match the look and feel of our web site made it an ideal choice for integration with drupal. Here is a list of available integrations with other CMSs.

This infrastructure of a CMS and embedded image database has made it possible for AADL to create community partnerships and to host digital images. Last month four new historical wall displays were unveiled for the Downtown A2 Historical Street Exhibit Program.

Check Gallery and the four wall panels in our CMS.

WALL DISPLAY 1: Ann Arbor’s African American Community
WALL DISPLAY 2: A Changing Neighborhood
WALL DISPLAY 3: Between Downtown and the Railroad
WALL DISPLAY 4: Industry on Detroit Street

Graphic for events post

Blog Post

Certifiable

by ejk

Image removed.
As part of the php|tek conference I attended in May, I took the Zend PHP Certification test. To be honest, taking a multiple-choice, closed book test on a subject that I was used to dealing with on a freedom-of-design, open-reference basis was a little unnerving. I thought I had done well, but I had no idea where the passing mark would be.

As you can see, I passed. While I have a degree in Computer Science, my knowledge of PHP has been entirely self-taught, so it's nice to have some independent confirmation that I do indeed know how to program in PHP. Now if I could just figure out what to do with this big honkin' sticker.

Graphic for events post

Blog Post

Server Names

by eby

racks

Some people probably have interest in the naming schemes of servers and computers. There was a thread not too long ago on a library server discussing the various names. Here's a small sample of ours:

  • Bilbo
  • Frodo
  • Sauron
  • Pippin
  • Magwitch
  • Murkworks
  • Lutefisk
  • Borfin

And many more. Do you recognize all the names? The first four should be easy.

Graphic for events post

Blog Post

Playing with Flex

by ejk

We have quite a few in-house applications written in Adobe (formerly Macromedia) Flash. It's an easy way to layout your GUI and build dynamic animations. Another plus is the ability to run it on multiple platforms.

But Flash is intended as an animation tool: you layout graphical elements on a timeline for movements and transitions. You can then go to keyframes in the timeline and attach ActionScript code to them in order to do your programming logic. This model is sufficient for development and deployment, but it becomes a little troublesome to maintain. There is no easy way to search the ActionScript code that has been attached to the different objects in the timeline. Say you need to correct the logic surrounding all the calls to your updateWidget() function. You have to manually navigate through the timeline, searching over the bits of code until you find what you're looking for, and basically cross your fingers that you've corrected them all.

Graphic for events post

Blog Post

Library Card Renewal Alerts: a sonnet

by glenmodell

A tragedy! Your AADL card
Has now expired, and you must renew.
Just keeping track of all this stuff is hard,
And each new thing is one more thing to do.

But now, we send alerts out in advance,
One month before, by e-mail, as you'll see;
While III's Createlist does its dance,
The work is mostly done in PHP.

So now, you need remember one thing less,
Which hopefully will ease life's angst; and so,
If you decide this service (as we guess)
Is helpful, please feel free to let us know.

For those who travel Innovative's road:
The Clearinghouse is where I've put the code.

*****************************************

(P.S. If you are not with Triple-I,
You cannot use the Clearinghouse, you know;
And therefore, should you find you'd like to try
These card alerts, I've placed the code below.)

Graphic for events post

Blog Post

IRC For Staff Communication

by eby

With multiple branches, buildings and tech support that can often be anywhere working on problems, there is a need for an easy way of communication.

At AADL this is currently an inhouse IRC server with channels for various groups of staff. A webclient is provided for those who only have a browser or need an easy way to sign on. This allows staff to have easy communication with each other with a low barrier. Here's some of the things I've seen:

  • Troubleshooting problems with phone lines (can't reach branch, multiple people test)
  • Help with patron questions
  • Sharing knowledge about library events and information

There is also a bot that announces when helpdesk issues are reporting (allowing staff to know the problem is happening) and gives some utilities for looking up information on various in-house things.

Granted IRC may be a bit more infrastructure that some care to install, but there are other options. A library may look into using Meebo rooms or Campfire. While IM and Email serve their purposes, there is something about a "chat room" or channel that gives a kind of continuing converstation and immediacy that breaks down the distance between locations. Suddenly everyone is connected.

Some other tips include having people append their location such as the branch to their name. I would be Eby[ne] if I was at the Northeast branch. This allows others in the room to know who exactly is present and who to send any specific questions to. I also use [d] for desk and [h] for home (since we work from all over).

Regardless what option you choose if you have multiple locations think about different ways they can communicate in real time. I hadn't thought of it before but now that I see it in use I think it makes a huge difference.

Graphic for events post

Blog Post

Summer Reading Registration... What's new!

by jaimonr

It's that time of the year when all flock to the library for Summer Reading sign-up. Last year we had over 8000 participants including youth, teens and adults.

This year we bring the sign-up form to you to sign-up from home. The Summer Reading form was build using drupal's new form API. If you want to get a jump start I would suggest the "quickstart guide", which is awesome with little code snippets and examples.

Here is how the form works. The name of the from is the $form_id and to build the form drupal looks for a function with the same name. In this case the $form id is sumreading_form. Here is an example:


function sumreading_form() { 
  $form['last_name'] = array(
     '#type' => 'textfield',
     '#title' => t('Last name'),
      );                 
  $form['first_name'] = array(
     '#type' => 'textfield',
     '#title' => t('First name'),
     );
  $form['submit'] = array (
     '#type' => 'submit',
     '#value' => t('Save Registration'),
     );
  return drupal_get_form('sumreading_form', $form);
}

There are two fields in the form that is required. The phone number and the game type. Drupal has a wonderful way of validating its forms. So we need two more functions to validate and submit. Don't forget the $form_id for the validating function...


function sumreading_form_validate($form_id, $form_values) {
  if ($form_values['phone'] == '') {
    form_set_error('', t('You must enter a phone number.'));
  }
   if ($form_values['type'] == '') {
    form_set_error('', t('Please specify a type of Youth Listeners, Youth Readers, Teen OR Adult'));
  }
}

form_set_error(,) will display the form back with the user input that was just typed in and displays the specified error. So, if you forget to put a phone number on your form an error would show up with the words "You must enter a phone number".

Now we finally submit the form. The form will only submit if there are no errors returned.


function sumreading_form_submit($form_id, $form_values) {
       db_query("INSERT INTO {table} VALUES (last_name, first_name)", $form_values['last_name'], $form_values['first_name']);
       drupal_set_message(t('Your registration is successfully saved'));
       drupal_goto('services/read');
}

If there are no return values, the form refreshes and gives you a fresh form to fill in another participant.

Graphic for events post

Blog Post

My 7 Favorite Sessions from php|tek

by ejk

In May, I was lucky enough to attend the php|tek conference in Chicago. I met some really cool people, took a crash course on Zend Certification, and learned a lot about security, optimization, and new technologies. Here's a list of my five six SEVEN favorite sessions that I attended during the week (I had to add a couple from my original plan):

7. Opening Keynote : Rasmus Lerdorf "PHP on Hormones"

The conference was started off with a bang as the "father" of PHP, Rasmus Lerdorf, gave the opening keynote. Rasmus gave some of the history of PHP, which started as a pet project. He talked about how to get people to contribute to open source projects, how to tweak performance, security issues and APIs. He even used drupal as his example for testing performance (hint: turn on drupal caching!). Great talk and a great way to get the Oxytocin flowing!

6. Microsoft Tools and Platforms for PHP : Joe Stagner

Joe is a pretty cool guy and I thought he was brave just to stand up in front of the entire conference and represent Microsoft. He's on a couple of their development teams and made some points about how Windows is relevant in the PHP world, as a development platform (even if not as the server). He also talked quite a bit about Silverlight, Microsoft's new browser plug-in that promises cross-platform Media and Rich Internet Application delivery. You may even be able to write client-side Silverlight code in PHP someday.

5. PHP Data Objects (PDO) : Wez Furlong

Wez wrote the PDO library. I hadn't heard of it before the conference, but every PHP developer should know about it. It's an improved data access library that is faster, and more secure than the regular DB functions in PHP. It's so good that it's included in the standard install of PHP as of PHP 5.1. There's a ton of stuff that it can do, but rather than list them all here, I'll let you read about it in the official docs. The short answer is: use PDO for your database access.

4. The Truth About Sessions : Chris Shiflett

I was already familiar with Chris's work before the conference, having found his blog as a great resource for PHP security issues. It was great to see him in person, I attended both of his talks. This one gave a great overview and security details about Sessions-- why thy exist, what they do, how to use them and how to avoid session security problems. Being sloppy in your PHP not only can compromise your site's security, it can compromise the security of your users on other sites, as well.

3. Top 15 Ways to Kill MySQL Performance : Jay Pipes

Jay is a very enthusiastic and knowledgeable presence. He had tons of cool things to share about how MySQL works, and shared some tips that can make a huge difference in the performance of your PHP app. He talked about the difference between Heavy-read vs. Heavy-write environments, choosing the right data types for indexing, persistent connections (and why NOT to use them), writing SQL to optimize the query cache... and more. Making a 1 MS optimization in your PHP algorithm doesn't help when your DB is thrashing through bad queries at 5 seconds apiece.

2. Dude, Where's My Used Car? : Adam Trachtenberg

Did you know that over 50% of the listings on Ebay are generated through their API, no the standard web interface? Adam's title is "eBay Platform Evangelist." He showed off his mashup that allows you to find Ebay's used car listings in your area that meet your criteria. He talked about AJAX, the Dojo toolkit, and SOAP. Ebay has a very rich API that exposes a lot of functionality and this mashup is an inspiration to create similar projects.

1. PHP Features You Didn't Know Existed : Eli White III

Eli's presentation was the most fun of the whole conference. Eli is the "PHP Hacker" at digg, and he showed us some really fun functions hidden in the PHP libraries, such as pspell functions, levenshtein(), similar_text(), metaphone(), and soundex().

He also gave insights as to how script execution can be tweaked and handled outside of standard behavior. Eli really knows his stuff, and it was a pleasure to hear his picks.

AADL Open-Source Software

We do quite a bit of software development at AADL, and some of the work we've done may be of interest or use to other libraries. Our website is powered by the completely awesome open-source CMS Drupal, and much of our development takes the form of drupal modules. We also run Innovative Millennium (Triple-I), so many of our drupal modules use shared code libraries or PHP classes that we've developed to interface with our III server. Here are several tools you may be interested in, especially if you've got PHP experience or are running III.

These files are all released under the GNU Public License, so they're yours to use and remix however you'd like, but use must be attributed, and resultant works cannot be sold. Also, feel free to if you have questions about these projects, but please understand that we cannot provide tech support for this software.

Thanks for your interest, and enjoy!

  • III-PatronAPI: This is a PHP script that interfaces with III's optional web-based PatronAPI module and makes that data more easily available to PHP projects.
  • III-XMLOPAC: This is a PHP5 Class that uses III's XMLOPAC to return a bib record as a PHP array when passed the bib number.
  • SOPAC & Middleware source code: SOPAC is what we call our social features on our public catalog. It includes the ability to add ratings, reviews, and tags to items in the catalog and integrates with our drupal patron account module.
  • PatREST Documentation: PatREST is a RESTful interface to information about your account, protected by a hashed token for security.
  • azImgSrc: a PHP script that retrieves an ASIN for a III Bib # then caches the cover art for that ASIN in a MySQL database.
  • iii-vcards: a PHP script that creates virtual card catalog cards with the option to display marginalia.
  • ISBN tool: A set of functions that help manage 10 and 13 digit ISBN numbers.
  • Term Lib: A PHP class for automating terminal commands, contains a sample function for setting a PIN in Millennium.
  • Quartz Composer files - screen savers that access and display circulation data for Mac OS X.