Opened 10 years ago

Closed 10 years ago

#803 closed (fixed)

It should be possible to define biomaterial - file associations from the file side

Reported by: olle Owned by: olle
Milestone: Proteios SE 2.19.0 Keywords:
Cc:

Description

Biomaterial - file associations can currently be defined by selecting files to be associated with a biomaterial. It should also be possible to define the association from the file, by selecting biomaterials to be associated with it.

Change History (8)

comment:1 Changed 10 years ago by olle

Status: newassigned

Ticket accepted.

comment:2 Changed 10 years ago by olle

Traceability note:

  • Biomaterial - file associations were introduced in Ticket #283 (Add possiblitiy for direct file - sample links).
  • Biomaterial - file associations were extended to extracts and labeled extracts in Ticket #339 (Enable annotations for extracts).
  • Removal of biomaterial - file associations from the GUI were added in Ticket #800 (Removal of sample - file associations).
Last edited 10 years ago by olle (previous) (diff)

comment:3 Changed 10 years ago by olle

Design discussion.

Display of file properties/annotations is performed by class/file action/file/ViewActiveFile.java in client/servlet/, and biomaterial - file associations are shown in a table in the annotations tab, similarly to how the associations are shown for biomaterials by action/sample/ViewActiveSample.java, action/extract/ViewActiveExtract.java, and action/extract/ViewActiveLabeledExtract.java, all in client/servlet/. For a file, associations are shown by listing the associated biomaterials, while for a biomaterial, the assocated files are listed. This symmetrical arrangement is currently upset by the following two exceptions:

  • The association table for biomaterials have a toolbar button for adding files.
  • The association table is always shown for biomaterials, while for a file, it is hidden if no associations exist.

In order to make the arrangement symmetrical, the following updates are needed:

  • The association table for a file should get a toolbar button for adding biomaterials.
  • In order to be able to use the functionality above to add the first file - biomaterial association, the association table for a file should always be shown.

In order to implement the desired functionality to associate biomaterials to a file, one more lack of symmetry needs to be rectified:

  • Classes/files action/sample/AddSampleFile.java, action/extract/AddExtractFile.java, and action/extract/AddLabeledExtractFile.java in client/servlet/, all use class/file action/directory/ViewActiveDirectory.java in client/servlet/ to perform the file selection. The latter class was introduced in the first year of Proteios SE development, and has grown in complexity since the start. It contains a directory table and a file table, and has two major modes, one for browsing the Proteios SE file system, and one support mode for selecting one or more files as part of the set-up for a multi-step operation. There is currently no corresponding class for the latter purpose for other items than files. It has been possible to select multiple items in a table and then select an extension to process the items, but this is a different approach.

In order to be able to select biomaterials to be associated with a file, the following update should be made:

  • An equivalent class to ViewActiveDirectory should be created for general items (only restricted to be instances of Class<? extends BasicItem>), in order to be able to select the items as part of the set-up for a multi-step operation. The new class will be named ViewItemTable, and will be based on ViewActiveDirectory, but without the extra complexity added by the directory table.
Last edited 10 years ago by olle (previous) (diff)

comment:4 Changed 10 years ago by olle

Design update:

  • For the new class ViewItemTable to be able to show a table of BioMaterial items, class file ClassDescriptor.java in api/core/ needs to be updated. The latter class is used by class/file gui/table/TableFactory2.java in client/servlet/ to read values for various item attributes to be placed in table cells. ClassDescriptor is configured to use a specific class, describedClass, as a kind of template when reading values for an item, and will only read values if the item belongs to the same class. This leads to problems when showing a table of BioMaterial items, since BioMaterial is an abstract class, and the individual items will be instances of classes Sample, Extract, and LabeledExtract. However, all the latter classes are subclasses of BioMaterial, and this should be adequate for the current purpose. ClassDescriptor should therefore be updated in public method Object readValue(Object obj, AttributeDefinition attributeDefinition) to check if describedClass is assignable from the object's class, instead of checking for equality of the classes.

comment:5 Changed 10 years ago by olle

(In [4455]) Refs #803. New class ViewItemTable introduced for displaying a table of items of a specific class. It has two modes, one for general inspection, and one support mode for selecting one or more items as part of the set-up for a multi-step operation:

  1. Class/file action/ViewItemTable.java in client/servlet/ added. It is based on class/file action/directory/ViewActiveDirectory.java in client/servlet/, but without the extra complexity added by the directory table. ViewItemTable is intended to be used for item classes of type Class<? extends BasicItem>. If session attribute VBoolean ViewItemTable.VSELECT is null or true, select mode will be used. The list of integer id values for selected items is available in valid parameter FormFactory.VID.
  2. Class/file ClassDescriptor in api/core/ is updated in public method Object readValue(Object obj, AttributeDefinition attributeDefinition) to check if describedClass is assignable from the object's class, instead of checking for equality of the classes.

Last edited 10 years ago by olle (previous) (diff)

comment:6 Changed 10 years ago by olle

(In [4458]) Refs #803. Refs #283. Biomaterial - file associations can now be defined by selecting biomaterials to be associated with a file, instead of the other way around:

  1. Class/file action/file/ViewActiveFile.java in client/servlet/ updated to always show the association table. The table tool-bar is updated with a new button "Add BioMaterials" coupled to action link to new class/file action/file/AddFileBioMaterial.java in client/servlet/.
  2. New class/file action/file/AddFileBioMaterial.java in client/servlet/ added. It uses class ViewItemTable to display a table of available biomaterials to select from, after which action is forwarded to new class CreateFileBioMaterial.
  3. Class/file action/ViewItemTable.java in client/servlet/ is based on class/file action/directory/ViewActiveDirectory.java in client/servlet/, but without the extra complexity added by the directory table. ViewItemTable is intended to be used for item classes of type Class<? extends BasicItem>. If session attribute VBoolean ViewItemTable.VSELECT is null or true, select mode will be used. The list of integer id values for selected items is available in valid parameter FormFactory.VID.
  4. New class/file action/file/CreateFileBioMaterial.java in client/servlet/ added. It obtains a list of biomaterial id values from valid parameter FormFactory.VID and adds the items to the file.
  5. English dictionary file locale/en/dictionary in client/servlet/ updated with new entries for various string keys.
  6. Default icon settings file icons/default in client/servlet/ updated with icon assignments for new string keys.

comment:7 Changed 10 years ago by olle

(In [4459]) Refs #803. Class/file action/sample/AddSample.java in client/servlet/updated to create the sample set as a HashSet<SharedItem>, instead of a TreeSet<SharedItem>, in order to avoid problems when adding a sample item (a TreeSet requires that its members adheres to the Comparable interface).

comment:8 Changed 10 years ago by olle

Resolution: fixed
Status: assignedclosed

Ticket closed as the requested functionality has been added.

Note: See TracTickets for help on using tickets.