Table Of Contents

Previous topic

omeroweb.webadmin.templatetags package

Next topic

omeroweb.webclient.controller package

This Page

omeroweb.webclient package

Submodules

omeroweb.webclient.custom_forms module

class omeroweb.webclient.custom_forms.AnnotationModelChoiceField(queryset, empty_label=u'---------', cache_choices=False, required=True, widget=None, label=None, initial=None, help_text=u'', to_field_name=None, *args, **kwargs)

Bases: django.forms.models.ModelChoiceField

_get_choices()
_set_choices(value)
choices
clean(value)
class omeroweb.webclient.custom_forms.AnnotationModelMultipleChoiceField(queryset, required=True, widget=<class 'django.forms.widgets.SelectMultiple'>, label=None, initial=None, help_text=None, *args, **kwargs)

Bases: omeroweb.webclient.custom_forms.AnnotationModelChoiceField

A MultipleChoiceField whose choices are a model QuerySet.

clean(value)
default_error_messages = {'invalid_choice': <django.utils.functional.__proxy__ object at 0x32615f50>, 'list': <django.utils.functional.__proxy__ object at 0x32615ed0>}
hidden_widget

alias of MultipleHiddenInput

class omeroweb.webclient.custom_forms.AnnotationQuerySetIterator(queryset, empty_label)

Bases: object

class omeroweb.webclient.custom_forms.MetadataModelChoiceField(queryset, empty_label=u'---------', cache_choices=False, required=True, widget=None, label=None, initial=None, help_text=u'', to_field_name=None, *args, **kwargs)

Bases: django.forms.models.ModelChoiceField

_get_choices()
_set_choices(value)
choices
clean(value)
class omeroweb.webclient.custom_forms.MetadataQuerySetIterator(queryset, empty_label)

Bases: object

class omeroweb.webclient.custom_forms.MultiEmailField(required=True, widget=None, label=None, initial=None, help_text=u'', error_messages=None, show_hidden_initial=False, validators=[], localize=False)

Bases: django.forms.fields.Field

clean(value)
is_valid_email(email)
class omeroweb.webclient.custom_forms.ObjectModelChoiceField(queryset, empty_label=u'---------', cache_choices=False, required=True, widget=None, label=None, initial=None, help_text=u'', to_field_name=None, *args, **kwargs)

Bases: django.forms.models.ModelChoiceField

_get_choices()
_set_choices(value)
choices
clean(value)
class omeroweb.webclient.custom_forms.ObjectModelMultipleChoiceField(queryset, required=True, widget=<class 'django.forms.widgets.SelectMultiple'>, label=None, initial=None, help_text=None, *args, **kwargs)

Bases: omeroweb.webclient.custom_forms.ObjectModelChoiceField

A MultipleChoiceField whose choices are a model QuerySet.

clean(value)
default_error_messages = {'invalid_choice': <django.utils.functional.__proxy__ object at 0x22d48190>, 'list': <django.utils.functional.__proxy__ object at 0x22d48110>}
hidden_widget

alias of MultipleHiddenInput

class omeroweb.webclient.custom_forms.ObjectQuerySetIterator(queryset, empty_label)

Bases: object

class omeroweb.webclient.custom_forms.UrlField(required=True, widget=None, label=None, initial=None, help_text=u'', error_messages=None, show_hidden_initial=False, validators=[], localize=False)

Bases: django.forms.fields.Field

clean(value)
is_valid_url(url)

omeroweb.webclient.decorators module

Decorators for use with the webclient application.

class omeroweb.webclient.decorators.login_required(ignore_login_fail=False, setGroupContext=False, login_redirect=None, **kwargs)

Bases: omeroweb.decorators.login_required

webclient specific extension of the OMERO.web login_required() decorator.

on_logged_in(request, conn)

Called whenever the users is successfully logged in.

on_not_logged_in(request, url, error=None)

This can be used to fail silently (not return 403, 500 etc. E.g. keepalive ping)

prepare_session(request)

Prepares various session variables.

class omeroweb.webclient.decorators.render_response

Bases: omeroweb.decorators.render_response

Subclass for adding additional data to the ‘context’ dict passed to templates

load_settings(request, context, conn)
prepare_context(request, context, *args, **kwargs)

This allows templates to access the current eventContext and user from the L{omero.gateway.BlitzGateway}. E.g. <h1>{{ ome.user.getFullName }}</h1> If these are not required by the template, then they will not need to be loaded by the Blitz Gateway. The results are cached by Blitz Gateway, so repeated calls have no additional cost. We also process some values from settings and add these to the context.

omeroweb.webclient.forms module

class omeroweb.webclient.forms.ActiveGroupForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.BaseAnnotationForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

This is the superclass of the various forms used for annotating single or multiple objects. All these forms use hidden fields to specify the object(s) currently being annotated.

base_fields = {}
media
class omeroweb.webclient.forms.BasketShareForm(*args, **kwargs)

Bases: omeroweb.webclient.forms.ShareForm

base_fields = {'message': <django.forms.fields.CharField object at 0x32642690>, 'expiration': <django.forms.fields.CharField object at 0x32642790>, 'enable': <django.forms.fields.BooleanField object at 0x32642810>}
media
class omeroweb.webclient.forms.CommentAnnotationForm(*args, **kwargs)

Bases: omeroweb.webclient.forms.BaseAnnotationForm

base_fields = {'comment': <django.forms.fields.CharField object at 0x32609290>}
media
class omeroweb.webclient.forms.ContainerDescriptionForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

base_fields = {'description': <django.forms.fields.CharField object at 0x32642c50>}
media
class omeroweb.webclient.forms.ContainerForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

base_fields = {'name': <django.forms.fields.CharField object at 0x32642910>, 'description': <django.forms.fields.CharField object at 0x32642a90>}
media
class omeroweb.webclient.forms.ContainerNameForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

base_fields = {'name': <django.forms.fields.CharField object at 0x32642b10>}
media
class omeroweb.webclient.forms.FilesAnnotationForm(*args, **kwargs)

Bases: omeroweb.webclient.forms.BaseAnnotationForm

base_fields = {'annotation_file': <django.forms.fields.FileField object at 0x32609110>}
media
class omeroweb.webclient.forms.GlobalSearchForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

base_fields = {'search_query': <django.forms.fields.CharField object at 0x326425d0>}
media
class omeroweb.webclient.forms.MetadataChannelForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataDetectorForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataDichroicForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataEnvironmentForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataFilterForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataLightSourceForm(*args, **kwargs)

Bases: django.forms.forms.Form

BOOLEAN_CHOICES = (('', '---------'), ('True', 'True'), ('False', 'False'))
base_fields = {}
media
class omeroweb.webclient.forms.MetadataMicroscopeForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataObjectiveForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.MetadataObjectiveSettingsForm(*args, **kwargs)

Bases: omeroweb.webclient.forms.MetadataObjectiveForm

