Last modified 15 years ago
Last modified on 10/06/09 16:33:55
Analysis
Overview
- The goal of this task is to allow the users to create book on the server
Task requirements
- Create a prototype for this functionality
- Ignore the security issues.
- Fix the bug - crash when user tries to open already opened book from server.
Task result
- The result should be code
Implementation idea
- Add 'Save on Server' button inside the file menu under 'Save as' button
- This button will evoke dialog window that contains
- list of available accounts - that the user is currently connected to
- users should be able to type the name of the book
- file browser will NOT be available for this revision, but we must provide some way of navigating (browse) the server, and pick up a book location
- This button will evoke dialog window that contains
- The icon of the book in the tab bar will indicate that a book is opened from a server.
Related
APP_CONNECTIVITY_REDESIGN
GROUP_APP_SERVER_RESOURCE_ACCESS_R0
How to demo
- Run the author application
- Create a new book
- Insert some frames and pages
- Upload the book to the server
- Open the book from the server
Design
Menu
- Create a SaveBookOnServer menu item. It's text is "Save On Server..." and the hot key will be Ctrl+Alt+S.
- It's logic operation def will be in ServersTabLogic's constant ON_SAVE_BOOK_ON_SERVER.
- The logic is to open a server resource dialog choose a server and path and save the book creating an AutoAction which changes the model of the server's top resource.
Server Resource Dialog
- A BaseCustomModalDialog base abstract class is created
- It's is the base class for non !JOptionPane custom modal dialogs.
- This dialogs are BaseVisualElement
- They can access application visual elements hierarchy
- They must be registered somewhere in that hierarchy
- It has swingDialog, okButton, cancelButton, etc.
- Abstract validation logic so when ok button is clicked a subclass have to provide validation method. if it returns ok (true) the dialog is closed, otherwise it can
be closed only by cancel button and/or Esc key.
- ServerResourceDialog dialog class is created
- Extends !Dialog
- Defines three inner classes for dialog input and output, and for a concrete implementation of BaseCustomModalDialog.
- Input contians default book name on the server, and dialog parent - a base visual element used to find the ServerResourceDialog in the view hierarchy.
- Output contains the selected account, path to the new resource and a flag if the user wants to start edit the book on the server.
- Dialog (implementation of BaseCustomModalDialog)
- List with connected accounts - filtered from the ConnectionsPalette's accounts pro list.
- The accounts are rendered using AccountListCellRenderer which is extracted in new class renderer for ConnectionsPalette's items
- A text field for the resource path
- A check box for the flag start editing on server.
- Uses spring layout to show it's content.
- List with connected accounts - filtered from the ConnectionsPalette's accounts pro list.
Icons
- Changes on DocView hierarchy.
- Now the icon of a DocView is calculated in DefaultDocView which depends on the concrete DocView class and there are two icons - for a book and for a script.
- There is need to change where this calculation is done and by who.
- The implementation of documentIcon() as it is now in DefaultDocView will be moved in ScriptDocView.
- A new implementation of documentIcon() will be added in BookDocView wich will know what is the type of the current resource access.
- If it points to a server location the icon will be for server book and if not it can be common for all others now but can easily be changed for mem, file and distrib locations.
- Server Book Icon will be in the skin of BookDocView with id server-document-icon.
Prototype
A prototype of the described design can be found in the branch branches/private/tsachev/CREATE_BOOK_ON_SERVER
Implementation
The result can be found in the branch branches/private/tsachev/CREATE_BOOK_ON_SERVER which merged with trunk with last change at 7259.
Merged to the trunk at [7304].
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)