Analysis
Overview
Resource manipulation is set of features that allow various operations with resources. Some of these include
- Import resources
- Copy resources
- Delete resources
- Edit resources - this is available for some resources
- Export resources
- Meta manipulation
Task requirements
- For this revision you should
- Ensure only the first level of resources is displayed (e.g without subresources as embeded books' resources)
- Ensure the other levels' resources can be easily implemented in future revisions of this task - if we decide to implement tree view for advanced users
- Implement the delete resource and duplicate resource functionalities
- Delete resource should delete resource and it's children.
- If the resource is content of a frame for example, the user should be warned. After deletion, this frames become empty (no content).
- Duplicate resource should duplicate resource and it's children. If a resource is a page element, it's duplicated with an offset on the same page. If the resource is page, it is inserted after the source page.
- Implement Import functionality. Note that Import should insert the resource into the book, not only into resources palette.
- Import should allow import of any kind of resources (optional for this revision)
- Implement the duplicate functionality
- Duplicate should copy all the data from the resource.
- Implement the editing feature for the meta palette
- For the editable properties the field should allow text editing. See which fields are editable in the Overview section
Task result
The result of this task is source code.
Implementation idea
The interactions may be the following
- Drag and drop (not part of this revision)
- Dragging file from the OS to the resources palette inserts the file as a resource
- Dragging file from the OS to a work area inserts the resource into the resources palette AND the work area.
- Dragging resource from the resources palette exports the resource as a file
- Buttons
- Following buttons are available when a list item is selected or not
- Import button allows importing of a resource by envoking file dialog
- Following buttons are available only when a list item is selected
- Export button allows exporting of a resource by envoking file dialog
- Edit button allows out-of-frame editing of a resource with appropriate plugin. Note that for 2.0 we plan only text editing that way, but there should be a way to know exactly what resource types are editable
- Duplicate button creates a copy of a selected resource
- Delete button deletes the selected resource. A dialog with a warning will be useful if the resource is used by frames as content.
- Following buttons are available when a list item is selected or not
- Editable fields in the metapalette of the resource tab - for the resources that the user has writing permission the meta palette should allow editing of the writeable fields (comments, etc)
- Make the delete and copy buttons active (clickable) only when a resource is selected
- The import button should always be active
Related
(Add links to related tasks that could be useful or helpful.)
How to demo
Prerequestuques
- Open Sophie
- Create a new book
Steps
- Import a resource using the Import button from the palette (optional)
- Select the resource from the list
- Duplicate the resource from the list. Show the copy in the list and on the page
- Delete the first resource
- Show that the second resource is still on place
- Reload the book
Design
For the resource manipulation there will be present one palette in the Resources tab used for displaying and editing the resource meta.
- There will be button for duplicating a Resource. This button will be active only when a resource of the resource palette is chosen by the user. When clicked the button copies the chosen in the resource palette resource.
- If the resource is Frame or other resource - page element, it will be copied into the currently opened page, and it will show the same content as the original one.
- If the resource is Page the page will be copied and put into current book's pages array into the last place.
- If the resource is a Book it will be copied on the desktop like a new book.
- If the resource is a content resource it will be copied, and put into the book's content resources, but will be not inserted. The insert will be performed with drag&drop in the future.
- There will be a button for deleting a resource. It will delete the resource. The resource will be deleted from the current book and the palettes. If no resource is chosen in the resource palette the button will be inactive.
- There will be a button for exporting a resource that will work in a future revision.
- In the AllResourcesPalette there will be an Import button, that will import resources from the database. When clicked it will raise file chooser dialog and will filter files by all the known file types for resources. And when file is chosen for its contents will be created new frame with the appropriate content and will be inserted to the current page and the resource's palettes. The implementation of this feature will be optional for this revision.
The resource meta information will be displayed into the Resource Details palette too. The editable fields of the resource will be editable there and fields like the name or the date of creation that are permanent will be not.
In the new Details there will be and preview panel that will be implemented in a future revision.
- There will be the following shortcuts:
- Del button -> for deleting the currently chosen resource from the all resource palette.
- Ctrl+C -> Ctrl+V Copy-Paste a resource from the palette or the book to the currently chosen location if it is possible (that is optional for that revision)
A screenshot with the Resource Palette and the Resource Detail Palette visual design:
Implementation
Since the timeboxing, the task currently has only implemented:
- Resource meta editing is working - the palette is showing and firing events, which are handled.
- The button are showing and firing events, but they are not handled:
- For the deletion of resources, only the Frames' is working properly - these methods should be refactored, then called.
- Resource copying is currently hardly working - template copying is kind of blocker.
- Changeset for what is implemented until now: [2306]
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)