BOOLEAN_CHOICES = (('', '---------'), ('True', 'True'), ('False', 'False'))
base_fields = {}
media
class omeroweb.webclient.forms.MetadataStageLabelForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.NewTagsAnnotationForm(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=None, empty_permitted=False)

Bases: django.forms.forms.Form

Helper form for new tags

base_fields = {'tag': <django.forms.fields.CharField object at 0x32642e90>, 'description': <django.forms.fields.CharField object at 0x32642f90>, 'tagset': <django.forms.fields.IntegerField object at 0x32609050>}
media
class omeroweb.webclient.forms.ShareForm(*args, **kwargs)

Bases: omeroweb.custom_forms.NonASCIIForm

base_fields = {'message': <django.forms.fields.CharField object at 0x32642690>, 'expiration': <django.forms.fields.CharField object at 0x32642790>, 'enable': <django.forms.fields.BooleanField object at 0x32642810>}
clean_expiration()
media
class omeroweb.webclient.forms.TagsAnnotationForm(*args, **kwargs)

Bases: omeroweb.webclient.forms.BaseAnnotationForm

Form for annotating one or more objects with existing Tags or New tags

base_fields = {'tags': <django.forms.fields.CharField object at 0x32642d10>}
clean_tags()
media
class omeroweb.webclient.forms.UsersForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
class omeroweb.webclient.forms.WellIndexForm(*args, **kwargs)

Bases: django.forms.forms.Form

base_fields = {}
media
omeroweb.webclient.forms.save_metadata(obj, name, options=False)
omeroweb.webclient.forms.set_widget_attrs(field, set_class=True)

omeroweb.webclient.show module

Generic functionality for handling particular links and “showing” objects in the OMERO.web tree view.

exception omeroweb.webclient.show.IncorrectMenuError(uri)

Bases: exceptions.Exception

Exception to signal that we are on the wrong menu.

class omeroweb.webclient.show.Show(conn, request, menu)

Bases: object

This object is used by most of the top-level pages. The “show” and “path” query strings are used by this object to both direct OMERO.web to the correct locations in the hierarchy and select the correct objects in that hierarchy.

PATH_REGEX = <_sre.SRE_Pattern object at 0x17a56f30>
SUPPORTED_OBJECT_TYPES = ('project', 'dataset', 'image', 'screen', 'plate', 'tag', 'acquisition', 'run', 'well', 'tagset')
TOP_LEVEL_PREFIXES = ('project', 'screen', 'tagset')
WELL_REGEX = <_sre.SRE_Pattern object at 0x1e72af00>
_add_if_supported(path)

Adds a path to the initially selected list if it is supported.

_find_first_selected()

Finds the first selected object.

_load_first_selected(first_obj, attributes)

Loads the first selected object from the server. Will raise L{IncorrectMenuError} if the initialized menu was incorrect for the loaded objects.

@param first_obj Type of the first selected object. @type first_obj String @param attributes Set of attributes to filter on. @type attributes L{dict}

_load_tag(attributes)

Loads a Tag based on a certain set of attributes from the server.

@param attributes Set of attributes to filter on. @type attributes L{dict}

_load_well(attributes)

Loads a Well based on a certain set of attributes from the server.

@param attributes Set of attributes to filter on. @type attributes L{dict}

first_selected

Retrieves the first selected object. The first time this method is invoked on the instance the actual retrieval is performed. All other invocations retrieve the same instance without server interaction. Will raise L{IncorrectMenuError} if the initialized menu was incorrect for the loaded objects.

get_well_row_column(well)

Retrieves a tuple of row and column as L{int} for a given Well name (“A1” or “1A”) string.

@param well Well name string to retrieve the row and column tuple for. @type well L{str}

initially_open

Retrieves the nodes of the tree that will be initially open based on the nodes that are initially selected. Should not be invoked until after first retrieval of the L{Show.first_selected} property.

initially_open_owner

Retrieves the owner of the node closest to the root of the tree from the list of initially open nodes. Should not be invoked until after first retrieval of the L{Show.first_selected} property.

initially_select

Retrieves the list of “paths” (“type-id”) we have been requested to show/select in the user interface. May be different than we were first initialised with due to certain nodes of the Screen-Plate-Well hierachy not being present in the tree. Should not be invoked until after first retrieval of the L{Show.first_selected} property.

omeroweb.webclient.show.get_image_ids(conn, datasetId=None, groupId=-1, ownerId=None)

Retrieves a list of all image IDs in a Dataset or Orphaned (with owner specified by ownerId). The groupId can be specified as needed, particuarly when querying orphaned images.

omeroweb.webclient.show.paths_to_object(conn, experimenter_id=None, project_id=None, dataset_id=None, image_id=None, screen_id=None, plate_id=None, acquisition_id=None, well_id=None, group_id=None, page_size=None)

Retrieves the parents of an object (E.g. P/D/I for image) as a list of paths. Lowest object in hierarchy is found by checking parameter ids in order: image->dataset->project->well->acquisition->plate->screen->experimenter If object has multiple paths, these can also be filtered by parent_ids. E.g. paths to image_id filtered by dataset_id.

If image is in a Dataset or Orphaned collection that is paginated (imageCount > page_size) then we include ‘childPage’, ‘childCount’ and ‘childIndex’ in the dataset or orphaned dict. The page_size default is settings.PAGE (omero.web.page_size)

Note on wells: Selecting a ‘well’ is really for selecting well_sample paths if a well is specified on its own, we return all the well_sample paths than match

omeroweb.webclient.show.paths_to_tag(conn, experimenter_id=None, tagset_id=None, tag_id=None)

Finds tag for tag_id, also looks for parent tagset in path. If tag_id and tagset_id are given, only return paths that have both. If no tagset/tag paths are found, simply look for tags with tag_id.

omeroweb.webclient.tree module

Helper functions for views that handle object trees

omeroweb.webclient.tree._marshal_annotation(conn, annotation, link=None)

Given an OMERO annotation, marshals it into a dictionary. @param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Dataset row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_dataset(conn, row)

