public virtual HtmlDom GetPreviewHtmlFileForWholeBook()
{
//we may already know we have an error (we might not discover until later)
if (HasFatalError)
{
return GetErrorDom();
}
if (!_storage.GetLooksOk())
{
return GetErrorDom(_storage.GetValidateErrors());
}
var previewDom= GetBookDomWithStyleSheets("previewMode.css", "origami.css");
AddCreationTypeAttribute(previewDom);
//We may have just run into an error for the first time
if (HasFatalError)
{
return GetErrorDom();
}
BringBookUpToDate(previewDom, new NullProgress());
// this is normally the vernacular, but when we're previewing a shell, well it won't have anything for the vernacular
var primaryLanguage = _collectionSettings.Language1Iso639Code;
if (IsShellOrTemplate) //TODO: this won't be enough, if our national language isn't, say, English, and the shell just doesn't have our national language. But it might have some other language we understand.
primaryLanguage = _collectionSettings.Language2Iso639Code;
TranslationGroupManager.UpdateContentLanguageClasses(previewDom.RawDom, _collectionSettings, primaryLanguage, _bookData.MultilingualContentLanguage2, _bookData.MultilingualContentLanguage3);
AddPreviewJavascript(previewDom);
previewDom.AddPublishClassToBody();
return previewDom;
}