Opened 13 years ago

Closed 13 years ago

#704 closed (fixed)

Deleting a project does not place the project in Trash

Reported by: Jari Häkkinen Owned by: olle
Milestone: Proteios SE 2.14.0 Keywords:
Cc:

Description

... or is it in the trash? The GUI does not show the deleted project anywhere. What I wanted to do was really 'Trash project' but I didn't realize that until after deleting the project. So now I cannot trash the project anymore.

Change History (12)

comment:1 Changed 13 years ago by Gregory Vincic

Owner: set to olle

The query for listing My Projects should also include removed projects, then you would be able to list removed projects and restore(=set removed to false) them.

comment:2 Changed 13 years ago by olle

Status: newassigned

Ticket accepted.

comment:3 Changed 13 years ago by olle

Milestone: Proteios SE Future ReleaseProteios SE 2.14.0

Milestone changed from Proteios SE Future Release to Proteios SE 2.14.0.

comment:4 Changed 13 years ago by olle

Traceability note:

  • Deletion of an entire project was introduced in Ticket #585 (Deletion of entire project).
  • Trashcan functionality was updated in Ticket #523 (Trashcan updated with separate item class views and links in menus).
  • Emptying trash can as a job was introduced in Ticket #620 (Empty trashcan as job).

comment:5 Changed 13 years ago by olle

Design discussion.

Current design:

  • A button coupled to action DeleteItems will automatically be added to the tool bar of any table managed by class ConfigureTableFactory2, if the table item class implements interface Removable. The action will mark selected items as deleted and move them to the trash can.
  • The action TrashProject coupled to tool bar button "Trash Project" in the project table creates a job using plug-in ProjectToTrash, that removes hits and features for the project, while jobs, files, directories, and spectrum searches are marked as deleted and moved to the trash can (the project itself is closed). For more details see Ticket #585 (Deletion of entire project).
  • Routines for listing, restoring or permanently removing items in the trash can do not currently support project items.

Proposed design update:

  • Since a user normally wants to perform the actions related to "Trash Project", when referring to deletion of a project, the original "Delete" button coupled to action DeleteItems should be removed for the project table and the name of button "Trash Project" changed to "Delete".
  • Routines for listing, restoring or permanently removing items in the trash should be updated to support project items.
  • Routines for emptying the trash can should be updated to repeat attempts to empty the trash can, as long as some item is removed in each attempt, and more items to remove remain. This increases the chance of successfully removing items, where one has a reference to another deleted item, that is not yet removed permanently. The order in which items are removed will therefore not be as important as previously. This design has successfully been used in the BASE project.

Actions TrashProject and its related plug-in ProjectToTrash should be updated to increase the chance of successfully removing an entire project:

  • Problems with calls to DbControl method reattachItem(...) can be fixed by re-creating the Project item with the new DbControl from the id value of the former, as this eliminates the need to call reattachItem(...) (recommended by Nicklas Nordborg of the BASE project). This will allow the project directory to be marked as deleted and moved to the trash can.
  • Current queries to find directories and files for the project did not always find all items, when the project directory contained more directories in several layers. The queries will therefore be replaced by new methods to find directories and files (the old queries will be kept in the code).
  • The project item will be marked as deleted, as originally intended. (The ability to mark a project as closed will not be removed, as it is still of value, and may be performed when editing the properties of a project item.)
  • The job related to plug-in ProjectToTrash will no longer be owned by the project, as this made the job itself be marked as deleted. Although this did not stop the job from performing its actions, it made it harder to find the job item when it was finished, as it did not appear in the job table.

comment:6 Changed 13 years ago by olle

(In [3952]) Refs #704. Refs #585. Refs #287. Project table tool bar updated to remove the "Delete" button coupled to action DeleteItems, and rename button "Trash Project" coupled to action TrashProject to new name "Delete":

  1. Class/file action/project/ListMyProjects.java in client/servlet/

updated:

  1. Public method void runMe() updated to remove the "Delete" button

coupled to action DeleteItems from the tool bar of the project table.

  1. Class/file gui/Toolbar.java in client/servlet/ updated:

a Public method void clear() updated to first check if instance variable ArrayList<AbstractLink> toolbar differs from null, before calling its clear() method.

  1. English dictionary file locale/en/dictionary in client/servlet/

