Analysis
Overview
Books can be part of other books
Task requirements
- Implement truly embedded books.
- "Book" menu item in the "Insert" menu should trigger a submenu that offers "Embedded" and "Linked" options.
- The embedded and linked books should not be interactive in author mode
- In reader mode the controls for switching pages should be active.
- Embedded books should be shown in embedded books palette. Linked embedded books should be shown with a prefix "[Linked]". Double clicking an embedded book from the palette should open it for editing.
- Optional : A content halo should trigger a HUD that gives the opportunity to choose whether the controls will be visible and which page will be shown at the first opening
- Content halo should appear inside the bounding rectangle, on click, with 10px right and top offset from the click.
- Volume control slider for the embedded book.
- Content halo should appear inside the bounding rectangle, on click, with 10px right and top offset from the click.
Task result
Code
Implementation idea
Add an option for real embedded book in the menu and when chosen create a child book resource of the current book. Then create a frame whose main resource is the newly created book.
Related
How to demo
- Insert two books, one linked and one truly embedded
- Open them for editing in the palette.
- Show hud and remove controls for one of the books (optional)
Design
Make the InsertBookItem menu item a successor of AppMenu and make two AppMenuItems that are registrated to it - InsertEmbeddedBook and InsertLinkedBook. The operation in EmbeddedBookLogic that handles InsertLinkedBook should be called ON_ADD_LINKED_BOOK_FRAME and the other - ON_ADD_EMBEDDED_BOOK_FRAME.
Use the old logic to handle the file menu showing but make the AutoAction use the FrameH.create(...) method. Use the same for the handling of the other event but when you get the File to embed open the ResourceAccess to it and copy its model as a child of the current book.
Fix the EmbeddedBooksPalette to go through all frames and if they are “book-frame” add their main-resource`s as BookItems. Also add a property that flags a book as linked. It should be true if the ref points to an outer resource. Override the doubleclicked() method of BookItem and use the AppViewUtil.openBook to open the book for editing.
Clear the effects list of the content controls when adding the new ones and also clear the list of contentControl views every time they are recomputed.
For those controls to work properly it is best to make the ResourceAccess.#getRef() method to always give absolute ref. This is going to fix a lot of other ishues.
EmbeddedBookTest
Implementation
Merged into [6751].
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)