Thursday, October 30, 2008

Multilingual Capabilities in Gallery Server Pro

A great deal of work has gone into making Gallery Server Pro capable of displaying text in multiple languages, and I thought I would give an overview and finish up with a call for volunteers to assist with translating into other languages.

When a user navigates to a web site, most web browsers automatically send the user's preferred language to the web server with the request. Gallery Server Pro uses this setting to automatically return a web page to the user in that language. If no translation has been provided for that language, the default resource - English - is used.

For example, an English user might see a gallery like this:

menu_english

Another user in the Netherlands, whose browser is set to the Dutch language, can view the same gallery and see the resources in Dutch:

menu_dutch

A single installation of Gallery Server Pro automatically provides the correct language, without any intervention by the user. You do not need to choose one language for everyone, nor do your users need to click a special link to read the version in their language. How cool is that!

Be aware that some text in your gallery cannot be automatically served in different languages. This includes any text that is directly editable by an administrator, such as album titles and summaries, and media object titles. It is expected that you edit them directly in your preferred language.

Gallery Server Pro ships with English resources by default. Support for additional languages is provided in language packs which can be downloaded in the Language Translation forum. Deploying a language pack is as simple as copying a few files into the web application. And you can deploy as many packs as you like.

At the moment there is only a Dutch translation and a partially complete Spanish translation, and they are for an older version of Gallery Server Pro. But that is about to change, as I have just finished putting together a process that makes it very easy for volunteers to translate text into their language. I am providing a utility called the Zeta Resource Editor that lets you open two resource files side by side. To create a new translation, make a copy of the English resource file and name it according to your language. For example, the Dutch version of GalleryServerPro.resx is GalleryServerPro.nl.resx. Then you open both files in the Zeta editor:

zeta1

The two files are merged into a single grid where you can easily compare the two languages. Edit the column GalleryServerPro.nl.resx to contain the translation for the text in the column to its left (GalleryServerPro.resx). That's it. No messing around with the underlying XML or that primitive resource editor in Visual Studio.

After an initial translation is complete, it must be updated when new versions of Gallery Server Pro are released. Each resource has a date stamp for when it was last updated. The Zeta editor automatically looks for this date stamp and highlights the resources where they differ. For example, here is a screen shot of the 2.0 version of the Dutch resource when compared to the 2.1 version of the English resource:

zeta2

The yellow, green, and salmon colored cells indicate a resource that must be updated. As you update each one, the background turns white. You know you are done when all the rows are white! (FYI, the first column is always light blue.)

Translators Needed!

Gallery Server Pro is open source and supported entirely by volunteers and donations. If you are able to contribute by providing a translation in your language, we would love your help! As a thank you, I will send everyone who submits a complete translation a copy of the Dilbert book Casual Day Has Gone Too Far.

To get started with a translation, check out the Getting Started thread in the Language Translation forum.

Monday, October 27, 2008

Gallery Server Pro Version 2.1.3222 Released

This is a minor bug fix release. It contains three bug fixes:

  • (SQL Server only) Error when installing to a SQL Server database that uses a case-sensitive collation
  • Wrong resource name used in edit album popup window (only affects non-English translations)
  • Hidden files are added to the gallery during a synchronization. The synchronization code now inspects the hidden file attribute and ignores all hidden files.

Thanks to forum member KiloMike for helping identify the collation issue. This affects only SQL Server users. I had C# code and SQL in stored procedures that referred to column names that differed only by case, such as AlbumId and AlbumID. That works fine when you are using a case-insensitive collation, which is the default, at least on every installation I have ever done. But this fails in case-sensitive collations, such as SQL_Latin1_General_CP1_CS_AS. As I researched this bug, I also found an issue with the database configuration SQL script. I had originally used Visual Studio Database Edition to produce the SQL that configures the database, and it specifies the SQL_Latin1_General_CP1_CS_AS collation. That has always bothered me, because it just didn't seem right to hard code something so culture-specific. Today I discovered that I could replace these references with "COLLATE database_default", causing it to inherit the collation of the database.

