+ All Categories
Home > Documents > Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186...

Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186...

Date post: 28-Oct-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
186
Administrator’s Guide Version 2.1.3222 Released October 27, 2008
Transcript
Page 1: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Administrator’s Guide

Version 2.1.3222 Released October 27, 2008

Page 2: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 2 of 186

Table of Contents 1. Welcome ......................................................................................................................................................... 5

How Gallery Server Pro Works...................................................................................................................... 5

Requirements .............................................................................................................................................. 6

Data Storage ................................................................................................................................................ 6

Known Issues ............................................................................................................................................... 7

Administrator’s Guide Document Revisions .................................................................................................. 8

2. Installing Gallery Server Pro ............................................................................................................................. 8

Installation Overview ................................................................................................................................... 8

Performing a New Installation of Gallery Server Pro, SQLite ....................................................................... 11

Performing a New Installation of Gallery Server Pro, SQL Server ................................................................. 18

Upgrading from Gallery Server Pro 2.0.2898 to 2.1.3162 ............................................................................ 29

Upgrading from Gallery Server Pro 2.1.3162 or 2.1.3196 to 2.1.3213 ......................................................... 34

Upgrading from Gallery Server Pro 2.1.3213 to 2.1.3222 ............................................................................ 36

Uninstalling Gallery Server Pro ................................................................................................................... 37

3. Running Gallery Server Pro ............................................................................................................................ 37

Running Gallery Server Pro for the First Time ............................................................................................. 37

Example: Adding your media library to Gallery Server Pro .......................................................................... 40

4. Working with Galleries ................................................................................................................................... 41

Overview.................................................................................................................................................... 41

SQLite Users ............................................................................................................................................... 42

SQL Server Users ........................................................................................................................................ 42

5. Working with Albums ..................................................................................................................................... 45

Overview of Albums ................................................................................................................................... 45

Creating an Album...................................................................................................................................... 47

Page 3: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 3 of 186

Edit Album Information .............................................................................................................................. 48

Delete an Album ........................................................................................................................................ 50

Move / Copy an Album ............................................................................................................................... 51

Assign Album Thumbnail Object ................................................................................................................. 51

Synchronize an Album ................................................................................................................................ 54

6. Working with Media Objects .......................................................................................................................... 59

Overview of Media Objects ........................................................................................................................ 59

Adding Media Objects ................................................................................................................................ 60

Edit Captions .............................................................................................................................................. 71

Delete Objects ........................................................................................................................................... 73

Delete High-Resolution Version of Images .................................................................................................. 75

Move or Copy Media Objects ..................................................................................................................... 77

Rearrange Objects ...................................................................................................................................... 81

Rotate Objects ........................................................................................................................................... 82

Watermarking ............................................................................................................................................ 86

Image Metadata ......................................................................................................................................... 89

Searching ................................................................................................................................................... 90

Rendering Media Objects in the Browser.................................................................................................... 90

Microsoft Silverlight ................................................................................................................................... 97

7. Security.......................................................................................................................................................... 98

Overview of the Security Model ................................................................................................................. 98

Roles ........................................................................................................................................................ 100

Users ........................................................................................................................................................ 102

Hiding Albums and Media Objects from Users .......................................................................................... 103

8. Site Administration ...................................................................................................................................... 106

Page 4: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 4 of 186

Overview.................................................................................................................................................. 106

Site Settings – General ............................................................................................................................. 106

Site Settings – Email ................................................................................................................................. 109

Site Settings – Backup and Restore Data ................................................................................................... 111

Membership – Roles ................................................................................................................................ 118

Membership – Users ................................................................................................................................ 119

Albums – General ..................................................................................................................................... 125

Media Objects – General .......................................................................................................................... 127

Media Objects – Media Object Types ....................................................................................................... 132

Media Objects – Images ........................................................................................................................... 134

Media Objects – Video / Audio / Other ..................................................................................................... 139

Configuration Settings in galleryserverpro.config ..................................................................................... 141

9. Membership Configuration .......................................................................................................................... 156

Membership Overview ............................................................................................................................. 156

New membership in current SQL database ............................................................................................... 156

Use existing membership schema in current SQL database ....................................................................... 156

Use existing membership schema in different SQL database ..................................................................... 157

Integrate Gallery Server Pro with Active Directory .................................................................................... 159

10. Data Provider ............................................................................................................................................. 163

About the data provider model ................................................................................................................ 163

Moving data between SQL Server and SQLite ........................................................................................... 163

Behind the Scenes: How the Data Provider is Specified in the Config Files ................................................ 164

Create a custom data provider ................................................................................................................. 167

11. Customizing Gallery Server Pro .................................................................................................................. 169

Overview.................................................................................................................................................. 169

Page 5: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 5 of 186

Themes .................................................................................................................................................... 169

Integrating Gallery Server Pro Into another Web Application ................................................................... 170

12. Using Internet Information Services (IIS) Manager ..................................................................................... 172

IIS 6 .......................................................................................................................................................... 172

IIS 7 .......................................................................................................................................................... 177

13. Configuring NTFS Permissions In Microsoft Windows ................................................................................. 180

14. Management Tools for SQLite and SQL Server............................................................................................ 184

Overview.................................................................................................................................................. 184

SQL Server................................................................................................................................................ 185

SQLite ...................................................................................................................................................... 185

15. Glossary ..................................................................................................................................................... 185

1. Welcome Gallery Server Pro is a free, open source web application for sharing photos, video, audio, documents

and other files. It’s like having your own personal YouTube or Flickr site. It is intended for users who want to share large collections of media objects on their own web site, while maintaining a high degree of control.

How Gallery Server Pro Works

Gallery Server Pro is a web application you install on your web server or your web hosting company's server.

Add your media library by synchronizing your directory containing photos, videos and other media objects with the Gallery Server Pro database. You can also ZIP up all your files and upload them.

Gallery Server Pro automatically creates a thumbnail image to represent each media object. If you upload a high resolution image, a bandwidth-friendly, compressed version is created. EXIF, IPTC and other types of metadata are extracted and stored in the database.

Media object files are stored on the hard drive. Metadata about these files, such as width, height, caption, etc. are stored in the database.

When web users browse your albums and media objects, Gallery Server Pro queries the database for the necessary information, and dynamically renders a custom web page. If watermarking is enabled, the watermark is applied to the image before it is sent.

Page 6: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 6 of 186

Requirements

Server Requirements:

Microsoft .NET Framework 2.0 or higher

Microsoft AJAX Extensions 1.0 (not required if .NET Framework 3.5 is installed)

Internet Information Services (IIS) 5.0 or higher, or a compatible web server, such as UltiDev Cassini Web Server

Optional: SQL Server 2000 or higher, including the free Express versions. It does not have to be installed on your server, but it must be available on the network.

Optional: Microsoft .NET Framework 3.0 or 3.5. If present, Gallery Server Pro extracts additional image metadata not accessible to version 2.0 (primarily titles and keywords).

Optional: SMTP server (required if e-mail functionality is enabled).

The use of the SQLite database engine requires the web application to run under Full Trust or that System.Data.SQLite.dll be in the server's Global Assembly Cache (GAC). If these are not possible, SQL Server is fully supported in reduced trust environments.

Client Requirements:

Any modern web browser (IE 5+, Netscape 6+, Firefox, Opera, Safari)

Data Storage

There are two types of data managed by Gallery Server Pro:

Media files - These are your images, videos, audio files, and documents. The default storage location is the mediaobjects directory in the Gallery Server Pro web application, but you can specify any location on the web server's hard drive.

Gallery data - Information about the media files, such as captions, width, height, and the album to which they belong, are stored in either a SQLite or SQL Server database.

Choosing a data provider

The web-based installer will ask you to choose whether to store data in SQLite or SQL Server.

SQLite (www.sqlite.org) is a self-contained, serverless, zero-configuration, transactional, ACID compliant SQL database engine. It is embedded in various Adobe products, Mozilla Firefox, and even in the Apple, Solaris, and Symbian operating systems. The data reside in a file named galleryserverpro_data.sqlite in the App_Data directory of your web application.

Microsoft SQL Server (www.microsoft.com/sqlserver/) is an enterprise class client-server database engine. It is in use by many companies and supported by a large number of web hosting providers.

Page 7: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 7 of 186

Most users should choose SQLite due to its ease of management, high performance, and potentially lower hosting costs. 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 Gallery Server Pro 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 database engine 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 Gallery Server Pro 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 a situation where a traditional client-server database such as SQL Server is clearly superior.

Known Issues

Playing locally hosted video using the Silverlight plug-in does not work reliably in Firefox 3. External media objects served from Silverlight Streaming play correctly.

The web-based installer may not work correctly if you change the Membership settings in web.config (for example, you change the passwordFormat attribute). Make any changes to web.config after running the installer, and revert to the original version any time you run the installer (such as when you converting from one database engine to another).

Restoring data to a SQL Server 2000 database using the built-in restore function is not supported.

Restoring data to SQL Server using the Restore function requires SQL permissions equivalent to that provided in the db_ddladmin or db_owner roles. You may have to manually configure the SQL user using a tool such as SQL Management Studio to provide this permission.

Cancelling an upload on the Add Objects page or Backup/Restore page causes the upload control to have a corrupt state. Reload the page to do another upload. This is a known issue with the ComponentArt Upload control.

If you attempt to upload a file that exceeds the maximum upload size, you are correctly informed of this and the upload is cancelled. Unfortunately, the upload control becomes corrupted and cannot be used to upload another file. Reload the page to attempt another upload. This is a known issue with the ComponentArt Upload control.

Page 8: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 8 of 186

Administrator’s Guide Document Revisions

Doc Version Date Description

1.0.0 01-Jan-06 Original release.

1.0.1 08-Jan-06 Minor formatting changes and included references to SQL Server 2005 and SQL Server 2005 Express, which are now supported.

2.0.0 17-Oct-07 Complete rewrite of guide for 2.0.2830 release.

2.0.1 25-Oct-07 Modified Set Maximum Upload Size section to include info about request filtering in IIS 7.

2.0.2 26-Nov-07 Added info about new replacement parameters {MediaObjectAbsoluteUrlNoHandler} and {MediaObjectRelativeUrlNoHandler}. Added security warning to the security chapter about how to prevent users from directly accessing media objects. Added info for new config settings defaultAlbumDirectoryNameLength and synchAlbumTitleAndDirectoryName. Added section for upgrading from 2.0.2830. Updated screen shot and text in Rearrange objects section.

2.0.3 27-Nov-07 Added instructions for upgrading from 2.0.2886

2.0.4 8-Dec-07 Added instructions for upgrading from 2.0.2887

2.1.0 5-Sep-08 Updated for 2.1.3162

2.1.1 1-Oct-08 Updated for 2.1.3196

2.1.2 19-Oct-08 Updated for 2.1.3213

2.1.3 27-Oct-08 Updated for 2.1.3222

2. Installing Gallery Server Pro

Installation Overview

There are two versions of Gallery Server Pro available for download:

Gallery Server Pro web application (pre-compiled)

Gallery Server Pro source code (Visual Studio 2005 format)

Most users will want the pre-compiled web application. Check out the source code version if you are interested in viewing or modifying the code. The source code version must be compiled prior to deployment. It is in Visual Studio 2005 format, but it can be opened in Visual Studio 2008 and the freely available Visual Web Developer 2008 Express SP1, downloadable from Microsoft.

Page 9: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 9 of 186

Gallery Server Pro uses a web-based installer to configure the database and initialize the data. The setup process is largely the same whether you are installing it locally or using a hosting provider. The basic steps are:

1. Extract the files from the ZIP and convert the root directory to a web application in IIS.

2. Use your browser to run the web-based installer and step through the wizard.

3. You’re done!

Reduced Trust Installation

Gallery Server Pro runs well in a Medium Trust environment, albeit with a few caveats:

The SQLite data provider requires either Full Trust or that the System.Data.SQLite.dll assembly be installed in the Global Assembly Cache (GAC) on the web server. If you are running Gallery Server Pro in a reduced trust environment (such as GoDaddy), then SQL Server is your only option, unless you can convince the web administrator to install System.Data.SQLite.dll in the GAC. Instructions for installing an assembly into the GAC can be found in the document Assembly Cache Viewer.

Many of the site administration pages cannot save data to the configuration file galleryserverpro.config. This is a security feature provided by the .NET Framework. Fortunately, a workaround is available - edit the file in a text editor.

The real-time feedback provided by the ComponentArt File Upload control requires Full Trust. In reduced trust environments, Gallery Server Pro automatically replaces the ComponentArt control with the standard ASP.NET FileUpload control. It still lets you upload files to the server, but it doesn't give the fancy real-time feedback to inform you of the upload progress.

Installing Gallery Server Pro in Medium Trust using SQL Server

If SQLite is not an option because you are running in a reduced trust environment and you cannot install System.Data.SQLite.dll in the GAC, then you can install Gallery Server Pro using the SQL Server database engine. Before you run the installer, you must remove all references to SQLite from the application:

1. Replace the contents of web.config with the contents of web_sqlserver.config. You will find web_sqlserver.config in the root of the Gallery Server Pro web application. (If you are running on a .NET 3.5 server, then use web_sqlserver_3.5.config.)

2. Delete the file System.Data.SQLite.dll from the bin directory.

3. (I don't think this step is necessary, but I include it just in case) Open galleryserverpro.config (in the config directory) in a text editor. Scroll down to the end and replace the contents of the <dataProvider …> element with this text:

<dataProvider defaultProvider="SqlServerGalleryServerProProvider"> <providers> <add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlServerGalleryServerProProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider" />

Page 10: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 10 of 186

</providers> </dataProvider>

After you make these changes, follow the installation instructions below.

64-bit Web Server Installation

Gallery Server Pro includes the 32-bit version of System.Data.SQLite.dll. If you are installing Gallery Server Pro on a 64-bit operating system, then you must replace this file with the 64-bit version, available on the Gallery Server Pro Download page. You will find the 32-bit version of the file in the bin directory. Overwrite this file with the 64-bit version.

Source code users: You do not need this file if you are using the source code version of Gallery Server

Pro, as it contains both the 32-bit and 64-bit files. Just update the reference in the SQLite project to

point to the appropriate version.

.NET Framework 3.5

You do not need Microsoft AJAX Extensions 1.0 if you have.NET Framework 3.5 installed. However, you do need to replace the web.config file with one that is configured for 3.5.

The download includes two versions of web.config that are pre-configured for .NET 3.5. They are in the same directory as web.config, and are named:

web_3.5.config

web_sqlserver_3.5.config

Replace the web.config file in your web application with one of these. Most users, including ALL SQLite users, will use web_3.5.config. If you are running in a reduced trust environment, then you may need to use web_sqlserver_3.5.config instead. (This version has all traces of SQLite removed from it.)

What To Do If You Get an Error

If an error occurs during installation or at any time while running Gallery Server Pro, a detailed error message will be displayed. If you cannot figure out the cause from this message and want to post a question to the support forum, please copy ALL the text and include it in your post. Remember to search this document and the forum before posting your question.

Note: If you are working remotely and receive a generic error like "I am sorry, but Gallery Server Pro is

feeling a bit ill", temporarily enable detailed error reporting in the web.config file (it is in the root of

the Gallery Server Pro web application). Look for this line:

<customErrors mode="RemoteOnly" defaultRedirect="error/error.htm">

Change it to this:

<customErrors mode="Off" defaultRedirect="error/error.htm">

Page 11: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 11 of 186

Saving this file should automatically cause the web application to restart and import the new settings.

In some cases, however, this does not happen, and the web application seems to ignore the new

setting. When this occurs, you can force an app restart by recycling the IIS worker process or executing

iisreset in a Start – Run dialog box.

Once you get a detailed error message, search the Gallery Server Pro forums and/or the internet for more information.

OK, grab a beer, hot cocoa, or soy latté and let’s get this bad boy installed.

Upgrading Previous Versions

You can upgrade from previous versions and keep all your captions and other data.

To upgrade from Gallery Server Pro 1.0 - Follow the steps in the section Performing a New Installation of Gallery Server Pro, SQL Server. The install wizard will detect the 1.0 data and offer to automatically import the data into the 2.X tables.

To upgrade from Gallery Server Pro 2.0.XXXX - First upgrade to 2.0.2898, then follow the instructions in the section Upgrading from Gallery Server Pro 2.0.2898 to 2.1.3162. Then upgrade to 2.1.3213 by following the instructions in Upgrading from Gallery Server Pro 2.1.3162 or 2.1.3196 to 2.1.3213. Finally, upgrade to 2.1.3222 by following the instructions in Upgrading from Gallery Server Pro 2.1.3213 to 2.1.3222.For help in upgrading to 2.0.2898, refer to the instructions in the 2.0.2898 Administrator's Guide.

Note: When you upgrade from 1.0 or 2.0.XXXX, you must upgrade to the SQL Server version of 2.1.

After the upgrade is complete, you may convert to SQLite if you wish. Directions for switching data

providers are in the section Moving data between SQL Server and SQLite.

To upgrade from Gallery Server Pro 2.1.3162 or 2.1.3196 - Follow the instructions in Upgrading from Gallery Server Pro 2.1.3162 or 2.1.3196 to 2.1.3213. Then upgrade to 2.1.3213 by following the instructions in Upgrading from Gallery Server Pro 2.1.3213 to 2.1.3222.

To upgrade from Gallery Server Pro 2.1.3213 - Follow the instructions in Upgrading from Gallery Server Pro 2.1.3213 to 2.1.3222.

Performing a New Installation of Gallery Server Pro, SQLite

Follow these instructions to install Gallery Server Pro using SQLite as the data store.

Set up the web application

1. Download the ZIP file containing the Gallery Server Pro web application from www.galleryserverpro.com.

2. Extract the contents of the zip file to a directory on your web server. For example, C:\inetpub\wwwroot\galleryserverpro\.

Page 12: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 12 of 186

.NET 3.5 users - Replace web.config with the 3.5 version. See the section that discusses .NET 3.5

earlier in this document.

3. Use Internet Information Services (IIS) Manager to configure this directory as a web application. (Click Start – Run and then type inetmgr to start IIS Manager.)

4. (IIS 5 and 6 only) Use IIS Manager to make sure the application is running under ASP.NET 2.0 and that the default document is default.aspx.

Note: For more information on using IIS Manager, refer to Using Internet Information Services (IIS)

Manager.

5. Use Windows Explorer to give the user account IIS is running under modify permission to the web application directory (ex: C:\inetpub\wwwroot\galleryserverpro\). Refer to the section Configuring NTFS Permissions In Microsoft Windows for more information.

Note: Technically, Gallery Server Pro requires modify permission only to the following directories:

App_Data, config, and mediaobjects. If desired, you can assign this permission to each of these

directories instead of applying them to the parent directory.

Note: If you are using a hosting provider, follow the process provided by them for performing the

above steps. This step is not necessary for some hosting companies, so you can try skipping it for now

and only come back to it if you receive an error.

Running the web-based installer

1. Use a web browser to navigate to the Installer directory. For example, if you configured your web application at http://www.yoursite.com/galleryserverpro, the installer is at http://www.yoursite.com/galleryserverpro/installer/. The screen should look like this:

Page 13: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 13 of 186

Note: If you get the error below, you do not have Microsoft ASP.NET 1.0 AJAX installed. Get it here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d

6

As an alternative, you can upgrade to .NET Framework 3.5, which includes Ajax functionality. If you do

this, read the section .NET Framework 3.5 for more information.

Configuration Error

Description: An error occurred during the processing of a configuration file required to

service this request. Please review the specific error details below and modify your

configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Extensions,

Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its

dependencies. The system cannot find the file specified.

2. Click next. Review the license agreement. If you agree to the terms, select the checkbox and click Next.

Page 14: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 14 of 186

3. The following screen appears. Select the SQLite database engine. If you want to use the SQL Server engine, then follow the instructions in the section Performing a New Installation of Gallery Server Pro, SQL Server.

Page 15: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 15 of 186

4. The next step requests the username, password, and email address you would like to use for the administrator account of your new Gallery Server Pro site. You will use this account to log on to Gallery Server Pro to perform administrative tasks. Fill in the fields and click Next.

Page 16: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 16 of 186

5. The final step indicates that all required information has been gathered and it is ready to perform the installation. Click Next.

Page 17: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 17 of 186

6. If the installation was successful, you will see a confirmation message. This page may also specify additional steps you must take to complete the installation. Follow the instructions given. For example, in the screen shot below, the galleryserverpro.config file must be manually updated. Be sure to update the file before clicking the link "click here to go to your gallery".

Note: You must manually update web.config and/or galleryserverpro.config when the IIS account that

the installer is running under does not have modify permission to the directory containing these files.

Page 18: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 18 of 186

7. Congratulations! Click the link to go to your new Gallery Server Pro site.

Note: When you are finished with the installation, it is strongly recommended that you disable the

setup wizard to prevent unauthorized access to your server. To disable, delete the installer directory

or change the value of the ENABLE_SETUP hidden field to FALSE in installer/default.aspx and

installer/upgrade.aspx.

Performing a New Installation of Gallery Server Pro, SQL Server

Follow these instructions to install Gallery Server Pro using SQL Server as the data store.

Set up the web application

1. Download the ZIP file containing the Gallery Server Pro web application from www.galleryserverpro.com.

2. Extract the contents of the zip file to a directory on your web server. For example, C:\inetpub\wwwroot\galleryserverpro\.

.NET 3.5 users - Replace web.config with the 3.5 version. See the section that discusses .NET 3.5

earlier in this document.

Page 19: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 19 of 186

3. Use Internet Information Services (IIS) Manager to configure this directory as a web application. (Click Start – Run and then type inetmgr to start IIS Manager.)

4. (IIS 5 and 6 only) Use IIS Manager to make sure the application is running under ASP.NET 2.0 and that the default document is default.aspx.

Note: For more information on using IIS Manager, refer to Using Internet Information Services (IIS)

Manager.

5. Use Windows Explorer to give the user account IIS is running under modify permission to the web application directory (ex: C:\inetpub\wwwroot\galleryserverpro\). Refer to the section Configuring NTFS Permissions In Microsoft Windows for more information.

Note: Technically, Gallery Server Pro requires modify permission only to the following directories:

App_Data, config, and mediaobjects. If desired, you can assign this permission to each of these

directories instead of applying them to the parent directory.

Note: If you are using a hosting provider, follow the process provided by them for performing the

above steps. This step is not necessary for some hosting companies, so you can try skipping it for now

and only come back to it if you receive an error.

6. Use your SQL management tool such as SQL Management Studio to create a new, empty database.

Note: You can optionally install Gallery Server Pro into an existing database that contains other

applications and even Gallery Server Pro 1.0. The only requirement is that there must not be any name

conflicts. All database objects in Gallery Server Pro 2.0 are prefixed with “gs_”, so there is a good

chance the tables and stored procedures used by Gallery Server Pro will be unique. (Gallery Server Pro

1.0 objects do not use a unique prefix.)

Running the web-based installer

1. Use a web browser to navigate to the Installer directory. For example, if you configured your web application at http://www.yoursite.com/galleryserverpro, the installer is at http://www.yoursite.com/galleryserverpro/installer/. The screen should look like this:

Page 20: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 20 of 186

Note: If you get the error below, you do not have Microsoft ASP.NET 1.0 AJAX installed. Get it here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d

6&displaylang=en

As an alternative, you can upgrade to .NET Framework 3.5, which includes Ajax functionality. If you do

this, read the section .NET Framework 3.5 for more information.

Configuration Error

Description: An error occurred during the processing of a configuration file required to

service this request. Please review the specific error details below and modify your

configuration file appropriately.

Parser Error Message: Could not load file or assembly 'System.Web.Extensions,

Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its

dependencies. The system cannot find the file specified.

2. Click next. Review the license agreement. If you agree to the terms, select the checkbox and click Next.

Page 21: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 21 of 186

3. The following screen appears. Select the SQL Server database engine. If you want to use the SQLite engine, then follow the instructions in the section Performing a New Installation of Gallery Server Pro, SQLite.

Page 22: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 22 of 186

4. On the next screen, specify the desired SQL Server instance and the security credentials the Installer should use to configure the database. The credentials must have permission to create database objects and, if you request a new login be created (see step 7), must be able to create a new login as well.

Note: These credentials are used only by the installer and are discarded once the installation is

complete. A later step in the wizard will request the connection setting used for normal operation.

Note: The SQL Server database engine does not have to be installed on the web server. As long as the

web server can “see” the database, it doesn’t matter where it is. If you are connecting to a local

installation, specify (local), 127.0.0.1, or the name of the server. Include the SQL Server instance name

if necessary, such as when using SQL Express or when there is more than one instance of SQL Server.

The instance name of a default installation of SQL Express on the local server is .\SQLExpress (replace

the period with the server name or IP address if it is on another machine, such as

MYSERVER\SQLExpress or 192.168.10.100\SQLExpress).

Page 23: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 23 of 186

5. When you click Next, the installer will attempt to connect. If it is successful, you will see a drop-down list with your database as one of the options. Select your database and click Next.

Page 24: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 24 of 186

6. When you select the database, the web installer will check to see if it contains any data from Gallery Server Pro 1.0. If it finds data, it will give you the option to import the data from version 1.0 into the version 2.1 tables. If you want to do this, you should abort the setup and follow the directions in the section titled Upgrading from Gallery Server 1.0.

7. Specify the account Gallery Server Pro will use to communicate with the database during normal operation. This can be the same account specified earlier, an existing login, or a new SQL login. The credential entered here will be used for the runtime connection string and written into the web.config file in the root of the web application.

Note: If you specify a login that does not exist or is not a member of the database you selected, the

wizard will attempt to create it during installation.

Page 25: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 25 of 186

8. The next screen provides installation options. Leave the option “Script ASP.NET Membership” checked unless the database already has the ASP.NET Membership installed or you want to configure Gallery Server Pro to communicate with an external Membership data store.

Note: For more information on configuring the membership, see the Membership Configuration

section below.

Page 26: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 26 of 186

9. The next step requests the username, password, and email address you would like to use for the administrator account of your new Gallery Server Pro site. You will use this account to log on to Gallery Server Pro to perform administrative tasks. Fill in the fields and click Next.

Page 27: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 27 of 186

