Skip to content

Commit

Permalink
Merge pull request #514 from will-moore/show_fileset_link
Browse files Browse the repository at this point in the history
Add support for ?show=fileset-123
  • Loading branch information
knabar authored Dec 19, 2023
2 parents 66a1c0c + f03849d commit 5ec437f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions omeroweb/webclient/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Show(object):
"well",
"tagset",
"roi",
"fileset",
)

# Regular expression which declares the format for a "path" used either
Expand Down Expand Up @@ -270,6 +271,16 @@ def _load_first_selected(self, first_obj, attributes):
first_selected = self._load_tag(attributes)
elif first_obj == "well":
first_selected = self._load_well(attributes)
elif first_obj == "fileset":
# Don't use getObjects() for fileset since it loads ALL file and images
params = omero.sys.ParametersI()
params.addId(attributes["id"])
params.page(0, 1)
query = "select img from Image img where img.fileset.id=:id order by img.id"
first_image = self.conn.getQueryService().findAllByQuery(
query, params, self.conn.SERVICE_OPTS
)[0]
first_selected = self.conn.getObject("Image", first_image.id.val)
else:
# All other objects can be loaded by type and attributes.
(first_selected,) = self.conn.getObjects(first_obj, attributes=attributes)
Expand Down Expand Up @@ -308,6 +319,8 @@ def _load_first_selected(self, first_obj, attributes):
if first_obj == "roi":
first_obj = "image"
first_selected = first_selected.getImage()
elif first_obj == "fileset":
first_obj = "image"

# Tree hierarchy open to first selected object.
self._initially_open = ["%s-%s" % (first_obj, first_selected.getId())]
Expand Down

0 comments on commit 5ec437f

Please sign in to comment.