wiki:GROUP_EMBEDDED_BOOKS_R0
Last modified 16 years ago Last modified on 06/05/09 13:55:52

Error: Macro BackLinksMenu(None) failed
compressed data is corrupt

Error: Macro TicketQuery(summary=GROUP_EMBEDDED_BOOKS_R0, format=table, col=summary|owner|status|type|component|priority|effort|importance, rows=description|analysis_owners|analysis_reviewers|analysis_score|design_owners|design_reviewers|design_score|implementation_owners|implementation_reviewers|implementation_score|test_owners|test_reviewers|test_score|) failed
current transaction is aborted, commands ignored until end of transaction block

Analysis

Overview

This group of tasks is about embedded books support. A user should be able to:

  • Insert a book into a frame (either by dragging and dropping or by using the Insert menu).
  • Choose whether the inserted book should be fully embedded or just linked.
    • These two do not differ in the way the embedded book is displayed but in the way it is stored - inside the book for the former and at a remote location for the latter.
  • Choose how to display the embedded book - in a frame or in its own window.
  • Manage the resources in the embedded book (via the Resources palette).
  • Navigate through the embedded book (change pages, interact with resources (play audio, video, etc.)).
  • Modify some basic properties of the embedded book (rename, scale, delete, etc.)

At this revision only a basic version of some of these features will be implemented.

Task requirements

At this iteration the following should be achieved:

  • Provide basic support for embedded books:
    • Define and implement embedded book frame content.
    • Allow inserting of a Sophie book through the menu.
  • Resolve issues related to embedded book resources:
    • See if cyclic referencies cause problems and resolve them.
    • Make sure that when the embedded book is on focus, only its resources are shown in the Resource palette.
    • Make sure that when the embedded book is on focus, only its pages are shown in the Pages palette.
    • Think of other possible smells and resolve or document them.
  • Define interaction with the embedded books:
    • Add a panel for controlling the embedded books or use the existing book's bottom panel.
    • Allow navigating through pages in the embedded book.
  • Define how embedded books will be managed:
    • Add an embedded books palette or use the existing books palette.
    • Allow renaming and deleting of embedded books.
  • (Optional) Document things related to embedded books in a wiki page: EMBEDDED_BOOKS?

Task result

  • Source code
  • (Optional) Wiki page

Implementation idea

  • Create classes EmbeddedBookContent (similar to other frame contents).
  • You may display the first page of a book as a starting point and change that later.
  • Have a look at the Resource library and see how it handles cyclic dependencies.
  • See similar tasks in the Related section to get an idea of how things can be done.

EMBEDDED_BOOKS_CONTENT_R0
EMBEDDED_BOOKS_RESOURCE_SUPPORT_R0
EMBEDDED_BOOKS_MANAGING_R0
GROUP_PDF_R0
Specification about embedded books

How to demo

  • Insert a Sophie2 book.
  • Navigate through its pages.
  • Show that resources are displayed correctly in the resource palette.
  • (Optional) Show the created wiki page.

Design

Review the old code in org.sophie2.extra.func.embedded. Leave the working implementation for

  • a menu item in the Insert menu;
  • a frame content provider;
  • a frame content view provider;
  • an embedded books palette;

Review the BookContentView so that it fits in the current hierarchy and extends FrameContentView and implement the BookView. Also review the BookView interface and remove the swing component. This is not a good fix but for now it should do. In later revisions of the Book related tast the whole hierarchy for book viewing should be rafactored.

BookContentView should have:

  • workArea() - this should be a reader work area (so that the scene elements are cliped to the book size).
  • previewMode() - should be set to true
  • element() - which is a CompositeSceneElement that is constructed by the workArea() for the current book page - the page that should be visible.
    • all sub elements come from the workArea()
    • set scaling matrix so that the elements are resized along with the frame content size.
  • zoom() - It is good to allow the user to zoom the book content without the whole book but for this revision could be left 1.0f .

Review the R3Logic OperationDef for book contents and add options for switching pages and removing book frame. Deletion of a book frame should also remove the book resource and all its resources from the local cache.

Cyclic embedding - Book A embeds Book B which embeds book A for example, is not an opption since the embedding a book uses the persistence logic for oppening a saved book. If a book is in the local cache it could not be oppened again.

Export base classes for scene button controls from the media logic. Add to the FrameContentView new set of elements - manipulationViews that should render controls. Add contentElement for the rendering of the content itself. The scene element of this view should be constructed by its contentElement and its manipulation elements.

Refactor the media controls and all other ContentViews. Create two new buttons - 'next' and 'previous' and add then to the BookContentView controls. Find appropriate 16px icons with GPL licence for the buttons.

Since the insertion of a book frame is called by a menu item, there was needed system test. To avoid cyclic dependancies it is located in the org.sophie2.author module. EmbeddedBookTest

Implementation

The changeset of creation of the module and all previous implementation - [2100].

The implemetation was done according to the design. When refactoring the scene controls a bug was resolved in the drawing of ImageSceneElement. The image colors weren't transformed according to the color of the SceneElment. The problem was fixed in the ImageElementHelpers drawContent method.

changesets - [3226], [3230]

Implementation code merged to the trunk in [3231].

Testing

Place the testing results here.

Comments

Write comments for this or later revisions here.