updated by changing the string value for key TrashProject from "Trash Project" to "Delete".

comment:7 Changed 13 years ago by olle

(In [3953]) Refs #704. Refs #523. Refs #620. Routines for listing, restoring or permanently removing items in the trash should be updated to support project items:

  1. Class/file gui/MainMenu.java in client/servlet/ updated to add

a menu item for projects in the trash can menu.

  1. Class/file action/read/ViewHome.java in client/servlet/ updated:
  2. New valid parameter VInteger VPROJECTCOUNT added.
  3. Public method void runMe() updated to support project items.
  4. Private method Form getTrashCanForm(...) updated with new

argument Integer projectCount and support for projects in the form.

  1. Class/file action/write/EmptyTrash.java in client/servlet/

updated to support project items.

  1. Class/file plugins/EmptyTrashPlugin.java in plugin/ updated

to support project items.

comment:8 Changed 13 years ago by olle

(In [3956]) Refs #704. Refs #523. Refs #620. Routines for permanently removing items in the trash updated to repeat attempts to empty the trash can, as long as some item is removed in each attempt, and more items to remove remain:

  1. Class/file action/write/EmptyTrash.java in client/servlet/ updated:
  2. Private method void emptyTrashCan() updated with new argument

int totalItemCount and calling new private method int emptyTrashCanAttempt() as long as some item is removed in each attempt, and more items to remove remain.

  1. New private method int emptyTrashCanAttempt() added.

It attempts to permanently remove items, using code previously in private method void emptyTrashCan().

  1. Class/file plugins/EmptyTrashPlugin.java in plugin/ updated:
  2. Public method void execute(Request request, Response response, ProgressReporter progress)

updated to call new private method int emptyTrashCanAttempt(Request request, Response response, ProgressReporter progress, int accDeletedCount, int totalItemCount) as long as some item is removed in each attempt, and more items to remove remain.

  1. New private method

int emptyTrashCanAttempt(Request request, Response response, ProgressReporter progress, int accDeletedCount, int totalItemCount) added. It attempts to permanently remove items, using code previously in public method void execute(Request request, Response response, ProgressReporter progress).

comment:9 Changed 13 years ago by olle

(In [3957]) Refs #704. Refs #585. Class/file action/project/TrashProject.java in client/servlet/ updated to no longer create a job owned by the project to delete, as this made the job itself be marked as deleted:

  1. Protected method void runMe() updated to set the active

project to null before creating the job.

comment:10 Changed 13 years ago by olle

(In [3958]) Refs #704. Refs #585. Class/file plugins/ProjectToTrash.java in plugin/ updated:

  1. Public method

void run(Request request, Response response, ProgressReporter progress) updated:

  1. The Project item was re-created with the new DbControl from

the id value of the former, as this eliminates the need to call reattachItem(...).

  1. The lists of directories and files in the project is now obtained

by calling new private methods List<Directory> directoryTree(DbControl dc, List<Directory> dirList, Directory startDir) and List<File> filesInDirectories(DbControl dc, List<Directory> dirList), respectively.

  1. New private method

List<Directory> directoryTree(DbControl dc, List<Directory> dirList, Directory startDir) added. It obtains a list of all directories that have the start directory as ancestor.

  1. New private method

List<File> filesInDirectories(DbControl dc, List<Directory> dirList) added. It obtains a list of all files in a list of directories.

comment:11 Changed 13 years ago by olle

Addendum to commit message for changeset [3958] entered 2010-11-05 12:09 by olle:

Refs #704. Refs #585. Class/file plugins/ProjectToTrash.java in plugin/ updated:

  1. Public method

void run(Request request, Response response, ProgressReporter progress) updated:
...

  1. The project is marked as deleted instead of closed.

...

Closing of a project can still be performed when editing the properties of a project item. Closed projects may be filtered out from showing up when listing projects.

comment:12 Changed 13 years ago by olle

Resolution: fixed
Status: assignedclosed

The ticket is closed, as the desired functionality has been added. Should problems with the current solution appear, this ticket may be reopened, or a new ticket created.

Note: See TracTickets for help on using tickets.