[[BackLinksMenu]] [[TicketQuery(summary=BOOK_HTML_EXPORT_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|)]] = 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 [wiki:GROUP_PERSISTENCE_R0]. * Will create a module for HTML export named [source:/branches/private/peko/peko2/modules/org.sophie2.extra.func.html org.sophie2.extra.func.html] * It will have a module class named [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/HtmlModule.java HtmlModule] that will register all the extensions of the [source:branches/private/peko/peko2/modules/org.sophie2.base.persistence/src/main/java/org/sophie2/base/persistence/persister/MasterPersister.java MasterPersister]. * Will create Persister implementations for Book, Page, Frame and ImmImage and will register them as extensions to the MasterPersister. * [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/persister/BookToHtmlPersister.java BookToHtmlPersister] having a schema "book|storage|html" - will convert a book to a storage node. * [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/persister/PageToHtmlPersister.java PageToHtmlPersister] having a schema "page|storage|html" - will convert a page to a storage node. * [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/persister/FrameToHtmlPersister.java FrameToHtmlPersister] having a schema "frame|storage|html" - will convert a frame to a storage node. * The FrameToHtmlPersister will invoke two other persisters for text and images: * [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/persister/HotTextToHtmlPersister.java HotTextToHtmlPersister] having a schema "hottext|storage|html" - will convert a Sophie formated text to a storage node. * [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/persister/ImmImageToHtmlPersister.java ImmImageToHtmlPersister] having a schema "imm:image|storage|html" - will convert a Sophie ImmImage to a storage node. * These will also be extensions of the MasterPersister. * Will create a Persister implementation named HthlPersister for converting from a storage tree to HTML file. It will have a schema as follows - "storage|text:html|html". It will create an XHTML file and a directory containing the resources - current only the images. It will also be registerred as an extension to the MasterPersister. * Exporting to HTML will be done from the file menu. An [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/ExportAsHtmlItem.java ExportAsHtmlItem] will represent a menu item which when clicked fires an event that will be handled in a [source:branches/private/peko/peko2/modules/org.sophie2.extra.func.html/src/main/java/org/sophie2/extra/func/html/HtmlLogic.java HtmlLogic]. * The logic will eventually show a dialog and prompt the user to export the book to a file. = Implementation = ^(Describe and link the implementation results here (from the wiki or the repository).)^ = Testing = ^(Place the testing results here.)^ = Comments = ^(Write comments for this or later revisions here.)