Some of you will have no idea what I am talking about. No worries. The end result is that GSP will now install in more situations and you have the option of enforcing case sensitivity if you want. So, a gallery search for 'Summer Vacation' is different than 'summer vacation'. Again, I am still talking about SQL Server only. SQLite ignores case, and I am not aware of a way to change this (but I admit I haven't looked into it, either).

Finally, there is a change in how GSP synchronizes files. Starting with this release, if it encounters a file with the 'hidden' file attribute, it now ignores it. That will help with Apple OS-X users. Thanks to Ralf from Germany for this suggestion.

Instructions for upgrading are - as always - in the Administrator's Guide.

Sunday, October 19, 2008

Gallery Server Pro Version 2.1.3213 Released

I released another set of bug fixes for Gallery Server Pro. The most important of these is fixing the Silverlight issue in Firefox 3. As you may recall, while video and audio played fine in Firefox 2, it worked only intermittently in Firefox 3. The code I used was based on Silverlight 2 Beta 2, and Silverlight finally went RTM last week. I downloaded it and extracted the two javascript files from System.Web.Silverlight. That, combined with a little tweaking of the ScriptTemplate in galleryserverpro.config, and I was able to get it rock solid! Wa HOO!

The only remaining limitation with Silverlight is that it does not accept media objects streamed from the ASHX handler that GSP uses for all images, audio, video, and other media objects. When you try, you get an empty player and the Play button doesn't do anything. I will be working with Microsoft to get to the bottom of this. Meanwhile, your Silverlight templates in galleryserverpro.config must use the replacement parameters {MediaObjectAbsoluteUrlNoHandler} (for when your media objects directory is within the web application) or {MediaObjectRelativeUrlNoHandler} (for when your media objects directory is outside the web application). Do not use {MediaObjectUrl}.

There are no database changes in this release, and instructions for upgrading are - as always - in the Administrator's Guide. Here is a list of the remaining changes and bug fixes:

Updates

  • Updated to version 2008.2 SP1 of ComponentArt Web.UI
  • Updated to version 1.0.60.0 of System.Data.SQLite.dll

Bug fixes

  • Silverlight works intermittently in Firefox 3
  • Navigation error when one or more objects in album are deleted by another user
  • NullReferenceException when browsing gallery
  • Permission error when searching gallery
  • Cannot remove user from role
  • Installer does not update provider names
  • Error when logging out of my account page
  • Image metadata items added twice
  • Misleading message during a SQL Server installation

Thursday, October 2, 2008

Gallery Server Pro Version 2.1.3196 Released

Yesterday I released several bug fixes for Gallery Server Pro and updated a couple third party components. Instructions for installing and upgrading can be found in the Administrator’s Guide.

The most important fix was to address a problem with video and audio not playing in the Silverlight plug-in. When I released the Silverlight feature in August, I had tested it extensively on my internal network and, with the exception of some issues with Firefox 3, it worked great. However, after the release it became apparent that the plug-in did not work in many situations. A blue box would appear, indicating that the Silverlight control was instantiated, but the video never started.

In Gallery Server Pro, all media files – photos, video, etc – are served through an ASHX handler. This provides added security and fine tuned control over how the media is streamed to the browser. Unfortunately, the Silverlight plug-in is not behaving well with the handler, and as best I can tell the issue is with Silverlight and not the handler (when in doubt, blame the other guy, right?).

The browser requires Silverlight 1.0 or higher, but I am using javascript and a player that is distributed with the Silverlight 2.0 Beta 2 Developer Tools. When Silverlight 2.0 goes gold, I will get the latest files and try again. If it still doesn’t work, I’ll contact Microsoft for some assistance.

Meanwhile, there is an easy workaround that is implemented in this release – link directly to the media file instead of using the handler. The way to do this is to open ~/config/galleryserverpro.config and replace {MediaObjectUrl} with {MediaObjectAbsoluteUrlNoHandler} for each of the templates where Silverlight is specified (there are four). If you need more help, there are additional directions in the upgrade section in the Admin Guide. If your media objects directory is outside the Gallery Server Pro web application, you must use {MediaObjectRelativeUrlNoHandler} instead.

You may be wondering about my statement that the ASHX handler provides additional security. When you don’t use the handler, your users can view the HTML source and see something like this:

mediaSource:http://www.galleryserverpro.com/gsdemo-mediaobjects/Videos/3StrikesChipmunk_56.wmv

Anyone can copy this URL and use it to access your video any time they want. IIS happily serves the video without checking with ASP.NET (and the Gallery Server Pro user security model) to make sure the user is allowed to see it. I should note that there is a new feature in IIS 7 where you can restrict access to static files like wmv, but this feature does not provide access to the Gallery Server role/user security so it is not a viable solution.

If you are allowing anonymous users access to your gallery, then you don’t have anything to worry about, because you are not trying to restrict them anyway. I say this more as an FYI to those of you who lock down the gallery to restrict access to only logged-on users. And even then an anonymous user can get at your video only if they can guess the URL.

The Silverlight plug-in still does not reliably work in Firefox 3. Sometimes it plays the video; sometimes it doesn’t. Due to the intermittent nature it may be some kind of javascript timing issue. Microsoft has stated they will offer full support with the 2.0 release. I will keep an eye on this and release updated code as soon as I can.

This release also includes an updated version of the SQLite dll and the just-released 2008.2 ComponentArt Web.UI release. Gallery Server Pro uses many of the CA controls for enhanced UI functionality, including uploading files, the menu, tabs, and grids. Unfortunately, the new release still doesn’t fix an issue where the Add objects page becomes unusable after an upload is aborted, either through clicking Cancel during an upload or after the Upload control aborts an upload because the file exceeds the maximum limit. I am working with them to get a fix.

Below is the full list of bug fixes. If you are bored, you can read a detailed report of the bug fixes.

  • Silverlight media does not play with ASHX handler
  • Silverlight media not playing when %2b is in URL query string
  • Media objects are added in reverse order
  • Hard coded English text in web pages
  • Width and height properties not updated when small images are rotated
  • SQLite provider does not delete related data
  • Incorrect SQL in SQLiteProfileProvider
  • Records associated with anonymous users are not removed
  • SQLite DataReader closes connection during transaction
  • Web.config has <machineKey ...> element
  • Error occurs when creating an album with an empty name
  • Calendar popup appears behind edit album dialog
  • User is allowed to add an empty external object
  • SQL Server password accidentally set to encrypted
  • Invalid password attempt count too low
  • Null reference exception when session and profile are null

Monday, September 29, 2008

Gallery Server Pro Ad Campaign Started

Today I started an ambitious ad campaign with Google and Kanoodle. Until today, the only marketing I have done are press releases and general SEO techniques. I don’t think the press releases have done much, but the SEO has worked reasonably well. The popularity of Gallery Server Pro continues to grow every month, and the latest stats show about 25,000 unique visitors per month. There is potential for much more, and I believe Gallery Server Pro has the stability, robustness, and features to justify laying out cold, hard cash to bring in more users.

I continue to work full time on Gallery Server Pro. Your support – through donations – is greatly appreciated and is what makes this whole thing work. I thank you from the bottom of my heart.

Tuesday, September 23, 2008

Gallery Server Pro Architecture White Paper

CodeProject has published an article I wrote describing the architecture of Gallery Server Pro. I first wrote it for the 2.0 release several months ago, but just updated it for 2.1. It has been very popular, with over 90,000 views and an average rating of 4.6 out of 5!

If you are interested in a behind-the-scenes look, check it out. I describe several of the software patterns, including the composite and strategy pattern. In addition, I describe the HTML rendering model and the data provider infrastructure. There is also a section that describes the image metadata extraction technique.

Thursday, August 28, 2008

Version 2.1 Released!

I am pleased to announce the immediate availability of Gallery Server Pro 2.1. There are several new features and a couple dozen bug fixes.

The most important new feature is the use of the open source SQLite database engine for storing gallery data. SQLite is a self-contained, serverless, zero-configuration, transactional, ACID compliant SQL database engine. That is a mouthful, but it can be summed up as “It rocks!”. In fact, you are probably already a SQLite user, as it is the most widely deployed SQL database engine in the world. It is embedded in various Adobe products, Mozilla Firefox, and even in the Apple, Solaris, and Symbian operating systems.

The beauty of SQLite – at least as far as Gallery Server Pro is concerned – is that there is nothing extra to install. The data reside in a file named galleryserverpro_data.sqlite in the App_Data directory of your web application. GSP communicates with the database using System.Data.SQLite.dll, which is a .NET wrapper around the sqlite3.dll C library. This .NET wrapper greatly simplifies the coding, and I owe a great big thanks to its creator, Robert Simpson, at http://sqlite.phxsoftware.com.

During installation, you no longer have to mess with SQL configuration settings. The wizard asks you which database engine you want to use – SQLite or SQL Server. If you choose SQLite, then you enter the username and password you want to use for GSP administration, and you are done! Ba-da-boom, ba-da-bing!

SQL Server is still a first-class component, including SQL Server 2008 and SQL Server 2008 Express. You may want to use SQL Server if any of the following are true:

  • You are comfortable with SQL Server.
  • You are already using SQL Server and want to keep all your data in one place.
  • You are forced to run Gallery Server Pro in a Medium Trust environment and are not able to install System.Data.SQLite.dll in the Global Assembly Cache (GAC).
  • Your installation of GSP is mission-critical and you don’t want to take any chances with your data. Since SQLite is file-based, there are rare circumstances where the hard drive reports to the software that the data is written to disk, when in fact it has not yet done so. If, at this moment, your PC loses power, SQLite will think the data is safely stored, but it is not.
  • You are already using ASP.NET membership and have your users in SQL Server. For example, you may have DotNetNuke installed and want GSP to use the existing user accounts in your SQL Server DotNetNuke database.
  • You have other applications besides the GSP web application interacting with the data file. You may encounter file locking issues and slowed performance as multiple threads wrestle for access to the file. This is one of the few cases where a traditional client-server database such as SQL Server is clearly superior.

I believe the vast majority of you will find SQLite to be the best option, and there are a good number of you who wouldn’t consider using GSP before because you didn’t know a darn thing about SQL Server, and didn’t have the time or inclination to learn yet another thing. Now, you don’t have to know anything about SQLite, because it “just works”.

The second major feature is the use of Microsoft’s Silverlight plug-in to render wmv, wma, mp3, asf, and asx files. For example, here is Silverlight being used for an asf video:

asf_sample

You can start playing the video as soon as a few seconds are buffered. Previously, GSP typically rendered videos in an <object …> tag and let the browser figure out what plug-in to use. The plug-ins that I tended to have on my browsers always wanted to fully download the video before starting to play it, meaning you were often twiddling your thumbs. The old functionality is still available if you want (just edit the templates in galleryserverpro.config), but I believe most of you will appreciate the consistency and added features of Silverlight, especially as the plug-in becomes more widely installed.

If Silverlight is not installed on a user’s browser, a Microsoft-supplied image will appear that says Get Silverlight. When clicked, the user is shown a download page and stepped through the process of installing it. You have probably already seen this image on other sites that use Silverlight.

GSP also allows you to point to media objects stored on other servers. For example, when browsing videos on YouTube, you may have seen the embed code textbox on the side:

youtube_screenshot 

Copy this text to your clipboard and then navigate to the GSP Add objects page. Click the External content tab, and then paste the embed code, like this:

add_objects 

Click Add media object, and your gallery now has a link to the YouTube video! The video is not actually downloaded to your web server. Instead, the video is streamed straight from YouTube to your user’s browser. YouTube pays for the bandwidth! But it *looks* like it is on your server:

youtube_in_gsp 

A lot of web sites are offering embed code for their videos. A few that I stumbled across are www.msnbc.com, www.metacafe.com, and www.dailyshow.com.

You can also upload your videos to Silverlight Streaming and link to them from your gallery. Again, the bandwidth is paid for by them, not you.

There are a lot of other new features and bug fixes that I won’t get into detail at the moment. Among them are significant improvements to the synchronization process, performance of very large galleries, and full support for IIS 7 Integrated Pipeline Mode.

I am proud of the new release, and I hope you enjoy it. If you have any questions, comments, or feature requests, please use the forums.