Last modified 16 years ago
Last modified on 06/10/09 15:06:05
Analysis
Overview
User should be able to export Sophie 2 Book as html file.
Task requirements
- Provide prototype that exports book to html file.
- Add 'Export as' sub menu in file menu that contains 'as pdf' and 'as HTML' buttons.'as HTML' button evoke dialog window who allows the users to select the name of the html file.
- The entire book should be exported as single html file in this revision.
- Multiple html export as well as export single page should be consider in the next revision.
- Links and timlines will not be preserved for now.
- Images should be exported.
- See if we could export firs frame of the movie as image in this revision.
- Audio will not be exported in this revision.
- Rotated frames will be exported without rotation.
- Research how to allow to export for video, audio, rotated frames etc.
- If needed frames background (as gradient color) should be exported as image background.
- Research and implement if possible in this revision export of alpha property.
- Test in different browsers. (Firefox, IE6, IE7, Safari etc.). Give list of known problems in specific browser.
Task result
- The result should be code.
Implementation idea
- Export every page as div tag with needed attributes (width, height etc.).
- Export every frame as div tag (child of the page div)
- Use absolute positioning for div tags.
Related
How to demo
- Run the application
- Create new book
- Insert few frames as well as few pages
- Export the book as html
- Open the html file in some web browser.
Design
- Exporting sophie books to html, will use the org.sophie2.base.persistence library. For more information about it see GROUP_PERSISTENCE_R0.
- Will create a module for HTML export named org.sophie2.extra.func.html
- It will have a module class named HtmlModule that will register all the extensions of the MasterPersister.
- Will create Persister implementations for Book, Page, Frame and ImmImage and will register them as extensions to the MasterPersister. The already created persisters about Book, Page etc are not of use for the html persisting. The tags used are not html compatible. That is why the new ones will be created that are alike the already created, differing in schema and tags.
- BookToHtmlPersister having a schema "book|storage|html" - will convert a book to a storage node.
- PageToHtmlPersister having a schema "page|storage|html" - will convert a page to a storage node.
- FrameToHtmlPersister having a schema "frame|storage|html" - will convert a frame to a storage node.
- The FrameToHtmlPersister will invoke a persister for content to html invoking two other persisters for text and images:
- ContentToHtmlPersister will have a schema "storage|text:html|html" and will invoked a persister fot HotText and a persister for Images.
- HotTextHtmlPersister having a schema "hot-text|storage|html" - will convert a Sophie formated text to a storage node.
- ImageHtmlPersister having a schema "image|storage|html" - will convert a Sophie image content to a storage node. Images will be stored in a directory "_resources" and will be linked in the main html file.
- These will also be extensions of the MasterPersister.
- The FrameToHtmlPersister will invoke a persister for content to html invoking two other persisters for text and images:
- Exporting to HTML will be done from the ExportSubMenu which is a sub-menu of the file menu. An ExportAsHtmlItem will represent a menu item in the ExportSubMenu which when clicked fires an event that will be handled in a HtmlLogic. Note: The ExportToPDFItem will also be attached to the ExportSubMenu, since that menu will contain all supported formats that we export to.
- The title of the ExportSubMenu will be "Export as". It will have a mnemonic VK_E. The mnemonic of the ExportToPDFItem will be VK_P and its title "PDF". The mnemonic of the ExportAsHtmlItem will be VK_H and its title "HTML".
- The logic will eventually show a dialog and prompt the user to export the book to a file.
- The new persisters will be located in the org.sophie2.extra.func.html module. For current revision they are not that much to be divided by what they persist. In addition, they need nothing else, but the model and nothing needs them, but the HtmlLogic.
- Changesets:
Design related code merged into the trunk in [3223].
Implementation
Merged into the trunk in [3356].
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)