Given a Dataset row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • child_count (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Dataset row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_date(time)
omeroweb.webclient.tree._marshal_discussion(conn, row)

Given a Discussion row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • details.owner.id (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Discussion row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_exp_obj(experimenter)
omeroweb.webclient.tree._marshal_experimenter(conn, row)

Given an Experimenter row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • omeName (rstring)
  • firstName (rstring)
  • lastName (rstring)
  • email (rstring)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Experimenter row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_group(conn, row)

Given an ExperimenterGroup row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • permissions (dict)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Group row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_image(conn, row, row_pixels=None, share_id=None, date=None, acqDate=None, thumbVersion=None)

Given an Image row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • fileset_id (rlong)
May also take a row_pixels (list) if X,Y,Z dimensions are loaded
  • pixels.sizeX (rlong)
  • pixels.sizeY (rlong)
  • pixels.sizeZ (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Image row to marshal @type row L{list} @param row_pixels The Image row pixels data to marshal @type row_pixels L{list}

omeroweb.webclient.tree._marshal_image_deleted(conn, image_id)

Given an Image id and marshals it into a dictionary.

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param image_id The image id to marshal @type image_id L{long}

omeroweb.webclient.tree._marshal_plate(conn, row)

Given a Plate row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • child_count (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Plate row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_plate_acquisition(conn, row)

Given a PlateAcquisition row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • startTime (rtime)
  • endTime (rtime)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The PlateAcquisition row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_project(conn, row)

Given a Project row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • child_count (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Project row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_screen(conn, row)

Given a Screen row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • name (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • child_count (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Screen row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_share(conn, row)

Given a Share row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • details.owner.id (rlong)
  • child_count (rlong)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Share row to marshal @type row L{list}

omeroweb.webclient.tree._marshal_tag(conn, row)

Given a Tag row (list) marshals it into a dictionary. Order and type of columns in row is:

  • id (rlong)
  • text_value (rstring)
  • description (rstring)
  • details.owner.id (rlong)
  • details.permissions (dict)
  • namespace (rstring)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param row The Tag row to marshal @type row L{list}

omeroweb.webclient.tree.build_clause(components, name='', join=', ')

Build a string from a list of components. This is to simplify building where clauses in particular that may optionally have zero, one or more parts

omeroweb.webclient.tree.init_params(group_id, page, limit)
omeroweb.webclient.tree.marshal_annotations(conn, project_ids=None, dataset_ids=None, image_ids=None, screen_ids=None, plate_ids=None, run_ids=None, ann_type=None, group_id=-1, page=1, limit=200)
omeroweb.webclient.tree.marshal_datasets(conn, project_id=None, orphaned=False, group_id=-1, experimenter_id=-1, page=1, limit=200)

Marshals datasets

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param project_id The Project ID to filter by or None to not filter by a specific project. defaults to None @type project_id L{long} @param orphaned If this is to filter by orphaned data. Overridden by project_id. defaults to False @type orphaned Boolean @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_discussions(conn, member_id=-1, owner_id=-1, page=1, limit=200)

Marshal discussion for a given user.

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param member_id The Experimenter (user) ID membership to filter by @type member_id L{long} @param owner_id The Experimenter (user) ID ownership to filter by @type owner_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_experimenter(conn, experimenter_id)

Marshals experimenter.

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param experimenter_id The Experimenter ID to get details for @type experimenter_id L{long}

omeroweb.webclient.tree.marshal_experimenters(conn, group_id=-1, page=1, limit=200)

Marshals experimenters, possibly filtered by group.

To make this consistent with the other tree.py functions this will default to restricting the results by the calling experimenters group membership. e.g. if user is in groupA and groupB, then users from groupA and groupB will be returned.

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_groups(conn, member_id=-1, page=1, limit=200)

Marshals groups

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param member_id The ID of the experimenter to filter by or -1 for all defaults to -1 @type member_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_images(conn, dataset_id=None, orphaned=False, share_id=None, load_pixels=False, group_id=-1, experimenter_id=-1, page=1, date=False, thumb_version=False, limit=200)

Marshals images

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param dataset_id The Dataset ID to filter by or None to not filter by a specific dataset. defaults to None @type dataset_id L{long} @param orphaned If this is to filter by orphaned data. Overridden by dataset_id. defaults to False @type orphaned Boolean @param share_id The Share ID to filter by or None to not filter by a specific share. defaults to None @type share_id L{long} @param load_pixels Whether to load the X,Y,Z dimensions @type load_pixels Boolean @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_orphaned(conn, group_id=-1, experimenter_id=-1, page=1, limit=200)

Marshals orphaned containers

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_plate_acquisitions(conn, plate_id, page=1, limit=200)

Marshals plate acquisitions (‘runs’)

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param plate_id The Plate ID to filter by @type plate_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_plates(conn, screen_id=None, orphaned=False, group_id=-1, experimenter_id=-1, page=1, limit=200)

Marshals plates

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param screen_id The Screen ID to filter by or None to not filter by a specific screen. defaults to None @type screen_id L{long} @param orphaned If this is to filter by orphaned data. Overridden by dataset_id. defaults to False @type orphaned Boolean @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_projects(conn, group_id=-1, experimenter_id=-1, page=1, limit=200)

Marshals projects

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_screens(conn, group_id=-1, experimenter_id=-1, page=1, limit=200)

Marshals screens

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_shares(conn, member_id=-1, owner_id=-1, page=1, limit=200)

Marshal shares for a given user.

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param member_id The Experimenter (user) ID membership to filter by @type member_id L{long} @param owner_id The Experimenter (user) ID ownership to filter by @type owner_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_tagged(conn, tag_id, group_id=-1, experimenter_id=-1, page=1, load_pixels=False, date=False, limit=200)

Marshals tagged data

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param tag_id The tag ID to filter by @type tag_id L{long} @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.marshal_tags(conn, tag_id=None, group_id=-1, experimenter_id=-1, page=1, orphaned=False, limit=200)

Marshals tags

@param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway} @param tag_id The tag ID to filter by @type tag_id L{long} defaults to None @param group_id The Group ID to filter by or -1 for all groups, defaults to -1 @type group_id L{long} @param experimenter_id The Experimenter (user) ID to filter by or -1 for all experimenters @type experimenter_id L{long} @param page Page number of results to get. None or 0 for no paging defaults to 1 @type page L{long} @param limit The limit of results per page to get defaults to the value set in settings.PAGE @type page L{long}

omeroweb.webclient.tree.parse_permissions_css(permissions, ownerid, conn)

Parse numeric permissions into a string of space separated CSS classes.

@param permissions Permissions to parse @type permissions L{omero.rtypes.rmap} @param ownerid Owner Id for the object having Permissions @type ownerId Integer @param conn OMERO gateway. @type conn L{omero.gateway.BlitzGateway}

omeroweb.webclient.urls module

omeroweb.webclient.views module

A view functions is simply a Python function that takes a Web request and returns a Web response. This response can be the HTML contents of a Web page, or a redirect, or the 404 and 500 error, or an XML document, or an image... or anything.

Deletes links between objects specified by a json blob in the request body. e.g. {“dataset”:{“10”:{“image”:[1,2,3]}}}

omeroweb.webclient.views._api_links_POST(conn, json_data, **kwargs)

Creates links between objects specified by a json blob in the request body. e.g. {“dataset”:{“10”:{“image”:[1,2,3]}}} When creating a link, fails silently if ValidationException (E.g. adding an image to a Dataset that already has that image).

omeroweb.webclient.views.activities(request, *args, **kwargs)

This refreshes callback handles (delete, scripts, chgrp etc) and provides html to update Activities window & Progressbar. The returned html contains details for ALL callbacks in web session, regardless of their status. We also add counts of jobs, failures and ‘in progress’ to update status bar.

omeroweb.webclient.views.activities_update(request, *args, **kwargs)

If the above ‘action’ == ‘clean’ then we clear jobs from request.session[‘callback’] either a single job (if ‘jobKey’ is specified in POST) or all jobs (apart from those in progress)

omeroweb.webclient.views.annotate_comment(request, *args, **kwargs)

Handle adding Comments to one or more objects Unbound instance of Comment form not available. If the form has been submitted, a bound instance of the form is created using request.POST

omeroweb.webclient.views.annotate_file(request, *args, **kwargs)

On ‘POST’, This handles attaching an existing file-annotation(s) and/or upload of a new file to one or more objects Otherwise it generates the form for choosing file-annotations & local files.

omeroweb.webclient.views.annotate_map(request, *args, **kwargs)

Handle adding Map Annotations to one or more objects POST data “mapAnnotation” should be list of [‘key’:’value’] pairs.

omeroweb.webclient.views.annotate_rating(request, *args, **kwargs)

Handle adding Rating to one or more objects

omeroweb.webclient.views.annotate_tags(request, *args, **kwargs)

This handles creation AND submission of Tags form, adding new AND/OR existing tags to one or more objects

omeroweb.webclient.views.api_annotations(request, *args, **kwargs)
omeroweb.webclient.views.api_container_list(request, *args, **kwargs)
omeroweb.webclient.views.api_dataset_list(request, *args, **kwargs)
omeroweb.webclient.views.api_experimenter_detail(request, *args, **kwargs)
omeroweb.webclient.views.api_experimenter_list(request, *args, **kwargs)
omeroweb.webclient.views.api_group_list(request, *args, **kwargs)
omeroweb.webclient.views.api_image_list(request, *args, **kwargs)

Get a list of images Specifiying dataset_id will return only images in that dataset Specifying experimenter_id will return orpahned images for that user The orphaned images will include images which belong to the user but are not in any dataset belonging to the user Currently specifying both, experimenter_id will be ignored

Entry point for the api_links methods. We delegate depending on request method to create or delete links between objects.

omeroweb.webclient.views.api_paths_to_object(request, *args, **kwargs)

This finds the paths to objects in the hierarchy. It returns only the path, not the object hierarchy itself.

An example usage is for the ‘show’ functionality Example to go to the image with id 1 somewhere in the tree. http://localhost:8000/webclient/?show=image-1

This method can tell the webclient exactly what needs to be dynamically loaded to display this in the jstree.

omeroweb.webclient.views.api_plate_acquisition_list(request, *args, **kwargs)
omeroweb.webclient.views.api_plate_list(request, *args, **kwargs)
omeroweb.webclient.views.api_share_list(request, *args, **kwargs)
omeroweb.webclient.views.api_tags_and_tagged_list(request, *args, **kwargs)
omeroweb.webclient.views.api_tags_and_tagged_list_DELETE(request, conn=None, **kwargs)

Delete the listed tags by ids

omeroweb.webclient.views.api_tags_and_tagged_list_GET(request, conn=None, **kwargs)

Get a list of tags Specifiying tag_id will return any sub-tags, sub-tagsets and objects tagged with that id If no tagset_id is specifed it will return tags which have no parent

omeroweb.webclient.views.avatar(request, *args, **kwargs)

Returns the experimenter’s photo

omeroweb.webclient.views.batch_annotate(request, *args, **kwargs)

This page gives a form for batch annotation. Local File form and Comment form are loaded. Other forms are loaded via AJAX

omeroweb.webclient.views.change_active_group(request, *args, **kwargs)

Simply changes the request.session[‘active_group’] which is then used by the @login_required decorator to configure conn for any group-based queries. Finally this redirects to the ‘url’.

omeroweb.webclient.views.chgrp(request, *args, **kwargs)

Moves data to a new group, using the chgrp queue. Handles submission of chgrp form: all data in POST. Adds the callback handle to the request.session[‘callback’][‘jobId’]

omeroweb.webclient.views.chgrpDryRun(request, *args, **kwargs)

This is just used internally by api_link DELETE below

omeroweb.webclient.views.custom_index(request, *args, **kwargs)
omeroweb.webclient.views.download_annotation(request, *args, **kwargs)

Returns the file annotation as an http response for download

omeroweb.webclient.views.download_orig_metadata(request, *args, **kwargs)

Downloads the ‘Original Metadata’ as a text file

omeroweb.webclient.views.download_placeholder(request, *args, **kwargs)

Page displays a simple “Preparing download...” message and redirects to the ‘url’. We construct the url and query string from request: ‘url’ and ‘ids’.

omeroweb.webclient.views.edit_channel_names(request, *args, **kwargs)

Edit and save channel names

omeroweb.webclient.views.figure_script(request, *args, **kwargs)

Show a UI for running figure scripts

omeroweb.webclient.views.fileset_check(request, *args, **kwargs)

Check whether Images / Datasets etc contain partial Multi-image filesets. Used by chgrp or delete dialogs to test whether we can perform this ‘action’.

omeroweb.webclient.views.getAllObjects(conn, project_ids, dataset_ids, image_ids, screen_ids, plate_ids, experimenter_id)

Given a list of containers and images, calculate all the descendants and necessary siblings (for any filesets)

omeroweb.webclient.views.getIds(request)

Used by forms to indicate the currently selected objects prepared above

omeroweb.webclient.views.getObjectUrl(conn, obj)

This provides a url to browse to the specified omero.model.ObjectI P/D/I, S/P, FileAnnotation etc. used to display results from the scripting service E.g webclient/userdata/?path=image-12601 If the object is a file annotation, try to browse to the parent P/D/I

omeroweb.webclient.views.getObjects(request, conn=None)

Prepare objects for use in the annotation forms. These objects are required by the form superclass to populate hidden fields, so we know what we’re annotating on submission

omeroweb.webclient.views.get_bool_or_default(request, name, default)

Retrieves a parameter from the request. If the parameter is not present the default is returned

This does not catch exceptions as it makes sense to throw exceptions if the arguments provided do not pass basic type validation

omeroweb.webclient.views.get_long_or_default(request, name, default)

Retrieves a parameter from the request. If the parameter is not present the default is returned

This does not catch exceptions as it makes sense to throw exceptions if the arguments provided do not pass basic type validation

omeroweb.webclient.views.get_longs(request, name)

Retrieves parameters from the request. If the parameters are not present an empty list is returned

This does not catch exceptions as it makes sense to throw exceptions if the arguments provided do not pass basic type validation

This is just used internally by api_link DELETE below

omeroweb.webclient.views.get_original_file(request, *args, **kwargs)

Returns the specified original file as an http response. Used for displaying text or png/jpeg etc files in browser

omeroweb.webclient.views.group_user_content(request, *args, **kwargs)

Loads html content of the Groups/Users drop-down menu on main webclient pages. Url should be supplied in request, as target for redirect after switching group.

omeroweb.webclient.views.image_as_map(request, *args, **kwargs)

Converts OMERO image into mrc.map file (using tiltpicker utils) and returns the file

omeroweb.webclient.views.image_viewer(request, *args, **kwargs)

Delegates to webgateway, using share connection if appropriate

omeroweb.webclient.views.keepalive_ping(request, *args, **kwargs)

Keeps the OMERO session alive by pinging the server

omeroweb.webclient.views.list_scripts(request, *args, **kwargs)

List the available scripts - Just officical scripts for now

omeroweb.webclient.views.load_calendar(request, *args, **kwargs)

Loads the calendar which is displayed in the left panel of the history page. Shows current month by default. Filter by experimenter

omeroweb.webclient.views.load_chgrp_groups(request, *args, **kwargs)

Get the potential groups we can move selected data to. These will be groups that the owner(s) of selected objects is a member of. Objects are specified by query string like: ?Image=1,2&Dataset=3 If no selected objects are specified, simply list the groups that the current user is a member of. Groups list will exclude the ‘current’ group context.

omeroweb.webclient.views.load_chgrp_target(request, *args, **kwargs)

Loads a tree for user to pick target Project, Dataset or Screen

omeroweb.webclient.views.load_data(request, *args, **kwargs)

This loads data for the center panel, via AJAX calls. Used for Datasets, Plates & Orphaned Images.

omeroweb.webclient.views.load_data_by_tag(request, *args, **kwargs)

Loads data for the center panel. Either get the P/D/I etc under tags, or the images etc under a tagged Dataset or Project. @param o_type ‘tag’ or ‘project’, ‘dataset’.

omeroweb.webclient.views.load_history(request, *args, **kwargs)

The data for a particular date that is loaded into the center panel

omeroweb.webclient.views.load_metadata_acquisition(request, *args, **kwargs)

The acquisition tab of the right-hand panel. Only loaded for images. TODO: urls regex should make sure that c_type is only ‘image’ OR ‘well’

omeroweb.webclient.views.load_metadata_details(request, *args, **kwargs)

This page is the right-hand panel ‘general metadata’, first tab only. Shown for Projects, Datasets, Images, Screens, Plates, Wells, Tags etc. The data and annotations are loaded by the manager. Display of appropriate data is handled by the template.

omeroweb.webclient.views.load_metadata_hierarchy(request, *args, **kwargs)

This loads the ancestors of the specified object and displays them in a static tree. Used by an AJAX call from the metadata_general panel.

omeroweb.webclient.views.load_metadata_preview(request, *args, **kwargs)

This is the image ‘Preview’ tab for the right-hand panel.

omeroweb.webclient.views.load_original_metadata(request, *args, **kwargs)
omeroweb.webclient.views.load_public(request, *args, **kwargs)

Loads data for the center panel in the ‘public’ main page.

omeroweb.webclient.views.load_searching(request, *args, **kwargs)

Handles AJAX calls to search

omeroweb.webclient.views.load_template(request, *args, **kwargs)

This view handles most of the top-level pages, as specified by ‘menu’ E.g. userdata, usertags, history, search etc. Query string ‘path’ that specifies an object to display in the data tree is parsed. We also prepare the list of users in the current group, for the switch-user form. Change-group form is also prepared.

omeroweb.webclient.views.login(request)

Webclient Login - Also can be used by other Apps to log in to OMERO. Uses the ‘server’ id from request to lookup the server-id (index), host and port from settings. E.g. “localhost”, 4064. Stores these details, along with username, password etc in the request.session. Resets other data parameters in the request.session. Tries to get connection to OMERO and if this works, then we are redirected to the ‘index’ page or url specified in REQUEST. If we can’t connect, the login page is returned with appropriate error messages.

omeroweb.webclient.views.logout(request, *args, **kwargs)

Logout of the session and redirects to the homepage (will redirect to login first)

omeroweb.webclient.views.manage_action_containers(request, *args, **kwargs)

Handles many different actions on various objects.

@param action: “addnewcontainer”, (creates a new Project, Dataset,
Screen), “editname”, “savename”, “editdescription”, “savedescription”, (used as GET and POST for in-line editing), “removefromshare”, (tree P/D/I moving etc) “delete”, “deletemany” (delete objects)
@param o_type: “dataset”, “project”, “image”, “screen”, “plate”,
“acquisition”, “well”,”comment”, “file”, “tag”, “tagset”,”share”, “sharecomment”
omeroweb.webclient.views.marshal_tagging_form_data(request, *args, **kwargs)

Provides json data to ome.tagging_form.js

omeroweb.webclient.views.ome_tiff_info(request, *args, **kwargs)

Query to see if we have an OME-TIFF attached to the image (assume only 1, since Batch Image Export will delete old ones)

omeroweb.webclient.views.ome_tiff_script(request, *args, **kwargs)

Uses the scripting service (Batch Image Export script) to generate OME-TIFF for an image and attach this as a file annotation to the image. Script will show up in the ‘Activities’ for users to monitor and download result etc.

omeroweb.webclient.views.run_script(request, conn, sId, inputMap, scriptName='Script')

Starts running a script, adding details to the request.session so that it shows up in the webclient Activities panel and results are available there etc.

omeroweb.webclient.views.script_run(request, *args, **kwargs)

Runs a script using values in a POST

omeroweb.webclient.views.script_ui(request, *args, **kwargs)

Generates an html form for the parameters of a defined script.

omeroweb.webclient.views.switch_active_group(request, active_group=None)

Simply changes the request.session[‘active_group’] which is then used by the @login_required decorator to configure conn for any group-based queries.

omeroweb.webclient.views.update_callback(request, cbString, **kwargs)

Update a callback handle with key/value pairs

omeroweb.webclient.webclient_gateway module

class omeroweb.webclient.webclient_gateway.DatasetWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._DatasetWrapper

omero_model_DatasetI class wrapper overwrite omero.gateway.DatasetWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
class omeroweb.webclient.webclient_gateway.EventLogWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omero.gateway.BlitzObjectWrapper

omero_model_EventLogI class wrapper extends omero.gateway.BlitzObjectWrapper.

class omeroweb.webclient.webclient_gateway.ExperimenterGroupWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._ExperimenterGroupWrapper

omero_model_ExperimenterGroupI class wrapper overwrite omero.gateway.ExperimenterGroupWrapper and extend OmeroWebObjectWrapper.

getMembers(excluded_omename=[], excluded_ids=[])
getOwners()
getOwnersNames()
isEditable()
isLocked()
isOwner()

Returns True if current user is Owner of this group

loadLeadersAndMembers()

Returns lists of ‘leaders’ and ‘members’ of the specified group (default is current group) as a dict with those keys.

@return: {‘leaders’: list L{ExperimenterWrapper},
‘colleagues’: list L{ExperimenterWrapper}}

@rtype: dict

class omeroweb.webclient.webclient_gateway.ExperimenterWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._ExperimenterWrapper

omero_model_ExperimenterI class wrapper overwrite omero.gateway.ExperimenterWrapper and extend OmeroWebObjectWrapper.

getDefaultGroup()
getOtherGroups(excluded_names=('user', 'guest'), excluded_ids=[])
isEditable()
isLdapUser()

Return DN of the specific experimenter if uses LDAP authentication (has set dn on password table) or None. @param eid: experimenter ID @type eid: L{Long} @return: Distinguished Name @rtype: String

ldapUser = None
class omeroweb.webclient.webclient_gateway.ImageWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._ImageWrapper

omero_model_ImageI class wrapper overwrite omero.gateway.ImageWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
formatPixelSizeWithUnits(size)

Formats the response for methods above. Returns [value, unitSymbol] If the unit is MICROMETER in database (default), we convert to more appropriate units & value

getChannels(*args, **kwargs)

This override standard omero.gateway.ImageWrapper.getChannels and catch exceptions.

getFilesetImages()

Returns a list of the ‘sibling’ images (including this one) that belong to this image’s Fileset. Sorted by name. If Image has no Fileset, return an empty list.

@rtype: List of {ImageWrapper}

getInplaceImportCmd()

Returns the command used to do import transfer for this image, E.g. ‘ln’, or empty string if not in-place imported.

getPixelSizeUnits()

We use the pixelSizeX to find the appropriate units. By default, we get the actual size in Microns, then use the lengthunit filter to pick the most suitable size (same logic is used for doing the length conversions). However, if unit can’t be converted, then we just return the current unit’s symbol.

getPixelSizeXMicrons()

Helper for calling getPixelSizeX(units=”MICROMETER”) in templates

getPixelSizeXWithUnits()

Returns [value, unitSymbol] If the unit is MICROMETER in database (default), we convert to more appropriate units & value

getPixelSizeYMicrons()

Helper for calling getPixelSizeX(units=”MICROMETER”) in templates

getPixelSizeYWithUnits()

Returns [value, unitSymbol] If the unit is MICROMETER in database (default), we convert to more appropriate units & value

getPixelSizeZMicrons()

Helper for calling getPixelSizeX(units=”MICROMETER”) in templates

getPixelSizeZWithUnits()

Returns [value, unitSymbol] If the unit is MICROMETER in database (default), we convert to more appropriate units & value

showOriginalFilePaths()

This determines whether we want to show the paths of Original Imported Files.

class omeroweb.webclient.webclient_gateway.OmeroWebGateway(*args, **kwargs)

Bases: omero.gateway._BlitzGateway

addComment(host, share_id, comment)
changeActiveGroup(gid)

Every time session is created default group becomes active group and is loaded with the security for the current user and thread. Public data has to be created in the context of the group where user, who would like to look at these data, is a member of. Public data can be only visible by the member of group and owners.

@param gid: New active group ID @type gid: Long

@return: Boolean

changeMyPassword(password, old_password)

Change the password for the current user by passing the old password.

@param password Must pass validation in the security
sub-system.

@type password String @param old_password Old password @type old_password String @return None or error message if password could not be

changed

@rtype String

changeUserPassword(omeName, password, my_password)

Change the password for the a given user.

@param omeName Experimetner omename @type omeName String @param password Must pass validation in the security sub-system. @type password String @param my_password Must pass validation in the security sub-system. @type my_password String

checkEmail(email, old_email=None)
checkGroupName(name, old_name=None)
checkOmeName(ome_name, old_omeName=None)
chgrpDryRun(targetObjects, group_id)

Submits a ‘dryRun’ chgrp to test for links that would be broken. Returns a handle.

Parameters:
  • targetObjects – Dict of dtype: [ids]. E.g. {‘Dataset’: [1,2]}
  • group_id – The group to move the data to.
countDataByPeriod(start, end, eid, otype=None)

Counts given data objects by the given period of time controlled by the security system.

@param start Starting data @type start Long @param end Finishing data @type end Long @param otype Data type: Project, Dataset, Image @type otype String @return: Counter @rtype: Long

countOrphans(obj_type, eid=None)
createContainer(dtype, name, description=None)

Creates new Project, Dataset or Screen and returns ID

createDataset(name, description=None, img_ids=None)

Creates a Dataset and adds images if img_ids is specified. Returns the new Dataset ID.

createExperimenter(omeName, firstName, lastName, email, isAdmin, isActive, defaultGroup, otherGroups, password, middleName=None, institution=None)

Create and return a new user in the given groups with password. @param omeName A new username. @type omeName String @param firstName A new first name. @type firstName String @param lastName A new last name. @type lastName String @param email A new email. @type email String @param isAdmin An Admin permission. @type isAdmin Boolean @param isActive Active user (user can log in). @type isActive Boolean @param defaultGroup Instance of ExperimenterGroup selected as a first

active group.

@type defaultGroup ExperimenterGroupI @param otherGroups List of ExperimenterGroup instances. Can be empty. @type otherGroups L{ExperimenterGroupI} @param password Must pass validation in the security sub-system. @type password String @param middleName A middle name. @type middleName String @param institution An institution. @type institution String @return ID of the newly created Experimenter Not null. @rtype Long

createGroup(name, permissions, owners=[], description=None)

Create and return a new group with the given owners.

@param group A new ExperimenterGroup instance. @type group ExperimenterGroupI @param owners List of Experimenter instances. Can be empty. @type owners L{ExperimenterI} @param permissions Permissions instances. @type permissions L{PermissionsI} @return ID of the newly created ExperimenterGroup Not

null.

@rtype Long

createProject(name, description=None)

Creates new Project and returns ID

createScreen(name, description=None)

Creates new Screen and returns ID

createShare(host, images, message, members, enable, expiration=None)
createTag(name, description=None)

Creates new Tag and returns ID

createTagset(name, description=None)

Creates new Tag Set and returns ID

cropExperimenterPhoto(box, oid=None)

Crop File annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO) linked to the given user ID. If user id not set, owned by the current user. New dimensions are defined by squer positions box = (x1,y1,x2,y2)

@param box tuple of new square positions @type box Tuple @param oid experimenter ID @type oid Long

deleteExperimenterPhoto(oid=None)
findTag(name, desc=None)

Retrieves Tag by given Name and description

@param name name of tag @type name String @param desc description of tag @type desc String @return: TagAnnotation @rtype: AnnotationWrapper

findWellInPlate(plate_name, row, column)
getAllGuests(share_id)

Get the email addresses for all share guests.

@param share_id: share ID @type share_id: Long @return: List of e-mail addresses @rtype: List of Strings

getAllMembers(share_id)

Get all {@link Experimenter users} who are a member of the share.

@param share_id: share ID @type share_id: Long @return: Members of share @rtype: L{ExperimenterWrapper} generator

getAllUsers(share_id)

Get a single set containing the login names of the users as well email addresses for guests.

@param share_id: share ID @type share_id: Long @return: List of usernames and e-mail addresses @rtype: List of Strings

getCollectionCount(parent, child, ids)

Counts the number of members in a collection for a given object.

@param parent The fully-qualified classname of the object to be
tested

@type parent String @param child Name of the property on that class, omitting

getters and setters.

@type child String @param ids Set of Longs, the ids of the objects to test @type ids L{Long} @return A map from id integer to count integer @rtype L{(Long, Long)}

getCommentCount(share_ids)

Returns a map from share id to comment count.

@param share_ids: List of IDs @type share_ids: List of Longs @return: Dict of shareId: comment-count @rtype: Dict of long: long

getComments(share_id)

Looks up all comments which belong to the share, wrapped in object wrapper

@param share_id: share ID @type share_id: Long @return: Share comments @rtype: L{AnnotationWrapper} generator

getContents(share_id)

Looks up all items belonging to the share, wrapped in object wrapper

@param share_id: share ID @type share_id: Long @return: Share contents @rtype: L{omero.gateway.BlitzObjectWrapper} generator

getDataByPeriod(start, end, eid, otype=None, page=None)

Retrieve given data objects by the given period of time controlled by the security system.

@param start Starting data @type start Long @param end Finishing data @type end Long @param otype Data type: Project, Dataset, Image @type otype String @return: Map of project, dataset and image lists @rtype: Map

getDropdownMenuSettings()

** Deprecated ** Use BlitzGateway.getClientSettings().

getEmailSettings()

Retrieves a configuration value “omero.mail.config” from the backend store.

@return: String

getEventsByPeriod(start, end, eid)

Retrieve event log objects by the given period of time controlled by the security system.

@param start Starting data @type start Long @param end Finishing data @type end Long @return: List of event logs @rtype: List

getExperimenterDefaultPhoto()

If file annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO) is not linked to experimenter this method generate default picture of the person.

@return Data from the image. @rtype String

getExperimenterPhoto(oid=None)

Get File annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO) linked to the given user ID. If user id not set, owned by the current user.

@param oid experimenter ID @type oid Long @return Data from the image. @rtype String

getExperimenterPhotoSize(oid=None)

Get size of File annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO) linked to the given user ID. If user id not set, owned by the current user.

@param oid experimenter ID @type oid Long @return Tuple including dimention and size of the file @rtype Tuple

getExperimenters()

Return all experimenters apart from current user.

@return: Generator yielding experimetners list @rtype: L{ExperimenterWrapper} generator

getFileFormat(format)

Get file annotation format for the given value.

@return Omero File format @rtype String

getLdapAuthExperimenter(eid)

Return DN of the specific experimenter if uses LDAP authentication (has set dn on password table) or None.

@param eid: experimenter ID @type eid: L{Long} @return: Distinguished Name @rtype: String

getMemberCount(share_ids)

Returns a map from share id to the count of total members (including the owner). This is represented by ome.model.meta.ShareMember links.

@param share_ids: List of IDs @type share_ids: List of Longs @return: Dict of shareId: member-count @rtype: Dict of long: long

getMemberShares()

Gets all shares where current user is a member.

@return: Shares that user is a member of @rtype: L{ShareWrapper} generator

getOrphanedContainerSettings()

** Deprecated ** Use BlitzGateway.getClientSettings().

getOwnShares()

Gets all owned shares for the current user.

@return: Shares that user owns @rtype: L{ShareWrapper} generator

getServerVersion()

Retrieves a configuration value “omero.version” from the backend store.

@return: String

getShare(oid)

Gets share for the given share id.

@param oid: Share ID. @type oid: Long @return: ShareWrapper or None @rtype: L{ShareWrapper}

getShareId()

Returns active share id .

@return: Share ID @rtype: Long

getTagCount(eid=None)
getUpgradesUrl()

Retrieves a configuration value “omero.upgrades.url” from the backend store.

@return: String

hasExperimenterPhoto(oid=None)

Check if File annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO) is linked to the given user ID. If user id not set, owned by the current user.

@param oid experimenter ID @type oid Long @return True or False @rtype Boolean

isAnythingCreated()

Checks if any of the experimenter was created before

@return: Boolean

listImagesInDataset(oid, eid=None, page=None, load_pixels=False)

List Images in the given Dataset. Optinally filter by experimenter ‘eid’

@param eid: experimenter id @type eid: Long @param page: page number @type page: Long @return: Generator yielding Images @rtype: L{ImageWrapper} generator

listLdapAuthExperimenters()

Lists all IDs of experimenters who are authenticated by LDAP (has set dn on password table).

@return: List of experimetner IDs @rtype: L{Dict of String: Long}

listTags(eid=None)
listTagsRecursive(eid=None, offset=None, limit=1000)

Returns a two-element tuple: * A list of tags, where each tag is a list with the following

elements: 0: id 1: description 2: text 3: owner id 4: list of child tag ids (possibly empty), or 0 if this is not a tag

set
  • A dictionary of user ids mapped to user names
regroupFilesets(dsIds, fsIds)

For each Fileset, make sure all the Images are in the same Dataset as each other. We choose a ‘target’ Dataset that already has one of the Fileset Images in it, and is in the dsIds list. This method is used when preparing to chgrp the specified datasets

removeImage(share_id, image_id)
saveAndReturnFile(binary, oFile_id)

Provide method for directly updating a file object and return binary. Assumes that the checksum algorithm used for file integrity verification is SHA-1.

@param binary Binary. Not null. @type binary String @param oFile_id File Id in order to manage the state of the

service. Not null.

@type oFile_id Long @return Shallow copy of file.

saveAndReturnId(obj)

Provide method for directly updating object graphs and return ID. Act recursively on the entire object graph, replacing placeholders and details where necessary, and then “merging” the final graph. This means that the objects that are passed into methods are copied over to new instances which are then returned. The original objects should be discarded.

@param obj An entity or an unloaded reference to an entity. Not
null.

@type obj ObjectI @return ID of saved object @rtype Long

saveAndReturnObject(obj)

Provide method for directly updating object graphs and return it. Act recursively on the entire object graph, replacing placeholders and details where necessary, and then “merging” the final graph. This means that the objects that are passed into methods are copied over to new instances which are then returned. The original objects should be discarded.

@param obj An entity or an unloaded reference to an entity. Not
null.

@type obj ObjectI @return Saved object @rtype ObjectI

saveArray(objs)

Provide method for directly updating list of object graphs. Act recursively on the entire object graph, replacing placeholders and details where necessary, and then “merging” the final graph. This means that the objects that are passed into methods are copied over to new instances which are then returned. The original objects should be discarded.

@param obj List of entities or an unloaded references to an
entity. Not null.

@type obj L{ObjectI}

saveObject(obj)

Provide method for directly updating object graphs. Act recursively on the entire object graph, replacing placeholders and details where necessary, and then “merging” the final graph. This means that the objects that are passed into methods are copied over to new instances which are then returned. The original objects should be discarded.

@param obj An entity or an unloaded reference to an entity. Not
null.

@type obj ObjectI

setDefaultGroup(group_id, exp_id=None)

Sets the default group for the specified experimenter, or current user if not specified.

setMembersOfGroup(group, new_members)

Change members of the group. Returns a list of existing group members that could not be removed from the group because it is their only group.

@param group An existing ExperimenterGroup instance. @type group ExperimenterGroupI @param new_members List of new new Experimenter Ids. @type new_members L{Long} @return List of Experimenters not removed from group @rtype List of L{ExperimenterWrapper}

setOwnersOfGroup(group, new_owners)

Change members of the group.

@param group An existing ExperimenterGroup instance. @type group ExperimenterGroupI @param new_members List of new new Experimenter Ids. @type new_members L{Long}

updateExperimenter(experimenter, omeName, firstName, lastName, email, isAdmin, isActive, defaultGroup, otherGroups, middleName=None, institution=None)

Update an existing user including groups user is a member of. Password cannot be changed by calling that method. @param experimenter An existing Experimenter instance. @type experimenter ExperimenterWrapper @param omeName A new username. @type omeName String @param firstName A new first name. @type firstName String @param lastName A new last name. @type lastName String @param email A new email. @type email String @param isAdmin An Admin permission. @type isAdmin Boolean @param isActive Active user (user can log in). @type isActive Boolean @param defaultGroup Instance of ExperimenterGroup selected as a first

active group.

@type defaultGroup ExperimenterGroupI @param otherGroups List of ExperimenterGroup instances. Can be empty. @type otherGroups L{ExperimenterGroupI} @param middleName A middle name. @type middleName String @param institution An institution. @type institution String

updateGroup(group, name, permissions, owners=[], description=None)

Update an existing user including groups user is a member of. Password cannot be changed by calling that method.

@param group A new ExperimenterGroup instance. @type group ExperimenterGroupI @param name A new group name. @type name String @param permissions Permissions instances. @type permissions L{PermissionsI} @param owners List of Experimenter instances. Can be empty. @type owners L{ExperimenterI} @param description A description. @type description String

updateMyAccount(experimenter, firstName, lastName, email, defaultGroupId, middleName=None, institution=None)

Allows a user to update his/her own information and set the default group for a given user. @param experimenter A data transfer object. Only the fields:

firstName, middleName, lastName, email, and institution are checked. Not null.

@type experimenter ExperimenterWrapper @param firstName A new first name. @type firstName String @param lastName A new last name. @type lastName String @param email A new email. @type email String @param defaultGroup Instance of ExperimenterGroup selected as a

first active group.

@type defaultGroup ExperimenterGroupI @param middleName A middle name. @type middleName String @param institution An institution. @type institution String

updatePermissions(group, permissions)

Allow to change the permission of the group.

@param group A wrapped entity or an unloaded reference to an
entity. Not null.

@type group BlitzObjectWrapper @param perm The permissions value for this entity. Not null. @type perm PermissionsI

updateShareOrDiscussion(host, share_id, message, add_members, rm_members, enable, expiration=None)
uploadMyUserPhoto(filename, format, data)

Uploads a photo for the user which will be displayed on his/her profile. This photo will be saved as an OriginalFile object with the given format, and attached to the user’s Experimenter object via an File Annotation with the namespace: “openmicroscopy.org/omero/experimenter/photo” (NSEXPERIMENTERPHOTO). If such an OriginalFile instance already exists, it will be overwritten. If more than one photo is present, the oldest version will be modified (i.e. the highest updateEvent id).

Note: as outlined in ticket:1794, this photo will be placed in the “user” group and therefore will be visible to everyone on the system.

@param filename name which will be used. @type filename String @param format Format.value string. ‘image/jpeg’ and ‘image/png’

are common values.

@type format String @param data Data from the image. This will be written to disk. @type data String

@return ID of the overwritten or newly created user photo
OriginalFile object.

@rtype Long

class omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper

Bases: object

annotation_counter = None
countAnnotations()

Count on annotations linked to the object and set the value on the custom fiels ‘annotation_counter’.

@return Counter

countParents()
getPermissions()
getPermsCss()

Returns a string that can be used as classes on an html element to indicate the permissions flags of the object. E.g. “canEdit canLink” Flags/classes are canEdit, canAnnotate, canLink, canDelete

setRating(rating)

Add a rating (long) annotation to the object, or update an existing rating. If rating is zero, we remove any existing rating annotation.

warpName()

Warp name of the object if names is longer then 30 characters.

@return Warped string.

class omeroweb.webclient.webclient_gateway.OmeroWebSafeCallWrapper(proxyObjectWrapper, attr, f)

Bases: omero.gateway.OmeroGatewaySafeCallWrapper

Function or method wrapper that handles L{Ice.ObjectNotExistException} by re-creating the server side proxy.

handle_exception(e, *args, **kwargs)
class omeroweb.webclient.webclient_gateway.PlateAcquisitionWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._PlateAcquisitionWrapper

omero_model_PlateI class wrapper overwrite omero.gateway.PlateWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
class omeroweb.webclient.webclient_gateway.PlateWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._PlateWrapper

omero_model_PlateI class wrapper overwrite omero.gateway.PlateWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
class omeroweb.webclient.webclient_gateway.ProjectWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._ProjectWrapper

omero_model_ProjectI class wrapper overwrite omero.gateway.ProjectWrapper and extend OmeroWebObjectWrapper.

annotation_counter = None
class omeroweb.webclient.webclient_gateway.ScreenWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._ScreenWrapper

omero_model_ScreenI class wrapper overwrite omero.gateway.ScreenWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
class omeroweb.webclient.webclient_gateway.ShareWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omero.gateway.BlitzObjectWrapper

omero_model_ShareI class wrapper extends BlitzObjectWrapper.

getExpireDate()

Gets the end date for the share

@return: End Date-time @rtype: datetime object

getOwner()

The owner of this share

@return: Owner @rtype: L{ExperimenterWrapper}

getShareType()
getStartDate()

Gets the start date of the share

@return: Start Date-time @rtype: datetime object

isEmpty()
isExpired()

Returns True if we are past the end date of the share

@return: True if share expired @rtype: Boolean

isOwned()

Returns True if share is owned by the current user

@return: True if owned @rtype: Boolean

class omeroweb.webclient.webclient_gateway.WellWrapper(conn=None, obj=None, cache=None, **kwargs)

Bases: omeroweb.webclient.webclient_gateway.OmeroWebObjectWrapper, omero.gateway._WellWrapper

omero_model_ImageI class wrapper overwrite omero.gateway.ImageWrapper and extends OmeroWebObjectWrapper.

annotation_counter = None
omeroweb.webclient.webclient_gateway.defaultThumbnail(size=(120, 120))

omeroweb.webclient.webclient_utils module

omeroweb.webclient.webclient_utils._formatReport(callback)

Added as workaround to the changes made in #3006.

omeroweb.webclient.webclient_utils._purgeCallback(request)
omeroweb.webclient.webclient_utils.formatPercentFraction(value)

Formats a fraction as a percentage for display

omeroweb.webclient.webclient_utils.getDateTime(timeString)

Module contents