wiki:RESOURCES_EXPORT_IMPORT_R0

Version 10 (modified by deyan, 16 years ago) (diff)

--

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

Error: Macro TicketQuery(summary=RESOURCES_EXPORT_IMPORT_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

(Give as much as possible of the needed information for designing and implementing the task in the following sections.)

Overview

The resource palette consist of only frame contents. These frames include all the frames which can be inserted without the browser frame. All The resources can be imported and exported as while exporting, the elements are exported in the corresponding format(if jpg, in jpg; if pdf in pdf; if sjrb, in sjrb and so on). The other goal of this revision is to support import multiple files at once.

Task requirements

  • Create support for selecting multiple items in the file dialogs
    • This should allow importing a lot of image or other media resources at once.
  • Create an ability for importing any resource.
    • The file dialog dropdown should have 1 entry - All files (*.*) - This is for now, later "Image", "Audio", etc things should be added.
    • The tooltip should say "Import any kind of supported resource, folder or zip with resources."
    • When a folder is selected the button should not change to "Open" like it does in the other file dialogs. Import should be available instead, which should allow import of a folder with resources
      • zip files should be scanned for resources and they should be added to the list with the resources. This should be done carefully, because Sophie internal resources are in zips too.
      • For both, folder and zip, only their supported contents should be added. But if the user has selected an unsupported file, he should be warned by a message box. If multiple files are selected and part of them are unsupported the user should be notified about them, and the supported ones should be imported
  • Every resource is exported in the corresponding format.
  • Texts and comments are exported in rtf format.
  • All the imported resources are not inserted on the page work area but only in the resources palette and can be inserted in the page by drag and drop.
  • (optioanal) Resources can be exported and imported by drag and drop

Task result

Source code

Implementation idea

  • Make file dialog to support multiple selection and provide a logic that will handle it.
  • Add new file dialog that can open files and directories. When the user select something:

1 If it is a file, try to open it

1.2 If it is a zip file, decompress it and go to 1

2 If it is a directory list its files

2.1 If there are only files go to 1

2.2 If there are directories go to 2

  • Create something like ResourceManipuationProvider, which will be used for easier and centralized import of resources, for example with it will be registered the corresponding insert menus and will be used for both inserting resources with frames and importing them.
  • Modify the FileDialogInput to work with folders.
  • Add logic for decompressing or browsing zip files
  • Try to fix the RTF export/import of the text to take in mind styles (optional because it could be time taking).

APP_RESOURCE_LIST_IMPORT_EXPORT_R0
APP_RESOURCE_LIST_IMPORT_EXPORT_R1

How to demo

  1. Create a book
  2. Go to insert menu, choose Image..., and select 2 images in jpeg format by using ctrl+click and notice they are inserted at the one and same time.
  3. Export one of the pictures and notice it is exported in jpeg format.
  4. Insert a text frame.
  5. Export the text frame and notice it is in rtf format.
  6. Choose insert -> Any resource
  7. Select the folder and click insert. Notice all the familiar format files from the folder are inserted.

Design

(Describe your design here.)

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.)

Attachments