Variables

Revision as of 2 July 2014 15:27 by sannanordgren (Comments | Contribs)

The web pages jAlbum generates are based on "template pages" which can contain HTML and CSS code mixed with special tags, scripts and variables that are expanded to their values. When referring to a variable in HTML context, use the format ${variable}. In scripting context or when used in existence testing (see ja:if exists on the [tags page]) simply use variable name as is.

Template file variables

The following variables are defined. Note that case is significant:

General
Name Explanation
albumDescription Description for the entire album. Picked from the root folder's description
albumHeight Album height in pixels. (Set when embedding album). Since v10
albumWidth Album width in pixels. (Set when embedding album). Since v10
albumURL Album address. Only available when processing "embed.htt". Since v10
albumTitle Title for the entire album. Picked from the root folder's title
cols Number of image columns on index pages
currentRows Number of image rows on current index page
executedNormally Set to true after successful (not aborted or error) album generation. Can be referred to in finally.bsh
generator Name and version of jAlbum
generatorUrl Address to the jAlbum homepage
homepageAddress Address (URL) to the album owner's home page (v10.8)
homepageLinkText Anchor text for home page link (v10.8)
imageNum Number of the current image within an album
indexImageCount Number of images on current index page
indexNum The number of the current index page1
internalVersion Internal version number
language Define as user defined variable to explicitly set a language for a multilingual skin (ISO two character language code)
level Level of album directory (0 meaning root level)
maxImageWidth Max image width as set by user
maxImageHeight Max image height as set by user
maxThumbWidth Max thumbnail width as set by user
maxThumbHeight Max thumbnail height as set by user
rows Max number of image rows on index pages
skin Name of current skin
style Name of current style sheet
description Description for album directory
totalIndexes Total number of index pages1
totalAlbumImages Total number of images in an album (subdirectory images included)
totalImages Total number of images in a directory
textEncoding Character set and encoding of generated pages and comments



Navigation
Name Explanation
folder Only defined if curent file is a folder/directory. Use in ja:if exists tests (v6)
firstIndexPage Filename of the first index page
lastIndexPage Filename of the last index page
previousIndexPage Filename of the previous index page 2
nextIndexPage Filename of the next index page 2
parentIndexPage Filename of parent index page 2
closeupPath Path to get from index page to closeup image (or slide)
iconPath Path to icon for directories not having a thumbnail image and other non-image files
thumbPath Path to thumbnail image
rootPath Path to get back to the top of a multi directory level album
imagePath Path to the image that is shown in slides
originalPath Path to original file. Only defined if linking is "Link to originals via scaled images" or if an original is included for a specific image. If linking is "Link to originals" then imagePath links to the original image
hiResPath Path to the hi-res file. Only defined if linking is "Link to hi-res via scaled images". Since 8.14
contentPath Same as imagePath for displayable images. Same as originalPath for other file types. Since 8.8
mediarssPath Path to the Media RSS version of this album (if any)
stylePath Path to the selected style file
styleFile Filename of the selected style file. Deprecated. Please use stylePath instead
resPath Path to the "res" directory containing album resources (support files like gif buttons etc)
firstPage Filename of the first slide page
lastPage Filename of the last slide page
previousPage Filename of the previous slide page 2
currentPage Filename of the current slide page
nextPage Filename of the next slide page 2
indexPage Filename of index page for current slide



