Opened 4 months ago

Closed 3 months ago

#2202 closed enhancement (fixed)

Include information from parent items in list pages

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.16
Component: web Version:
Keywords: Cc:

Description

It would be really nice if it was possible to add more columns to a list page with data from parent items (no matter how far up in the parent chain). To begin with, the name and annotations would go a long way. Exporting should be possible. Filtering would be nice but is probably not very friendly for performance. Displaying the values in the table can also be "lazy" in the sense that the table is loaded with placeholders and then extra requests are made to fill in actual values.

Change History (19)

comment:1 Changed 4 months ago by Nicklas Nordborg

In 7764:

References #2202: Include information from parent items in list pages

Proof-of-concept has been implemented that can load annotations from parent items to raw bioassays.

It it implemented as a "list column" extension that scans the "columns" settings for entries matching /ITEMTYPE/Subtype-id/#Annotationtype-id. If found, it will create an action that uses the Annotatable.getAnnotatableParents() method to to find a parent item that matches the item type and subtype and the get the specified annotation from it.

It seems to work, but it relativeley slow.

comment:2 Changed 4 months ago by Nicklas Nordborg

In 7765:

References #2202: Include information from parent items in list pages

Started with re-factoring the implementation. An abstract base class ParentItemColumn takes care of finding the correct parent item(s). Added subclasses for taking an annototation value and a regular property (eg. name) from the parent item.

Introduced a helper class that should improve performance by caching already loaded items and annotations.

comment:3 Changed 4 months ago by Nicklas Nordborg

In 7766:

References #2202: Include information from parent items in list pages

Adding formatter implementations to get nicer formatting both when exporting and in the list page.

comment:4 Changed 4 months ago by Nicklas Nordborg

In 7767:

References #2202: Include information from parent items in list pages

Reducing memory usage when exporting large data sets by using separate read-only transactions for loading parent items that can ne re-cycled at regular intervals.

comment:5 Changed 4 months ago by Nicklas Nordborg

In 7768:

References #2202: Include information from parent items in list pages

Implemented lazy-loading of data from the parent item colums. The column definition will generate a proxy html tag (ParentItemColumn.getProxyTag()) that a JavaScript (lazy-parent-items.js) can detect and initiate a lazy loading action via AJAX.

comment:6 Changed 4 months ago by Nicklas Nordborg

In 7769:

References #2202: Include information from parent items in list pages

Events handlers are now attached to the lazy-loaded content by calling Doc.autoInitElements(). Basically this means that links to other items now works as expected.

comment:7 Changed 4 months ago by Nicklas Nordborg

In 7770:

References #2202: Include information from parent items in list pages

Implemented support for filtering on parent item columns. Basically this works by executing an extra query just to find the matching parent items for each of the columns and then using the "Item list" functionality to traverse down to find the child items.

This can take a long time if there are many steps between the parent and child levels. To improve performance a simple cache has been implemented.

The filtering feature is also limiting the parent items that are supported to those that can be used for items lists. There is also one remaining issue with subtypes that has the "Push annotations to parent" flag set. When displaying data, those items will be found since the annotation system in BASE knows that it should go back down in those branches, but the item list functionality doesn't. Thus, filtering on such items will never return any results.

comment:8 Changed 4 months ago by Nicklas Nordborg

In 7771:

References #2202: Include information from parent items in list pages

This should have been included in [7770].

comment:9 Changed 3 months ago by Nicklas Nordborg

In 7773:

References #2202: Include information from parent items in list pages

Implemented a simple dialog for selecting parent item columns. It currently allows selecting to display the name of a parent item or any annotation that is attached to it. It can probably be improved a bit more.

comment:10 Changed 3 months ago by Nicklas Nordborg

In 7774:

References #2202: Include information from parent items in list pages

Implemented nice formatting of parent item filtering in item list synchronization filters.

comment:11 Changed 3 months ago by Nicklas Nordborg

In 7775:

References #2202: Include information from parent items in list pages

Added '›' prefix in column headers to indicate a parent item column.

comment:12 Changed 3 months ago by Nicklas Nordborg

In 7776:

References #2202: Include information from parent items in list pages

Fixes an issue with incorrect caching in the transition from Physical Bioassay to Extract. We need to keep the extract chain that was collected from Raw/Derived? bioassay until we reach a known extract.

If we don't do this the Pool aliquot and Pool will be cached without context and the next time we have a Library from the same Pool, we will get the Library item we will get the cached Library item instead of the Library in the context.

comment:13 Changed 3 months ago by Nicklas Nordborg

In 7777:

References #2202: Include information from parent items in list pages

Display name of subtype instead of id after adding it to the selected columns.

comment:14 Changed 3 months ago by Nicklas Nordborg

In 7778:

References #2202: Include information from parent items in list pages

Change some styles and colors while data is lazy-loading to make the user feel that something is going on.

comment:15 Changed 3 months ago by Nicklas Nordborg

In 7779:

References #2202: Include information from parent items in list pages

Added support for other static properties than "Name".

comment:16 Changed 3 months ago by Nicklas Nordborg

In 7780:

References #2202: Include information from parent items in list pages

Improved column titles for parent items.

comment:17 Changed 3 months ago by Nicklas Nordborg

In 7781:

References #2202: Include information from parent items in list pages

Incorrect filter property when filtering on the name of a parent item.

comment:18 Changed 3 months ago by Nicklas Nordborg

In 7782:

References #2202: Include information from parent items in list pages

When a parent item column with a filter is hidden the filter must be removed, since it is not possible to get information about this hidden filter which may confuse the user.

comment:19 Changed 3 months ago by Nicklas Nordborg

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.