Last modified 15 years ago
Last modified on 11/18/09 18:49:15
Analysis
Overview
The applet allows reading a book in a browser
- The applet only runs reader application
- The applet may be deployed not only on Sophie Server
- The applet gets as parameters the book path and size
Task requirements
- Choose which modules are sensible for the applet and load only them
- Optional requirements
- Identify the user OS and download natives only for it
- Identify which of the modules are needed for the chosen book and load only them
- Make applet deployment automatic with building
- Write documentation how to deploy applet
- The applet must be without menus
Task result
- Code
Implementation idea
- The applet may have capability for fullscreen (F11 and Esc)
- The user should be able to copy text from Sophie book.
- The user should be able to paste text in the search field of the applet or in comment frame.
- The following functionalities in reader will not be needed in the applet:
- Menus
- Drag and drop (but copy will be)
- All edit operations (excluding copy)
- Help contents
- Halos
- Annotations
- The following tabs are in Reader, but will not be needed in the applet
- Config
Related
How to demo
- Deploy the applet with a sample book in sophie2.org/applet
- Open the page and show the book in the browser
Design
Open Book on startup
- The applet will open a specified book provided as applet parameter named bookRef that will contain a valid absolute url to the book.
- The launcher (AppletMain) will set it as system property sophie2.startupBookLocation
- The Reader module will check for the system property and if supplied will try to fetch the given url in a temp file created like
File.createTempFile("startupBook", PersistenceUtil.EXTENSION);
and then open it using file.
Deploy applet
- The applet (launcher and modules) will be deployed on a single place at sophie2.org server the complete url now is
http://sophie2.org/sophie2-reader-applet/
- On that location will be the org.sophie2.launcher-2.0.jar which contains the launcher and a folder modules which contains all needed modules.
- To launch the applet in an html page the following snippet is needed
<applet width="500" height="500" name="sophie2-applet" codebase="http://sophie2.org/sophie2-reader-applet/" code="org.sophie2.launcher.AppletMain" archive="org.sophie2.launcher-2.0.jar"> <param name="edition" value="reader" /> <param name="bundlesConfigFile" value="applet.bundles.config" /> <param name="bookRef" value="absolute_url_to_the_book" /> </applet>
- edition is the sophie edition to be launched - must be reader
- bundlesConfigFile is the file which contains modules configuration. applet.bundles.config must be what you need in most cases.
- bookRef is the absolute ref to the book to be opened.
Stripping unnecessary modules
- To avoid starting of unnecessary for the applet modules there is a new .config file for applet called applet.bundles.config
- It will remove some modules, and only install(not start) some modules with unwanted functionality.
Platform Dependent modules
- There will be 4 assembled jars for the org.sophie2.base.natlib modle
- linux32
- linux64
- mac32i
- win32
- The idea is to implement placeholder formatter which will replace a given template in the config file with some dynamic content.
- Now will be implemented platform formatter
For example
org.sophie2.base.natlib${platform}
for 64 bit architecture Linux should be replaced with
org.sophie2.base.natlib-linux64
Launcher fixes
- There many code duplication in different launchers. We can extract them in a separate class named SophieLauncher which will start the osgi context.
- The spash screen must be changed not to extend !JWindow so it can be runned in applet.
Implementation
Merge
Merged to the trunk at [8170].
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)