10. The final step indicates that all required information has been gathered and it is ready to perform the installation. Click Next.

Page 28: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 28 of 186

11. If the installation was successful, you will see a confirmation message. This page may also specify additional steps you must take to complete the installation. Follow the instructions given. For example, in the screen shot below, the web.config and galleryserverpro.config files must be manually updated. Be sure to update these files before clicking the link "click here to go to your gallery".

Note: You must manually update web.config and/or galleryserverpro.config when the IIS account that

the installer is running under does not have “modify” permission to the directory containing these files.

Page 29: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 29 of 186

12. Congratulations! Click the link to go to your new Gallery Server Pro site.

Note: When you are finished with the installation, it is strongly recommended that you disable the

setup wizard to prevent unauthorized access to your server. To disable, delete the installer directory

or change the value of the ENABLE_SETUP hidden field to FALSE in installer/default.aspx and

installer/upgrade.aspx.

Upgrading from Gallery Server Pro 2.0.2898 to 2.1.3162

Upgrading from 2.0.2898 follows these basic steps:

1. Replace the files in the web application directory with the new ones.

2. Edit web.config to contain your SQL connection string and to specify that the SQL Server providers are specified for Membership, Roles, and Profile.

3. Edit galleryserverpro.config so that the SQL Server provider is specified for gallery data.

4. Run the upgrade wizard.

Detailed steps for this are below.

Page 30: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 30 of 186

If you are upgrading from a version earlier than 2.0.2898, first upgrade to 2.0.2898. Instructions can be found in the 2.0.2898 Administrator's Guide and the 2.0.2898 web files can be found here.

Note: Version 2.0 used SQL Server as the data store, but version 2.1 offers SQLite as a new option. If

you want to move to SQLite, first run the upgrade wizard. After the upgrade is complete, follow the

steps in the section Moving data from SQL Server to SQLite, or vice versa.

1. Download the ZIP file containing the Gallery Server Pro web application from www.galleryserverpro.com.

2. Make a backup of web.config (in the root directory of the Gallery Server Pro web app) and galleryserverpro.config (in the config directory). These contain settings specific to your installation, so you don’t want to lose them.

3. Delete all the web application directories and files in your Gallery Server Pro web directory EXCEPT your mediaobjects directory. If you store your media objects outside this web directory, you can safely delete the mediaobjects directory.

4. Extract the contents of the Gallery Server Pro ZIP file to the web directory.

Note: If you downloaded the source code, you must compile it before copying the files.

5. Use Windows Explorer to give the user account IIS is running under modify permission to the config and mediaobjects directories. Refer to the section Configuring NTFS Permissions In Microsoft Windows for more information.

Note: You do not need to give modify permission to the mediaobjects directory if you have

configured Gallery Server Pro to store your media objects elsewhere. In this situation, the

mediaobjects directory is not used.

Note: If you are using a hosting provider, follow the process provided by them for performing the

above steps. This step is not necessary for some hosting companies, so you can try skipping it for

now and only come back to it if you receive an error.

6. Open web.config in a text editor and look for these three sections:

<membership defaultProvider=" SQLiteMembershipProvider ">

<roleManager defaultProvider=" SQLiteRoleProvider " …>

<profile defaultProvider=" SQLiteProfileProvider ">

7. Edit the defaultProvider attributes to specify the SQL Server providers for Membership, Roles, and Profile. It will look like this when you are done:

<membership defaultProvider="SqlMembershipProvider">

<roleManager defaultProvider="SqlRoleProvider" …>

Page 31: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 31 of 186

<profile defaultProvider=" SqlProfileProvider ">

Note: If you are running Gallery Server Pro in a reduced trust environment (like Godaddy), you must

remove any mention of SQLite from web.config. Do this by doing one of the following: (1) Edit

web.config to remove the three <add …> sections that specify SQLite for Membership, Roles, and

Profile, or (2) Replace web.config with web_sqlserver.config (or web_sqlserver_3.5.config for .NET

3.5). Also, you must delete System.Data.SQLite.dll from the bin directory.

8. Copy the connection string from your backup of web.config (from step 1) to the new web.config file. The new web.config file contains two connections strings: one named SQLiteDbConnection and the other named SqlServerDbConnection. Update the one named SqlServerDbConnection by replacing the contents of the connectionString attribute with the string from your 2.0.2898 version of web.config. It will look something like this:

<add name="GalleryServerDbConnection" connectionString="Data Source=(local);Initial Catalog=GalleryServerPro;Integrated Security=true;Application Name=Gallery Server Pro" />

Note: Be aware that the name of the SQL Server connection string changed! In 2.0 it was named

GalleryServerDbConnection; in 2.1 it is named SqlServerDbConnection.

9. If you made any other changes to web.config, copy them to the new web.config file. (For example, you may have modified the applicationName attribute for the membership, role, or profile providers.)

10. Open the file config\galleryserverpro.config in a text editor. Scroll down to the bottom and look for this line:

<dataProvider defaultProvider="SQLiteGalleryServerProProvider">

Change it to this:

<dataProvider defaultProvider="SqlServerGalleryServerProProvider">

11. (Optional) Edit config\galleryserverpro.config to include any custom settings you made in the earlier version. This typically includes the gallery ID, website title, watermark settings, and e-mail configuration. If you don't want to mess with manually editing the config file, you may find it is easier to edit the settings in the Site admin area of the Gallery Server Pro web site. Those pages act as a user-friendly front end to galleryserverpro.config.

Note: The remaining steps describe how to use the web based upgrade wizard to execute the SQL

upgrade script. If you wish, you can instead run the SQL using SQL Management Studio (SQL Server

2005/2008) or Query Analyzer (SQL Server 2000). The SQL script file is located in the installer/sql

directory and is named GS_2.0.2886_to_2.1.3162_upgrade.sql.

12. Use a web browser to navigate to the web upgrade wizard at installer/upgrade.aspx. For example, if you configured your web application at http://www.yoursite.com/galleryserverpro, the upgrade wizard is at http://www.yoursite.com/galleryserverpro/installer/upgrade.aspx.

Page 32: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 32 of 186

Note: If you get the error below, then the IIS process does not have modify permission to the

App_Data directory. Refer to the section Configuring NTFS Permissions In Microsoft Windows for more

information.

Configuration Error

Description: An error occurred during the processing of a configuration file required to

service this request. Please review the specific error details below and modify your

configuration file appropriately.

Parser Error Message: Attempt to write a read-only database attempt to write a readonly database

Note: If you see "Not detected" next to “Detected version of Gallery Server Pro data store”, then you

are likely running version 1.X or do not have any Gallery Server Pro tables in your database. In either

case, you should be running the installer instead (replace upgrade.aspx with default.aspx in the

browser's address bar).

13. The wizard determines the current version of the Gallery Server Pro database and displays it. It also displays the current version of the web application. The drop down list displays the available scripts. Select the script named GS_2.0.2886_to_2.1.3162_upgrade.sql. Click Next.

Note: If you are wondering why the data store version shows 2.0.2886 instead of 2.0.2898, that is

because the data schema did not change between 2.0.2886 and 2.0.2898.

Page 33: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 33 of 186

Note: If you installed Gallery Server Pro by downloading the source code and compiling it, your

compiled DLLs will report a version different than 2.0.2898. However, if you have not modified the

code from the 2.0.2886 source code, then you can safely choose the file

GS_2.0.2886_to_2.1.3162_upgrade.sql.

1. The following screen appears (this is actually a screen shot from the 2.0.2886 upgrade, but you get the idea):

2. This screen displays the name of the SQL script to be executed and tells you that the wizard is ready to run it. Click Next to execute the SQL upgrade script.

3. When the upgrade is complete, you will see a confirmation message. Congratulations! Click the link to go to your upgraded Gallery Server Pro site.

Note: When you are finished with the upgrade, it is strongly recommended that you disable the

setup wizard to prevent unauthorized access to your server. To disable, delete the installer

directory or change the value of the ENABLE_SETUP hidden field to FALSE in installer/default.aspx

and installer/upgrade.aspx.

Page 34: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 34 of 186

Upgrading from Gallery Server Pro 2.1.3162 or 2.1.3196 to 2.1.3213

Version 2.1.3213 fixed several bugs in the previous version, but there were no changes to the database structure. Follow these steps to upgrade from version 2.1.3162 or 2.1.3196. If you are upgrading from a version earlier than 2.1.3162, first upgrade to 2.1.3162 as described in the previous section.

1. Make a backup copy of the following files in the web application:

~/web.config

~/App_Data/galleryserverpro_data.sqlite (SQLite users only)

~/config/galleryserverpro.config

2. Delete all the web application directories and files in your Gallery Server Pro web directory EXCEPT your mediaobjects directory. If you store your media objects outside this web directory, you can safely delete the mediaobjects directory.

3. Extract the contents of the Gallery Server Pro ZIP file to the web directory.

Note: You do not need the installer directory, so don't copy it.

4. SQL Server users only: Copy the connection string from your original web.config file to the new one.

5. SQLite users only: Copy your backup of galleryserverpro_data.sqlite over the one in the App_Data directory.

.NET 3.5 users: You must replace the web.config file with one that is pre-configured for .NET 3.5.

Read the section .NET Framework 3.5 for more information.

6. Copy your backup of galleryserverpro.config over the one in the config directory.

7. Open galleryserverpro.config in a text editor. The HTML templates for four media types - mp3, wma, wmv, and asf - have been updated. Replace these sections with the following text:

<mediaObject mimeType="audio/x-mp3">

<browsers>

<browser id="default" htmlOutput="&lt;div id='mp1p'&gt;&lt;/div&gt;"

scriptOutput="Sys.UI.Silverlight.Control.createObject('mp1p', '&lt;object

type=&quot;application/x-silverlight&quot; id=&quot;mp1&quot;

style=&quot;height:{Height}px;width:{Width}px;&quot;&gt;&lt;param

name=&quot;Windowless&quot; value=&quot;True&quot; /&gt;&lt;a

href=&quot;http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0&quot;&gt;&lt;im

g src=&quot;http://go2.microsoft.com/fwlink/?LinkID=108181&quot; alt=&quot;Get

Microsoft Silverlight&quot; style=&quot;border-width:0;&quot;

/&gt;&lt;/a&gt;&lt;/object&gt;'); Sys.Application.add_init(function() {

$create(Sys.UI.Silverlight.MediaPlayer, { &quot;mediaSource&quot;:

&quot;{MediaObjectAbsoluteUrlNoHandler}&quot;, &quot;scaleMode&quot;: 1,

&quot;source&quot;:

&quot;skins/mediaplayer/AudioGray.xaml&quot;,&quot;autoPlay&quot;:{AutoStartMediaOb

jectText} }, null, null, $get(&quot;mp1p&quot;)); });

Sys.Application.initialize();Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);" />

</browsers>

</mediaObject>

<mediaObject mimeType="audio/x-ms-wma">

<browsers>

<browser id="default" htmlOutput="&lt;div id='mp1p'&gt;&lt;/div&gt;"

Page 35: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 35 of 186

scriptOutput="Sys.UI.Silverlight.Control.createObject('mp1p', '&lt;object

type=&quot;application/x-silverlight&quot; id=&quot;mp1&quot;

style=&quot;height:{Height}px;width:{Width}px;&quot;&gt;&lt;param

name=&quot;Windowless&quot; value=&quot;True&quot; /&gt;&lt;a

href=&quot;http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0&quot;&gt;&lt;im

g src=&quot;http://go2.microsoft.com/fwlink/?LinkID=108181&quot; alt=&quot;Get

Microsoft Silverlight&quot; style=&quot;border-width:0;&quot;

/&gt;&lt;/a&gt;&lt;/object&gt;'); Sys.Application.add_init(function() {

$create(Sys.UI.Silverlight.MediaPlayer, { &quot;mediaSource&quot;:

&quot;{MediaObjectAbsoluteUrlNoHandler}&quot;, &quot;scaleMode&quot;: 1,

&quot;source&quot;:

&quot;skins/mediaplayer/AudioGray.xaml&quot;,&quot;autoPlay&quot;:{AutoStartMediaOb

jectText} }, null, null, $get(&quot;mp1p&quot;)); });

Sys.Application.initialize();Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);" />

</browsers>

</mediaObject>

...

<mediaObject mimeType="video/x-ms-wmv">

<browsers>

<browser id="default" htmlOutput="&lt;div id='mp1p'&gt;&lt;/div&gt;"

scriptOutput="Sys.UI.Silverlight.Control.createObject('mp1p', '&lt;object

type=&quot;application/x-silverlight&quot; id=&quot;mp1&quot;

style=&quot;height:{Height}px;width:{Width}px;&quot;&gt;&lt;param

name=&quot;Windowless&quot; value=&quot;True&quot; /&gt;&lt;a

href=&quot;http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0&quot;&gt;&lt;im

g src=&quot;http://go2.microsoft.com/fwlink/?LinkID=108181&quot; alt=&quot;Get

Microsoft Silverlight&quot; style=&quot;border-width:0;&quot;

/&gt;&lt;/a&gt;&lt;/object&gt;'); Sys.Application.add_init(function() {

$create(Sys.UI.Silverlight.MediaPlayer, { &quot;mediaSource&quot;:

&quot;{MediaObjectAbsoluteUrlNoHandler}&quot;, &quot;scaleMode&quot;: 1,

&quot;source&quot;:

&quot;skins/mediaplayer/Professional.xaml&quot;,&quot;autoPlay&quot;:{AutoStartMedi

aObjectText} }, null, null, $get(&quot;mp1p&quot;)); });

Sys.Application.initialize();Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);" />

</browsers>

</mediaObject>

<mediaObject mimeType="video/x-ms-asf">

<browsers>

<browser id="default" htmlOutput="&lt;div id='mp1p'&gt;&lt;/div&gt;"

scriptOutput="Sys.UI.Silverlight.Control.createObject('mp1p', '&lt;object

type=&quot;application/x-silverlight&quot; id=&quot;mp1&quot;

style=&quot;height:{Height}px;width:{Width}px;&quot;&gt;&lt;param

name=&quot;Windowless&quot; value=&quot;True&quot; /&gt;&lt;a

href=&quot;http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0&quot;&gt;&lt;im

g src=&quot;http://go2.microsoft.com/fwlink/?LinkID=108181&quot; alt=&quot;Get

Microsoft Silverlight&quot; style=&quot;border-width:0;&quot;

/&gt;&lt;/a&gt;&lt;/object&gt;'); Sys.Application.add_init(function() {

$create(Sys.UI.Silverlight.MediaPlayer, { &quot;mediaSource&quot;:

&quot;{MediaObjectAbsoluteUrlNoHandler}&quot;, &quot;scaleMode&quot;: 1,

&quot;source&quot;:

&quot;skins/mediaplayer/Professional.xaml&quot;,&quot;autoPlay&quot;:{AutoStartMedi

Page 36: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 36 of 186

aObjectText} }, null, null, $get(&quot;mp1p&quot;)); });

Sys.Application.initialize();Array.add(_mediaObjectsToDispose, &quot;mp1&quot;);" />

</browsers>

</mediaObject>

Note: Instead of copying it from here, you can also get the updated template from the

galleryserverpro.config file in the download.

8. That's it. You do not have to run the installer or upgrade wizard.

Upgrading from Gallery Server Pro 2.1.3213 to 2.1.3222

This version, released just nine days after 2.1.3213 contains three bug fixes that do not affect most users, so it is not necessary to upgrade unless you are affected by one of these bugs:

(SQL Server only) You are receiving collation-related errors during installation, or you want to run Gallery Server Pro using a collation other than SQL_Latin1_General_CP1_CI_AS.

You have hidden files that you do not want imported during a synchronization.

The wrong resource name was used on the edit dialog popup window (only affects non-English translations).

Follow these steps to perform the upgrade.

1. Extract the contents of the Gallery Server Pro ZIP file to a temporary location.

2. Replace the contents of the bin directory with the dll files in the bin directory of the downloaded code.

3. Replace the file ~/uc/albumedittemplate.ascx with the matching file from the downloaded code.

Fixing the collation bug requires re-installing the SQL Server database. This causes certain columns to be defined using the default database collation rather than SQL_Latin1_General_CP1_CI_AS. Most users will not need to do this, but if it does affect you, follow these steps:

1. Make a backup of your user and gallery data using the Backup Wizard in the Site admin area.

2. Make a backup of your web.config and config/galleryserverpro.config files.

3. Create a new, empty SQL Server database.

4. Delete the contents of the web directory, except for the mediaobjects directory.

5. Extract the contents of the Gallery Server Pro ZIP file to the web directory.

6. Copy the connection string from your backup web.config file to the new web.config file.

7. Copy any custom settings from your galleryserverpro.config file to the new one.

Page 37: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 37 of 186

8. Run the web-based installer and set up Gallery Server Pro against your new, empty database.

9. After installation, restore your original data by using the Restore Wizard in the site admin area.

Uninstalling Gallery Server Pro

To uninstall Gallery Server Pro, delete the web application files and the data store. Gallery Server Pro does not use any other location such as the registry or the Program Files directory.

To delete the files and directories in the web application, navigate to the directory using a file utility such as Windows Explorer. Delete the root application directory. For example, if you installed Gallery Server Pro to C:\inetpub\wwwroot\galleryserverpro\, then delete C:\inetpub\wwwroot\galleryserverpro\.

Note: Use caution when deleting the mediaobjects directory, since it may contain media files that you

want to keep!

If using SQL Server as the data store, then use Enterprise Manager (SQL 2000) or Management Studio (SQL 2005/2008) to delete the database containing Gallery Server Pro.

Note: If you are using the database to store more than just Gallery Server Pro data, then obviously you

do not want to delete the entire database. You can delete just the Gallery Server Pro objects. All

Gallery Server Pro objects have the prefix “gs_”, so they are easy to identify. There are several tables,

stored procedures, and one user-defined function. If you are storing users and roles in the database

(which is the default), and they are not needed for any other application, they can be deleted by

deleting the tables and stored procedures that begin with “aspnet_” and views that begin with

“vw_aspnet_”.

3. Running Gallery Server Pro

Running Gallery Server Pro for the First Time

The first time you run Gallery Server Pro, a screen similar to the one shown below is displayed.

Page 38: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 38 of 186

Note: Starting with version 2.1, I shamelessly replaced the Death Valley photo with one of my family,

but I am too lazy to update this screen shot.

Log in with the administrator account you specified during the installation. An Actions menu appears to the left of the album breadcrumb menu. This menu gives you access to most of the functionality in Gallery Server Pro. Any function the logged on user does not have permission to execute is disabled.

The installer adds an album named Samples and one photo. Click the album to see a thumbnail of the photo. Click the thumbnail of the photo to see a larger version, as shown below.

Page 39: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 39 of 186

Notice the toolbar that appears above the photo. Individual buttons are shown or hidden based on the authorization of the current user and whether certain features are enabled. For example, if enableSlideShow=”false” in the configuration file galleryserverpro.config, the button does not appear. Below is a table that describes the toolbar buttons.

Show image metadata

Download media file

Toggle hi-res image

Get permalink

Start/pause slideshow

Move to another album

Copy to another album

Rotate image

Delete media object

Page 40: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 40 of 186

Toolbar button Description

Show image metadata Displays a resizable, movable popup window with metadata, such as EXIF and IPTC, from the image. Does not apply to non-image media objects. Not shown if the enableImageMetadata property is set to false in galleryserverpro.config.

Download media file Download the media file to the user’s computer. Not shown if the enableMediaObjectDownload property is set to false in galleryserverpro.config.

Toggle hi-res image Shows or hides the original, high resolution version of an image, if it exists. This button is hidden when no high resolution image exists.

Get permalink Displays a hyperlink that can be used to link directly to the current media object. This is useful because the Next/Previous buttons use AJAX callbacks to load the media object, which does not update the URL in the browser’s address bar. . Not shown if the enablePermalink property is set to false in galleryserverpro.config.

Start/pause slideshow Starts or pauses a slide show of images in the current album. Slide shows only display images; any video, audio, or documents in the album are skipped. The Start/pause slideshow button is not shown if the enableSlideShow property is set to false in galleryserverpro.config.

Move to another album Transfers the current media object to another album. The user is redirected to another page where the destination album can be selected. Not shown if the user does not have permission to move media objects.

Copy to another album Copies the current media object to another album. The user is redirected to another page where the destination album can be selected. Not shown if the user does not have permission to copy media objects.

Rotate image Redirects the user to another page where the image can be rotated. Applies only to images. Not shown if the user does not have permission to edit media objects.

Delete media object Deletes the current media object, including the thumbnail, compressed version (for images), and original media file.

Example: Adding your media library to Gallery Server Pro

This section helps you add your existing media library to Gallery Server Pro. See the section Working with Media Objects for additional options and more detailed information.

Let’s say you have thousands of photos and video clips on your hard drive at C:\MyPicsAndVideo\. Follow these steps to add them to Gallery Server Pro.

Page 41: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 41 of 186

1. Copy your media files from C:\MyPicsAndVideo\ to the mediaobjects directory in the Gallery Server Pro web application. For example, if you installed Gallery Server Pro at C:\inetpub\wwwroot\galleryserverpro\, then copy the files to C:\inetpub\wwwroot\galleryserverpro\mediaobjects\.

Note: By default, Gallery Server Pro uses the mediaobjects directory to store and manage the media

files, but you can specify any location on the web server’s hard drive. Refer to the section Media

Objects - General for more information.

2. Configure Gallery Server Pro to accept the types of media files in your collection. For example, your collection may consist of JPG, GIF, WMV, and AVI files. Use your browser to log on as an administrator, then click Site admin on the Actions menu. In the menu that appears, click Media Object Types. A list with more than 100 file types appears. By default, only JPG and JPEG files are enabled. Select those file types that exist in your collection and click Save changes.

3. Select Synchronize from the Actions menu. The Synchronize page appears. Select the option Include child directories (recursive). Click Synchronize. A popup window appears showing the progress of the synchronization as Gallery Server Pro analyzes each of your files. Click Close when finished.

4. You are done! Browse your media collection by clicking the root album from the album breadcrumb menu (default name is All albums).

4. Working with Galleries

Overview

Gallery Server Pro supports multiple galleries. A gallery encompasses all the media objects associated with a single web application. Each web application has one gallery. However, there can be multiple installations of Gallery Server Pro on a web server, with each specifying a different gallery.

The albums and media objects within each gallery are not visible to other galleries. The list of user accounts and roles can be shared across galleries or separated depending on your requirements. A single SQL Server database can store data for an unlimited number of galleries.

Galleries are useful for setting up hosted solutions where individuals require administrative permission to separate groups of media objects. They are also useful when site-wide settings, such as watermarking, need to be applied to multiple groups of albums and media objects.

For example, one can set up a gallery at http://www.yoursite.com/robert/ and another at http://www.yoursite.com/susan/. Each gallery is set up with its own membership, where user Robert is the administrator for his site and user Susan is the administrator for the other. Robert and Susan manage each of their galleries, but neither has permission to the other gallery. Robert cannot view any of Susan’s media objects from his URL http://www.yoursite.com/robert/ and vice versa. Robert can enable any site-wide setting such as watermarking and thumbnail length without affecting Susan’s site.

Page 42: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 42 of 186

Even though the two sites appear as completely separate web applications, both can share the same data store. This simplifies the management of Gallery Server Pro, and offers greater value to customers who pay hosting providers on a per-database policy.

By default, Gallery Server Pro is installed with a gallery ID = 1. The gallery ID is managed on the Site settings – General page in the Site administration console.

SQLite Users

The concept of galleries is useful when groups of media objects must be kept separate and the data must be stored in a single SQL Server database.

Starting with 2.1, you can store data in a SQLite database that is locally stored within the web application. Since each web application has its own SQLite database (and therefore list of users accounts and gallery data), it is not necessary to follow these directions for creating multiple galleries. Instead, just run the install wizard in each web application. Each web application is completely self contained and does not have access to the other.

If you want to share a single set of user accounts across multiple web applications, then use SQL Server or store your SQLite database file in a shared location and then update your web.config file in each web application to point to this file (galleryserverpro_data.sqlite).

SQL Server Users

To set up an additional instance of Gallery Server Pro to use a different gallery than the default, follow these steps.

1. Copy the web application files for Gallery Server Pro from the original instance and save them to a new location on the web server’s hard drive. Do not copy any media files that may be in the mediaobjects directory.

2. Use IIS to configure the directory as a web application.

3. Open the home page for the new application in a web browser. Log on to the application as an administrator and click Site admin from the Actions menu. The following screen appears.

Page 43: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 43 of 186

4. Change the gallery ID to a new value, such as 2. Click Save changes. Behind the scenes, Gallery Server Pro updated the galleryId property in the configuration file galleryserverpro.config.

5. Click the root album. In the example above, the root album is named All albums. You will probably see a screen similar to the following.

Page 44: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 44 of 186

* Behind the Scenes* The first time a page is clicked after the galleryserverpro.config file is updated,

the Gallery Server Pro web application restarts, using the new values in the config file. Special startup

code runs that checks for basic data integrity in the data store. This includes verifying that a record

exists in the gallery table for the current gallery (table gs_Gallery), a root album exists in the album

table (gs_Album), and that each role is linked to the current gallery (table gs_Role). In this case, when a

new gallery ID is specified, Gallery Server Pro will add a record to gs_Gallery, a record to gs_Album,

and as many records to gs_Role as there are roles in the roles provider. However, for security reasons,

Gallery Server Pro does not give any of the roles permission to the root album, so no accounts will

have access to the new gallery until one of the tables is manually updated (explained below).

6. If the message Insufficient permission appears, don’t panic. The security system is working properly. (For an explanation, read the Behind the Scenes section above.) Use SQL Management Studio (SQL 2005/2008) or Enterprise Manager (SQL 2000) to open the table gs_Role in the Gallery Server Pro database.

7. You need to give Administer site permission to a role. Search the records in the table gs_Role until you find one where the FKGalleryId column matches the new gallery ID and the RoleName field contains a role that should have Administer site permission to the new gallery. For this record, set the AllowAdministerSite field to true. (A default installation of Gallery Server Pro creates a role named System Administrator with this permission, so if this role exists in your installation you will look for the record where RoleName = System Administrator and FKGalleryId = 2.)

