Showing posts with label WebMedia. Show all posts

Clause after Clause #

This past week I was lent out as a contractor to The Davies Project, a Harold Shapiro venture that focuses on the history of US libraries. The part that I worked on involved putting online about 10,000 cards that described U.S. libraries prior to 1876 (apparently a banner year in terms of library information, everything before that date is very murky). The most important thing was having a decent query interface, so that would-be researchers could use to find whatever esoteric information was needed.

The end result was this query page. Initially, all that I had was the "Basic" interface. This has two disadvantages: it was rather intimidating for the user to see all those fields at once, and it didn't support the same field being used twice (e.g. to specify a date range). Therefore, inspired by the Mail.app and Finder rule/search UI, I came up with the "Advanced" tab.

To actually implement the UI, I used some very basic DOM objects and methods. The entire query form is a table, and each new clause is a row. The complete solution is in fact not pure DOM, in that the controls are not generated by creating additional DOM elements, rather the innerHTML of the respective cells is set to whatever is appropriate. This makes swapping the contents of the middle row very easy, since I don't have to destroy/create nodes, I can just replace the contents.

To keep track of the various clauses, no parallel array is needed. Rather, upon form submission, the table is walked and the values of the various form controls are extracted (controls of the same type have the same name attribute, making them easy to find). This is used to generate a custom SQL WHERE clause that is then passed on to DBToolbox.

This cushy part of this project was the requirement that it only had to work with IE 6. Firebird was use for some sanity checking (and better JavaScript error reporting), but the site isn't guaranteed to work with other browsers. Maybe after my thesis is due I can do better.

Un-perfect #

Just map image tweaking today. Added a couple of new buildings, and then spent a lot of time cleaning up the text that had been used to label buildings for the past 7+ years. Of course, the irony of all this is that Facilities actually has a very up to date map (i.e. it was last modified on 1/16/2003), in PDF form, all digitized. It's cases like this that make me realize why Arlo is such a perfectionist with his own projects.

Building Things For Myself #

Finished up the map administrator over the past few days, it now handles adding/removing of buildings/departments too. I also made a cool link checking page that verifies all of the department URLs by looking at status codes (not just 404's, but also 301/302 (moved)) and things like META refresh tags (again for sites that have moved) and displays everything in a nice graphical color-coded list. Spent the afternoon fixing 70 or so broken links, and realized that it's sort of fun to use your own tool and have it work exactly as you intended (minus the minor bugs that I fixed as I went along).

LDAP-ulous #

Bit of work today, added LDAP-based authentication to the admin script, and made it so that a backup file is created every single time a change is made, instead of once per day.

Build Me Up... #

Stats project was thankfully put off by boss. Started work on web interface to campus map administration. Delete buildings file by mistake. Twice. Had to sheepishly ask boss to restore from backups each time. Have viewer and editor of buildings done (but with no add/removing or rebuilding of databases).

'And on the left, we have "Parparita Hall"' #

Map admin project is nastier than I thought. The framework I'm working on is terrible, but I can't change it since it's a stopgap measure (supposedly at some point the facilities people will get off their asses and use the data they already have). Right now it works with three text files which are imported into a MySQL database, which is then used as the backend of the map script. Why not work with MySQL directly, I don't know. And then there's gems like having URLs for departments in a completely separate file, even though they could be just another field in the departments one. Anyway, it's mostly done, all that's left is adding/removing, but given that I have editing working, this shouldn't be that hard.

Edwards was "Parparita Hall" and the stadium was Jiang Stadium for a few minutes today. Tempting to do more since I'm logged into hulk :p

Quickies Rock #

Whipped up quickie script to restrict number of analog instances allowed to be running on web server. Started to look into stats project, but specs are so vague I have no idea where to begin.