
doc.transformers.int_daisy_filesetRenamer.html Maven / Gradle / Ivy
The newest version!
int_daisy_filesetRenamer
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:
- uid: A string representing a unique identifier of the fileset
- rnd(n): A random string guaranteed to be unique within the fileset. The 'n' parameter in the parenthesis is a positive integer, indicating the number of hyphen-separated groups of four characters to use. Example: rnd(2) will result in the string 'fooh-baar'.
- fixed(string): A fixed string, whose value is given within the parenthesis. Example: 'fixed(daisy)'.
- label: A string representing a label of the individual file (a heading, content descriptor, name or similar). Depending on input fileset type, this cannot always be set.
- seq: A string representing this files position within a sequence of all the files of the same type within the fileset. The first occuring audiofile will have value '1', the first occuring imagefile will have value '1', etc.
- echo: A string representing an echo of the input filename. (To use for example in conjunction with the filesystemSafe parameter.)
Examples of complete renaming patterns are:
- seq+label
- uid+seq
- fixed(dtb)+seq
- uid+seq+label
- rnd(4)
- uid+rnd(2)
- echo
- 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
- IBM icu4j (at time of writing: icu4j_3_4_4.jar)
Author
Markus Gylling, Daisy Consortium
Licensing
LGPL
© 2015 - 2025 Weber Informatics LLC | Privacy Policy