Page 45: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 45 of 186

8. Since Gallery Server Pro uses caching to retain a list of roles and permissions, the cache must be cleared by restarting the web application. This can be done by recycling the application pool in IIS or by entering the text iisreset in a Start-Run dialog box.

9. Now click the All albums link to open the root album. It should be empty, as shown below.

10. The new gallery is ready to go! Add new albums and media objects. Notice they do not appear in the original gallery (gallery ID = 1), even though both galleries use the same database.

5. Working with Albums

Overview of Albums

Gallery Server Pro stores media objects in albums, and each album holds zero or more media objects and/or child albums. This is similar to how Windows stores directories and files. In fact, Gallery Server Pro stores albums as directories in the file system, and media objects are stored as files (which makes sense, since they are files.)

Gallery Server Pro starts with one album that serves as a container for all other albums. This top-level album is called the root album and by default is named All albums. This album can never be deleted. Media objects and albums are added to the root album. In turn, each child album can store additional media objects and/or child albums.

Page 46: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 46 of 186

There is no limit to the number of media objects and albums one can store, except the limit presented by hard drive space limitations and the operating system for maximum file path length. That is, since some versions of Windows have a maximum file path length of 260 characters, the full path to the album (directory) must be less than this limit.

You must be logged on to perform any action in Gallery Server Pro that modifies albums or media objects. Once logged on, the Actions menu (shown below) is displayed.

Note: If the Actions menu does not appear when you are logged on, that means you do not have

permission for any of its menu items. In this case, Gallery Server Pro does not render the menu.

Only those menu items that are valid for the current album, and for which the current user has permission, are enabled. For example, if the logged on user does not have Add album permission, the Create album menu item will be disabled.

Page 47: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 47 of 186

Creating an Album

An album is a container that holds one or more media objects and/or child albums. Upon installation Gallery Server Pro has one album named All albums.

To create a new album select Create album from the Actions menu. The following page appears.

Step 1: Type the desired name of the album in the Album name field. The album name is limited to 200 characters.

Step 2: Specify in which album the new album should be created. The existing albums are displayed in a tree view. A check box appears next to all albums for which the current user has Add album permission. By default, the album you were viewing when you chose Create album from the Actions menu, is selected.

After clicking Create album, the album is created and a screen showing its contents is displayed, as below. It is, of course, empty.

Page 48: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 48 of 186

Edit Album Information

To edit the information for the albums, select Edit album info from the Actions menu or double click the rectangular area in which the Album’s name, summary and begin and end dates appear, as shown below.

Page 49: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 49 of 186

Note: If nothing happens when you double click in the album area, then you are not logged on or you

do not have Edit album permission.

The Edit album box appears as shown below.

Fill in the text boxes as desired. Note character maximums for the text boxes and the necessary format for the date fields. All fields are optional. To learn more about private albums see the section Hiding Albums from Users. Click Save to return to the album view with the newly entered information displayed.

If no begin or end date is entered for an album, the Date label is hidden. It will re-appear if a date is entered.

* Behind the Scenes * Album information is saved to the web server through an AJAX callback.

How album titles correspond to the directory names on the hard disk

Recall that each album in Gallery Server Pro has a matching directory in the media objects folder. When an album’s title is changed, Gallery Server Pro modifies the name of the directory for that album to match the title. In the example above, the album title is Photos and the corresponding directory in the media objects folder is also named Photos. If the title is changed to My Favorite Photos, Gallery Server Pro will modify the directory name to My Favorite Photos.

This is all well and good, but we have a problem. Most (all?) Windows operating systems cannot handle a directory path longer than 255 characters. Since a title in Gallery Server Pro can be up to 200 characters, one could reach this limitation pretty easily. To help prevent this, Gallery Server Pro only uses the first

Page 50: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 50 of 186

twenty-five characters of the title for the directory name. As a result, you will notice an album with the title “This is a long title for an album” has a directory with the name “This is a long title for ”.

You might want to change this behavior. For example, you may have all your photos in a directory structure with lots of long names, and you don’t want Gallery Server Pro truncating them when you edit the album’s title. There are two configuration settings in galleryserverpro.config available to modify this behavior:

defaultAlbumDirectoryNameLength – Gallery Server Pro will truncate directory names longer than this value. The default value is 25, but it can be any value from 1 to 255.

synchAlbumTitleAndDirectoryName – Indicates whether to update the directory name corresponding to an album when the album's title is changed. The default value is true. Setting it to false tells Gallery Server Pro to never alter the directory name. The only exception to this is when Gallery Server Pro has to slightly tweak the name of a directory to prevent a naming conflict. For example, this may happen if you move or copy an album into a directory containing another album with the same name. When this setting is false, the configuration setting defaultAlbumDirectoryNameLength has no effect.

Delete an Album

To delete an album, first navigate to album to be deleted. Choose Delete this album from the Actions menu. The following confirmation page appears.

Page 51: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 51 of 186

If you are sure you want to delete the album, click Delete album. The album, all child albums, and all media objects in the album(s) are permanently deleted. There is no undo function, so use caution!

Note: For media objects, both the records in the data store and the media files on the hard drive are

permanently deleted.

Note: The current user must have Delete child album permission for the parent album of the album

being deleted. If the album contains media objects, they are also deleted, even if the user does not

have Delete media object permission.

Note: When the media objects directory is within the web application (as it is by default), deleting an

album triggers an application restart. This flushes all cache and session objects, causing issues with any

synchronizations or file uploads that happen to be occurring. This, unfortunately, is a "feature" of

ASP.NET 2.0 that occurs when a directory is deleted within the web application. The easiest way

around this is to put the media objects directory outside the web application (for example,

D:\my_media_objects). Read the section Media Objects – General for more information about

changing the media objects directory. Another solution is to create a directory junction.

Move / Copy an Album

Albums are copied in the same way that media objects are copied. See Move / Copy Objects for instructions.

Assign Album Thumbnail Object

Each album has an album thumbnail image. This image is shown whenever an icon representing an album is displayed on a web page. In the screen shot below, there are two albums and one image. The images shown for the two albums are the thumbnail images for that album.

Page 52: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 52 of 186

By default, the first media object added to an album is used as the thumbnail image for the album. However, you can choose any media object in the album. To designate an album’s thumbnail image, choose Assign thumbnail from the Actions menu. The media objects are then displayed—each with a radio button underneath, as below.

Album thumbnail images

Page 53: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 53 of 186

Select the image you would like to use as the thumbnail image for the album. When you click Assign thumbnail, the image you selected is now set to be displayed whenever an icon view of the album is shown.

NOTE: You must select an image from the current album.

If the image currently set as the thumbnail image for an album is moved or deleted, Gallery Server Pro automatically selects the next media object in the album as the thumbnail image. If no image is available (because the album is empty), a default image is used. The format and text displayed on the default image can be specified on the Albums – General page in the Site administration console.

Page 54: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 54 of 186

Synchronize an Album

Gallery Server Pro maintains two related sets of data – the media files stored in directories on the web server’s hard drive and metadata about those files and albums in the database. If the two sets of data ever get out of synch, you can synchronize the database with the media files on the hard drive to restore data integrity.

When should you synchronize? You might want to synchronize when:

You just installed Gallery Server Pro and you want to load the database with your entire media library.

You just extracted a bunch of photos or videos from your digital camera and you want to quickly add them to Gallery Server Pro. Sure, you could ZIP them up and use the Add objects menu command, but some people find it easier to copy the media files to the web server and then synchronize.

You added, moved, copied, or deleted images using Windows Explorer instead of the Gallery Server Pro interface, causing the database to become out of synch with the media files on the web server's hard drive.

You used a third party program like PhotoShop to alter one or more images, and you want Gallery Server Pro to recreate the thumbnail and compressed images.

In simple terms, the synchronization procedure updates the Gallery Server database with information about the media files on the web server’s hard drive, and makes sure the media files have valid thumbnail and compressed versions. Remember that the files themselves are not stored in the database; only metadata about them (size, width, height, etc…)

Synchronizing also ensures the album has a valid album thumbnail image. See the section about setting the album thumbnail image to learn more about what this is.

You can synchronize an album, an album and all child albums, or the entire gallery.

To synchronize an album, navigate to the album you want to synchronize. Then click the Synchronize command from the Actions menu. The following screen appears.

Note: The current user must have Synchronize permission for the album being synchronized.

Page 55: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 55 of 186

There are four options you can check. They are:

Include child directories (recursive) – When checked, any albums within this album are also synchronized. Recently added directories are added to the gallery as new albums. If the current album does not contain any child albums, this setting has no effect.

Overwrite existing thumbnail images – When checked, new thumbnail images are created when you synchronize the database, even if it means overwriting existing thumbnails. The thumbnails are created from the original media object. If unchecked, a new thumbnail is created only if it doesn't exist. Synchronizing the database will run faster if you leave this option unchecked.

Overwrite existing compressed images – When checked, new compressed images are created when you synchronize the database, even if it means overwriting existing compressed images. The compressed images are created from the original image. If unchecked, a new compressed image is created only if doesn't exist. This setting applies only to images in the gallery. Synchronizing the database will run faster if you leave this option unchecked.

NOTE: Compressed versions of images will exist only for images whose file size is larger than the

Compression limit or whose length is larger than the Compressed image length. More information

about these settings can be found in the Media Objects – Images section.

Page 56: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 56 of 186

Re-import metadata for existing images – When checked, metadata that was extracted from images when they were first added to Gallery Server Pro are replaced with the current metadata in the original image file. Metadata includes items such as camera model, shutter speed, title, and keywords. Gallery Server Pro supports the following formats: EXIF, XMP, tEXt, IFD, and IPTC. For example, this is useful if you used a program like Vista Photo Gallery to add keywords to the image files and you want Gallery Server Pro to retrieve this information to aid in searching. This setting has no effect on non-image media objects. More information about image metadata is in the Extracting Image Metadata section.

Note: Metadata that may exist in the original image files are not replicated to the thumbnail and

compressed versions. If you delete the original versions of photos using the Delete hi-res images

command, that means there is no metadata to extract during subsequent synchronizations. The

consequence of this is that checking this option after you have deleted the original images will cause

you to lose the metadata that was extracted from the original files. Therefore, it is recommended to

leave this option unchecked when you synchronize an album whose original, high resolution photos

have been deleted.

When you have selected the desired options, click Synchronize. A popup window like that shown below provides real-time status of the task.

Page 57: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 57 of 186

A message will indicate when the task is complete, and a Close button will appear on the popup window. Click Close to close the popup window.

NOTE: Click Cancel to stop a synchronization, but be aware this can cause the database to become out

of synch with the media files on the hard drive. If you discover any issues after cancelling, start another

synchronization and allow it to finish.

Some additional points to remember about synchronizing:

Gallery Server Pro will ignore any file whose type is not enabled on the Media Object Types page in the Site administration console.

Gallery Server Pro NEVER modifies or deletes the original media files during synchronizing. (Rotating is the only function in Gallery Server Pro that modifies the original media file, and that applies only to images.)

Page 58: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 58 of 186

Gallery Server Pro searches for media files only in the directory corresponding to the specified album. If the Include child albums option is turned on, then all files below the specified directory will also be synchronized. But Gallery Server Pro does not search for or add media files outside the Original file storage location.

Thumbnail images are stored in the Thumbnail image storage location. By default, all thumbnail images begin with the prefix zThumb_. If desired, this can be changed in the configuration file galleryserverpro.config.

Compressed images are stored in the Compressed image storage location. By default, all compressed images begin with the prefix zOpt_. If desired, this can be changed in the configuration file galleryserverpro.config.

If the thumbnail or compressed images are ever deleted, then can be recreated by performing a synchronization.

Note: The properties mentioned above: Original file storage location, Thumbnail image storage

location, and Compressed image storage location can be found on the Media Objects – General

page in the Site administration console.

Depending on your web server, Gallery Server Pro typically synchronizes from one to twenty images per second. Keep in mind that if you have thousands of images, it may take a long time.

Gallery Server Pro does its best to preserve captions and other information you enter about a media object. For example, if you use Windows Explorer to move a media file from one directory to another, and then synchronize the database, Gallery Server Pro will re-link the file with the existing database record, thus preserving the information. (This is done by creating a hash code of the file based on its name and creation date and searching for a matching hash code.) However, Gallery Server Pro does not preserve album information (e.g. the summary and begin/end dates) if you move a directory to another directory outside of the Gallery Server Pro user interface. In general, you should use the Gallery Server Pro web interface when you add, move, copy, and delete media objects and albums.

You can modify any Gallery Server Pro media object in a third party program like PhotoShop without losing the caption or other data you entered, as long as you don’t change the file name or the file’s created date/time stamp.

Your images must be located on the same machine as your web server.

* Behind the Scenes * During a synchronization, database records are inserted, updated and deleted, and compressed and thumbnail versions of media objects are created and/or overwritten on the hard drive. Specifically, synchronizing performs these steps:

1. A table named gs_Synchronize exists in the database to manage the synchronization process. When a synchronization is started, this table is updated so that other users cannot begin a second synchronization until the first one is complete.

2. Starting with the first file Gallery Server Pro finds in the directory representing the specified album, Gallery Server Pro checks its file type to determine if it should be managed by Gallery

Page 59: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 59 of 186

Server Pro. If it is, it tries to find the corresponding record in its database, based on a hash of the file name and the date/time stamp of when the file was created.

3. If a record is found, it is updated with current information about the file, such as its size and the album to which it belongs.

4. If a record isn’t found, a new media object is created.

5. Gallery Server Pro checks to make sure a thumbnail image exists to represent this media object. If the media object is an image, it verifies a compressed image exists. If not, one is created. If the option Overwrite existing thumbnail image or Overwrite existing compressed image is checked, then new versions are always created, even if it means overwriting an existing compressed or thumbnail image.

6. Gallery Server Pro continues processing each file it finds. If the Include child directories option is checked, then all the album’s subdirectories are recursively processed.

7. If any album or media object records in the data store weren’t updated during this synchronization, then they must not have corresponding media files on the hard disk, and the records are deleted from the data store.

6. Working with Media Objects

Overview of Media Objects

A media object is any file managed by Gallery Server Pro. Typically these are photos, video, audio, and PDF documents, but they can be any file type. The default installation enables JPG and JPEG files. To enable additional types, use the Media Object Types page in the Site administration console.

A media object can also be an HTML fragment that refers to externally hosted content (for example, YouTube videos).

The available functions vary depending on the type of media object. For images, Gallery Server Pro extracts metadata such as camera model, shutter speed, etc. Gallery Server Pro also provides the ability to apply a watermark to images, run a slide show, and rotate images.

All media objects can be rearranged, moved or copied to another album, deleted and have their captions edited.

The available functions also depend on the authorization of the logged on user. A user with Administer site permission has unrestricted access to all functions for all albums. A user with restricted access, however, will find particular functions disabled in the Actions menu, or toolbar items will be missing from the media object view page.

Video and audio files are rendered to the browser in an <object> tag. If the user’s browser has a plug-in capable of playing the video or audio, the plug-in appears and the user can play the file.

Page 60: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 60 of 186

Any media object - except for externally hosted objects such as YouTube videos - can be downloaded by clicking the Download toolbar item on the media object view page. This is useful for documents and for audio and video files the browser cannot render.

The HTML for individual media objects is dynamically built from a template stored in the configuration file galleryserverpro.config. In that file one can modify the template so that, for example, videos are rendered in an <embed> tag rather than an <object> tag. Also, different HTML can be sent based on browser and browser family. See the section Rendering Media Objects to the Browser for more information.

Adding Media Objects

There are several ways to add media objects to the gallery. Each of these is discussed below.

1. Use a web browser to upload individual files.

2. Use a web browser to add externally hosted media objects.

3. Use a web browser to upload a ZIP file containing multiple files.

4. Configure Gallery Server Pro to change the media objects directory to an existing directory containing media objects, then use a web browser to synchronize Gallery Server Pro with the files.

5. Manually copy files into the Gallery Server Pro media objects directory, then use a web browser to synchronize Gallery Server Pro with the files.

Upload individual files using a web browser

You can add individual media objects to a single album with this technique.

1. Log on to Gallery Server Pro with an account that has permission to add media objects.

2. Navigate to the album to which you want to add media objects.

3. Select the Add objects link from the Actions menu. The screen shown below appears.

Note: If you do not see the Actions menu, either you are not logged on or the account under which

you are logged on does not have permission to execute any of its commands.

Page 61: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 61 of 186

4. Click the Browse button and select a file. To add more than one file, click the Add File button. Click Upload. The Upload Status progress bar will indicate the progress of the upload.

Note: In certain cases the Upload Status progress bar is not present and the upload control looks

slightly different. This will occur when the web application is running at less than Full Trust.

Note: The caption for each object defaults to the file name. For images, if the title metadata item

has been specified, that value is used for the caption instead of the file name.

Page 62: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 62 of 186

5. The files are transferred to the web server and added to the Gallery Server Pro database. When the upload is complete, you will see thumbnail-sized objects representing the object(s) you have just uploaded on the album view page.

Add externally hosted media objects

You can add media objects that are hosted elsewhere, such as another web site on your intranet or even the internet. For example, you might upload your videos files to Silverlight Streaming and then add links to those videos within Gallery Server Pro. Since the videos are streamed straight from the external web site, you save on disk storage and bandwidth costs.

Any web site that offers embed code that you can copy can be used. A few common ones are YouTube, MSNBC, CNN, Comedy Central's Daily Show, and metacafe.

For example, below is a screenshot of a video on YouTube. Notice, at center right, the embed code. This code can be added to any web site to refer to the original video. Copy this code and paste into Gallery Server Pro to add the video. Although it appears within the Gallery Server Pro gallery and can be browsed, moved, copied, and deleted, the video is actually stored on - and served from - the YouTube web site.

Page 63: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 63 of 186

1. Log on to Gallery Server Pro with an account that has permission to add media objects.

2. Navigate to the album to which you want to add media objects.

3. Select the Add objects link from the Actions menu. Click the External Content tab. The screen shown below appears.

Note: If you do not see the Actions menu, either you are not logged on or the account under which

you are logged on does not have permission to execute any of its commands.

Page 64: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 64 of 186

4. Select the type of media object you are adding (audio, image, video, or other). This is used to determine an appropriate thumbnail image for the object.

5. Enter a title.

6. Paste the embed code into the HTML Fragment / Embed Code textbox. This is the code you copied from the other web site.

Page 65: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 65 of 186

Warning: In an effort to be as flexible as possible, Gallery Server Pro allows HTML and even javascript

in this textbox. Make sure you trust anyone who may be adding objects. For increased security, you

can disable this feature on the Media Objects - General page.

7. Click Add media object. The media object will be created and shown, as seen here:

When you click on the thumbnail image, the object will appear:

Page 66: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 66 of 186

Forcing the menu to appear above media objects

Certain plug-ins, in certain browsers, will render in the browser as the top level object, preventing other objects from displaying above them. For example, in Firefox, when you add a YouTube video, the menu appears behind the video, like this:

Page 67: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 67 of 186

In some cases you can prevent this issue by tweaking the embed code provided by the web site. For example, the default embed code from YouTube looks similar to this:

<object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/HWDCeEJ9ZfI&hl=en&fs=1"></param> <param name="allowFullScreen" value="true"></param> <embed src="http://www.youtube.com/v/HWDCeEJ9ZfI&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344">

Page 68: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 68 of 186

</embed> </object>

This code instructs the browser to use the Flash plug-in to play the video. If you know a little about Flash, then you know that you can entice a little better behavior by adding a <param …> element and a wmode attribute to the <embed …> tag, like this:

<object width="425" height="344"> <param name="movie" value="http://www.youtube.com/v/HWDCeEJ9ZfI&hl=en&fs=1"></param> <param name="allowFullScreen" value="true"></param> <param name="WMODE" value="opaque"></param> <embed src="http://www.youtube.com/v/HWDCeEJ9ZfI&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344" wmode="opaque"> </embed> </object>

When you add a media object with this modified embed code, the menu now appears on top of the Flash plug-in:

Page 69: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 69 of 186

Although this trick works for Flash, other plug-ins behave differently. For example, while I was able to get the menu to render correctly for locally hosted files played in the Silverlight plug-in, I don't know of a technique for tweaking the embed code for objects hosted at Silverlight Streaming. At this moment, the menu hides behind the plug-in for Firefox users (IE works correctly). Please contact me if you find a solution.

Page 70: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 70 of 186

Upload a ZIP file containing multiple files

This is a flexible technique allowing you to efficiently add a virtually unlimited number of media objects very quickly. First prepare a ZIP file containing the files you wish to add to Gallery Server Pro, then upload the ZIP file using the Add objects menu option.

Refer to the previous section for uploading a file. When you select a file to upload, choose the ZIP file you prepared.

Note: If the ZIP file contains multiple directories, even nested ones, then those directories are

converted to albums. Use this to your advantage! For example, the first time you use Gallery Server

Pro, you may have dozens, hundreds, or even thousands of photos you want to add. Put them all into a

ZIP file with the desired directory hierarchy, and upload it to Gallery Server Pro.

Configure Gallery Server Pro to point to an existing directory containing media objects, then use a web browser to synchronize Gallery Server Pro with the files.

By default, Gallery Server Pro stores all media object files in a subdirectory named mediaobjects. This can be changed to any location on the web server’s hard drive. To change this location, follow these steps:

1. Log on to Gallery Server Pro with an account that has Administer site permission.

2. Click the Actions menu and go to Site admin.

3. In the left menu, navigate to Media Objects – General. At the top of the page is a section called Media object storage. It allows you to specify the storage location for media objects, the thumbnail that represent the media objects, and the optimized (compressed) versions of images.

4. You can enter a path relative to the web application, or a full physical path to anywhere on one of the server’s hard drives.

Note: UNC or mapped drives are not permitted.

5. Click Save changes. If successful, you will see a confirmation message. A label below each text box shows the full physical path to the directory you specified. This helps confirm the directory location is where you intend it when you enter a relative path.

Note: Changing the location does not move media objects to the new location. For example, if you

choose a new location for thumbnail images, you should immediately synchronize the database to

generate new thumbnails in the new location (or you can use Windows Explorer to manually copy

the files). If you change the media objects path and then synchronize the database, the files in the

new location will replace all database entries for the previous media objects. Use care so you do

not inadvertently delete objects.

Follow the steps in the Synchronize an Album section to synchronize the media object files on the hard disk with the Gallery Server Pro database.

Page 71: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 71 of 186

Manually copy files into the Gallery Server Pro media objects directory, then synchronize

By default, Gallery Server Pro stores all media object files in a directory named mediaobjects. You can copy files to this directory and then synchronize the files with the Gallery Server Pro database. If you copy directories into this folder, they will be converted into albums in Gallery Server Pro.

You can copy the files using any technique such as FTP or Windows Explorer. Once you have finished, follow the steps in the Synchronize an Album section to synchronize the media object files on the hard disk with the Gallery Server Pro database.

Edit Captions

Each media object has a caption associated with it. You can edit all captions for an entire album at once, or edit a caption for a single media object. Both techniques are described below.

Note: The maximum length for a caption is 1000 characters. If you enter a caption longer than this, it is

automatically truncated to 1000 characters.

Note: Common HTML tags are recognized and preserved if the Allow HTML in titles and summaries of

albums and media objects option is enabled. If this option is disabled, all HTML tags are automatically

removed. Javascript is never allowed. Refer to the Site settings – General page for more information.

Editing multiple captions at once

When viewing multiple objects within a single album, captions can be edited by choosing Edit captions from the Actions menu. When the images are displayed with text boxes beneath them, edit the contents of the scroll bar to read the desired captions, and choose Save captions. Below is a screenshot of the Edit captions page.

Page 72: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 72 of 186

Edit the caption for a single media object

When viewing a single object on the media object view page, its caption can be edited by double clicking the existing caption beneath the object. A text box appears as shown below. Edit the text and choose Save changes.

Page 73: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 73 of 186

Delete Objects

Deleting a media object removes information about it from the data store and permanently deletes the media file from the hard drive. Also deleted is the thumbnail image and compressed image (if it exists).

For externally hosted objects, such as YouTube videos, only the database record and locally stored thumbnail image is deleted. The object on the external web server is not affected.

You can delete several media objects at once using the Delete objects command, or delete a single media object using the Delete toolbar button. Both techniques are described below.

Note: Deleting an object is permanent! There is no undo command, and once an object is deleted,

there is no way to retrieve it.

Delete Multiple Media Objects

To delete multiple objects in an album, navigate to the album containing the objects you wish to delete. Choose Delete Objects from the Actions menu and the following page appears.

Page 74: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 74 of 186

Select one or more media objects to delete by checking the checkbox below it. To quickly check or uncheck all media objects within the current album, use the checkbox next to Check/Uncheck all. Individual items can then be unchecked or checked as desired. When you are finished, click Delete selected objects. The objects you selected are permanently deleted.

Note: Albums are not available for selection to be deleted on this page. To delete an album, navigate

to the album and select Delete this album from the Actions menu.

Delete Individual Media Object

To delete a single media object, navigate to a page showing the media object in media object view. Choose the red “X” toolbar button from the toolbar above the media object. A popup window asks for confirmation that the object should be deleted, as shown below. Choose OK and the object is permanently deleted.

Page 75: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 75 of 186

Note: If the current user does not have permission to delete the media object, the Delete toolbar

button does not appear.

Delete High-Resolution Version of Images

When you add images whose file size is large, Gallery Server Pro automatically created a compressed version that is more bandwidth-friendly and takes up less hard drive space. However, the original is not deleted and is still available through the Show/hide the original, high-resolution image toolbar button.

You can save significant amounts of hard drive space by deleting the original high resolution versions of images, keeping only the compressed and thumbnail versions.

Note: This function applies only to images.

Delete toolbar button

Page 76: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 76 of 186

Navigate to the album containing the images for which you want to delete one or more high resolution images. Click the Delete hi-res images command in the Actions menu. The following screen appears.

The images in the current album are displayed with checkboxes underneath them. Gallery Server Pro calculates and displays the hard drive space that would be saved if all high resolution images in the current album were to be deleted.

Page 77: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 77 of 186

