sitemap deployed

I’ve deployed my web site map. This is the result of the work discussed in my post on Using Wt (C++ Web Toolkit) for a web site map. The original application mentioned in that post can now run as a WidgetSet application, and is now embedded in my php page wrappers.

I’m starting to think that it’d be nice to play with replacing my search page with a Wt application. Not because there’s anything wrong with the existing search, but because I’d like to free myself from maintaining the javascript. The javascript for my search page isn’t large nor terrible since I’m using jQuery, but replacing it with Wt would permit graceful degradation. And while javascript is handy, I’m still a non-expert in it.

Using Wt (C++ Web Toolkit) for a web site map

It had been many years since I had looked at Wt, a C++ library for developing interactive web applications. Last weekend, I started using it again for a simple site map that’s automatically generated so I don’t have to manually update the map.

The first pass resulted in sitemap. I’m using a TreeView with Wt::WStandardItem objects.

The sitemap application initially generated the TreeView on the fly by traversing the filesystem under my document root, using my existing SiteIndexConfig class (used by my menu generators and my site indexer) for configuration. I knew from the start that this wouldn’t work for deployment, since it’d be too slow with all of the content from my old web server. But I already had classes to traverse the filesystem and pluck out web pages, find their titles (already stored in Xapian by my indexer), etc. It worked for a throwaway prototype.

I then wrote a new application to generate the data for sitemap, which I named (with no originality) mksitemap. It dumps a small binary file from a class named Dwm::WWW:DirectoryTree (derived from Dwm::DirectoryEntry), which can be directly read to populate a Dwm::WWW::SiteMap::DirectoryTree. From the instance of Dwm::WWW::SiteMap::DirectoryTree, I directly create Wt::WStandardItem objects for the Wt::TreeView.

The sitemap application itself is fairly small in terms of lines-of-code:


dwm@www2:/home/dwm/src/dwm/www/apps/sitemap% mcloc .
54 ./DwmWWWSiteMapApp.cc
22 ./DwmWWWSiteMapApp.hh
43 ./DwmWWWSiteMapDirectoryTree.cc
28 ./DwmWWWSiteMapDirectoryTree.hh
20 ./sitemap.cc
167 TOTAL

Obviously this isn’t counting the more general-purpose classes used by sitemap:


dwm@www2:/home/dwm/src/dwm/www/classes% mcloc src include
14 include/DwmWWW.hh
27 include/DwmWWWDirectoryTree.hh
41 include/DwmWWWSiteIndexConfig.hh
17 include/DwmWWWUtils.hh
97 src/DwmWWWDirectoryTree.cc
243 src/DwmWWWSiteIndexConfig.ll
130 src/DwmWWWUtils.cc
569 TOTAL

I’m not going to count the lines of code from libDwm; it’s a significant library, I’m only using a small part of it in this application, and it’s no effort to use it since I’ve been working on it for a decade. I’m using the Dwm::IO templates, the Dwm::SysLogger class, the Dwm::StringUtils templates, the Dwm::DirectoryEntry class and the Dwm::Signal class since I’m running under mod_fastcgi.

web-based bug tracking for the solo developer

It’s more than a little disappointing that there isn’t a clear winner in this space for the solo developer that wants to host their own bug reporting system, project tracking, various agile enablers, etc. Some of them look nice but wind up being huge resource consumers (Jira consumes 1G of RAM right out of the gate), some are getting crusty (Trac), some have little to no SCM integration, etc.

I’ve installed bugzilla and applied a whole bunch of CSS, but I’m not thrilled with using it. It’s more than I need on some fronts but less than I need on others, the HTML is inconsistent which makes it more work to style or process with javascript, etc. But it works; we’ll see how long I keep it.

Creating new Subversion repository part 1

In order to retire my old CVS and Subversion server, I need to migrate everything to my new web server.  In the process, I intend to migrate the old code in CVS to Subversion.

I installed Subversion 1.6.15 from ports on all of my FreeBSD machines.  I then created an svn user on www, which will be my new Subversion server.

I need to think about how to organize the new repository (or repositories).  All I know at the moment is that I want libDwm to have its own repository.

Migrating my web site to new hardware

Tonight I fished the first pass at migrating my new web site from its development machine to its new home on a nearly identical machine. More information is here.

