Installation and Configuration

The easiest way to install and configure the Nemesis Gallery application is to copy contents of the WebSite-Default folder to root of web site, modify configuration settings and upload your pictures.

Configuration of IIS handlers

First task is to configure the three HTTP handlers, which will create thumbnails, directory listings and information pages. Furthermore you must register the altairis.nemesis.gallery section, which configures the application itself. Is good idea to place contents of this section to separate file.

Simple web.config, with the Nemesis configuration in different file (Nemesis.Default.Silver.config) is here:
<configuration>
    <configSections>
        <section name="altairis.nemesis.gallery" type="Altairis.Nemesis.Gallery.Configuration.GallerySection" />
    </configSections>
    <altairis.nemesis.gallery configSource="Nemesis.Default.Silver.Config" />
    <system.webServer>
        <handlers>
            <add name="NemesisRootDirectoryListingHandler" path="/" verb="*" 
                 type="Altairis.Nemesis.Gallery.DirectoryListingHandler" resourceType="Directory" />
            <add name="NemesisDirectoryListingHandler" path="*/" verb="*" 
                 type="Altairis.Nemesis.Gallery.DirectoryListingHandler" resourceType="Directory" />
            <add name="NemesisThumbnailHandler" path="*.jpg.tn" verb="*" 
                 type="Altairis.Nemesis.Gallery.ThumbnailHandler" />
            <add name="NemesisInfoPageHandler" path="*.jpg.html" verb="*" 
                 type="Altairis.Nemesis.Gallery.InfoPageHandler" />
        </handlers>
    </system.webServer>
</configuration>

Configuration of Nemesis Publishing

The altairis.nemesis.gallery section configures the Nemesis Gallery application itself. Typical configuration for default template:
<altairis.nemesis.gallery>
    <thumbnails defaultSize="LQ">
        <size name="LQ" width="150" height="150" backgroundColor="Gray" />
        <size name="HQ" width="850" height="850" backgroundColor="Transparent" />
    </thumbnails>
    <directoryListing template="~/App_Data/Templates/Default/DirectoryListing.xsl" />
    <infoPage template="~/App_Data/Templates/Default/InfoPage.xsl" />
    <templateParameters>
        <add name="title" value="Michal Altair Valášek - photo gallery" />
        <add name="copyrightText" value="(c) Michal A. Valášek, 1998-2008" />
        <add name="copyrightLink" value="http://www.rider.cz/" />
        <add name="styleSheet" value="/_Static/Default/silver.css" />
    </templateParameters>
</altairis.nemesis.gallery>

<thumbnails> element

Configures the thumbnail handler. Has the following attributes:
  • enabled (optional, default true) - when set to false, thumbnail handler is disabled.
  • defaultSize (mandatory) - name of the size setting (see <size> element below) to be used by default.
  • cacheTimeout (optional, default 60) - time in minutes for which is the generated thumbnail held in output cache. See Caching for more information.

<size> element

Defines single named thumbnail generation settings.
  • name (mandatory) - logical name of the setting, invoked by query string parameter Q, ie. image.jpg.tn?Q=name.
  • width and height (mandatory) - maximum dimensions of thumbnail in pixels.
  • backgroundColor (optional, default Transparent) - when set to Transparent, picture is resized to fit the maximum dimensions of thumbnail, with constrained proportions. Width or height of the resulting image may me smaller than the defined maximum. When set to other valid color name, the thumbnail has the exact dimensions and free background space is filled by specified color.

<directoryListing> element

Configures directory listing handler. Has the following attributes:
  • enabled (optional, default true) - when set to false, directory listing handler is disabled.
  • template (optional, default ~/App_Data/Templates/Default/DirectoryListing.xsl) - full virtual path to XSL template used for HTML transformation. See Template Developer Guide for more information.
  • cacheTimeout (optional, default 60) - time in minutes for which is the generated listing HTML held in output cache. See Caching for more information.
  • varyByParam (optional, default false) - when set to true, different cached version is held for different quesy string and query string values are passed to XSL template. See Caching and Template Developer Guide for more information.
  • fileMask (optional, default *.jpg) - mask for names of files generated into listing.
  • folderMask (optional, default .) - mask for names of folder generated into listing.
  • excludeSystemFolders (optional, default true) - when set to true, the following folders are excluded from listing: App_*, bin and all whose names start with underscore and a dot.

<infoPage> element

Configures information page handler. Has the following attributes:
  • enabled (optional, default true) - when set to false, info page handler is disabled.
  • template (optional, default ~/App_Data/Templates/Default/InfoPage.xsl) - full virtual path to XSL template used for HTML transformation. See Template Developer Guide for more information.
  • cacheTimeout (optional, default 60) - time in minutes for which is the generated listing HTML held in output cache. See Caching for more information.
  • varyByParam (optional, default false) - when set to true, different cached version is held for different quesy string and query string values are passed to XSL template. See Caching and Template Developer Guide for more information.
  • dependOnFolder (optional, default true) - when set to true, cache is made dependent on the folder where image resides. When set to false, cache depends on file itself. See Caching for more information.

<templateParameters> element

Contains collection of parameters, which will be made available to XSLT template. Parameters are specified as a configuration collection, using <add>, <remove> and <clear> elements.
See Template Developer Guide for more information about how the parametes can be used.

<add> element

Adds single XSLT parameter to collection. Has the following attributes:
  • name (mandatory) - unique name of parameter, case sensitive.
  • value (mandatory) - value or parameter.
  • namespace (optional) - URI of XML namespace where the parameter resides. When missing, default (empty) namespace is used.

Template parameters used by templates Default and DefaultLightbox

The following parameters are used by templates Default and DefaultLightbox (all are optional):
  • Title - display name of the gallery. Default Nemesis Gallery.
  • CopyrightText - copyright text. When set to empty string, no copyright message is displayed. Default (c) Altairis, 2008.
  • CopyrightLink - copyright link. When set to empty string, no link is displayes. Default http://www.altairis.cz/.
  • StyleSheet - URL of alternate CSS stylesheet. Default /_Static/Default/silver.css or /_Static/DefaultLightbox/silver.css.

Last edited Nov 4, 2008 at 3:29 PM by altair, version 1

Comments

No comments yet.