
doc.transformers.se_tpb_dtbSplitter.html Maven / Gradle / Ivy
se_tpb_dtbSplitterMerger.split
Transformer documentation: se_tpb_dtbSplitterMerger.split
Transformer Purpose
The purpose of this transformer is to split Daisy DTB file sets into subvolumes of a given size.
In its current version the transformer supports splitting Daisy 2.02, Z39.86-2002 and Z39.86-2005 file sets.
The programmatic flow of this transformer in summary:
- Try to create an
org.daisy.util.fileset.interfaces.Fileset
instance on the input file (with DTD validation turned on).
- If the input maximal volume size is greater than or equal to the input file set's size, copy the file set as it is to the output directory.
- If the input maximal volume size is smaller than the input file set's size, depending on the
org.daisy.util.fileset.FilesetType
instantiate an appropriate extension of se_tpb_dtbSplitterMerger.spilt.DtbSplitter
:
se_tpb_dtbSplitterMerger.spilt.DtbSplitter202
for FilesetType.DAISY_202
se_tpb_dtbSplitterMerger.spilt.DtbSplitter3
for FilesetType.Z3986
and initialize splitting the file set.
- Build subvolumes according to the input maximal volume size and the maximal split header level, adding appropriate volume prompt information and files.
- If the user prompt is on, ask the user whether the created volumes should be written to the output directory.
- Write the subvolumes to disk.
Input Requirements
This transformer is meant for splitting Daisy 2.02, Z39.86-2002 or Z39.86-2005 file sets. If an org.daisy.util.fileset.interfaces.Fileset
cannot be built or the built Fileset
is not of a supported type, an exception will be thrown.
Output
On success
In the output directory there will be a number of subfolders containing the subvolumes of the split Daisy DTB file set.
Daisy 2.02
Distribution of the SMIL and media files in the subvolumes is described in modified copies of the navigation files - ncc and full text files - placed in each subvolume. Each modified copy of a navigation file contains references to the SMIL files available in a given subvolume. References to SMIL files placed in another subvolume are replaced with prompt SMIL references telling the reader of a book to which subvolume he/she should move to be able to continue reading.
Z39.86-2002 or Z39.86-2005
Distribution of the SMIL and media files in the subvolumes is described in the distinfo.dinf file.
On error
On error, this transformer will send a fatal message, then throw an exception and abort.
See further Parameters.
Configuration/Customization
Parameters (tdf)
- inputFilePath
- Path to a Daisy 2.02 NCC file or Z39.86-2002 / Z39.86-2005 OPF file.
- outDirPath
- The output directory where the DTB subvolumes will be saved.
- volumeSizeInMB
- Maximal volume size in megabytes.
- promptFilesManifestPath
- Path to a manifest file listing available prompt SMIL and audio files. If this parameter is not set, a default path will be used.
- userPrompt
- Specifies whether standard output prompts should be used, e.g. number of calculated volumes approval or file overwriting approval.
- keepInput
- Specifies whether the input file sets should be kept.
- maxSplitLevel
- The value should be a digit 1 through 6, corresponding to the maximal header level in the navigation control document (ncc/ncx) at which splitting shall be allowed.
Extended configurability
None.
Further development
The abstract class se_tpb_dtbSplitterMerger.spilt.DtbSplitter
implements base functionality needed for splitting DTB Daisy file sets, that can be used or overridden by its subclasses. Current extensions are:
se_tpb_dtbSplitterMerger.spilt.DtbSplitter202
se_tpb_dtbSplitterMerger.spilt.DtbSplitter3
The abstract class se_tpb_dtbSplitterMerger.spilt.DtbSplitter
may be extended to support new types of Daisy DTB file sets when they come up.
Dependencies
- none
Author
Piotr Kiernicki, TPB
Licensing
LGPL