I’m really enjoying the Supermicro MBD-X7SPA-H-O motherboards in the new web server and gateway.  With 6 SATA ports and dual ethernet, and Intel D510 Atom processors that are easy to keep cool, they work well in a reasonable case.  I’m also really liking the Supermicro CSE-731i-300B cases.  Though they’re significantly larger than I need, they’re inexpensive for the features.  The only modifications I made: I cut an intake hole adjacent the hard drive cage for an 80mm Noctua NF-R8 fan, populated the front intake location with another Noctua NF-R8 fan, and replaced the stock 92mm fan with a Noctua NF-B9.  The Noctua fans are all rated for 150,000 hours, and are quiet.

Replacing ‘imageindex’ with my own software: part 2

Over the weekend, I finished the first pass at ‘mcphotoweb’. It generates basic photo albums. On the web server side, I’m using javascript to expand the medium-sized images from the thumbs and the full-size images from the medium-sized images. It works, and the presentation is nicer than what ‘imageindex’ produced. The javascript is hackish, but it works. For an example, see my August 30, 2007 album from the 2007 BMW Z Homecoming.

The next round will probably emit XML files with more meta-information, which will enable some of the EXIF details of photos to be shown.

Replacing ‘imageindex’ with my own software

I’ve grown somewhat tired of ‘imageindex’. It doesn’t do what I want without modifying my ~/.imageindexrc file each time, which is annoying. I modified it to permit reading in a separate configuration, but the perl code is spaghetti and I don’t like the structure of the index file (tables… ugh!). I also want output that fits into my site’s style.

There are options other than imageindex, but I haven’t found any that work exactly as I’d like. It’s particularly important that I be able to easily bring in galleries from my old web site, and I can’t do that with Gallery3 or any of the freely available generators I’ve found while also fitting into my site’s style.

I’m almost done with a replacement written in C++, using the GraphicsMagick library. It’s smart enough to avoid unnecessary image regeneration, and automatically recurses into subdirectories to generate ‘medium’ images, thumbnails and montages. It also generates an index.php with all of the thumbnails and subdirectory montages as links. I need to decide how I want to display the medium images (via a slide file or via javascript) and how I want to link to the full-size image from the medium image.

Indexing my web site for search: part 4

Why do I get the feeling this will be a never-ending blog series? Perhaps because my javascript skills are still at the novice level?

I’ve finished my tweaking of the search interface for now. When a search is started from a non-search page, I give the user the search page with results. Once on the search page, up to 5 previous searches will be saved (in browser memory via jQuery calls and some other javascript), and may be flipped through by clicking the search results title (“N matches found for …”). I may change this number in the future. At the moment it has little effect on browser memory consumption, and is very handy for flipping through search results for different search terms.

You can check out the search page here.

My javascript foo is getting better, as is my CSS foo. It won’t be long before I move from procedural javascript to OO javascript (as unintuitive as its syntax is for OO, it works).

I like jQuery and the yui library.

Automatic menu generation for my web site

It’s tedious to need to update the menu on each of my web pages when I add new children of a page, new siblings of a page, or move a page or directory. Especially since I keep my content organized via the underlying filesystem; why should I have to do more than that to get a menu that shows child directories, siblings and ancestors? I shouldn’t. One could argue that the easiest way to achieve what I want is to not have any index files, but that’d be quite ugly.

I’ve instead written a CGI program in C++ that will automatically add a ‘Genealogy’ menu to a page’s side menu. Within the ‘Genealogy’ menu are submenus: ‘Children’, ‘Siblings’ and ‘Ancestors’. I call the CGI from the RenderHeader() member of my PageStart PHP class to add to the side menu. Simple, always works. The only downside is that it’s a little slow since it accesses the Xapian backend to get page titles to use in the menu. I can live with it for now. I may later write the menus to files in batch mode and remove the CGI.

Indexing my web site for search: part 3

I now have my indexer working on albums and photos in the photo gallery. It needs some additional features, but it’s functional. So now I have indexing and searching for my HTML content, php content, blog posts and photos. This should be sufficient to get me by for a while; I’ll tweak it as needed.

The indexer (dwmsiteindex) uses a configuration file that permits skipping some directories when searching for HTML and php content. It is also used for database settings for the blog database and the gallery.