TOC Processing instructions in the book component metadata
Use case 1: Hide book components from TOC (developed)
Use case 1: Hide book components from TOC / do not include in TOC.xml file
Context
Some books have a sidebar on the Bookshelf site, for example the "GeneReviews Links" section for the GeneReviews Book, which displays selected book components instead of including these in the TOC.
Workflow
- User indicates in the metadata table of the Word source file that it should not be included in the TOC.
- When the file is converted to xml this becomes a processing instruction
<?hideTOC?>
in the book component metadata. - Any file with
<?hideTOC?>
displays a flag with a tooltip on book manager - Any file with
<?hideTOC?>
does not get included in the TOC.xml that the BCMS generates
Design
First flag: Hidden from TOC:
Book manager showing a component with the Hidden from TOC flag on chapter 16:
Use case 2: Repeat book components in more than one part of the TOC
Context
Some chapter-proccessed books are like databases. These databases can have entires that are relevant to more than one section. For example see this entry in the database Endotext which is listed in two parts: here and here. In BCMS terminology this means that books with parts should allow a book component to be repeated in more than one part.
This proposal applies only to chapter-proccessed books.
Workflow (example using Word workflow)
- User uploads one or more Word source files
- After conversion, the user moves the book components into a part
- on book manager page the action can be done individually or in bulk (already developed)
- on the preview tab we can extend functionality to move an individual chapter (new feature)
- Once a component exists in a part, it can be repeated in other parts. This action is done on an individual level from book manager page or the preview tab.
- the user selects the "repeat" button
- this opens a modal that lists all the parts in the book
- the user sees that the part to which the chapter currently belongs is selected
- the users selects one or more additional parts and "Save"
- The saving action has two results:
- The toc repeat icon is displayed on the chapter row on the book manager page and next to the chapter status on the chapter page
- the chapter is visually repeated in the relevant parts on the book manager page
- Removing a repeated chapter from any part is also done on an individual level from the preview tab.
- the user selects the "repeat" button
- this opens a modal that lists all the parts in the book
- the user sees that all the parts to which the chapter currently belongs is selected
- the users de-selects one or more parts and "Save" (note: "Save" button will be inactive unless one part is selected)
- For TOC.xml building: any chapter with the repeat toc flag gets included in the TOC.xml file according to the template
toc-template-special-hidden-or-repeated-entries.xml
provided in #24 (closed)
Design
Second icon: repeated on TOC:
Book manager page showing repeated entries in "Part title level two A" and "Part title level two B", and "repeat" button in the bottom action bar:
The Preview tab showing the "move" and "repeat" buttons. Note: "Repeat" will not display unless the chapter already belongs to a part.
The Repeat modal where a user adds removes a chapter to multiple parts.
Showing two parts selected, un-selects to remove the repeated chapter. Or selects more parts to repeat the chapter.
Original issue history
re our chat about #63 (closed), we discussed two use cases for processing instructions in the metadata that affect the TOC.
1. Some book components should not be included in the TOC
Instead they are displayed in a sidebar on the Bookshelf site, as in "GeneReviews Links" section for the GeneReviews Book.
The rendering of the components is controlled by a processing instruction <?hideTOC?>
in the book component metadata.
We spoke about one way to handle this:
In the book manager page we have sections Front / Body / Back. There could be an additional section "Other", "Sidebar", or some other appropriate wording. Users would move the book component to this section. Book components in this section are excluded from the TOC preview and the toc.xml file Coko system creates. When these component are published, coko system does not need to send a toc.xml file.
2. Some book components should be included on the TOC in more than one part
For books that have parts, a book component may be listed in the TOC in more than one part. It should display in both places in the TOC preview and be included accordingly in the toc.xml file.
An example is this chapter in the book Endotext. The chapter is listed in two parts: here and here.
Both use case apply to books processed at the chapter level in all workflows:
- We need to support a way for the user to do in this the UI for Word books.
- @lathrops1 , since most PDF and XML books are submitted via FTP, would the Sys admin take this action in the UI? Or is it possible that this processing instruction can be included in the meta.xml file in the FTP submission?
Please provide example xml files for both cases.