File metadata
File metadata Meaning
label Base name (without extension) of file or folder
fileName Full name of image/movie or folder
title Alternative name for this file or folder, or if not set, same as label
folderTitle Alternative name for this folder
fileTitle Alternative name for this file (v8.0)
fileCategory Category. Possible values are image, folder, video, audio, webPage, other of type Category (v11.0)
rating Rating. If rated, a number between 0 and 5 (v8.0)
includeOriginal Exists if user has checked current image to include original (v8.0)
thumbWidth Width of thumbnail image in pixels
thumbHeight Height of thumbnail image in pixels
imageWidth Width of image in pixels
imageHeight Height of image in pixels
originalWidth Width of original image in pixels
originalHeight Height of original image in pixels
originalWidthDpi Horizontal resolution of the original image
originalHeightDpi Vertical resolution of the original image
formatName Type of image
compressionLevel Level of compression as set by the camera
fileSize Size of original file
fileDate Date of original file
mimeType MIME type of original file (if defined in system/filetypes.xml)
originalDate Date written by camera 3
currentDate Date of album generation
resolution Original image resolution as written by camera 3
flash If flash was used 3
focalLength Focal length 3
focalLength35mm 35mm focal length equivalent 3. This variable is calculated with the focalLength as base, then multiplied with the focal length multiplier for that specific camera. Focal length multipliers can be edited in the system/cameras.properties file. If a multiplier isn't found for a particular camera, jAlbum tries to grab the 35mm focal length equivalent from the image itself (Nikon D90 writes this for instance). If this fails too, then this variable is undefined.
exposureTime Exposure time 3
isoEquivalent ISO equivalent 3
aperture Aperture 3
focusDistance Focus distance 3
meteringMode Metering mode 3
cameraMake Camera make 3
cameraModel Camera model 3
sensorType Camera sensor type 3
comment Comment. Will either be extracted from (as soon as found):

An external "texts.properties" file.

  1. The JPEG comment section of an image file.
  2. The IPTC caption section of an image file. 3
  3. The EXIF user comment secion. 3
keywords IPTC keywords 3
category IPTC category 3
objectName IPTC Object name 3
headline IPTC Headline 3
photographer IPTC Photographer 3
writer IPTC writer 3
author Deprecated. use writer instead 3
copyright IPTC copyright 3
gpsLocation Google Maps formatted GPS location 3 (v11.2.5)
gpsLongitude GPS longitude in deg°min'sec.dec" format 3
gpsLatitude GPS latitude in deg°min'sec.dec" format 3
gpsAltitude GPS altitude (height) in meters 3
orientation Image orientation. Can be either "normal", "left" or "right"
videoFPS Frame rate of video 4 (v11)
videoDuration Length of video in hh:mm:ss.ff format 4 (v11)
videoHeight Height of video in pixels 4 (v11)
videoWidth Width of video in pixels 4 (v11)


Notes:

1 Not defined if only one index page exist

2 Only defined if such page exist

3 Only exists for images containing EXIF/IPTC data and if EXIF extraction is turned on

4 Only defined for video files

You can list these variables and their current values by writing the following into a slide.htt template file:

<pre>${current}</ pre>


Implicit objects

Apart from having access to ordinary variables when scripting, jAlbum also provide some special objects (Java type within parenthesis):

Objects
Object name Explanation
out Page writer. Printing to out will generate output on the resulting page (PrintWriter)
application Container for variables bound to the current instance of jAlbum (Map)
album Container for variables bound to the current album generation (Map)
current Container for all variables bound to the current image (Map)
previous Container for all variables bound to the previous image (Map)
next Container for all variables bound to the next image (Map)
local Container for all variables bound to the local scope. Use to avoid inheritance (Map)
meta Container for all metadata variables (EXIF etc) found inside an image (Map)
programDirectory File object representing the current jAlbum directory (File)
skinDirectory File object representing the current skin directory (File)
skinResDirectory File object representing the res directory of the current skin (File)
imageDirectory File object representing the current image directory (File)
rootImageDirectory File object representing the root image directory (File)
outputDirectory File object representing the current output directory (File)
rootOutputDirectory File object representing the root output directory (File)
resDirectory File object representing the output resource directory (File)
files Array of File objects for the images and mediafiles in the current image directory (File[])
currentFile File object representing the currently processed file. A more convenient shorthand for files[imageNum-1] (File)
representingFile File object representing the original file that represents the current folder (or non-image file)
engine The album generating JavaBean inside jAlbum. See API (AlbumBean)
window The window of jAlbum, useful when creating modal popup windows like color pickers etc (Frame)
context Reference to the current JAlbumContext, which is a central repository for commonly used jAlbum classes. Since v8.6
currentObject Reference to the AlbumObject for the currently processed file. Since v9.4
currentFolder Reference to the AlbumObject for the currently processed directory. Since v9.4
rootFolder Reference to the AlbumObject for the root of the album. Since v9.4