C# Class Bloom.Book.BookStarter

Creates the files for a new blank book from a template book
Show file Open project: BloomBooks/BloomDesktop Class Usage Examples

Public Properties

Property Type Description
OnNextRunSimulateFailureMakingBook bool

Public Methods

Method Description
BookStarter ( IChangeableFileLocator fileLocator, BookStorage bookStorageFactory, CollectionSettings collectionSettings ) : System
CreateBookOnDiskFromTemplate ( string sourceBookFolder, string parentCollectionPath ) : string

Given a template, make a new book

SetLanguageForElementsWithMetaLanguage ( XmlNode elementOrDom, CollectionSettings settings ) : void

In xmatter, text fields are normally labeled with a "meta" language code, like "N1" for first national language. This method detects those and then looks them up, returning the actual language code in use at the moment.

This is a little uncomfortable in this class, as this feature is not currently used in any bloom-translationGroup elements.

SetupIdAndLineage ( XmlElement parentPageDiv, XmlElement childPageDiv ) : void
SetupPage ( XmlElement pageDiv, CollectionSettings collectionSettings, string contentLanguageIso1, string contentLanguageIso2 ) : void

Private Methods

Method Description
ClearAwayDraftText ( XmlNode element ) : void

When building on templates, we usually want to have some sample text, but don't let them bleed through to what the user sees

CopyFolder ( string sourcePath, string destinationPath ) : void
GetInitialName ( string sourcePath, string parentCollectionPath ) : string
GetMetaValue ( XmlDocument Dom, string name, string defaultValue ) : string
GetPathToHtmlFile ( string folder ) : string
InjectXMatter ( string initialPath, BookStorage storage, Layout sizeAndOrientation ) : void
RemoveDataDivElement ( XmlNode dom, string key ) : void
SetBookTitle ( BookStorage storage, BookData bookData, bool usingTemplate ) : void
SetLineageAndId ( BookStorage storage, string sourceFolderPath ) : void
SetupNewDocumentContents ( string sourceFolderPath, string initialPath ) : string
UpdateEditabilityMetadata ( BookStorage storage ) : void

Method Details

BookStarter() public method

public BookStarter ( IChangeableFileLocator fileLocator, BookStorage bookStorageFactory, CollectionSettings collectionSettings ) : System
fileLocator IChangeableFileLocator
bookStorageFactory BookStorage
collectionSettings Bloom.Collection.CollectionSettings
return System

CreateBookOnDiskFromTemplate() public method

Given a template, make a new book
public CreateBookOnDiskFromTemplate ( string sourceBookFolder, string parentCollectionPath ) : string
sourceBookFolder string
parentCollectionPath string
return string

SetLanguageForElementsWithMetaLanguage() public static method

In xmatter, text fields are normally labeled with a "meta" language code, like "N1" for first national language. This method detects those and then looks them up, returning the actual language code in use at the moment.
This is a little uncomfortable in this class, as this feature is not currently used in any bloom-translationGroup elements.
public static SetLanguageForElementsWithMetaLanguage ( XmlNode elementOrDom, CollectionSettings settings ) : void
elementOrDom System.Xml.XmlNode
settings Bloom.Collection.CollectionSettings
return void

SetupIdAndLineage() public static method

public static SetupIdAndLineage ( XmlElement parentPageDiv, XmlElement childPageDiv ) : void
parentPageDiv System.Xml.XmlElement
childPageDiv System.Xml.XmlElement
return void

SetupPage() public static method

public static SetupPage ( XmlElement pageDiv, CollectionSettings collectionSettings, string contentLanguageIso1, string contentLanguageIso2 ) : void
pageDiv System.Xml.XmlElement
collectionSettings Bloom.Collection.CollectionSettings
contentLanguageIso1 string
contentLanguageIso2 string
return void

Property Details

OnNextRunSimulateFailureMakingBook public property

Used in unit testing
public bool OnNextRunSimulateFailureMakingBook
return bool