Wednesday, December 31, 2008

Gallery Server Pro Version 2.2.3286 Released

Today I am pleased to release version 2.2 of Gallery Server Pro. It introduces a totally revamped UI architecture that makes it much easier for developers to add a gallery into an existing ASP.NET web application. Another significant feature is support for storing media files on UNC shares, including NAS devices. There is a new Upgrade Wizard, and a handful of other new features and bug fixes, too. The database schema has not changed, so upgrading is as simple as replacing the web files and using the new Upgrade Wizard to import your web.config and galleryserverpro.config settings. Over the coming days I will update the Administrator's Guide. Until then refer to the 2.2 QuickStart Guide.

Simplified integration

It has always been easy to deploy GSP as a stand-alone web application, but getting it to work inside your existing web site has been difficult. That's because until 2.2, GSP consisted of a collection of master pages and .aspx pages that use an ASP.NET theme. There was no easy way to incorporate this functionality into your site. The most common approach has been to install GSP as its own web application and then use an iframe in one of your pages to create the illusion of integration. But this is not true integration, and some hosting companies make managing more than one application difficult.

So for 2.2, I built a new UI architecture based on the concept of an ASP.NET user control. No more themes, no more master pages. There is just a single web page - default.aspx - that contains a single user control. All the functionality you are used to - browsing albums and images and managing your gallery - occur within this user control. Read my previous blog post to see an example of adding a gallery into a web site.

The developers reading this might be imagining one giant user control with 100,000 lines of code that is a maintenance nightmare. Relax, don't worry. The single user control I mentioned - named Gallery - is actually a container control that loads the appropriate child user control based on the query string in the URL. The .aspx pages that existed in the previous version are recreated as .ascx controls in 2.2. For the most part I copied and pasted the code. There is a nice separation of presentation and logic in the UI layer that should make it easy to wrap your head around.

Upgrade wizard

A pain point in upgrading GSP to newer versions has been trying to incorporate your existing user settings in galleryserverpro.config with the updated HTML templates and settings in the new version. I addressed this by building a new Upgrade Wizard that automatically imports common settings from your previous web.config and galleryserverpro.config files. It even runs in medium trust.

This is the first page of the wizard:

gs_upgrade_wiz

Network support

Thanks to a code contribution from UncleJohnsBand, GSP now supports storing media files on UNC shares in addition to the web server's hard drive. This includes other computers, external hard drives, and even network-attached storage (NAS) devices.

Note that the IIS application pool identity must have file share permission and NTFS permission to the network location. The default user - Network Service - does not have network permissions and will not work. To get the web server to read and write to a UNC share, you must modify the application pool identity in IIS to specify another user, and then ensure that user has the required permission to the network device.

Silverlight now rock solid

Ever since adding Silverlight support in 2.1 for .mp3, .wma, .wmv, .asf, and .asx files, I have had trouble getting Silverlight to accept media files sent from GSP's custom HTTP handler. This only affected Firefox; IE worked well. I finally tracked down the issue and modified the handler to make both web browsers happy. Now that the handler is correctly working, I modified the HTML templates in galleryserverpro.config to use {MediaObjectUrl} (which uses the handler) instead of {MediaObjectAbsoluteUrlNoHandler} (which uses a direct link to the file) for these file types.

The end result is that these video and audio files should play great in all browsers, and you have the robust security that comes from using the handler.

Smaller font

The font size of the text throughout the gallery has been slightly reduced, and it is now defined in pixels rather than em in the CSS file. There is a debate in the CSS community as to how to best define the font size, and in my judgment em was the best choice when IE 6 was a dominant browser. Now that IE 6 is becoming irrelevant, I believe pixels is the best choice. Originally, the CSS file had this line:

body { font: 0.9em Verdana, Arial, Helvetica, sans-serif; background-color: #f5f5f5; color: #000; }

Now that GSP is wrapped in a user control, I specify the font size in the global CSS namespace:

.gsp_ns { font: 12px Verdana, Arial, Helvetica, sans-serif; }

Any time GSP needs to display larger or smaller text, it is done relative to the font defined in the gsp_ns class. For example, to display slightly larger text, GSP uses the gsp_fl class:

.gsp_fl { font-size: 1.1em; }

The beauty of this approach is that you can change the font size globally in one place - the gsp_ns class - and all the text will scale appropriately. So if you like the bigger text of the previous version, just edit the font size in gsp_ns. Increase it to 14px or even revert back to the original 0.9em. Whatever yanks your crank.

While we're talking CSS, you may have noticed I changed the background color of the header from blue to the same eggshell white used on the rest of the page. This is due partly because I am getting sick of that color, but also because the color is likely to clash with most web sites that developers add the gallery to. It is easy enough to change the color to suit your fancy. Edit the following line in gs\styles\gallery.css:

.gsp_ns .header { background-color:transparent; overflow:hidden; }

If you change to a dark color, you will probably want the title and login and search controls to use a light color so that it is contrasted against the background. Again, this takes a few simple edits to the CSS file. I'll leave that as an exercise for you. Hint: Use the Firebug add-on for Firefox to quickly identify the CSS classes to modify.

Complete list of new features (view detailed report)

  • All functionality is contained within a single user control.
  • Support for storing media objects at any UNC-accessible location, including NAS devices
  • New upgrade wizard imports settings from the previous web.config and galleryserverpro.config files.
  • Added .pps (PowerPoint Slideshow) as a supported media object
  • The file path to the thumbnail and optimized image directory is now optional
  • Modified add objects page to eliminate use of images containing hard-coded English text
  • New configuration settings in galleryserverpro.config: showLogin (default=true) and showSearch (default=true). These control the visibility of the login and search controls at the top right of every page. The settings are exposed on the General page of the Site admin area
  • New configuration settings in galleryserverpro.config: showErrorDetails (default=false), enableExceptionHandler (default=true), and allowAnonymousBrowsing (default=true). These replace the previous technique of configuring these options in web.config through the customErrors and authorization elements.
  • Increased the height of the box surrounding thumbnail images to better contain the contents. This was done by changing the value of the thumbnailHeightBuffer setting in galleryserverpro.config from 65px to 70px.

Bug fixes (view detailed report)

  • Full support for Silverlight using the HTTP handler
  • Password validation not performed when changing password in SQLite
  • An error may occur if a SMTP server is not specified
  • Clicking current date in edit album window does nothing
  • "Template not found: enabledHeader" message on Media Object Types page
  • Thumbnails for external media objects may not be recreated during synch
  • Synch may leave orphan files
  • Captions inside thumbnails sometimes exceed boundary
  • Incorrect behavior on Add Objects page
  • Text in add user dialog remains visible during callback
  • SQLite user activity date inconsistent with SQL Server behavior
  • Rendering issue when gallery is used in web page with floated screen objects

I hope you enjoy the new version, and I wish everyone a Happy New Year! As soon as I finish the Admin Guide, I'll get hard at work on the next release. I'll be publishing a new roadmap within a few weeks. Cheers!

2 comments:

UncleJohnsBand said...

Excellent Roger....Thanks! loading it up now....Happy New Year!

daveburke said...

Wow! Great work, Roger! I'm looking forward to checking it out and spreading the good word!