Opened 10 years ago

Closed 10 years ago

#720 closed (fixed)

Add context for ViewFile

Reported by: Gregory Vincic Owned by: olle
Milestone: Proteios SE 2.14.0 Keywords:
Cc:

Description

To enable extensions that work on a file for a specific file type.

Change History (7)

comment:1 Changed 10 years ago by Gregory Vincic

Status: newassigned

comment:2 Changed 10 years ago by Gregory Vincic

Owner: changed from Gregory Vincic to olle
Status: assignednew

comment:3 Changed 10 years ago by olle

Status: newassigned

Ticket accepted.

comment:4 Changed 10 years ago by olle

Design discussion.

Current design:

  • Classes ViewFile/ViewActiveFile display properties/annotations for a single file item (the form has a "View" button coupled to an action link to class ShowFile, for viewing the file contents).
  • The ViewFile form also has an optional "Original search results" button, that is added if the file item is of file type FileType.MASCOT_XML or FileType.TANDEM_RESULT, in which case it is coupled to an action link to class ViewOriginalMascotResultsExtension or ViewOriginalXTandemResultsExtension, respectively.

Proposed updated functionality:

  • The optional "Original search results" button should be exchanged for a more general "Extensions" button, where clicking on the button shows a pop-up table with extensions available for the file type of the current file item.
  • The "Extensions" button should always be visible, but should be disabled (dimmed), if no extensions are available for the file type of the current file item.

Design description:

  • A new class FileTypeContext will be created based on class HitContext, but with an additional attribute String fileTypeString, defining the file type for the context.
  • Class ViewActiveFile will be updated to add an "Extensions" button for extension classes implementing interface ContextEnabled through new class FileTypeContext, where the context file type attribute value equals that of the current file item.
  • The "Extensions" button should be disabled (dimmed), if no extensions are available for the file type of the current file item.
  • The code for update of class ViewActiveFile should be based on that of class ListHits for context HitContext, but with necessary additions for checking if an extension supports the appropriate file type.
  • The optional "Original search results" button should be removed from the ViewFile form.
  • Classes ViewOriginalMascotResultsExtension and ViewOriginalXTandemResultsExtension should be updated to implement ContextEnabled through the new class FileTypeContext for the correct file type, instead of through class FileContext.

comment:5 Changed 10 years ago by olle

Traceability note:

  • The "Original search results" button and functionality was added in Ticket #554 (Direct link to native search results view).
  • Class HitContext was added in Ticket #717 (Move some of the hit table buttons to an Extensions button).

comment:6 Changed 10 years ago by olle

(In [4040]) Refs #720. Refs #554. Refs #287. Refs #290. First version of file type extensions button for file properties form:

  1. New class/file FileTypeContext.java in client/servlet/ added.

It is based on class HitContext, but has an attribute String fileTypeString, defining the file type for the context.

  1. Class/file action/file/ViewActiveFile.java in client/servlet/

updated:

  1. Public method void runMe() updated by exchanging code connected

to adding an "Original search results" button for a call to new private method Form addFileTypeExtensionsButton(Form form, File file), that adds a file type extension button.

  1. New private method Form addFileTypeExtensionsButton(Form form, File file)

added. It adds a file type extensions button to the toolbar, with a pop-up link to a table with extension classes implementing interface ContextEnabled through new class FileTypeContext, where the context file type attribute value equals that of the current file item.

  1. Class/file action/file/ViewOriginalMascotResultsExtension.java

in client/servlet/ updated to implement ContextEnabled through the new class FileTypeContext for file type string FileType.MASCOT_XML.

  1. Class/file action/file/ViewOriginalXTandemResultsExtension.java

in client/servlet/ updated to implement ContextEnabled through the new class FileTypeContext for file type string FileType.TANDEM_RESULT.

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

updated with new string keys.

  1. Default icon settings file "default" in icons/ in client/servlet/

updated with new icon assignments.

comment:7 Changed 10 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.