Bloom.Book.BookStarter.SetBookTitle C# (CSharp) Method

SetBookTitle() private static method

private static SetBookTitle ( BookStorage storage, BookData bookData, bool usingTemplate ) : void
storage BookStorage
bookData BookData
usingTemplate bool
return void
        private static void SetBookTitle(BookStorage storage, BookData bookData, bool usingTemplate)
        {
            //This is what we were trying to do: there was a defaultNameForDerivedBooks meta tag in the html
            //which had no language code. It worked fine for English, e.g., naming new English books
            //"My Book" or "My Dicionary" or whatever.
            //But in other cases, it actually hurt becuase that English name would be hidden down in the new
            //book, where the author wouldn't see it. But some consumer, using English, would see it, and
            //"My Book" is a pretty dumb name for tha carefully prepared book to be listed under.
            //
            //Now, if we are making this book from a shell book, we can keep whatever (title,language) pairs it has.
            //Those will be just fine, for example, if we have English as one of our national langauges and so get
            // "vaccinations" for free wihtout having to type that in again.
            //
            //But if we are making this from a *template*, then we *don't* want to keep the various ways to say the
            //name of the template. Seeing "Basic Book" as the name of a resulting shell is not helpful.

            //We just don't have a use for this at all anymore: nice idea, doesn't really work:
            storage.Dom.RemoveMetaElement("defaultNameForDerivedBooks");

            // Clear these out let other code set again when there is a real title.
            storage.MetaData.Title = "";
            storage.Dom.Title = "";

            //If we're making a book from a template, remove all the titles in all languages
            if(usingTemplate)
            {
                bookData.RemoveAllForms("bookTitle");
            }
        }