Transformer documentation: int_daisy_filesetRenamer

Transformer Purpose

Rename select members of a fileset using customizable token-based name patterns.

Input Requirements

The transformer has been written with the intention to work on any file/fileset that can be represented by the org.daisy.util.fileset package. However, preference has been given to DTB filesets - other types are not explicitly supported.

Output

On success

A file/fileset whose members have been renamed using the renaming approach defined by inparameters. See parameters

On error

On error, this transformer will attempt to copy the fileset unrenamed to the destination. If it fails even with this, it will send a fatal message, then throw an exception and abort.

Configuration/Customization

Parameters (tdf)

input
pathspec of the manifest member of input fileset
output
pathspec of output directory
renamingPattern
The type of renaming to apply, described as a series of plus-separated tokens. The token list includes: Examples of complete renaming patterns are:
exclude
A comma separated list of file type names to exclude from the renaming process.
Names that can be used are: XmlFile, Xhtml10File, DtbookFile, OpfFile, SmilFile,
ImageFile, JpgFile, BmpFile, PngFile, SvgFile,
CssFile,
AudioFile, Mp3File, Mp2File, WavFile.

Note that some file types encapsulate others: if you use XmlFile, then all XML files will be excluded (Smil, Dtbook, Opf, Xhtml etc).
filesystemSafe
Whether output names should only include filesystem (and DAISY DTB) safe characters: A-Z, a-z, 0-9, hyphen, underscore.
maxFilenameLength
The maximum number of characters in the output filename, excluding the extension. Default is 60.

Extended configurability

None.

Further development

Extend support for non-DTB filesets.

Dependencies

Author

Markus Gylling, Daisy Consortium

Licensing

LGPL