Check the checkboxes of the thumbnails for which you would like to delete the corresponding high resolution image. The thumbnail and compressed versions will not be deleted.

NOTE: The high resolution images will be permanently deleted from the web server! If these images

are important, make sure you have a copy safely stored elsewhere.

Move or Copy Media Objects

Media objects can be moved or copied to other albums. When a copy is made, a copy of the media file is saved to the directory representing the destination album. The original file remains in the source album.

Note: This section applies to moving or copying media objects within a single gallery. To transfer objects to another gallery (that is, web application), back up the gallery and then restore it at the destination. See the Backup / Restore section for more information.

An example: Copying Several Media Objects

Let’s look at an example. Say we have an album called Summer 2008 that contains several photos. We want to copy a few of those photos into another album called My favorites. We start by navigating to the Summer 2008 album. Then we click Copy objects from the Actions menu. A screen like this will appear:

Page 78: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 78 of 186

Select the media objects to copy. When I click Choose these objects, a screen like this appears:

Page 79: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 79 of 186

Since I want to move these photos into the My favorites album, I select that album. Then I click Copy objects. The photos are copied and I am redirected to the My favorites album where I can see that – yes – the photos were indeed copied.

An example: Moving a Single Object

As you browse your media objects, imagine you come across one that you want to move to your My favorites album. The page might look like this:

Page 80: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 80 of 186

Click the toolbar button labeled Transfer this object to another album. The following screen appears.

Move object button

Copy object button

Page 81: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 81 of 186

Select the My favorites album, and click Move object. The photo will be moved to the album.

Note: To copy the object instead of move it, click the toolbar button labeled Copy this object to

another album.

Rearrange Objects

To change the order in which Gallery Server Pro displays objects on a web page, choose Rearrange objects from the Actions menu. The media objects in the current album are displayed as shown below.

Page 82: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 82 of 186

Note: The Rearrange objects command on the Actions menu is only enabled when the logged on user

has Edit album permission for the current album.

To change the sequence of an object, drag it to the desired location. A rectangular area near the top and bottom of the screen scrolls the window up or down when the mouse hovers over it. Use these areas to drag objects above or below the visible portion of the window. When the user clicks Save changes, the objects will be displayed in album view, again in the right-to-left, then top-to-bottom format.

* Behind the Scenes * Rearranging objects modifies the Sequence field in the database table

gs_MediaObject (for media objects) and gs_Album (for albums).

Rotate Objects

Images can be rotated in intervals of 90 degrees in any direction. You can rotate all the images in an entire album at once, or rotate just a single image. Both techniques are described below.

Drag the media object to the desired location.

Page 83: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 83 of 186

Note: Only images can be rotated. Gallery Server Pro does not support rotating videos or other types

of objects.

Rotate more than one image

To rotate more than one image in the current album, choose Rotate images from the Actions menu. The thumbnails in the current album are displayed with selectable arrow boxes on each of the images’ four sides, as below.

For each image that needs to be rotated, click on the arrow on the side that should be on top. Click Rotate images and thumbnail image, original image, and compressed image (if it exists) for each image you selected will all be rotated as specified.

Note: After the images are rotated, your browser may display the previous image from its cache rather

than the newly rotated image. To get the latest version, refresh the page in your browser (pressing F5

or CTRL-F5 works in most browsers).

Note: Rotating is the only function in Gallery Server Pro that modifies the original image file. In some

cases, repeatedly rotating an image will degrade the original, so use this function with caution. Of

course, your thumbnails and compressed images may get degraded also, but they can always be

regenerated from the original, so that is not as big a concern.

Page 84: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 84 of 186

Rotating a single image

To rotate a single image from the media object view page, select the Rotate this image toolbar button from the toolbar above the image, as shown below.

A selectable arrow box is added to all four sides of the image, as below.

Rotate image button

Page 85: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 85 of 186

Click on the arrow box on the side that should be on top. Click Rotate image and the image will be rotated as requested.

Note: After the image is rotated, your browser may display the previous image from its cache rather

than the newly rotated image. To get the latest version, refresh the page in your browser (pressing F5

or CTRL-F5 works in most browsers).

Page 86: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 86 of 186

Watermarking

The watermark feature is a powerful tool to help protect images from unwanted duplication or to communicate the source of the image.

Watermarks are rendered dynamically on the image when it is requested by the browser. The original image files are not modified, and no files are stored on the web server with watermarks applied to them. If a user downloads an image using the Download toolbar button above an image, the downloaded image has the same watermark as the image rendered in the browser.

Below is an example of a photo with an image and text watermark.

Gallery Server Pro supports two kinds of watermarks:

A custom image that is applied to each image. For example, the Gallery Server Pro logo in the image above.

Custom text that is applied to each image. For example, the copyright message in the image above.

You can configure one or both of these watermarking techniques. Furthermore, you can control the following attributes of each watermark:

The source of the watermark image. Use your own image file.

The location to apply the watermark on the image. Choose from nine locations, such as TopLeft, MiddleCenter, etc.

The size of the watermark. The size can be relative to the size of the image, such as 50% of the width of the image. For a text watermark, you can optionally specify the font size.

Page 87: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 87 of 186

The opacity, from transparent to completely opaque.

For text watermarks, specify the font name and size.

Note: The watermark image and/or text applies to the entire application. It is not possible to specify

different watermarks for different albums or media objects. However, you can approximate this

feature by implementing multiple galleries, since each gallery can have its own watermark. Read the

section Working with Galleries for more information.

Although you cannot specify different watermarks within the application, you can specify that certain

users do not get the watermark. See the section Configure role-based watermarking below.

Enable watermarking

Watermark functionality is configured in the Site administration console. Click Site admin from the Actions menu. Then click Media Objects – Images from the menu on the left. Refer to the Media Objects – Images section for detailed information on the various configuration options.

Configuring role-based watermarking

Certain users can be configured to not receive the watermark. This is useful for, say, professional photographers who wish to allow users to browse all photos in the gallery. A watermark can be applied to users by default, but paying customers can be given a user account where watermarks are not rendered on the images. This can be specified at the album level so that certain albums render watermarks for a given user while others do not.

To configure Gallery Server Pro so that all users receive a watermark except for a certain user account, follow these steps.

1. Enable the watermark functionality. This is done on the Media Objects – Images page in the Site administration console.

2. Configure a role with Do not show watermark on image permission for at least one album.

3. Add a user to this role. (Make sure the user has view access to the desired media objects. Add view permission if necessary to the role you configured in step 2.)

Note: Browsers often cache images, so you may need to refresh the browser in order to see the

non-watermarked version of an image that previously had a watermark.

Page 88: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 88 of 186

Examples of watermarks

Below is a text watermark with the letters “TIS” set to 100% of the image width. Opacity is set to 20%. (TIS stands for Tech Info Systems.)

Here is an example where a custom image has been specified to be 100% of the width of the photo. Opacity is set to 20%.

Page 89: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 89 of 186

Image Metadata

When images are added to Gallery Server Pro, any metadata embedded in the file is extracted and saved to the data store. Gallery Server Pro can extract data in any of the following formats: EXIF, XMP, tEXt, IFD, and IPTC.

Viewing image metadata

When viewing an image, click the View information about this media object toolbar button that appears above the image, as shown below. A popup window shows all the metadata that has been extracted for an image. This is a read-only list and cannot be edited.

Gallery Server Pro stores each user’s preference for whether or not the Image metadata popup is shown. This preference is persisted across logon sessions.

Toggles image metadata

Page 90: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 90 of 186

Bonus: .NET 3.0 metadata extraction

Gallery Server Pro requires .NET Framework 2.0, and most metadata can be extracted using the functionality contained within it. However, .NET Framework 3.0 allows important new metadata items to be extracted. The most important of these are titles and keywords.

For example, one can use Vista's Windows Photo Gallery to add titles and keywords to images, and Gallery Server Pro will extract them, where they are then available for viewing and for the search function.

If Gallery Server Pro detects that .NET Framework 3.0 is installed on the web server, and if the application is running under Full Trust, it automatically takes advantage of this additional functionality.

Searching

The search functionality in Gallery Server Pro allows one to find all objects that contain the search criteria. The following properties are included in the search:

Album title and summary

Media object caption and file name

Media object metadata, such as camera model, shutter speed, title, etc.

An object is considered a match if all search words match an album or media object. For example, if one searches for desert mountain, only those albums or media objects that contain both desert and mountain are returned. If the search words are contained in quotation marks, such as “desert mountain”, then the phrase must match exactly.

The contents of documents such as PDF files are not searched. Only those objects for which the current user has authorization to view are returned in the search results.

Since the search function includes the metadata extracted from images, you can perform some pretty powerful searches. For example, to see all your photos that were shot at -0.5 step compensation, search for “-0.5 step”. You may have to adjust the text depending on your camera.

Rendering Media Objects in the Browser

Note: This section contains advanced information on customizing how Gallery Server Pro generates the

HTML for media objects. You should be comfortable with HTML before attempting to modify the

generated HTML.

Gallery Server Pro 1.0 managed only JPG or JPEG images, so it was easy to render images to the web browser, because one could assume all browsers can display a JPG image using a standard <img> tag. For version 2, however, things got more complicated. Browsers, by themselves, cannot play video, audio, or render many kinds of documents like Adobe PDF or Microsoft Word files. These types of objects require plug-ins, and one cannot make any assumptions about what, if any, plug-ins are installed in a user’s browser. Furthermore, Gallery Server Pro is meant to be flexible so that administrators can customize the HTML output rendered by Gallery Server. For example, some users might prefer that video files are rendered with

Page 91: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 91 of 186

<object> tags in order to pass XHTML validation, while others might prefer <embed> for maximum backward compatibility. Lastly, different browsers require different syntax, and new versions of browsers are frequently released, potentially breaking something that works today.

The solution was to use a combination of HTML templates stored in a configuration file and automatic browser sniffing by ASP.NET. The configuration file galleryserverpro.config (stored in the config directory) contains HTML templates for each major type of media object. For example, rendering the HTML for an image is pretty straightforward. Here is the relevant entry in galleryserverpro.config:

<galleryObject>

<mediaObjects>

<mediaObject mimeType="image/*">

<browsers>

<browser id="default" htmlOutput="&lt;div class=&quot;op1&quot;&gt;&lt;div class=&quot;op2&quot;&gt;&lt;div class=&quot;sb&quot;&gt;&lt;div class=&quot;ib&quot;&gt;&lt;img id=&quot;mo_img&quot; src=&quot;{MediaObjectUrl}&quot; class=&quot;{CssClass}&quot; alt=&quot;{TitleNoHtml}&quot; title=&quot;{TitleNoHtml}&quot; style=&quot;height:{Height}px;width:{Width}px;&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;" />

</browsers>

</mediaObject>

...

</mediaObjects>

</galleryObject>

The mediaObject tag specifies that the inner tags apply to the image/* MIME type. The asterisk (*) means that it will match all images, such as image/jpg, image/jpeg, and image/gif. Now, let’s take a closer look at what is in the htmlOutput attribute of the browser tag:

&lt;div class=&quot;op1&quot;&gt;&lt;div class=&quot;op2&quot;&gt;&lt;div class=&quot;sb&quot;&gt;&lt;div class=&quot;ib&quot;&gt;&lt;img id=&quot;mo_img&quot; src=&quot;{MediaObjectUrl}&quot; class=&quot;{CssClass}&quot; alt=&quot;{TitleNoHtml}&quot; title=&quot;{TitleNoHtml}&quot; style=&quot;height:{Height}px;width:{Width}px;&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

If you convert the escaped characters to their actual characters, it is more readable:

<div class="op1"> <div class="op2"> <div class="sb"> <div class="ib"> <img id="mo_img" src="{MediaObjectUrl}" class="{CssClass}" alt="{TitleNoHtml}" title="{TitleNoHtml}" style="height:{Height}px;width:{Width}px;" /> </div>

Page 92: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 92 of 186

</div> </div> </div>

Now that is starting to look a little more understandable, isn’t it? The four <div> tags that wrap the <img> tag are there to support the drop shadow and border that appears around each image.

But what is that stuff in the brackets, like {MediaObjectUrl}? Those are placeholders that are replaced with dynamically generated content at runtime. For example, {Height} is replaced with the height of the image. A full list and descriptions of these placeholders can be found below.

When Gallery Server Pro uses the above template to render an image to the browser, it ends up looking something like this:

<div class="op1"> <div class="op2"> <div class="sb"> <div class="ib"> <img src="/gs/handler/getmediaobject.ashx?moid=2064&aid=169&mo=D%3A%5Cgs%5Cmediaobjects%5CzThumb_100_1768.jpeg&mtc=1&dt=1" alt="Grand Canyon" style="width:86px;height:115px;" /> </div> </div> </div> </div>

If desired, one can tweak this template to change how <img> tags are rendered. For example, if you wanted to use the width and height attributes instead of a style, update the config file like this:

<browser id="default" htmlOutput="&lt;div class=&quot;op1&quot;&gt;&lt;div class=&quot;op2&quot;&gt;&lt;div class=&quot;sb&quot;&gt;&lt;div class=&quot;ib&quot;&gt;&lt;img src=&quot;{MediaObjectUrl}&quot; class=&quot;{CssClass}&quot; alt=&quot;{TitleNoHtml}&quot; title=&quot;{TitleNoHtml}&quot; width=&quot;{Width}&quot; height=&quot;{Height}&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;" />

Note: If you are a little confused about how we can specify image/* as the MIME type when everyone

knows that browsers can’t render ALL the different image formats that exist, read on. Gallery Server

Pro is hard wired to treat images a bit different than other media types. By default, Gallery Server Pro

assumes that browsers can natively render images of these types: JPG, JPEG, GIF, and PNG. If a user

uploads another type, such as TIFF, Gallery Server Pro will attempt to generate a JPEG version of the

image and send that to the browser. If Gallery Server Pro cannot create a JPEG version from an image

or the user is requesting the original TIFF image (by clicking the view original link), the user is shown a

message saying the image cannot be rendered and suggests the user download the image using the

download link. Because of this logic, we can assume that only JPG, JPEG, GIF, and PNG images are sent

to the browser in <img> tags, and it is therefore safe to specify the MIME type of image/* as shown

Page 93: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 93 of 186

above. The list of native image formats is stored in the configuration setting

imageTypesStandardBrowsersCanDisplay in galleryserverpro.config.

Image rendering is pretty straight forward. For video, let’s look at the relevant section of galleryserverpro.config:

<mediaObject mimeType="video/*">

<browsers>

<browser id="default" htmlOutput="&lt;object type=&quot;{MimeType}&quot; data=&quot;{MediaObjectUrl}&quot; style=&quot;width:{Width}px;height:{Height}px;&quot; &gt; &lt;param name=&quot;src&quot; value=&quot;{MediaObjectUrl}&quot; /&gt; &lt;param name=&quot;autostart&quot; value=&quot;{AutoStartMediaObjectInt}&quot; /&gt;&lt;/object&gt;" />

<browser id="ie" htmlOutput="&lt;object type=&quot;{MimeType}&quot; data=&quot;{MediaObjectUrl}&quot; style=&quot;width:{Width}px;height:{Height}px;&quot;&gt; &lt;param name=&quot;src&quot; value=&quot;{MediaObjectUrl}&quot; /&gt; &lt;param name=&quot;autostart&quot; value=&quot;{AutoStartMediaObjectText}&quot; /&gt;&lt;/object&gt;" />

</browsers>

</mediaObject>

<mediaObject mimeType="video/quicktime">

<browsers>

<browser id="default" htmlOutput="&lt;object type=&quot;{MimeType}&quot; data=&quot;{MediaObjectUrl}&quot; style=&quot;width:{Width}px;height:{Height}px;&quot;&gt; &lt;param name=&quot;autoplay&quot; value=&quot;{AutoStartMediaObjectText}&quot; /&gt; &lt;param name=&quot;controller&quot; value=&quot;true&quot; /&gt; &lt;param name=&quot;pluginurl&quot; value=&quot;http://www.apple.com/quicktime/download/&quot; /&gt;&lt;/object&gt;" />

<browser id="ie" htmlOutput="&lt;object classid=&quot;clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B&quot; codebase=&quot;http://www.apple.com/qtactivex/qtplugin.cab&quot; style=&quot;width:{Width}px;height:{Height}px;&quot;&gt; &lt;param name=&quot;src&quot; value=&quot;{MediaObjectUrl}&quot; /&gt; &lt;param name=&quot;autoplay&quot; value=&quot;{AutoStartMediaObjectText}&quot; /&gt; &lt;param name=&quot;controller&quot; value=&quot;true&quot; /&gt; &lt;param name=&quot;pluginspage&quot; value=&quot;http://www.apple.com/quicktime/download/&quot; /&gt;&lt;/object&gt;" />

</browsers>

</mediaObject>

Notice there are two mediaObject elements – one that specifies the MIME type video/* and the other specifies video/quicktime. The HTML template under video/* handles all generic cases of rendering video.

Page 94: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 94 of 186

The second element handles the more specific case of QuickTime video, since that type requires different HTML. One could add additional mediaObject elements if, for example, AVI files required custom HTML.

Look closer at the browser entries inside the video/* template:

<browser id="default" htmlOutput="&lt;object type=&quot;{MimeType}&quot; data=&quot;{MediaObjectUrl}&quot; style=&quot;width:{Width}px;height:{Height}px;&quot; &gt; &lt;param name=&quot;src&quot; value=&quot;{MediaObjectUrl}&quot; /&gt; &lt;param name=&quot;autostart&quot; value=&quot;{AutoStartMediaObjectInt}&quot; /&gt;&lt;/object&gt;" />

<browser id="ie" htmlOutput="&lt;object type=&quot;{MimeType}&quot; data=&quot;{MediaObjectUrl}&quot; style=&quot;width:{Width}px;height:{Height}px;&quot;&gt; &lt;param name=&quot;src&quot; value=&quot;{MediaObjectUrl}&quot; /&gt; &lt;param name=&quot;autostart&quot; value=&quot;{AutoStartMediaObjectText}&quot; /&gt;&lt;/object&gt;" />

There are two browser elements here – one with ID “default” and the other “ie”. The id attribute uniquely identifies the browser element, which must match the internal identifier of a browser as specified in the .Net Framework's browser definition file. See http://msdn.microsoft.com/msdnmag/issues/06/10/ExtremeASPNET/fig05.gif for a hierarchical list of ids recognized by .Net Framework 2.0.

These two <browser> elements are specifying one HTML template for the default browser, and another for IE. If you look at the HTML templates closely, you will notice they are identical except one specifies AutoStartMediaObjectInt and the other AutoStartMediaObjectText. That’s because IE requires the autostart parameter to be text, like “true” or “false”, while other browsers require a numerical value (1 for true, 0 for false).

If, for example, you discovered that the Safari browser wasn’t working quite right because of HTML incompatibilities, you could add a browser element with id=”safari”. Then add the HTML template using the syntax required by Safari, and you are finished. Gallery Server Pro and ASP.NET automatically detects the browser type and sends the correct HTML.

The following is a list of all replacement parameters supported within the htmlOutput attribute.

Name Description

{CssClass} A valid cascading style sheet class. The business logic determines which classes, if any, are inserted into this parameter. Example value: "msgsuccess", "msgsuccess indent"

{MimeType} The mime type of the media object. The mime type is determined from the file extension of the media object. The mapping between mime types and file extensions is in the mimeTypes section of galleryserverpro.config. Example value:

Page 95: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 95 of 186

"video/quicktime", "image/jpeg"

{MediaObjectUrl} The url to the media object. Example value: "handler/getmediaobject.ashx?moid=34&aid=8&mo=C%3A%5Cgs%5Cmypics%5Cbirthday.jpeg&mtc=1&dt=1&isp=false"

{MediaObjectAbsoluteUrlNoHandler} An url that points directly to the media object and bypasses the HTTP handler. Example value: /gallery/videos/birthdayvideo.wmv. The handler provides security checking and watermarking, so only use this parameter when necessary. For example, perhaps a video plug-in does not work unless the file is directly referenced.

IMPORTANT: This parameter requires that the media objects directory be within the Gallery Server Pro web application directory. By default, media objects are stored in the mediaobjects directory within the application, so this requirement is satisfied unless you change it. If this requirement is not met, use the {MediaObjectRelativeUrlNoHandler} parameter.

{MediaObjectRelativeUrlNoHandler} Provides an url that is relative to the media objects directory and which points directly to the media object. Example value: /videos/birthdayvideo.wmv). This parameter bypasses the HTTP handler that normally streams media objects to the browser. The handler provides security checking and watermarking, so only use this parameter when necessary. For example, perhaps a video plug-in does not work unless the file is directly referenced.

Typically this parameter is used instead of {MediaObjectAbsoluteUrlNoHandler} when the media objects directory is outside of the web application. If the user wants to allow direct access to the media objects using this parameter, she must first configure the media objects directory as a virtual directory in IIS. Then the path to this virtual directory must be manually entered into one or more HTML templates in galleryserverpro.config, so that it prepends the relative url returned from this method.

Example: If the media objects directory has been set to D:\media and a virtual directory named gallery has been configured in IIS that is accessible via http://yoursite.com/gallery, then you can configure the HTML template like this:

htmlOutput="&lt;a href=&quot;http://yoursite.com/gallery{MediaObjectRelativeUrl

Page 96: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 96 of 186

NoHandler}&quot;&gt;Click to open&lt;/a&gt;"

{Width} The width, in pixels, of the media object. Example value: 640, 480

{Height} The height, in pixels, of the media object. Example value: 640, 480

{Title} The title of the media object. May include HTML tags. Example value: Kayla 'sledding' down the <a href="http://www.bighill.com">hill</a>

{TitleNoHtml} The title of the media object with HTML tags removed and apostrophes and quotation marks are replaced with &quot; and &apos;. Example value: "Kayla sledding down the hill"

{AutoStartMediaObjectText} Indicates whether to automatically start a video or audio object on the client. This value comes from the galleryServerPro/core/autoStartMediaObject configuration element. Rendered as the text "true" or "false".

{AutoStartMediaObjectInt} Indicates whether to automatically start a video or audio object on the client. This value comes from the galleryServerPro/core/autoStartMediaObject configuration element. Rendered as the value "1" (true) or "0" (false).

Reference for galleryObject element in galleryserverpro.config

The following table contains definitions for each of the elements within the galleryObject element.

Element name Description

galleryObject Contains a collection of mediaObject elements. Valid attributes: none. Valid child elements: mediaObjects.

mediaObjects This is a collection of mediaObject elements. Valid attributes: none. Valid child elements: mediaObject.

mediaObject This is an element that contains information about how Gallery Server Pro should handle specific types of media objects. Each mediaObject is uniquely identified by the mimeType attribute. If a mimeType is specified more than once within the mediaObjects collection, only the first element is used (subsequent ones are ignored). An asterisk (*) can be used to represent all subtypes within a type (e.g. "video/*" matches all video objects). However, if another mediaObject element

Page 97: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 97 of 186

contains a more specific value, such as "video/quicktime", that element will override "video/*". The mimeType attribute must match one of the type attributes specified in the mimeType element (unless the mimeType attribute has an asterisk). Valid attributes: mimeType.

Valid child elements: browsers.

browsers This is a collection of browser elements. The collection must contain one browser element with id="default". It can optionally contain additional browser elements. Valid attributes: none. Valid child elements: browser.

browser This is an element that contains information about how the media object should be rendered when the client is using this browser. It is uniquely identified by the id attribute, which must match the internal identifier of a browser as specified in the .Net Framework's browser definition file. See http://msdn.microsoft.com/msdnmag/issues/06/10/ExtremeASPNET/fig05.gif for a hierarchical list of ids recognized by .Net Framework 2.0. If an id is specified more than once within the browsers collection, only the first element is used (subsequent ones are ignored). The htmlOutput attribute contains the HTML to be rendered to the client when the client is using this particular browser and is viewing the type of media object contained in the parent element. Valid attributes: id, htmlOutput. Valid child elements: none.

If the client's browser matches multiple browser elements (e.g. "ie" and "default"), the most specific browser element is preferred (in this example "ie"). Thus you can specify a browser element with id="default" containing the default HTML for a particular type of media object. Create additional browser elements to handle individual browsers as desired.

Microsoft Silverlight

Starting with version 2.1, wmv, wma, mp3, asf, and asx files are rendered using the Microsoft Silverlight 1.0 plug-in. If the user does not have Silverlight installed, a graphic will appear in place of the media object that says "Get Silverlight". When clicked, the user is stepped through the process of installing the plug-in.

Specifying Silverlight rather than just a generic <object …> tag offers better performance and a more predictable experience for your end users. Video and audio starts can play almost immediately rather than after downloading the entire file. Those users who do not have the Silverlight plug-in receive gentle hand holding for installing it; the previous technique left it up to the browser, and many browsers did not do a good job at helping the user install a compatible plug-in.

To accommodate the requrirements of Silverlight, a new attribute named scriptOutput was added to the <browser …> element in galleryserverpro.config. It is similar to htmlOutput, except that it specifies javascript that must be executed in addition to the HTML.

For example, the scriptOutput for the video/x-ms-wmv MIME type looks like this (after HTML decoding):

Page 98: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 98 of 186

Sys.UI.Silverlight.Control.createObject('mp1p', '<object type="application/x-silverlight" data="data:application/x-silverlight," id="mp1" style="height:{Height}px;width:{Width}px;"><param name="Windowless" value="True" /><a href="http://go2.microsoft.com/fwlink/?LinkID=114576&amp;v=1.0"><img src="http://go2.microsoft.com/fwlink/?LinkID=108181" alt="Get Microsoft Silverlight" style="border-width:0;" /></a></object>');Sys.Application.initialize();Sys.Application.add_init(function() { $create(Sys.UI.Silverlight.MediaPlayer, {"mediaSource":"{MediaObjectUrl}","scaleMode":1,"source":"skins/mediaplayer/Professional.xaml","autoPlay":{AutoStartMediaObjectText} }, null, null, $get("mp1p")); });Array.add(_mediaObjectsToDispose, "mp1");

There are several skins available for the Silverlight player. By default, audio files use the AudioGray.xaml skin and video files use Professional.xaml. You will find more skins in the skins directory. Feel free to edit the scriptOutput template to see what the other skins look like.

I created this script by closely studying the javascript generated by the MediaPlayer control that is part of the Silverlight 2.0 Beta 2 SDK. At the time of this writing, I can confirm the script works reliably in IE 6, IE 7, and Firefox 2. However, in Firefox 3 the video or audio file sometimes does not play. I am investigating this and hope to come up with a fix. (I will point out that objects hosted at Silverlight Streaming work reliably in all browsers I tested, except that the Actions menu appears behind the plug-in for Firefox users. Sigh… Always something, isn't it?)

7. Security

Overview of the Security Model

Gallery Server Pro uses a system of anonymous browsing, user accounts, and roles to provide a flexible security model that should satisfy most security needs.

By default, users can browse the albums and media objects without logging on. All tasks such as adding albums, rotating an image, site administration, etc, require a user to log on with a user account.

However, just being able to log on does not provide permission to perform a task. A user must belong to a role that has the appropriate permission. Roles can be configured with any of the following permissions:

Administer site (all albums)

View albums / objects

View original, hi-res images

Add albums

Add media objects

Edit album

Edit media object

Delete child albums

Delete media object

Synchronize

Do not show watermark on image

Page 99: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Each role is applied to one or more albums. For example, one can create a role named Browse Only All Albums with View albums… permission on all albums. A second role named Austin Branch Office can be given various add / edit / delete permissions to an album named Austin Branch Office. By creating a user and assigning it to both roles, the user receives read-only permission on all objects in the gallery and edit permission only on the Austin album.

Below is a screen shot of a user editing the role permissions for a role named Customer.

Gallery Server Pro uses ASP.NET Membership to manage users and roles. By default, the users and roles are stored in the same database as the Gallery Server Pro data. Optionally, you can configure Gallery Server Pro to connect to an existing store of users. For example, you may want to integrate Gallery Server Pro with your DotNetNuke users. Or you may be on an intranet and you want to use the existing accounts in Active Directory. Read more about configuring the membership provider in the Membership Configuration section.

The default security model allows users to anonymously browse the gallery, but they are prevented from any action that modifies the media objects. To require all users to log in, even to browse, find the following section in the web.config file in the root web directory:

<authorization> <!-- <deny users="?" /> --> </authorization>

Page 100: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 100 of 186

Change it to this to disable anonymous browsing:

<authorization> <deny users="?" /> </authorization>

Note: Gallery Server Pro cannot be configured to give anonymous users edit permission. Any action

other than viewing requires that the user log in.

The users and roles are maintained on the Manage users and Manage roles pages in the Site administration console (Click Site admin in the Actions menu). Read the Membership – Roles or Membership – Users sections for detailed information on configuring users and roles.

SECURITY WARNING: If your media objects directory is within the web application (which is the

default), then users can bypass security by guessing the URLs to the media object. If you wish to

prevent this, move the directory outside the web application so that IIS will not serve requests to the

objects. Information about changing the media objects directory is in the Media object storage section.

Roles

Permissions in Gallery Server Pro are applied to roles. Users gain access to tasks by being a member of one or more roles.

You can create as many users and roles as you want. By combining users and roles in different configurations, you can achieve a highly configurable gallery.

Below is a list of the permissions that can be applied to an album.

Role permission Description

Administer site (all albums)

Provides unrestricted access to all functionality in Gallery Server Pro. This is the only permission that applies to all albums in the gallery and cannot be selectively applied to individual albums.

View albums / objects Provides a read-only view of photos, videos and other media objects. Note that it does not give access to the original, high resolution versions of images (if they exist).

View original, hi-res images

Provides read only access to the original, high resolution versions of images, if they exist.

Add albums Allows a user to add an album in any of three ways: (a) The user can create a new album using the Create album menu item, (b) copy an album from another album, or (c) move an album from another album.

Note 1: Adding an album by moving it from another location is allowed only if the

Page 101: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 101 of 186

user also has delete permission for the source album.

Note 2: When moving or copying an album, users must have Add albums permission on the destination album.

Note 2: When a user moves or copies an album, any media objects within the album are also transferred regardless of whether the user has Add media objects permission on the destination album.

Add media objects Gives a user the ability to add media objects such as images, videos, audio files, and documents in any of three ways. The user can (a) add a new media object using the Add objects menu item, (b) copy a media object from another album, or (c) move a media object from another album.

Note 1: Adding a media object by moving it from another album is allowed only if the user also has Delete media object permission for the album from which the media object is being moved.

Note 2: A user must have both Add media objects permission and Add albums permission in order to add a ZIP file that contains one or more directories, since Gallery Server Pro converts the directories to albums.

Note 3: Only those media objects that are enabled on the Media Object Types page can be added.

Note 4: To add media objects through synchronizing, the Synchronize permission is also needed.

Edit album Allows a user to edit album information, such as the title; summary; begin and end dates; assigned thumbnail; and sequence of media objects and child albums.

Edit media object Allows a user to edit any media object's title. For images, it also allows rotation as well as deletion of the original, high resolution image (if it exists).

Delete child albums Allows the deletion of a child album in one of two ways: the user can either delete an album outright, or move an album to another album.

Note: When moving an album, users must have this permission on the source album, as moving can be thought of as deleting an album from one location and adding it to another. (The user must also have permission to add an album to the destination album.)

Delete media object Allows the deletion of a media object in one of two ways. The user can either delete a media object outright or move a media object to another album.

Note: When moving a media object, users must have this permission on the

Page 102: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 102 of 186

source album, as moving can be thought of as deleting an object from one location and adding it to another. (The user must also have permission to add a media object to the destination album.)

Synchronize Provides the ability to synchronize the media object files and directories on the web server's hard drive with the records in the data store.

Note: If a user has the ability to edit the media objects directory outside the security boundary of Gallery Server Pro (such as using a utility like Windows Explorer), and the user also has Synchronize permission here, she effectively has the ability to add and delete albums and media objects, even if those permissions are not included in a user's role.

Do not show watermark on image

This permission causes images to be shown to the user in their original form, without a watermark applied. If a user belongs to more than one role with conflicting values, then watermarks are not shown. This permission is ignored if the watermark functionality is disabled for the gallery. Refer to the section Watermarking for more information.

Applying role permissions to albums

Once the desired permissions are selected, choose one or more albums the selected permissions apply to. Role permissions automatically propagate to all child albums of the selected album. The top level selected album(s) is considered to have explicitly assigned role permissions. Any child albums are considered to have inherited role permissions because they inherit the permission from a parent album.

Since permissions apply to all child albums of a selected album, notice that all child albums become selected when you click an album, and you cannot de-select individual child albums.

Role behavior for new, moved or copied albums

When an album is added, moved, or copied, it automatically inherits the permissions of its parent album. If this album is subsequently moved to another album, it will inherit the permissions of its new containing album and not retain its original permissions. However, if you explicitly assign a role permission to the album, that role permission stays with the album when it is moved or copied.

Combining Roles

Gallery Server Pro will give a user permission to perform an activity if any of the user's roles contain the requested permission, even if the others do not. For example, say a user belongs to three roles. Two of the roles do not have Delete album permission but the third one does. In this case, the user is given permission to delete the album that is specified in the role with the Delete album permission.

Users

Individuals access Gallery Server Pro by logging on with user accounts. User accounts have access to albums and administrative tasks based on the roles to which the user belongs. Users are created and

Page 103: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 103 of 186

maintained on the Manage Users page in the Site administration console. Refer to the Membership – Users section for more information on configuring users.

Hiding Albums and Media Objects from Users

An Album can be hidden from anonymous and logged on users so that, from the user’s perspective, the album and any child albums and media objects do not exist. They don’t appear in the browser, cannot be navigated to via URL, and don’t appear in any task pages. However, you can configure individual users to have full access to the albums.

To hide an album from users who are not logged on (anonymous users), mark an album as private. For logged on users, albums are hidden unless the user belongs to a role with View albums / objects permission.

SECURITY WARNING: If your media objects directory is within the web application (which is the

default), then users can bypass security by guessing the URLs to the media object. If you wish to

prevent this, move the directory outside the web application so that IIS will not serve requests to the

objects. Information about changing the media objects directory is in the Media object storage section.

Note that IIS 7 provides additional configuration options that improve this situation, but at the time of

this writing it has not been released.

Hiding an album from anonymous (not logged on) users

An album marked as private is hidden from anonymous users. This is done in the Edit album popup, which is shown when selecting Edit album info from the Actions menu or double clicking the album title/summary/date area. The Edit album popup appears below.

Page 104: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 104 of 186

When an album is private, a small “lock” icon appears next to the album name, as shown below.

Page 105: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 105 of 186

Private albums have the following features:

They are never shown to users who are not logged on.

The privacy setting of an album applies to all child albums and media objects. You cannot make a child album visible if its parent is hidden.

The privacy setting of an album has no effect for logged on users.

Note: If you wish to make all albums hidden for anonymous users, you can mark the root album as

private. However, a better solution is to configure the web application to disable anonymous access.

This is described in the Overview of the Security Model section earlier in this chapter.

Hiding an album from a logged on user

Each user in Gallery Server Pro is a member of one or more roles. Roles are assigned permissions such as View albums / objects, Add albums, and Delete media object.

Page 106: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 106 of 186

To make an album invisible to a user, ensure the user does not belong to any roles with View albums / objects permission for the album.

8. Site Administration

Overview

Site settings can be accessed by choosing Site admin from the Actions menu. A new menu appears on the left. Notice that sections of this menu can be collapsed by clicking on the tiny arrows. We’ll review each section from top to bottom.

Site Settings – General

The first section is for General Site settings. Select it and the page should look as below.

Page 107: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 107 of 186

Page 108: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 108 of 186

Product Key

Gallery Server Pro is fully functional for the first 30 days. At the end of the trial period, a watermark appears on each image and the Site admin area becomes read-only. Enter a product key to restore full functionality.

I hope you forgive me for requiring a product key. The purpose is simple: to encourage you to come back to www.galleryserverpro.com after a trial period to give you an opportunity to provide financial support.

Gallery Server Pro is supported entirely by your donations. Without them, I must look for work elsewhere, and that takes away from the time I can spend on it. You can help make Gallery Server Pro a success and prove that the open source model works by providing a donation when you request the product key.

To get your product key, click the link on the Site Settings - General page to go to the Product Key Wizard at www.galleryserverpro.com. If you provide a donation, the wizard will temporarily transfer you to PayPal where you can make a secure donation by credit card or through your bank. Whether or not you provide a donation, you will receive a valid product key at the end of the wizard.

Enter your product key in the text box and click the Enter product key button. A message will appear indicating whether or not the key is valid. If it is, all functionality is enabled and you will not be asked for a key again.

If Gallery Server Pro does not have permission to update the configuration file galleryserverpro.config, you must update it manually. Open the file, which can be found in the config directory of the web app, in any text editor (such as Notepad) and edit the productKey attribute to contain the product key. Save the file. In some cases your changes won't take effect until you recycle the application pool or enter iisreset at a Start-Run dialog box.

Other Properties on Site Settings - General Page

The table below describes the rest of the properties.

Gallery ID: The value that uniquely identifies the gallery for this website. Each web application is associated with a single gallery. Read the section Working with Galleries for more information.

Web site heading text:

The header text that appears at the top of each web page.

Web site heading text URL:

The URL the user will be directed to when she clicks any page’s header text. This setting is optional – if not present, no link will be rendered.

Web site title: The text placed within the <title></title> HTML tag on each web page. This text appears in the browser’s title bar.

Page 109: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 109 of 186

Allow HTML in titles and summaries of albums and media objects:

Indicates whether to allow limited HTML tags in the titles and captions for albums and media objects. When checked, the following HTML tags are allowed: a, img, span, div, p, h1, h2, h3, h4, h5, h6, strong, em, u, b, i, strike, sup, sub, font, blockquote, ul, ol, li, address, pre, hr, br. Also, the following attributes are allowed: class, style, id. In addition, some tag-specific attributes are also allowed (e.g. src, alt, and title for img; href, target, name, and title for hyperlink (a)).

Javascript is NEVER allowed.

If you uncheck this option while existing media object titles and/or captions already contain HTML tags, these tags will remain. However, new and changed media object titles and captions will be stripped of HTML when they are saved.

Site Settings – Email

Below is the page where General Email Site Settings can be edited.

Page 110: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 110 of 186

Email detailed reports when web site error occurs:

When checked, the designated administrator is sent a detailed report when a web site error occurs. A valid SMTP server must be specified either below or in web.config.

Name and address to email error reports to :

Gallery Server Pro sends administrative emails, including error reports, to this person.

Name and address to show emails as coming from:

Emails sent from Gallery Server Pro (error reports and password change notifications) will appear to be sent from this person at this email address.

Page 111: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 111 of 186

SMTP server: Specify the IP address or name of the SMTP server used to send emails (e.g. 127.0.0.1, Godzilla, mail.yourisp.com).

This value is stored in the config file galleryserverpro.config. If you wish to use the SMTP server specified in web.config, (either explicitly assigned in this web application or inherited from a parent application) you may leave this field blank. Gallery Server Pro will automatically use the value specified in the system.net mailSettings section if no value is specified here.

SMTP server port: Specify the port number to use when sending SMTP mail. This setting is useful when the web server is behind a proxy.

This value is stored in the config file galleryserverpro.config. If you wish to use the SMTP port specified in web.config (either explicitly assigned in this web application or inherited from a parent application), you may leave this field blank. Gallery Server Pro will automatically use the value specified in the system.net mailSettings section if no value is specified here.

If not specified, and if no value is defined (nor inherited) in web.config, the default port 25 is used.

Site Settings – Backup and Restore Data

Gallery Server Pro stores data in two locations:

The media files are stored in a physical directory on the web server’s hard drive.

Information about media objects and albums are stored in a SQL Server or SQLite database.

Backing up, moving, copying, or restoring Gallery Server Pro data requires moving or copying both sets of data. The backup function built in to Gallery Server Pro exports all gallery data to an XML file, and the restore function replaces existing data with the data in the XML file.

Note: The backup / restore function backs up and restores only the gallery data, not the media files.

There are several techniques for implementing a backup strategy, several of which do not even use the built-in backup / restore function. See the section Backup strategy below for more information about performing regular backups.

Backup strategy

A regular backup is a normal part of every computer user's life. Which method you use, and how often, is up to you. Hopefully you don't learn the hard way that your strategy is inadequate.

Backing up your gallery data involves these sets of data:

Page 112: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 112 of 186

The media files

The data in the database.

(Optional) The web application files

Backing up the media files

The media files are stored on your server's hard drive and can be backed up the same way you back up any of your files. You can discover the location where the media files are stored by referring to the Original file storage location on the Media Objects – General page in the Site admin section of Gallery Server Pro. In the example below, the media files are stored at C:\inetpub\wwwroot\gs\mediaobjects.

Backing up the data

SQL Server: For SQL Server databases, there are a number of ways to back up the data:

Use the backup functionality built in to SQL Server.

Use the backup function built in to Gallery Server Pro to export data to an XML file. See below for more information.

Use a third party backup program that knows how to back up SQL Server databases.

Copy the MDF database file to your backup location, either manually or through an automated script.

SQLite: If you are using SQLite, backup your data with one of these techniques:

Use the backup function built in to Gallery Server Pro to export data to an XML file.

Copy the data file App_Data\galleryserverpro_data.sqlite to your backup location, either manually or through an automated script.

Page 113: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 113 of 186

Backing up the web application files

This is optional, since you can always download the web application files from www.galleryserverpro.com. However, there are two configuration files that store information specific to your application you may want to back up:

web.config - This is in the root of your Gallery Server Pro web application.

galleryserverpro.config - This is in the config directory of the Gallery Server Pro web application.

If desired, back up these files using the same technique you use for your media files, whether it is a third party program, manually copying, or an automated script.

Using the Built-In Backup Function To Create A Backup File

The database stores information about your media objects, such as title, extracted metadata, file names, etc. To export this data to an XML file, follow these steps.

1. Log on to Gallery Server Pro with an account that has Administer Site permission.

2. Click the Actions menu and go to Site admin.

3. In the left menu, navigate to the Backup / Restore page. The following screen appears:

Page 114: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 114 of 186

4. To include login accounts in the file, make sure the Export user accounts option is selected.

Note: Selecting Export user accounts includes the users, roles, and applications stored in the

membership tables (the tables whose names start with "aspnet_"). When selected, ALL membership

data is exported. If you using these tables to manage membership for other applications, be aware

that the data for these other applications are also included in the backup file.

5. To include the gallery data, make sure the Export media object and album data option is selected.

6. Click Create and download backup file. A file is created and downloaded to your browser.

Note: Remember that the backup file does not include the media files. It includes information about

the media objects, such as titles, captions, and extracted metadata.

Note: Be aware that the backup file may contain passwords in clear text format.

Using the Built-In Restore Function

Use the restore function to replace all data in your Gallery Server Pro database with the data in the backup file. Remember that the backup file does not include the media files. Restore these files separately

Page 115: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 115 of 186

by copying them from your backup device to your media objects directory. (You can do this either before or after the restore.)

SQL Server 2000 users: A limitation in SQL Server 2000 prevents the Restore function from working correctly. The only known workaround is to upgrade to a newer version of SQL Server or use SQLite.

SQL Server 2005 / 2008 users: The restore function uses a very efficient algorithm for importing large amounts of data very quickly (equivalent to the bcp utility), but this technique requires SQL permissions equivalent to that provided in the db_ddladmin or db_owner roles. You may have to manually configure the SQL user using a tool such as SQL Management Studio to provide this permission. After the restoration is complete, you can revert to the original permissions.

Note: Restoring data replaces the existing data. This action cannot be undone!

To restore the gallery data from an XML file created with the backup function, follow these steps:

1. Log on to Gallery Server Pro with an account that has Administer Site permission.

2. Click the Actions menu and go to Site admin.

3. In the left menu, navigate to the Backup / Restore page. Click the Restore tab. The following screen appears:

Page 116: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 116 of 186

4. Use the Browse button to select the backup file. Click Upload. The file will be verified and the web page will display the number of records in each of the tables in the backup file.

Page 117: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 117 of 186

5. To import login accounts, make sure the Import user accounts option is selected.

Note: If you de-selected the option Export user accounts when you created the backup file, then you

do not have any users to restore. In this case, make sure to de-select the option Import user accounts

when restoring your data so that the current accounts - including the one you are logged on as - is not

deleted.

6. To import the gallery data, make sure the Import media object and album data option is selected.

7. Click Restore data. When the restore process is finished, a message will confirm that the restoration is complete.

Note: Your current login account may no longer be valid since it was deleted during the restore. If this

occurs, log out and log in using an account that was in the backup file.

Migrate Gallery Server Pro to a new gallery

Follow these directions for transferring an existing installation of Gallery Server Pro to another web application. The new web application may be on the same server or a new server.

1. Copy the web application files to the destination.

2. Use Internet Information Services (IIS) Manager to configure the new directory as a web application, ensure it is running under ASP.NET 2.0, and has default.aspx specified as the default document. (Click Start – Run and then type inetmgr to start IIS Manager.)

Note: If using IIS 7, you do not need to specify the default document.

Note: For more information on using IIS Manager, refer to Using Internet Information Services (IIS)

Manager

Note: If you encounter an error about permissions, use Windows Explorer to give the user account IIS

is running under modify permission to the web directory (ex: C:\inetpub\wwwroot\galleryserverpro).

Refer to the section Configuring NTFS Permissions In Microsoft Windows for more information.

3. If your media files are not stored in the mediaobjects directory, then copy them to the new location, if required. After you copy them, you will need to update Gallery Server Pro so that it knows where your files are. This is on the Media Objects - General page in the Site administration console.

4. If you are using SQLite, then you already copied the gallery data, since it is in the file App_Data\galleryserverpro_data.sqlite. Skip the next step.

5. If you are using SQL Server and you need to migrate the data to another instance of SQL Server, you have two options:

Use the tool built in to SQL Server for detaching / backing up and re-attaching / restoring the Gallery Server Pro database. Refer to your SQL Server documentation for more information.

Use the backup function in Gallery Server Pro to back up the data to an XML file, then use the restore function at the destination gallery. Refer to the relevant section in this guide for creating a backup file and restoring it.

Page 118: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 118 of 186

If necessary, update the SQL Server connection string in web.config.

Membership – Roles

This section describes how to use the Manage Roles page. For more information about how roles work, read the Security section. Below is the page that appears when you click Manage Roles.

To create a new role, click Add new role… and the following popup window appears.

Page 119: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 119 of 186

Here a Role named Customer is being added and being given permission to view the contents, including high resolution images of Sample Album (and all its descendents).

Edit a role by clicking the Edit button next to a role. Similarly, a role can be deleted by clicking the Delete button.

Membership – Users

The Manage Users page is used to administer the accounts that are allowed access to the objects in the gallery. User accounts are assigned to one or more roles. There is no limit to the number of users that can be created.

Below is a screen shot of the Manage Users page. You’ll notice that it looks similar to the Manage Roles page.

Page 120: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 120 of 186

Add a user

Click Add new user and the Create New User wizard appears as shown below.

Page 121: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 121 of 186

Enter a username and password for the user. An email address can be used for the username if desired. When you leave the username field, an AJAX callback validates the username and reports whether it is already in use.

An email address is optional but is useful for allowing users to retrieve forgotten passwords.

Clicking the Next button displays the second page where one or more roles can be assigned to the user.

Page 122: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 122 of 186

Click Create User. A confirmation message appears in the pop-up box. Close the pop-up box and the Manage Users page will be updated with the new user you just created.

Edit a user

Click the Edit link next to a user to open the Edit user dialog.

Page 123: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 123 of 186

The General tab of the Edit user dialog allows a description and email address for the user to be updated. You can disable a user account by clicking No on the Is approved setting. Disabled users cannot log on to Gallery Server Pro. You can re-enable the account to resume access.

The Roles tab allows one to configure the roles to which the user belongs.

Page 124: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 124 of 186

The Password tab provides the ability to change the user’s password.

Note: To reset or change a password, select the desired option and then click the Update password

button.

Page 125: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 125 of 186

Example

As an example, imagine you want to give user David read/write access to an album Photos by David. Similarly, user Margaret should have read/write access to the album Photos by Margaret. Both users should have browse access to the entire gallery but only be able to edit their respective albums.

Create a role named DavidRole that has all permissions except Administer site permission. Apply the role to the Photos by David album. Do the same thing for Margaret, creating a role named MargaretRole, but apply it to the Photos by Margaret album. Then create two users - David and Margaret - and assign each to the respective role. At this point each user has control over his or her own album but no access – not even read only – to any other album. To allow these two users read access to all photos, create a new role named ViewOnlyRole and give it View albums / objects permission to all albums. Add each user to this role and – voila – they have browse permission to the entire gallery but can only edit his or her album.

Albums – General

The Albums - General page contains settings specific to albums.

Page 126: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 126 of 186

Album thumbnail settings

Number of characters of album title to display on thumbnail

The maximum number of characters to display when showing the title of an album in thumbnail view.

Empty album thumbnail settings

Text The text to appear on an empty album’s thumbnail image

Font name The font in which the text on an empty album’s thumbnail is displayed. The font must be installed on the web server. If the font is not installed, a generic sans serif font will be substituted.

Font size (px) The size, in pixels, of the font used to display the text on an empty album’s

Page 127: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 127 of 186

thumbnail image. Valid values: 6 - 100.

Font color The color of the text to display on an empty album’s thumbnail image. It can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the System.Color.KnownColor enum values in the .NET Framework (e.g. Maroon).

Background color The background color of the thumbnail image appearing on empty albums. It can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the System.Color.KnownColor enum values in the .NET Framework (e.g. Maroon).

Aspect ratio The ratio of the width to height of the thumbnail image on an empty album. The length of the longest side of the image is set by the Thumbnail Image Length property (Media Objects – General page), and the length of the remaining side is calculated using this ratio.

A ratio of more than 1.00 results in the width being greater than the height (landscape), while a ratio less than 1.00 results in the width being less than the height (portrait).

Example: If Thumbnail Image Length = 115 and the aspect ratio = 1.50, the width of the default thumbnail image is 115 and the height is 77 (115/1.50).

Media Objects – General

The Media Objects – General page contains settings specific to media objects. Recall that a media object is any file that Gallery Server Pro is managing within its gallery. It can be a photo, video, audio, document, or any other type of file.

Page 128: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 128 of 186

Media object storage

The Media object storage section tells Gallery Server Pro where the media object files are stored. There are up to three different locations: (a) original location, (b) thumbnail image location, (c) compressed image location.

Page 129: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 129 of 186

By default Gallery Server Pro is configured to store the original files, thumbnails and compressed image files in the mediaobjects directory of the web application. For example, if Gallery Server Pro is installed at C:\inetpub\wwwroot\gs\, then Gallery Server Pro uses C:\inetpub\wwwroot\gs\mediaobjects\ as the storage location for your media objects.

Each media object added to Gallery Server Pro has up to three files: (a) the original photo, video, audio, or other type of media file, (b) a small thumbnail image representing the object, (c) a compressed, bandwidth friendly image (large image files only). You can specify where each of these types of files are stored. Any location on one of the hard drives on the web server is valid. UNC or mapped drives are not permitted.

You can enter a path relative to the root of the web application or an absolute path. For example, if Gallery Server Pro is installed at C:\inetpub\wwwroot\gs\, the following are all valid and point to the same location:

C:\inetpub\wwwroot\gs\mypics\

C:\inetpub\wwwroot\gs\mypics

\mypics\

\mypics

mypics\

mypics

/mypics/

/mypics

Example: Changing where thumbnail and compressed images are stored

By default Gallery Server Pro stores the original, thumbnail, and compressed file in the mediaobjects directory. To keep the directory containing the original media files clean and tidy, you might want to keep the auto-generated thumbnail and compressed images in a separate directory named cache.

Open the Media Objects – General page in Gallery Server Pro. Change the values for the Thumbnail image storage location and Compressed image storage location to cache instead of mediaobjects. Click Save changes.

Note: If the cache directory does not exist, Gallery Server Pro will attempt to create it. If the IIS

account Gallery Server Pro is running under does not have permission to create the directory, an error

message will appear. Use Windows Explorer to either manually create the directory using your own

permissions or give the IIS account permission to create the directory.

Note: If the cache directory exists, but the IIS account Gallery Server Pro is running under does not

have permission to write to the directory, an error message will appear. Use Windows Explorer to give

the IIS account modify permission to the cache directory.

Select the Synchronize menu option from the Actions menu to open the synchronize page. Select the Include child directories (recursive) option and click Synchronize. Gallery Server Pro will create new thumbnails in the cache directory and remove the previous ones from the mediaobjects directory.

Page 130: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 130 of 186

Note: Changing the location does not move the media files to the new location. If you modify a path,

the database should be synchronized (from Actions menu, choose Synchronize) so that the database

records match the files in the directory. If the location for compressed or thumbnail images is changed,

Gallery Server Pro will re-generate the compressed and thumbnail versions of the originals upon

synchronization.

Alternatively, a tool such as Windows Explorer could be used to manually copy any of the files from the

old location to the new location.

Transition effects

Media object transition effect

Specifies the visual transition effect to use when browsing from one media object to the next.

Media object transition duration

The duration of the transition effect, in seconds, when navigating between media objects. This setting has no effect when the media object transition effect is set to None.

Upload settings

Upload media files

Indicates whether users are allowed to upload media files, such as photos, audio, and video. Unchecking this setting causes the Local Media tab on the Add objects web page to be hidden.

Users must also be authenticated and a member of a role with AllowAddMediaObject or AllowAdministerSite permission in order to upload files.

If this setting is disabled, and the Link to external content setting is also disabled, the only way to add media objects is through synchronizing.

Link to external content

Indicates whether users can add a link to external content, such as a YouTube video. Unchecking this setting causes the External Content tab on the Add objects web page to be hidden.

Users must also be authenticated and a member of a role with AllowAddMediaObject or AllowAdministerSite permission in order to add external links.

If this setting is disabled, and the Upload media files setting is also disabled, the only way to add media objects is through synchronizing.

Maximum upload file size

Indicates the maximum size, in kilobytes, of the files that can be uploaded using the Add Objects function. The default value is 2097151 (2 GB). Use this setting to keep users from uploading very large files and to help guard against Denial of Service (DOS) attacks. A value of zero (0) indicates there is no restriction on upload size (unlimited).

Page 131: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 131 of 186

This value applies to the content length of the entire upload request, not just the file. For example, if this value is 1024 KB and the user attempts to upload two 800 KB images, the request will fail because the total content length is larger than 1024 KB. This setting is not used during synchronization.

This setting may be overridden by the maxRequestLength setting in web.config. If web.config specifies a value smaller than the value specified here, ASP.NET will throw an error. Unfortunately, the error is not very user friendly, so it is preferable to keep the value in web.config larger than this value.

Note: This setting is not used when the application is running at less than Full Trust. In this case, the maxRequestLength setting in web.config controls the upload file size. To change it, follow these steps:

1. Open web.config in a text editor such as Notepad.

2. Look for this section:

<location path="task/addobjects.aspx"> <system.web> <httpRuntime maxRequestLength="2097151" executionTimeout="28800" /> </system.web> </location>

3. Edit the value for the maxRequestLength to the desired value. It is in kilobytes, so to specify 100 MB, enter the value 102400.

If a user attempts to upload a file that exceeds this value, the ASP.NET engine detects it and rejects the upload request. Unfortunately, this results in a rather generic error being sent to the user. For example, Firefox users receive the message “The connection was reset. The connection to the server was reset while the page was loading.” IE 7 users receive “Internet Explorer cannot display the webpage.” When possible, run the application at Full Trust so that users receive a friendly error message.

Note: IIS 7 restricts uploads larger than about 30 MB, even if the maxRequestLength attribute is

modified. Read the section Modify request filtering in IIS 7 below.

Example

You set the maximum upload limit to 4096 (4 MB). A user attempts to upload a 6 MB image. The upload will fail because it exceeded the 4MB limit. Another user attempts to upload three 2 MB images at one time. Even though each image is less than 4 MB, the upload will fail because the total size of the upload request is greater than the 4 MB limit. Another user attempts to upload a 1.5 MB zip file containing 20 100 KB images. The upload succeeds.

Note: This limit is enforced on the content length of the entire request, not just the size of the file(s), so you may notice some uploads are rejected if they are close, but not exceeding, this limit, because the total length of the request exceeds the limit.

Modify request filtering in IIS 7

By default IIS 7 restricts uploads larger than about 30 MB. To allow larger uploads, configure web.config to specify a new value for the <requestFiltering> element.

Open web.config and look for the following section.

Page 132: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 132 of 186

<security> <requestFiltering> <requestLimits maxAllowedContentLength="2147483648"/> </requestFiltering> </security>

By default it is commented out. That is, it is surrounded by <!-- --> tags. Uncomment the section by moving the closing comment (-->) to before the <security> element. Modify the attribute maxAllowedContentLength to the desired value. It is in bytes, so a value of 2 GB would be specified as 2147483648 (2 * 1024 * 1024 * 1024). Save your changes.

After making this change you may receive an error in Gallery Server Pro that says that requestFiltering cannot be overridden. This is a security feature. To allow requestFiltering to be overridden in web.config, you must edit another configuration file. I know, this is getting a little ridiculous, but you are almost done.

Open %windir%\System32\inetsrv\config\applicationHost.config file and change the string:

<section name="requestFiltering" overrideModeDefault="Deny" />

to:

<section name="requestFiltering" overrideModeDefault="Allow" />

Media object thumbnail settings

Thumbnail image length

The length (in pixels) of the longest edge of a thumbnail image. The length of the shorter side is calculated automatically based on the aspect ratio of the image.

Media object thumbnail title character max

The maximum number of characters to display when showing the title of a media object in thumbnail view.

Media Objects – Media Object Types

The Media Object Types page lets you configure the types of media files managed by Gallery Server Pro. By default only files with a JPG or JPEG file extension are allowed. To enable Gallery Server Pro to manage additional types of media objects – AVI videos, for example – select the checkbox next to the AVI file type and click Save changes.

Below is a screen shot of the Media Object Types page.

Page 133: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 133 of 186

If you disable a file type that has existing media objects in the gallery, those objects will be removed from the gallery during the next synchronization. Specifically, the associated database record in the media objects table (gs_MediaObject) is deleted but the original media file is not deleted. This provides the opportunity to later re-enable the file type, synchronize the database, and “recover” the previously removed media object.

Note that this is different behavior than when a media object is deleted with the Delete command, which deletes both the database record and the associated media files.

To enable a mime type not in the list, edit the file types directly in the configuration file config/galleryserverpro.config.

If the Allow any file type, regardless of whether it is listed below option is checked, Gallery Server Pro is allowed to manage file types not explicitly specified in the mime types list. When unchecked, only files with an extension in the list and marked as enabled are allowed. When this option is checked, Gallery Server Pro accepts all file types regardless of their file extension. For maximum security, leave this unchecked and enable only those file types you want to include in the Gallery Server Pro gallery.

Page 134: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 134 of 186

Media Objects – Images

The Media Objects – Images page allows the administrator to specify several options for displaying images in Gallery Server Pro. The Media Objects – Images page appears below.

Compressed images

When an image is added, Gallery Server Pro analyzes the image to determine if a compressed, bandwidth-friendly version of the image should be created. It uses two criteria when evaluating the image:

Is the file size of the image larger than the compression limit?

Is the length of the image's longest side larger than the compressed image length?

If the answer to either of these questions is true, Gallery Server Pro creates a compressed version of the image.

Page 135: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 135 of 186

Default Image Type The Default Image Type is identified with the heading Display original images rather than compressed ones by default. This setting specifies whether the original image or the compressed image is displayed when the user clicks the thumbnail of an image. If unchecked, the compressed image, if it exists, is shown. When checked, the compressed image is ignored and the original file is displayed.

Compression Limit

The compression limit is identified with the heading Make a compressed copy of images above this size (kB). If an image's file size is larger than this value, a bandwidth-friendly, compressed version is created.

The original image is never altered nor deleted, regardless of this setting. (Rotating is the only function that modifies the original image.)

This setting is used: (a) when new images are added to the gallery and (b) during synchronization if the Overwrite existing compressed images option is selected.

Compressed Image Length

The compressed image length is identified with the heading Length of longest side of compressed images (px). This value is used in two ways:

1. When a new image is added, Gallery Server Pro compares the length of the longest side of the new image to this value. If it is longer, than Gallery Server Pro creates a compressed version of the image.

2. This value dictates the length of compressed images in Gallery Server Pro. Specifically, it dictates the length of the longest side of an image. Therefore, it can refer to either the width or the height, depending whether an image is a portrait or landscape.

The length of the shorter side of an image is automatically calculated based on the aspect ratio of the image.

Compressed Image Quality

This is the quality level with which compressed JPG images are created. Valid values are 1 - 100, with 1 being the worst quality (smallest file size) and 100 being the best quality (largest file size).

Example: You upload a 1656 px by 1242 px JPG image that is 800 kB. You have Gallery Server Pro configured with these settings:

The compression limit is 50 kB.

The compression quality setting is 70.

The compressed image length is 640 px.

Page 136: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 136 of 186

Since the image is larger than the 50 kB limit, a compressed copy of the original is created with a quality setting of 70 and the dimensions 640 px by 480.

NOTE: In this example, even if the original image is less than 50 kB, a compressed image is still created,

because the length of its longest side - 1656 px - is longer than the compressed image length setting

(640 px).

Original images

Original Image Quality The quality level at which original JPG images are saved. This setting is only used when the original is rotated by the user. Valid values are 1 - 100, with 1 being the worst quality (smallest file size) and 100 being the best quality (largest file size).

Watermark settings

Watermarks on images are helpful if images need to be protected from unwanted duplication or to communicate the source of the image.

Below is an example of an image with an image and text watermark.

Configure settings for the watermark function on the Media Objects – Images page as shown below.

Page 137: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 137 of 186

Apply watermark to compressed and original images - Applies a watermark to compressed and original images. If checked, both the text and the image specified in Watermark text options and Watermark image options are applied to images.

Note: If a user belongs to a role with View images without watermarks permission, then no

watermarks are applied to images for this user, regardless of this setting.

Also apply watermark to thumbnails - Specifies whether to apply the text and/or image watermark to thumbnail images. This property is ignored if watermarking is disabled.

Watermark text options

Watermark text Specifies the text to apply to images in the gallery. The text is applied in a single line. Leave this setting blank if no text watermark is desired.

Page 138: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 138 of 186

Font name The font used for the watermark text. If the font is not installed on the web server, a generic sans serif font will be substituted.

Font size Specifies the height, in pixels, of the watermark text. Valid values are 1 - 10000.

Note: This value is ignored if the watermark text width percentage is non-zero.

Text width % Specifies the percent of the overall width of the recipient image that should be covered with the watermark text. The size of the text is automatically scaled up or down to achieve the desired width. Valid values are 0 - 100.

This setting overrides the watermark font size setting. To disable this setting so that the watermark font size is enabled, set this value to zero. For example, a value of 50 means the text is 50% as wide as the recipient image. The text is never rendered in a font smaller than 4 pixels, so in cases of long text it may stretch wider than the percentage specified in this setting.

Font color The background color of the thumbnail image. It can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the System.Color.KnownColor enum values (e.g. Maroon) in the Microsoft .NET Framework.

Text opacity % The opacity of the watermark image. Valid values are 0 - 100, 0 being completely transparent and 100 completely opaque.

Text location Specifies the location for the watermark text on the recipient image.

Watermark image options

Path to image to be used as watermark

Specifies the full or relative path to a watermark image to be applied to the recipient image. Common image types, such as JPG, GIF, BMP, TIF, and PNG are accepted.

Relative paths are relative to the root of the web application. The directory separator character can be either a forward or backward slash, and, for relative paths, the initial slash is optional.

Leave this setting blank if no image watermark is desired.

Examples:

/images/mywatermark.jpg

images/mywatermark.gif

\images\mywatermark.bmp

images\mywatermark.tif

Page 139: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 139 of 186

C:\images\mywatermark.png

Watermark image width %

Specifies the percent of the overall width of the recipient image that should be covered with the watermark image. The size of the image is automatically scaled to achieve the desired width. Valid values are 0 - 100.

For example, a value of 50 means the watermark image is 50% as wide as the recipient image.

A value of 0 turns off this feature and causes the image to be rendered at its actual size.

Watermark image opacity %

The opacity of the watermark image. Valid values are 0 - 100, 0 being completely transparent and 100 completely opaque.

Watermark image location

Specifies the location for the watermark image on the recipient image.

More information about the watermarking functionality can be found in the Watermarking section.

Media Objects – Video / Audio / Other

This page contains settings for any locally stored media file that meets the following criteria:

It is not an image. (A file is considered an image if its file extension corresponds to the image mime type as configured in the Media Object Types list.)

An htmlOutput template has been defined for the file’s mime type in the configuration file galleryserverpro.config. By default, Gallery Server Pro defines templates for all video, audio, and Shockwave Flash (SWF) files.

Note: This page is not relevant for externally hosted media objects, such as YouTube videos. It applies

only to media files stored on the web server.

Automatically start video, audio, and other dynamic content when the browser loads - Specifies whether a video, audio or other dynamic media object will automatically start playing in the user's browser. This setting is ignored if the browser plug-in does not support this feature or if the htmlOutput template does not reference the AutoStartMediaObjectInt or AutoStartMediaObjectText variables.

Video settings

Video player width (px): Specifies the width, in pixels, of the browser plug-in that plays a video file.

Video player height (px): Specifies the height, in pixels, of the browser plug-in that plays a video file.

Page 140: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 140 of 186

Audio settings

Audio player width (px): Specifies the width, in pixels, of the browser plug-in that plays an audio file.

Audio player height (px): Specifies the height, in pixels, of the browser plug-in that plays an audio file.

Settings for objects other than images, video, and audio

Generic object width (px):

Specifies the width, in pixels, of the browser plug-in that displays a generic media object.

This is used primarily for Shockwave Flash objects, but applies to any file with a mime type (a) that is not an image, video, or audio object, and (b) for which there are rendering instructions in the mediaObjects section of the configuration file galleryserverpro.config.

This value is mapped to the dynamic {Width} property that can be used in the htmlOutput attribute of the browser XML element in galleryserverpro.config. An alternative to setting the value here is to specify the desired value directly in the htmlOutput attribute for the desired mime type in the configuration file instead of using {Width}. This can be useful if, for example, you want all Shockwave files rendered at one size and generic media objects of another type to be rendered at another size.

Generic object height (px):

Specifies the height, in pixels, of the browser plug-in that displays a generic media object.

This is used primarily for Shockwave Flash objects, but applies to any file with a mime type (a) that is not an image, video, or audio object, and (b) for which there are rendering instructions in the mediaObjects section of the configuration file galleryserverpro.config.

This value is mapped to the dynamic {Height} property that can be used in the htmlOutput attribute of the browser XML element in galleryserverpro.config. An alternative to setting the value here is to specify the desired value directly in the htmlOutput attribute for the desired mime type in the configuration file instead of using {Height}. This can be useful if, for example, you want all Shockwave files rendered at one size and generic media objects of another type to be rendered at another size.

Page 141: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 141 of 186

Configuration Settings in galleryserverpro.config

Gallery Server Pro stores application level configuration settings in a file named galleryserverpro.config. It is stored in the config directory in the web application. Many of the settings are exposed in the user interface in the Site administration console (click Site admin from the Actions menu).

Core configuration settings

The first part of the configuration file contains core configuration settings. It consists of an XML element named core with dozens of attributes.

<core galleryId="1" ... />

Below is a list of the attributes and a description. Edit the values as desired and save. The web application automatically senses that the file has been updated and will restart with the new values.

Note: In some cases, the web application does not restart when the configuration file has changed,

causing the file changes to be ignored. If this occurs, recycle the application pool or enter iisreset at a

Start-Run dialog box.

Configuration setting Description

galleryId The value that uniquely identifies the gallery for this website. Each web application is associated with a single gallery.

mediaObjectPath The absolute or relative path to a directory on a local hard drive containing the media objects. Relative paths are relative to the root of the web application. The initial and trailing slashes are optional. For relative paths, the directory separator character can be either a forward or backward slash. UNC or mapped drives are not valid. Example: If Gallery Server Pro is installed at C:\inetpub\wwwroot\gsp, the following are all valid and point to the same location: "C:\inetpub\wwwroot\gsp\mypics\", "C:\inetpub\wwwroot\gsp\mypics","\mypics\", "\mypics", "mypics\", "mypics", "/mypics/", "/mypics"

websiteTitle The text placed within the &lt;title&gt; tag on each web page.

pageHeaderText The header text that appears at the top of each web page.

pageHeaderTextUrl The URL the user will be directed to when she clicks the page header text. Optional. If not present, no link will be rendered. Examples: “http://www.mysite.com", "/" (the root of the web site), "~/" (the root of the current application)

Page 142: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 142 of 186

defaultAlbumDirectoryName The default name for a directory when a valid name cannot be generated from the album title. This occurs when a user enters an album title consisting entirely of characters that are invalid for a directory name, such as ?, *, :.

defaultAlbumDirectoryNameLength The maximum length of the directory name when a user creates an album. By default, a directory name is the same as the album's title, but is truncated when the title is longer than the value specified here.

synchAlbumTitleAndDirectoryName

Indicates whether to update the directory name corresponding to an album when the album's title is changed. When true, modifying the title of an album causes the directory name to be changed to the same value. If the title is longer than the value specified in defaultAlbumDirectoryNameLength, the directory name is truncated. You may want to set this to false if you have a directory structure that you do not want Gallery Server Pro to alter.

Note that even if this setting is false, directories will still be moved or copied when the user moves or copies an album. Also, Gallery Server Pro always modifies the directory name when it is necessary to make it unique within a parent directory. For example, this may happen if you give two sibling albums the same title or you move/copy an album into a directory containing another album with the same name.

emptyAlbumThumbnailBackgroundColor

The color used for the background of the GIF image generated by Gallery Server when creating a default thumbnail image for a newly created album or an album without any objects. The color can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the System.Color.KnownColor enum values (e.g. Maroon).

emptyAlbumThumbnailText The default text written on the GIF image generated by Gallery Server when creating a default thumbnail image for a newly created album or an album without any objects. The GIF is dynamically generated by the application when it is needed and is never actually stored on the hard drive.

emptyAlbumThumbnailFontName The font used for text written on the GIF image generated by Gallery Server when creating a default thumbnail image for a newly created album or an album without any objects. The font must be installed on the web server. If the font is not installed, a generic sans serif font will be substituted.

Page 143: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 143 of 186

emptyAlbumThumbnailFontSize The size, in pixels, of the font used for text written on the GIF image generated by Gallery Server when creating a default thumbnail image for a newly created album or an album without any objects.

emptyAlbumThumbnailFontColor The color of the text specified in property EmptyAlbumThumbnailText. The color can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the System.Color.KnownColor enum values (e.g. Maroon).

emptyAlbumThumbnailWidthToHeightRatio

The ratio of the width to height of the default thumbnail image for an album that does not have a thumbnail image specified. The length of the longest side of the image is set by the MaxThumbnailLength property, and the length of the remaining side is calculated using this ratio. A ratio or more than 1.00 results in the width being greater than the height (landscape), while a ratio less than 1.00 results in the width being less than the height (portrait). Example: If MaxThumbnailLength = 115 and EmptyAlbumThumbnailWidthToHeightRatio = 1.50, the width of the default thumbnail image is 115 and the height is 77 (115 / 1.50).

maxAlbumThumbnailTitleDisplayLength

Maximum # of characters to display when showing the title of an album thumbnail view.

maxMediaObjectThumbnailTitleDisplayLength

Maximum # of characters to display when showing the title of a media object in a thumbnail view.

allowHtmlInTitlesAndCaptions Indicates whether to allow limited HTML tags in the titles and captions for albums and media objects.

When true, the following HTML tags are allowed: a, img, span, div, p, h1, h2, h3, h4, h5, h6, strong, em, u, b, i, strike, sup, sub, font, blockquote, ul, ol, li, address, pre, hr, br. Also, the following attributes are allowed: class, style, id. In addition, some tag-specific attributes are also allowed (e.g. src, alt, and title for img; href, target, name, and title for hyperlink (a)). Javascript is NEVER allowed. If this value is changed from true to false, existing objects will not be immediately purged of all HTML tags. Instead, individual titles and captions are stripped of HTML as each object is edited and saved by the user.

mediaObjectTransitionType Specifies the visual transition effect to use when moving from one media object to another. This value maps to the enumeration GalleryServerPro.Business.MediaObjectTransitionType, and must be one of the following values: None, Fade.

Page 144: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 144 of 186

mediaObjectTransitionDuration The duration of the transition effect, in seconds, when navigating between media objects. This setting has no effect when mediaObjectTransitionType = "None".

slideshowInterval The delay, in milleseconds, between images during a slide show.

mediaObjectDownloadBufferSize The size of each block of bytes sent to the client when downloading media objects (images, video, etc.)

encryptMediaObjectUrlOnClient Indicates whether security-sensitive portions of the URL to the media object are encrypted when it is sent to the client browser. Valid values are "true" and "false". When false, the URL to the media object is sent in plain text, such as handler/getmediaobject.ashx?moid=34&aid=8&mo=C%3A%5Cgs%5Cmypics%5Cbirthday.jpeg&mtc=1&dt=1 These URLs can be seen by viewing the source of the HTML page. From this URL one can determine the album ID for this media object is 8, (aid=8), the file path to the media object on the server is C:\gs\mypics\birthday.jpeg, and the requested image is a thumbnail (dt=1, where 1 is the value of the GalleryServerPro.Business.DisplayObjectType enumeration for a thumbnail). For enhanced security, set encryptMediaObjectUrlOnClient to true, which uses Triple DES encryption to encrypt the query string. It is recommended to set this to true except when you are troubleshooting and it is useful to see the file name and path in the HTML source. The Triple DES algorithm uses the secret key specified in the EncryptionKey property. Typically, this should be set to The Triple DES algorithm is used and the EncryptionKey property is used as the secret key.

encryptionKey The secret key used for the Triple DES algorithm. Applicable when encryptMediaObjectUrlOnClient = true. The string must be 24 characters in length and be sufficiently strong so that it cannot be easily cracked. An exception is thrown by the .NET Framework if the key is considered weak. Change this to a value known only to you to prevent others from being able to decrypt.

allowUnspecifiedMimeTypes Indicates whether Gallery Server Pro is allowed to manage file types not explicitly specified in the mimeTypes configuration section. When false, any file with an extension not listed in the mimeTypes section is rejected. When true, Gallery Server Pro accepts all file types regardless of their file extension.

imageTypesStandardBrowsersCanDisplay

A comma separated list of file extensions indicating types of images that a standard browser can display. When the user requests an original image (high resolution), the original is sent to the browser in

Page 145: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 145 of 186

an <img> HTML tagif its extension is one of those listed here. If not, the user is presented with a message containing instructions for downloading the image file. Typically this setting should not be changed.

allowAnonymousHiResViewing Specifies whether anonymous users are allowed to view the original, uncompressed versions of images. When no compressed (optimized) version of an image exists, the user is allowed to view the original, regardless of this setting. This setting has no effect on non-image media objects or for logged on users.

enableImageMetadata Specifies whether Gallery Server Pro extracts and displays metadata from image files. The metadata is displayed next to the optimized version of images when the View metadata toolbar icon is invoked. If the attribute enableWpfMetadataExtraction is true, then additional metadata such as title, keywords, and rating is extracted.

enableWpfMetadataExtraction Specifies whether metadata is extracted from image files using Windows Presentation Foundation (WPF) classes in .NET Framework 3.0. The WPF classes allow additional metadata to be extracted beyond those allowed by the .NET Framework 2.0, such as title, keywords, and rating. This attribute has no effect unless the following requirements are met: The attribute enableImageMetadata = "true"; .NET Framework 3.0 is installed on the web server; the web application is running in Full Trust. The WPF classes have exhibited some reliability issues during development, most notably causing the IIS worker process (w3wp.exe) to increase in memory usage and eventually crash during uploads and synchronizations. For this reason you may want to disable this feature until a .NET Framework service pack or future version provides better performance.

enableMediaObjectDownload Specifies whether Gallery Server Pro renders user interface objects to allow a user to download the file for a media object. Typically, this setting is used to control whether a download button is displayed in the toolbar that appears above a media object. Note that setting this value to false does not prevent a user from downloading a media object, since a user already has access to the media object if he or she can view it in the browser. To prevent certain users from viewing media objects (and thus downloading them), user private albums or disable anonymous viewing.

enablePermalink Specifies whether Gallery Server Pro renders user interface objects to provide the user with a hyperlink that links directly to the visible media object. This is convenient because AJAX callbacks are used as the user navigates the media objects in an album and the url in the

Page 146: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 146 of 186

browser's address bar is not updated for each media object. When true, a show permalink button is displayed in the toolbar that appears above a media object.

enableSlideShow Specifies whether slide show functionality is enabled. When true, a start/pause slideshow button is displayed in the toolbar that appears above a media object. The length of time each image is shown before automatically moving to the next one is controlled by the SlideshowInterval setting. Note that only images are shown during a slide show; other objects such as videos, audio files, and documents are skipped.

maxThumbnailLength The length (in pixels) of the longest edge of a thumbnail image. This value is used when a thumbnail image is created. The length of the shorter side is calculated automatically based on the aspect ratio of the image.

thumbnailImageJpegQuality The quality level that optimized JPG pictures are created with. This is a number from 1 - 100, with 1 being the worst quality and 100 being the best quality. Not applicable for non-image media objects.

maxOptimizedLength The length (in pixels) of the longest edge of an optimized image. This value is used when an optimzed image is created. The length of the shorter side is calculated automatically based on the aspect ratio of the image. Not applicable for non-image media objects.

thumbnailPath The absolute or relative path to a directory on a local hard drive specifying where Gallery Server should store the thumbnail images of media objects. Relative paths are relative to the root of the web application. The initial and trailing slashes are optional. For relative paths, the directory separator character can be either a forward or backward slash. If no path is specified, the directory containing the original media object is used to store the thumbnail image. UNC or mapped drives are not valid. The following are all valid and point to the same location (assuming Gallery Server is installed as a web application at C:\inetpub\wwwroot\gsp): "C:\inetpub\wwwroot\gsp\cache\", "C:\inetpub\wwwroot\gsp\cache", "\cache\", "\cache", "cache\", "cache", "/cache/", "/cache"

thumbnailFileNamePrefix The string that is prepended to the thumbnail file name for each media object. For example, if an image named puppy.jpg is added, and this setting is "zThumb_", the thumbnail image will be named "zThumb_puppy.jpg". NOTE: Any file named "zThumb_puppy.jpg" that already exists will be overwritten, so it is important to choose a

Page 147: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 147 of 186

value that, when prepended to media object file names, will not conflict with existing media objects.

thumbnailHeightBuffer The length (in pixels) that is added to the height of the each thumbnail image. A larger number creates more vertical padding between the image and the border of the thumbnail container.

thumbnailWidthBuffer The length (in pixels) that is added to the width of the each thumbnail image. A larger number creates more horizontal padding between the image and the border of the thumbnail container.

thumbnailClickShowsOriginal Specifies whether the original image is displayed when the user clicks the thumbnail of an image. If unchecked, the optimized image is shown instead. Not applicable for non-image media objects.

thumbnailImageJpegQuality The quality level that thumbnail images are stored at (0 - 100).

optimizedImageTriggerSizeKB The size (in KB) above which an image is compressed to create an optimized version. Not applicable for non-image media objects.

optimizedFileNamePrefix The string that is prepended to the optimized file name for images. This setting is only used for image media objects where an optimized image file is created. For example, if an image named puppy.jpg is added, and this setting is "zOpt_", the optimized image will be named "zOpt_puppy.jpg".

NOTE: Any file named "zOpt_puppy.jpg" that already exists will be overwritten, so it is important to choose a value that, when prepended to media object file names, will not conflict with existing media objects.

optimizedPath The absolute or relative path to a directory on a local hard drive specifying where Gallery Server should store the optimized images of media objects. Relative paths are relative to the root of the web application. The initial and trailing slashes are optional. For relative paths, the directory separator character can be either a forward or backward slash. If no path is specified, the directory containing the original media object is used to store the thumbnail image. UNC or mapped drives are not valid. Not applicable for non-image media objects. The following are all valid and point to the same location (assuming Gallery Server is installed as a web application at C:\inetpub\wwwroot\gsp): "C:\inetpub\wwwroot\gsp\cache\", "C:\inetpub\wwwroot\gsp\cache", "\cache\", "\cache", "cache\", "cache", "/cache/", "/cache"

Page 148: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 148 of 186

optimizedFileNamePrefix The string that is prepended to the optimized file name for images. This setting is only used for image media objects where an optimized image file is created. For example, if an image named puppy.jpg is added, and this setting is "zOpt_", the optimized image will be named "zOpt_puppy.jpg".

NOTE: Any file named "zOpt_puppy.jpg" that already exists will be overwritten, so it is important to choose a value that, when prepended to media object file names, will not conflict with existing media objects.

applyWatermark Specifies whether to apply a watermark to optimized and original images. If true, the text in the watermarkText property is applied to images, and the image specified in watermarkImagePath is overlayed on the image. If watermarkText is empty, or if watermarkImagePath is empty or does not refer to a valid image, that watermark is not applied. If applyWatermarkToThumbnails = true, then the watermark is also applied to thumbnails.

applyWatermarkToThumbnails Specifies whether to apply the text and/or image watermark to thumbnail images. This property is ignored if applyWatermark = false.

watermarkText Specifies the text to apply to images in the gallery. The text is applied in a single line.

watermarkTextFontName The font used for the watermark text. If the font is not installed on the web server, a generic sans serif font will be substituted.

watermarkTextFontSize Gets or sets the height, in pixels, of the watermark text. This value is ignored if the property watermarkTextWidthPercent is non-zero. Valid values are 0 - 10000.

watermarkTextWidthPercent Gets or sets the percent of the overall width of the recipient image that should be covered with the watermark text. The size of the text is automatically scaled up or down to achieve the desired width. For example, a value of 50 means the text is 50% as wide as the recipient image. Valid values are 0 - 100. The text is never rendered in a font smaller than 6 pixels, so in cases of long text it may stretch wider than the percentage specified in this setting. A value of 0 turns off this feature and causes the text size to be determined by the watermarkTextFontSize property.

watermarkTextColor Specifies the color of the watermark text. The color can be specified as hex (e.g. #336699), RGB (e.g. 127,55,95), or one of the

Page 149: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 149 of 186

System.Color.KnownColor enum values (e.g. Maroon).

watermarkTextOpacityPercent The opacity of the watermark text. This is a value from 0 to 100, with 0 being invisible and 100 being solid, with no transparency.

watermarkTextLocation Gets or sets the location for the watermark text on the recipient image. This value maps to the enumeration System.Drawing.ContentAlignment, and must be one of the following nine values: TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight.

watermarkImagePath Gets or sets the full or relative path to a watermark image to be applied to the recipient image. The image must be in a format that allows it to be instantiated in a System.Drawing.Bitmap object. Relative paths are relative to the root of the web application. The directory separator character can be either a forward or backward slash, and, for relative paths, the initial slash is optional. The following are all valid: "/images/mywatermark.jpg", "images/mywatermark.jpg", "\images\mywatermark.jpg", "images\mywatermark.jpg", "C:\images\mywatermark.jpg"

watermarkImageWidthPercent Gets or sets the percent of the overall width of the recipient image that should be covered with the watermark image. The size of the image is automatically scaled to achieve the desired width. For example, a value of 50 means the watermark image is 50% as wide as the recipient image. Valid values are 0 - 100. A value of 0 turns off this feature and causes the image to be rendered its actual size.

watermarkImageOpacityPercent Gets or sets the opacity of the watermark image. Valid values are 0 - 100, with 0 being completely transparent and 100 completely opaque.

watermarkImageLocation Gets or sets the location for the watermark image on the recipient image. This value maps to the enumeration System.Drawing.ContentAlignment, and must be one of the following nine values: TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight.

sendEmailOnError Specifies whether the Gallery Server Pro administrator (specified in EmailToName/EmailToAddress) is sent a report when a web site error occurs. A valid SMTP server must be specified if this is set to

Page 150: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 150 of 186

true (attribute SmtpServer).

emailFromName The name associated with the EmailFromAddress email address. Emails sent from Gallery Server will appear to be sent from this person.

emailFromAddress The email address associated with the EmailFromName attribute. Emails sent from Gallery Server will appear to be sent from this email address.

emailToName The name associated with the EmailToAddress email address. Emails sent from Gallery Server will be sent to this person. Note that the email address is set in the attribute EmailToAddress.

emailToAddress The email address associated with the EmailToName attribute. Emails sent from Gallery Server will be sent to this email address. Note that the name associated with this address is set inthe attribute EmailToName.

smtpServer Specifies the IP address or name of the SMTP server used to send emails. (Examples: 127.0.0.1, Godzilla, mail.yourisp.com) This value will override the SMTP server setting that may be in the system.net mailSettings section of the web.config file (either explicitly or inherited from a parent web.config file). Leave this setting blank to use the value in web.config or if you are not using the email functionality.

Note: If you need to specify a username and password for the SMTP server, you should follow these steps:

1. Set the smtpServer and smtpServerPort values to blank in galleryserverpro.config.

2. Open web.config in the root of the web application. Add the following section, below the <configuration> element:

<system.net> <mailSettings> <smtp> <network host="smtp.yourisp.com"

userName="Soren" password="pwdForSoren" /> </smtp> </mailSettings> </system.net>

3. Set the host value to the SMTP server. Set the userName and

Page 151: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 151 of 186

password to the appropriate values.

4. If using a port other than the default of 25, add a port attribute, like this:

<network host="…" userName="…" password="…" port="38" />

smtpServerPort

Specifies the SMTP server port number used to send emails. This value will override the SMTP server port setting that may be in the system.net mailSettings section of the web.config file (either explicitly or inherited from a parent web.config file). Leave this setting blank to use the value in web.config or if you are not using the email functionality. Defaults to 25 if not specified here or in web.config.

autoStartMediaObject Indicates whether a video, audio or other dynamic object will automatically start playing in the user's browser.

defaultVideoPlayerWidth Indicates the default width, in pixels, of the browser object that plays a video file. Typically this refers to the <object> tag that contains the video, resulting in syntax similar to this:

<object style="width:640px;height:480px;" ... >

defaultVideoPlayerHeight Indicates the default height, in pixels, of the browser object that plays a video file. Typically this refers to the <object> tag that contains the video, resulting in syntax similar to this:

<object style="width:640px;height:480px;" ... >

defaultAudioPlayerWidth Indicates the default width, in pixels, of the browser object that plays an audio file. Typically this refers to the <object> tag that contains the audio file, resulting in syntax similar to this:

<object style="width:300px;height:200px;" ... >

defaultAudioPlayerHeight Indicates the default height, in pixels, of the browser object that plays an audio file. Typically this refers to the <object> tag that contains the audio file, resulting in syntax similar to this:

<object style="width:300px;height:200px;" ... >

defaultGenericObjectWidth Indicates the default width, in pixels, of the browser object that displays a generic media object.

A generic media object is defined as any media object that is not an

Page 152: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 152 of 186

image, audio, or video file. This includes Shockwave Flash, Adobe Reader, text files, Word documents and others. The value specified here is sent to the browser as the width for the object element containing this media object, resulting in syntax similar to this:

<object style="width:640px;height:480px;" ... >

This setting applies only to objects rendered within the browser, such as Shockwave Flash. Objects sent to the browser via a download link, such as text files, PDF files, and Word documents, ignore this setting.

defaultGenericObjectHeight Indicates the default height, in pixels, of the browser object that displays a generic media object.

A generic media object is defined as any media object that is not an image, audio, or video file. This includes Shockwave Flash, Adobe Reader, text files, Word documents and others. The value specified here is sent to the browser as the width for the object element containing this media object, resulting in syntax similar to this:

<object style="width:640px;height:480px;" ... >

This setting applies only to objects rendered within the browser, such as Shockwave Flash. Objects sent to the browser via a download link, such as text files, PDF files, and Word documents, ignore this setting.

maxUploadSize

Indicates the maximum size, in kilobytes, of the files that can be uploaded using the Add Objects function. Use this setting to keep users from uploading very large files and to help guard against Denial of Service (DOS) attacks. A value of zero (0) indicates there is no restriction on upload size (unlimited).

This value applies to the content length of the entire upload request, not just the file. For example, if this value is 1024 KB and the user attempts to upload two 800 KB images, the request will fail because the total content length is larger than 1024 KB. This setting is not used during synchronization.

allowAddLocalContent Indicates whether a user can upload a physical file to the gallery, such as an image or video file stored on a local hard drive. The user must also be authenticated and a member of a role with AllowAddMediaObject or AllowAdministerSite permission. This setting is not used during synchronization.

Page 153: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 153 of 186

allowAddExternalContent Indicates whether a user can add a link to external content, such as a YouTube video, to the gallery. The user must also be authenticated and a member of a role with AllowAddMediaObject or AllowAdministerSite permission. This setting is not used during synchronization.

productKey Specifies the product key for this installation of Gallery Server Pro. The product key can be generated by the Product Key Wizard at www.galleryserverpro.com.

HTML Template Configuration Settings

Following the core element in galleryserverpro.config is the galleryObject element. This section contains settings for controlling how HTML is rendered to the browser for various types of media objects. A full discussion is in the Rendering Media Objects to the Browser section.

MIME Types Configuration Settings

The file galleryserverpro.config contains a list of file types that are managed by Gallery Server Pro. This list is exposed through the Media Object Types page in the Site administration console. (Click Site admin in the Actions menu, then click Media Object Types in the menu on the left.)

The Media Object Types page allows one to review the list of file types Gallery Server Pro is configured to manage. Each type can be enabled or disabled as desired.

However, the Media Object Types page does not allow adding new mime types or editing existing ones (except for enabling or disabling). For advanced configuration options, you can edit this data directly in galleryserverpro.config.

Below is an example of one of the mime types in the file.

<mimeType fileExtension=".jpeg" browserId="default" type="image/jpeg" allowAddToGallery="true" />

The mimeType element provides mapping information between a file extension, its associated mime type, and the family of browsers to which it applies. Each mime type is uniquely identified by the fileExtension and browserId attributes. If the combination of fileExtension and browserId values are specified more than once within the mimeTypes collection, only the first element is used (subsequent ones are ignored). Each fileExtension may be listed more than once, but there must always be one entry where browserId = "default", and it must be listed prior to any other elements with the same fileExtension. The type attribute may be used multiple times (e.g. "image/jpeg" is used for both .jpg and .jpeg extensions).

The type attribute holds the MIME type of the file extension. The browserMimeType attribute holds the MIME type that should be sent to the browser. If the browserMimeType attribute is omitted, the MIME type specified in the type attribute is used instead. Use the browserMimeType attribute for certain types of objects where the browser does not understand the standard MIME type.

Page 154: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 154 of 186

Example: Imagine you want Gallery Server to play WAV files in the browser. WAV files have a MIME type of audio/wav. But most, and possibly all, browsers do not understand this value, so HTML like this does not work:

<object type='audio/wav' .... </object>

Instead, browsers require this:

<object type`'application/x-mplayer2' .... </object>

Therefore, we need to specify the .wav mime type like this:

<mimeType fileExtension=".wav" type="audio/wav" browserId="default" browserMimeType="application/x-mplayer2" allowAddToGallery="true" />

What if the above solution worked for most browsers, but Internet Explorer 5.0 required "application/x-mplayer"? Add an additional mimeType element specifying the new value for the IE 5.0 browser:

<mimeType fileExtension=".wav" type="audio/wav" browserId="ie50" browserMimeType="application/x-mplayer2" allowAddToGallery="true" />

IMPORTANT: The MIME type for browserId="default" must ALWAYS appear before more specific

browser IDs (if there are any). An exception will occur if a non-default value is encountered before the

default value for a particular file extension .

The browserId attribute must be a valid browser specified in the .NET Framework's .browser files. See http://msdn.microsoft.com/msdnmag/issues/06/10/ExtremeASPNET/fig05.gif for a hierarchical list of IDs recognized by .Net Framework 2.0. If the client's browser matches multiple browser elements (e.g. "ie" and "default"), the most specific browser element is preferred (in this example "ie"). Thus you can specify a browser element with id="default" containing the default HTML for a particular type of media object. Create additional browser elements to handle individual browsers as desired.

Data Store Configuration Settings

The dataStore element in galleryserverpro.config stores configuration information about the data store. For example, if a SQL Server database is being used, these values are used by Gallery Server to set up the Command objects that communicate with the database.

Configuration setting Description

albumTitleLength The maximum allowed string length for an album title.

albumDirectoryNameLength The maximum length for a directory name in the media objects library. Each directory name matches the title of the matching album, with the following exceptions: (1) Characters that are not valid for directory names are removed, and (2) the name is

Page 155: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 155 of 186

shortened (if necessary) to the maximum length specified here.

albumSummaryLength The maximum allowed string length for an album summary.

mediaObjectTitleLength The maximum allowed string length for a media object title (caption).

mediaObjectFileNameLength The maximum length allowed for a media object file name. This must be the smaller of the restrictions set by the operating system and the corresponding data types in the data store (ThumbnailFileName, OptimizedFileName, OriginalFileName).

mediaObjectHashKeyLength The maximum length of the hash key generated for each media object. Gallery Server generates 47-character hash keys, so this value must be greater than or equal to 47.

mediaObjectMetadataDescriptionLength

The maximum allowed string length for a meta data description.

mediaObjectMetadataValueLength The maximum allowed string length for a meta data value.

roleNameLength The maximum allowed string length for a role name.

Data Provider Configuration Settings

This section stores configuration information about the data provider used by Gallery Server. It looks similar to this:

<dataProvider defaultProvider=" SQLiteGalleryServerProProvider "> <providers> <add applicationName="Gallery Server Pro" connectionStringName="SQLiteDbConnection" name="SQLiteGalleryServerProProvider" type="GalleryServerPro.Data.SQLite.SQLiteGalleryServerProProvider" /> <add applicationName="Gallery Server Pro" name="SqlDataProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider" /> </providers>

</dataProvider>

This example specifies the data provider is a class called SQLiteGalleryServerProProvider in the GalleryServerPro.Data.SQLite namespace, which is in a DLL named GalleryServerPro.Data.SQLite.dll. You may specify any provider that uses GalleryServerPro.Provider.DataProvider as its base class (which in turn inherits the .NET class System.Configuration.Provider.ProviderBase and implements the custom interface GalleryServerPro.Provider.Interfaces.IDataProvider).

Page 156: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 156 of 186

9. Membership Configuration

Membership Overview

Note: This section contains advanced information on customizing how Gallery Server Pro manages

users and roles. If you are using the default configuration, you can skip this section.

Gallery Server Pro uses the ASP.NET Provider model for storing users, roles, profiles, and gallery data. If the option Script ASP.NET Membership is selected during installation, the installer adds the necessary tables, stored procedures, and views to the Gallery Server Pro database. However, Gallery Server Pro can take advantage of an existing Membership schema in the database, in another database, or it can use an entirely different data store through the use of alternate membership providers such as ActiveDirectoryMembershipProvider or even one you write yourself.

We’ll discuss setting up Gallery Server Pro in the following scenarios:

1. Store users and roles in a new set of tables in the same SQL database as Gallery Server Pro,

2. Store users and roles in an existing membership schema in the same SQL database as Gallery Server Pro,

3. Store users and roles in an existing membership schema in a different SQL database than Gallery Server Pro, and

4. Using a membership provider other than the default SQL provider.

New membership in current SQL database

The simplest scenario, and the one Gallery Server Pro uses by default, is to let the web installer set up the tables, stored procedures, and views necessary for storing users and roles in the same database that Gallery Server Pro uses for its data.

1. Run the web installer, accepting the default Script ASP.NET Membership option.

2. After the installation is complete, Gallery Server Pro is properly configured and ready to run. You can log in with the administrator account you specified in the installer.

Use existing membership schema in current SQL database

Since all data objects used by Gallery Server Pro have names beginning with a “gs_” prefix, you can install Gallery Server Pro in an existing database used by other applications. If this database already has the ASP.NET Membership installed, you can configure Gallery Server Pro to use it.

When using an existing membership schema, there are two scenarios:

1. You want Gallery Server Pro to use its own set of user accounts and roles.

2. You want Gallery Server Pro to use the same set of users and roles as another application. For example, you may be using DotNetNuke and you want users to use their DotNetNuke accounts to log in to Gallery Server Pro.

Page 157: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 157 of 186

Use a new set of users and roles, same database

1. Run the web installer, making sure to uncheck the option Script ASP.NET Membership.

2. If the installer instructs you to update the connection string in web.config when it finishes, do so. After the installation is complete, Gallery Server Pro is properly configured and ready to run. You can log in with the administrator account you specified in the installer.

Use an existing set of users and roles, same database

1. Run the web installer, making sure to uncheck the option “Script ASP.NET Membership”.

Note: Since you will be using an existing set of users and roles, you will end up not using the

administrator account requested on the last step of the web installer. You can forget whatever you

entered on that step.

2. If the installer instructs you to update the connection string in web.config when it finishes, do so. Do not click the link to take you to the Gallery Server Pro home page. We need to do a couple of things first.

3. Open web.config in the root of the Gallery Server Pro web application and look for three instances of applicationName="Gallery Server Pro" (one each for the membership, role, and profile providers). Replace “Gallery Server Pro” with the name of the application with which you are sharing membership. You can find this in the other application’s web.config file and in the table aspnet_Applications.

Note: At this point you can log in to Gallery Server Pro with any user that exists in the application, but

you won’t get very far, because users have not yet been given access to any albums. That is, you can

authenticate but you don’t have any authorization.

4. Decide which existing role will be the system administrator role for Gallery Server Pro (create one with the other application if necessary). Then open the table gs_Role and add a record for this role. Set all true/false fields to true. The FKGalleryId field must match the GalleryId field in config/GalleryServerPro.config (the default is 1).

5. Now you can click the link to the Gallery Server Pro home page that is on the last step of the web installer. You can log in with any user that belongs to the system administrator role you chose in step 4.

6. If you navigate to the Manage Users or Manage Roles web administration pages of Gallery Server Pro, you will see a list of all users and roles for the application you specified in step 3. You can assign permissions as desired to give additional users and roles permission to Gallery Server Pro.

Use existing membership schema in different SQL database

You can configure Gallery Server Pro to use an ASP.NET Membership schema installed in another SQL database on your server or network. For example, you may want Gallery Server Pro to use the same set of users and roles as an existing application, or you may have a dedicated database for storing membership data.

Page 158: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 158 of 186

When using an existing membership schema, there are two scenarios:

1. You want Gallery Server Pro to use its own set of user accounts and roles.

2. You want Gallery Server Pro to use the same set of users and roles as another application. For example, you may be using DotNetNuke and you want users to use their DotNetNuke accounts to log in to Gallery Server Pro.

Use a new set of users and roles, different database

1. Run the web installer, making sure to uncheck the option Script ASP.NET Membership.

2. If the installer instructs you to update the connection string in web.config when it finishes, do so.

3. Open web.config in the root of the Gallery Server Pro web application and add a connection string that points to the database where membership data reside. Make sure you give it a unique name, such as MembershipDbConnection.

4. Update the connection string name for the membership, role, and profile sections in web.config. Look for three instances of connectionStringName="GalleryServerDbConnection". Replace “GalleryServerDbConnection” with the name of the connection string you added in the previous step.

5. Create a role that will be the system administrator role for Gallery Server Pro. Then create a user and assign the user to this role. For example, the role may be System Administrator and the user is Admin. One way to do this is to use the Web Site Administration Tool that is included with all versions of Visual Studio 2005 that can create web applications (including the free Express version). Using this tool is beyond the scope of this document, but online information is easily found.

6. Now you can click the link to the Gallery Server Pro home page that is on the last step of the web installer. You can log in with the user you created in the previous step.

Use an existing set of users and roles, different database

1. Run the web installer, making sure to uncheck the option Script ASP.NET Membership.

Note: Since you will be using an existing set of users and roles, you will end up not using the

administrator account requested on the last step of the web installer. You can forget whatever you

entered on that step.

2. If the installer instructs you to update the connection string in web.config when it finishes, do so. Do not click the link to take you to the Gallery Server Pro home page. We need to do a couple things first.

3. Open web.config in the root of the Gallery Server Pro web application and add a connection string that points to the database where membership data reside. Make sure you give it a unique name, such as MembershipDbConnection.

4. Update the connection string name for the membership, role, and profile sections in web.config. Look for three instances of connectionStringName="GalleryServerDbConnection". Replace “GalleryServerDbConnection” with the name of the connection string you added in the previous step.

Page 159: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 159 of 186

5. Now look for three instances of applicationName="Gallery Server Pro" (one each for the membership, role, and profile providers). Replace “Gallery Server Pro” with the name of the application with which you are sharing membership. You can find this in the application’s web.config file and in the table aspnet_Applications.

Note: At this point you can log in to Gallery Server Pro with any user that exists in the application, but

you won’t get very far, because users have not yet been given access to any albums. That is, you can

authenticate but you don’t have any authorization.

6. Decide which existing role will be the system administrator role for Gallery Server Pro (create one with the other application if necessary). Open the table gs_Role and add a record for this role. Set all true/false fields to true. The FKGalleryId field must match the GalleryId field in config/GalleryServerPro.config (the default is 1).

7. Now you can click the link to the Gallery Server Pro home page that is on the last step of the web installer. You can log in with any user that belongs to the system administrator role you chose in step 4.

8. If you navigate to the Manage users or Manage roles web administration pages of Gallery Server Pro, you will see a list of all users and roles for the application you specified in step 5. You can assign permissions as desired to give additional users and roles permission to Gallery Server Pro.

Integrate Gallery Server Pro with Active Directory

In this section I describe how to modify a default installation of Gallery Server Pro to use Active Directory for user management.

Step 1: Configure basic AD integration

The first step in Active Directory configuration is to modify the web.config file in the root of the Gallery Server Pro application. Add a connection string to AD:

<connectionStrings> <add name="GalleryServerDbConnection" connectionString="Data Source=(local);Initial Catalog=GalleryServerPro;Integrated Security=true;Application Name=Gallery Server Pro" /> <add name="ADConnection" connectionString="LDAP://192.168.1.1/CN=users,DC=mydomain,DC=techinfosystems,DC=com"/> </connectionStrings>

The value 192.168.1.1 is the IP address of the domain controller. You can also specify the Fully Qualified Domain Name (ex. mydomain.techinfosystems.com), the Relative Distinguished Name (ex. godzilla if that is the name of your DC); or for more redundancy you can specify just the domain name (ex. mydomain). Whichever you choose just be sure you can ping it.

The next step is to comment out the existing membership configuration by adding <!-- to the beginning and --> to the end, like this:

Page 160: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 160 of 186

<!-- <membership defaultProvider="SQLiteMembershipProvider"> <providers> <clear /> <add applicationName="Gallery Server Pro" passwordFormat="Clear" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="2" maxInvalidPasswordAttempts="2" enablePasswordReset="true" enablePasswordRetrieval="true" passwordAttemptWindow="10" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="SQLiteDbConnection" name="SQLiteMembershipProvider" type="GalleryServerPro.Data.SQLite.SQLiteMembershipProvider" /> <add applicationName="Gallery Server Pro" passwordFormat="Encrypted" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="2" maxInvalidPasswordAttempts="50" enablePasswordReset="true" enablePasswordRetrieval="true" passwordAttemptWindow="10" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="SqlServerDbConnection" name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" /> </providers> </membership> -->

Now add the new membership info for Active Directory:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider"> <providers> <add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnection" enableSearchMethods="true"/> </providers> </membership>

The version number must match the one installed on your web server, so update it as needed. Some examples I saw on the internet used 2.0.3600.0 instead of 2.0.0.0. Make sure the connection string name matches the name you specified in the connection string definition. The enableSearchMethods attribute is required so that Gallery Server Pro can retrieve a list of all users on the user management page.

Now, at this point you should be able to log on to Gallery Server with your domain account, but you will receive the following message:

"Insufficient permission. You are not authorized to view any albums. Contact your administrator to request access."

This is because your user account is not a member of any roles in Gallery Server Pro. Recall that when you installed Gallery Server Pro, a role named System Administrator was created with administrative permission. Now you need to add one or more AD users to this role. But how do you do this when no one has authorization to perform this task?

Page 161: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 161 of 186

If you are using IIS 7, the answer is easy. Open up IIS Manager, navigate to the Gallery Server Pro web app, and click .NET Users. A list of your AD users appears. Double click the one that you want to be the administrator, and add the user to the System Administrator role in the dialog box. The next time you log on to Gallery Server Pro you will have administrative access.

For IIS 6 and earlier users, the task is a bit more difficult because those versions don't provide a means for accessing the users. However, all versions of Visual Studio 2005 and higher - including the free Express versions - provide the Web Site Administration Tool, which allows you to edit the roles for users. Using this tool is beyond the scope of this document, but online information can be found. Use this tool to add one of the users to the System Administrator role.

At this point you should be able to log on using your AD account. Use the syntax user@fully_qualified_domain_name, such as [email protected]. Later I'll show you how can get change it to just the username.

Step 2: Create, edit and delete AD accounts within Gallery Server Pro

Once you are logged on as an administrator, you can go to the Manage Users page and add the remaining AD accounts to appropriate roles. If the IIS user account does not have permission to make changes to AD, you may receive an error like this when you click Save changes:

"Cannot update user. General access denied errror"

You will get this error because the IIS worker process does not have permission to modify AD data. To get around this, you have two choices:

1. Specify a domain account in web.config that has the necessary permission. Open web.config and add connectionUsername and connectionPassword attributes to the provider definition, like this:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider"> <providers> <add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"

connectionStringName="ADConnection" enableSearchMethods="true" connectionUsername="RMartin" connectionPassword="mypassword"/>

</providers> </membership>

Note that putting an AD account name and password in a plain text file is a security risk. If you go this route, I HIGHLY recommend you encrypt the web.config file. Here are two links where you can learn more:

How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI http://msdn.microsoft.com/en-us/library/ms998280.aspx

Video: How Do I: Encrypt My Web.Config File? http://weblogs.asp.net/scottgu/archive/2006/01/09/434893.aspx

2. Specify an account for the IIS worker process that has the necessary AD permission. I prefer this over the first solution.

Page 162: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 162 of 186

Once the permissions are sorted out, you have the potential to create, edit and delete users. Remember that adding a user creates a new account in Active Directory and deleting an account removes it! Obviously this can be abused in a way that affects your entire domain, so use caution. For this reason, you may actually prefer to revert to read-only permissions and handle role membership via IIS 7 Manager (or the Web Site Administration Tool for IIS 5-6).

Options

Log on with simple username instead of fully qualified name

Your users might not be thrilled with having to log on using the syntax user@fully_qualified_domain_name, such as [email protected]. If you want to log on with just a username, add the attributeMapUsername to the membership configuration:

<membership defaultProvider="AspNetActiveDirectoryMembershipProvider"> <providers> <add name="AspNetActiveDirectoryMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnection" enableSearchMethods="true" attributeMapUsername="sAMAccountName" /> </providers> </membership>

By setting attributeMapUsername to sAMAccountName, you can log on with just the username, such as 'Roger' in the previous example.

Additional provider options

The AspNetActiveDirectoryMembershipProvider provider includes several attributes I haven't mentioned. These attributes configure various logon and password options. Be sure to check them out if you want more control.

Caveats

Can't use Windows groups

If you are using AD, you probably use Windows groups to control permissions. You may have a Marketing group whose members have read/write access to the marketing shared folder but read only access to the Development and Engineering folders. Wouldn't it be nice if you could map albums in Gallery Server to your groups, so that the Marketing users would have control over the Marketing album, Developers have the Dev album, and so on?

On the surface, it seems we can just use the WindowsTokenRoleProvider instead of the SqlRoleProvider. However, if one tries this, the following error occurs during application startup:

"The configured Role Provider (WindowsTokenRoleProvider) relies upon Windows authentication to determine the groups that the user is allowed to be a member of. ASP.NET Role Manager cannot be used to

Page 163: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 163 of 186

manage Windows users and groups. Please use the SQLRoleProvider if you would like to support custom user/role assignment."

This error is generated when Gallery Server Pro tries to get a list of all roles with the Roles.GetAllRoles() method, and the WindowsTokenRoleProvider does not support it. Unfortunately, Gallery Server cannot do its job unless it can get a list of the roles, so for the time being we cannot take advantage of the Windows groups. If anyone discovers a way around this, let us know.

Can't auto-logon users

Back in my classic ASP days I built an intranet app that automatically recognized the Windows account the user was logged on with. No separate logon inside the web app was required. For reasons I don't understand, I cannot accomplish the same thing with ASP.NET Membership. Sure, you can disable anonymous authentication, enable Windows authentication, and turn on impersonation in web.config. Doing this *does* allow Gallery Server Pro to automatically log on users, but it doesn't think the user in in any roles, and there doesn't seem to be any way to configure roles for the user. Let us know if you know a way around this.

Can't reset or change password on other accounts

I didn't spend much time investigating this, but it appears you can't use Gallery Server Pro to reset or change another user's password. I received error messages when I tried. You *can*, however, change your

10. Data Provider

About the data provider model

Gallery Server Pro implements the ASP.NET 2.0 provider model for data and membership access. The Membership Configuration section discusses the membership provider, and this section focuses on the data provider.

The beauty of the provider model is that it does not limit the data storage technology. This allows Gallery Server Pro to use any source for its data storage as long as a provider is written for it. Gallery Server Pro 2.1 contains two providers - SQL Server and SQLite. Additional providers can be written that use MySQL, Oracle, Microsoft Access, or even an XML file as the data store.

Moving data between SQL Server and SQLite

Recall that gallery data, such as file names, extracted metadata, and captions are stored in a SQL Server or SQLite database. The media files are not stored in the database - they reside in your media objects directory (named mediaobjects by default and is in the web application directory). Moving data from SQL Server to SQLite - or the other way around - involves these basic steps:

1. Export all gallery data to a backup file using the backup function.

2. (Medium Trust only) Edit web.config and galleryserverpro.config to specify the new data provider.

3. Run the installer to set up the database structure.

Page 164: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 164 of 186

4. Restore the backup file using the restore function.

Below are detailed instructions for moving data from SQL Server to SQLite. Read the notes below for moving data from SQLite to SQL Server.

Note: SQLite cannot be used if the web application is running at Medium Trust, unless the file

System.Data.SQLite.dll is placed in the global assembly cache (GAC).

1. Before starting, make sure you are running version 2.1. Upgrade from an earlier version if necessary.

2. Open the Backup/Restore page by clicking Actions - Site Admin, then Backup/Restore from the menu on the left.

3. Create a backup file and save it to your hard drive (instructions in the section Using the Built-In Backup Function).

4. Use a web browser to navigate to the Installer directory. For example, if you configured your web application at http://www.yoursite.com/galleryserverpro, the installer is at http://www.yoursite.com/galleryserverpro/installer/. On the Select Data Provider step, choose the database you are migrating to. Follow the wizard to set up the database structure.

When ASP.NET does not have permission to edit web.config or galleryserverpro.config, you will

receive a message on the Select Data Provider step of the wizard. This is typically due to one of the

following reasons: (a) the application is running at less than Full Trust (b) ASP.NET does not have

modify permission to the directory containing the files. If you are unable to provide these

permissions, you can manually edit these files. Read the section Behind the Scenes: How the Data

Provider is Specified in the Config Files.

5. Restore the data from the backup file (instructions in the section Using the Built-In Restore Function).

6. When the restore process is finished, you may browse the gallery to verify your objects are still there. Nothing should look different, except any changes you make will now occur in the new database.

Note: Your current login account may no longer be valid since it was deleted during the restore. If

this occurs, log out and log in using an account that was in the backup file.

Behind the Scenes: How the Data Provider is Specified in the Config Files

Hopefully you don't have to bother reading this section, but if you have any trouble with the installation or upgrade, you may need to manually configure the data provider in the web.config and galleryserverpro.config files. Typically this will occur under the following circumstances:

The application is running at less than Full Trust. Some web hosting providers force ASP.NET applications to run at less than Full Trust, typically Medium Trust. In Medium Trust Gallery Server Pro is unable to update its own configuration files, so you have to do it.

The user account IIS is running under does not have NTFS permission to modify the files. By default, the user account is ASPNET in Windows 2000/XP and Network Service in Windows 2003/2008/Vista. You can often resolve this by giving this user 'modify' permission to the web

Page 165: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 165 of 186

directory containing Gallery Server Pro. Refer to the section Configuring NTFS Permissions In Microsoft Windows for more information.

Gallery Server Pro provides a choice of storing data in SQL Server or SQLite. There are four types of data:

Provider Config file Description

Membership web.config User accounts

Roles web.config Roles define the security context of users, such as which albums they are allowed to view

Profile web.config Preferences associated with users, such as whether the Image Metadata popup is displayed

Gallery data galleryserverpror.config Image and album captions, extracted metadata, and other data associated with the media objects

Web.config file

As the table above shows, the data providers for Membership, Roles, and Profile are stored in the web.config file, located in the root of the Gallery Server Pro web application. A web.config file is a standard file used in all ASP.NET applications, and it stores various configuration settings. Here is what the Membership, Roles, and Profile section looks like:

<!-- Configure the Membership provider.--> <membership defaultProvider="SQLiteMembershipProvider"> <providers> <clear /> <add applicationName="Gallery Server Pro" passwordFormat="Clear" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="2" maxInvalidPasswordAttempts="2" enablePasswordReset="true" enablePasswordRetrieval="true" passwordAttemptWindow="10" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="SQLiteDbConnection" name="SQLiteMembershipProvider" type="GalleryServerPro.Data.SQLite.SQLiteMembershipProvider" /> <add applicationName="Gallery Server Pro" passwordFormat="Encrypted" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="2" maxInvalidPasswordAttempts="50" enablePasswordReset="true" enablePasswordRetrieval="true" passwordAttemptWindow="10" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="SqlServerDbConnection" name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" /> </providers> </membership> <!-- Configure the Role provider.--> <roleManager enabled="true" cacheRolesInCookie="true" cookieProtection="Validation" defaultProvider="SQLiteRoleProvider"> <providers> <clear /> <add applicationName="Gallery Server Pro" connectionStringName="SQLiteDbConnection" name="SQLiteRoleProvider" type="GalleryServerPro.Data.SQLite.SQLiteRoleProvider" /> <add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" /> </providers> </roleManager> <!-- Configure the Profile provider.--> <profile defaultProvider="SQLiteProfileProvider"> <providers>

Page 166: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 166 of 186

<clear /> <add applicationName="Gallery Server Pro" connectionStringName="SQLiteDbConnection" name="SQLiteProfileProvider" type="GalleryServerPro.Data.SQLite.SQLiteProfileProvider" /> <add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" /> </providers> <properties> <add name="ShowMediaObjectMetadata" defaultValue="false" type="String" allowAnonymous="true" /> </properties> </profile>

It isn't too hard to figure it out when you study it for a couple minutes. Probably the most important attribute to understand is the defaultProvider attribute. Each provider section - Membership, Role, and Profile - specifies a defaultProvider. By default it is configured to use the SQLite providers - SQLiteMembershipProvider, SQLiteRoleProvider, and SQLiteProfileProvider. Each provider is configured in detail just below, in the <add … /> element.

To configure Gallery Server Pro to use SQL Server instead of SQLite, edit the defaultProvider for each of the three providers to specify the SQL Server provider. You can copy the provider name from the <add …/> element within it that defines the SQL Server provider. When you are done, it will look like this:

<membership defaultProvider="SqlMembershipProvider">

<roleManager defaultProvider="SqlRoleProvider" …>

<profile defaultProvider=" SqlProfileProvider ">

Save the file. The changes will take effect the next time you access a page in your web browser. You may receive an error if the database specified by the new provider is empty or not configured. You can configure the new database by running the web-based install wizard (in the installer directory).

Typically you will want to edit the Gallery data provider at the same time you change the other data providers. This is done in galleryserverpro.config, and is explained in the next section.

SQLite cannot be used when Gallery Server Pro is running in a medium trust environment, unless the file System.Data.SQLite.dll is placed in the global assembly cache (GAC). In fact, an error is thrown if SQLite is even mentioned in web.config file or if a SQLite dll exists in the bin directory. For this reason, a special Medium Trust-only version of web.config is provided in the download. It is named web_sqlserver.config and is found in the root of the web application, right next to web.config. The only difference is that all references to SQLite have been removed. For example, the Membership section looks like this:

<membership defaultProvider="SqlMembershipProvider"> <providers> <clear /> <add applicationName="Gallery Server Pro" passwordFormat="Encrypted" minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="2" maxInvalidPasswordAttempts="50" enablePasswordReset="true" enablePasswordRetrieval="true" passwordAttemptWindow="10" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" connectionStringName="SqlServerDbConnection"

Page 167: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 167 of 186

name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" /> </providers> </membership>

Similarly, the SQLite sections in the roleManager and profile sections have been removed.

Note: .NET 3.5 users will want to use web_sqlserver_3.5.config instead of web_sqlserver.config.

If you want to use SQL Server in medium trust, replace the contents of web.config with the contents of web_sqlserver.config (or web_sqlserver_3.5.config for .NET 3.5). Also delete the file System.Data.SQLite.dll from the bin directory. After you have made these changes, use the installer wizard to complete the installation.

Galleryserverpro.config

Galleryserverpro.config, in the config directory, contains configuration settings specific to Gallery Server Pro, such as e-mail and watermark settings, and HTML templates used for rendering media objects. It also specifies the data provider. You will find it at the end of the file, as shown here:

<dataProvider defaultProvider="SQLiteGalleryServerProProvider"> <providers> <add applicationName="Gallery Server Pro" connectionStringName="SQLiteDbConnection" name="SQLiteGalleryServerProProvider" type="GalleryServerPro.Data.SQLite.SQLiteGalleryServerProProvider" /> <add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlServerGalleryServerProProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider" /> </providers> </dataProvider>

It has a similar structure to the Membership, Role, and Profile sections in web.config. The above example shows that Gallery Server Pro is configured to store data in SQLite. To configure it to store data in SQL Server, change the defaultProvider attribute to SqlServerGalleryServerProProvider, like this:

<dataProvider defaultProvider="SqlServerGalleryServerProProvider">

You may find that to get Gallery Server Pro working in Medium Trust, you need to remove the reference to the SQLite provider. In this case, it will look like this:

<dataProvider defaultProvider="SqlServerGalleryServerProProvider"> <providers> <add applicationName="Gallery Server Pro" connectionStringName="SqlServerDbConnection" name="SqlServerGalleryServerProProvider" type="GalleryServerPro.Data.SqlServer.SqlDataProvider" /> </providers> </dataProvider>

Create a custom data provider

Below is a diagram showing how the SQL Server data provider, named SQLiteGalleryServerProProvider, inherits the DataProvider abstract class.

Page 168: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 168 of 186

The diagram above shows that the SQLiteGalleryServerProProvider class has several methods for retrieving and saving data. All data access in Gallery Server Pro passes through one of these methods. The DataProvider class is defined in GalleryServerPro.Provider.dll. It inherits from the Microsoft .NET Framework class System.Configuration.Provider.ProviderBase and implements the interface GalleryServerPro.Provider.Interfaces.IDataProvider (defined in GalleryServerPro.Business.Interfaces.dll).

To enable Gallery Server Pro to use an alternative data store such as MySQL, Oracle, Microsoft Access, or something else, write a new class that inherits from the DataProvider abstract base class defined in GalleryServerPro.Provider.dll. If you use a tool such as Visual Studio, it will automatically define all the methods that must be implemented. For example, here is the skeleton for the method to delete an album:

public override void Album_Delete(IAlbum album) { }

Page 169: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 169 of 186

Gallery Server Pro will call this method whenever an album is to be deleted. It is your job, as the writer of this custom provider, to write the code that will delete the album record from your data store. How you do it is up to you.

Note: You will probably want to refer to one of the existing providers to ensure you provide similar

behavior. For example, when deleting an album the SQLiteGalleryServerProProvider provider

recursively deletes all child albums of the specified album. Your custom provider should behave

similarly.

Once you have implemented all the methods and compiled your code, you are ready to configure Gallery Server Pro to use your provider. Copy the dll containing your provider into the bin directory of the Gallery Server Pro web application.

Update the data provider section of galleryserverpro.config. For example, if your provider is in a class named OracleGalleryServerProProvider that is in an assembly named GalleryServerPro.Data.Oracle.dll, the data provider section will look like this:

<dataProvider defaultProvider="OracleGalleryServerProProvider"> <providers> <add name="OracleGalleryServerProProvider"

type="GalleryServerPro.Data.Oracle.OracleGalleryServerProProvider, GalleryServerPro.Data.Oracle" />

</providers>

</dataProvider>

11. Customizing Gallery Server Pro

Overview

Gallery Server Pro was built from the ground up to take advantage of ASP.NET themes and master pages. The HTML conforms to XHTML 1.0 Strict web standards, and all styling is done through Cascading Style Sheets that validate against the W3C’s CSS validation engine (http://jigsaw.w3.org/css-validator/). There are no deprecated tags such as <FONT> littered throughout the web app!

There is a great deal of customizing one can do with Gallery Server Pro without touching the source code, but code modification is always an option. Gallery Server Pro was written in C# and ASP.NET 2.0 using Visual Studio 2005 and uses 100% managed code. The source code and project files are available from www.galleryserverpro.com.

Themes

Gallery Server Pro is released with a theme named HelixBlue. This theme is defined in the App_Themes directory of the web application and contains various images, CSS and skin files. These settings define the colors, images, positioning, and other style information that contribute to the look and feel of Gallery Server Pro.

Page 170: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 170 of 186

Feel free to copy this theme and modify it to suit your requirements. The name of the copied directory is the name of the theme. To configure Gallery Server Pro to use your new theme, open the web.config file in the root of the web application and look for this entry:

<pages theme="HelixBlue" styleSheetTheme="">

Update HelixBlue to the name of your theme.

Integrating Gallery Server Pro Into another Web Application

The easiest way to run Gallery Server Pro is as its own web application, but you can also integrate it with another web application. This requires ASP.NET skills and involves modifying at least one page in Gallery Server Pro, but it does not necessarily involve any code changes or recompiling.

When integrating Gallery Server Pro, it is critical to understand how master pages are used. All web pages use master pages to define basic functionality, and Gallery Server Pro takes advantage of nested master pages to reduce code duplication. There are five master pages in Gallery Server Pro as shown below.

Page 171: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 171 of 186

The diagram shows that global.master is the root master page. This page defines the DOCTYPE, a few meta tags in the <head> section, and a ScriptManager control used for AJAX functionality. The next master page, site.master, inherits from global.master and sets up the initial structure of the page, including the header area that contains the web site title, login controls, and search box.

All other master pages, and ultimately all web pages, inherit from site.master Integrating Gallery Server Pro into your web site typically means modifying site.master to include your own header information.

Note: If you delete controls from site.master, Gallery Server Pro might generate errors because it

cannot find them. A better approach is to set the Visible property to false. For example, to hide the

login controls that appear on the top right of each page, find the Panel control named

pnlheaderloginandsearch and add Visible="False" to the tag, like this:

<asp:Panel ID="pnlheaderloginandsearch" runat="server" CssClass="headerloginandsearch"

Visible="False">

global.master

(root master page)

site.master

browse.master taskMstr.master adminMstr.master

ASPX pages

Page 172: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 172 of 186

12. Using Internet Information Services (IIS) Manager

IIS 6

Internet Information Services (IIS) 6 is native to Windows Server 2003.

Configure a directory to run as a web application

1. Extract the Gallery Server Pro web application files to a directory on the web server. This example assumes they are copied to C:\inetpub\wwwroot\galleryserverpro\.

2. Once the files have been extracted to a destination directory, start IIS Manager. The following screen appears.

Note: Start IIS Manager by entering inetmgr at a Start-Run dialog box.

3. Expand the Web Service Extensions node. Verify that ASP.NET 2.0 is installed and enabled, as shown below.

Page 173: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 173 of 186

4. Since I created the galleryserverpro directory within C:\inetpub\wwwroot\, the directory automatically appears under the Default Web Site node. Right click the galleryserverpro directory, and choose Properties.

Note: If the web files are located outside the default web directory, right click Default Web Site and

choose New > Virtual Directory. Step through the wizard to create a virtual directory. (On the

Virtual Directory Access Permissions step, leave Read permissions checked and the remaining

items unchecked.) Once the virtual directory is created, right click on it and choose Properties.

Then resume with the following steps.

Page 174: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 174 of 186

5. After choosing Properties, the following screen appears. Click Create to convert the directory to a web application.

Page 175: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 175 of 186

6. Navigate to the Documents tab. Verify default.aspx is specified as a default document, as shown below.

Page 176: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 176 of 186

7. Navigate to the ASP.NET tab. Verify that ASP.NET 2.0.50727 is selected, as shown below.

Note: In some cases the dropdown list is disabled. To enable the list, click OK on the Properties

dialog, and then re-open the dialog.

Page 177: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 177 of 186

8. That’s it! The web application should now be configured and is available through your web browser at http://localhost/galleryserverpro/.

Note: Don’t forget to use Windows Explorer to modify the NTFS permissions on the config and

mediaobjects directories as described in the Installation instructions.

IIS 7

Internet Information Services (IIS) 7 is native to Windows Server 2008 and Vista.

Configure a directory to run as a web application

1. Extract the Gallery Server Pro web application files to a directory on the web server. This example assumes they are copied to C:\inetpub\wwwroot\galleryserverpro\.

2. Once the files have been extracted to a destination directory, start IIS Manager. The following screen appears.

Note: Start IIS Manager by entering inetmgr at a Start-Run dialog box.

Page 178: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 178 of 186

3. Since I created the galleryserverpro directory within C:\inetpub\wwwroot\, the directory automatically appears under the Default Web Site node. Right click the galleryserverpro directory, and choose Convert to Application.

Note: If the web files are located outside the default web directory, right click Default Web Site and

choose Add Application.

Page 179: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 179 of 186

4. The Add application dialog box appears. Click OK to create the application and return to the main IIS Manager screen.

5. IIS Manager now shows the galleryserverpro directory configured as a web application.

Page 180: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 180 of 186

6. That’s it! The web application should now be configured and is available through your web browser at http://localhost/galleryserverpro/.

Note: Don’t forget to use Windows Explorer to modify the NTFS permissions on the web application

directory as described in the Installation instructions.

13. Configuring NTFS Permissions In Microsoft Windows By default, in Windows 2003 / 2008 / Vista, the IIS process runs under the context of the Network

Service user. In Windows 2000 / XP, it is the ASPNET user. Follow these instructions to give the user modify permission for this user to the directory containing Gallery Server Pro.

Note: These instructions are screen shots from Windows Server 2008, but previous versions of

Windows work similarly.

1. Start Windows Explorer (type explorer.exe in the Start - Search box).

2. Navigate to the directory containing the Gallery Server Pro web application directory.

3. Right click the directory and choose Properties, as shown below:

Page 181: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 181 of 186

Page 182: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 182 of 186

4. The Properties dialog appears. Select the Security tab, as seen here:

5. Click the Edit button. The Permissions dialog box appears:

Page 183: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 183 of 186

6. Click Add to show the Select Users or Groups dialog box. Type Network Service (or ASPNET for Windows 2000/XP) into the textbox, as shown below.

Page 184: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 184 of 186

7. Click OK. Make sure the Allow checkbox is selected for the Modify permission, as seen below.

8. Click OK until all the dialog boxes disappear, and you are done!

14. Management Tools for SQLite and SQL Server

Overview

When all is well and good in the world, you don't have to think about the database used by Gallery Server Pro. However, there may be times when you want to review - and possible edit - the data directly in the tables. Below I describe the various tools that are available for managing SQL Server and SQLite.

Using these tools is outside the scope of this document and can be found on the internet, so I'll be brief.

Page 185: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 185 of 186

SQL Server

The full retail version of SQL Server comes with a management tool that allows you to view the tables and other database objects. It is called SQL Server Management Studio for versions 2005 and 2008 and SQL Enterprise Manager for SQL Server 2000.

SQL Server 2008 Express, the free version of SQL Server 2008, optionally comes with management tools. I recommend you choose one of the versions with management tools when you download it.

SQLite

There are many management tools available for the open source SQLite database engine. Some are free, some are not. I have used two that I can recommend:

SQLite Manager: (http://code.google.com/p/sqlite-manager/) This is an extension that plugs into a host application. I use it as an add-on to Mozilla Firefox, and it works really well.

SQLite Administrator: (http://sqliteadmin.orbmu2k.de/) This is a stand-along utility. It also works well.

15. Glossary

Gallery – A gallery encompasses all the media objects associated with a single web application. Each web application has one gallery.

Root album – The highest level album in a gallery. It can never be deleted.

Album – A container for media objects such as photos, video, audio, and documents. Each album is mapped to a directory on the hard drive.

Media object – Any file that Gallery Server Pro is managing within its gallery. It can be a photo, video, audio, document, or any other type of file.

Album view page – The web page that shows thumbnail images of all the media objects in an album.

Media object view page – The web page that displays a single media object.

Compressed image – The image that is created from a high resolution image. The compressed image is typically shown to the user instead of the original file because it is a more bandwidth-friendly image.

Child album – An album contained inside another album.

Parent album – The album that contains the current album.

Page 186: Administrator’s Guide - Gallery ServerGallery Server Pro 2.1 Administrator’s Guide Page 8 of 186 Administrator’s Guide Document Revisions Doc Version Date Description 1.0.0 01-Jan-06

Gallery Server Pro 2.1 Administrator’s Guide Page 186 of 186

Gallery object - The term gallery object is not used in the user interface. However, in the source code, a gallery object is the root object from which albums and media objects are derived. In other words, an album is a type of gallery object and a media object (photo, video, etc.) is a type of gallery object.


Recommended