Skip to content

Commit

Permalink
Merge pull request ome#20 from aleksandra-tarkowska/public-repo
Browse files Browse the repository at this point in the history
moving public data to the sysadmin section and improving the content
  • Loading branch information
hflynn committed Apr 15, 2015
2 parents 0f8c2fb + 4f137f3 commit fb49132
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 120 deletions.
101 changes: 1 addition & 100 deletions omero/developers/Web/PublicData.txt
@@ -1,100 +1 @@
Public data in OMERO.web
========================

Public user
-----------

Since OMERO 4.4, the OMERO.web framework has supported auto-login for a single
username / password. This means that any "public" visitors to certain
OMERO.web pages will be automatically logged in and will be able to access the
data available to the defined 'public user'.

Here is how to go about setting this up on your OMERO.web install:

- Create a group with read-only permissions (name can be anything e.g.
"public-data"). We use read-only permissions so that the public user will
not be able to modify, delete or annotate data belonging to other members.

- Create a member of this group, noting the username and password (we will
enter these below). Again, the First Name, Last Name, username and
password can be anything you like.

- Enable the :property:`omero.web.public.enabled` and set their
:property:`omero.web.public.user` and
:property:`omero.web.public.password`:

::

$ bin/omero config set omero.web.public.enabled True

$ bin/omero config set omero.web.public.user '<username>'

$ bin/omero config set omero.web.public.password '<password>'

- Set the :property:`omero.web.public.url_filter`. This filter is a
regex expression that will only allow matching urls to be accessed
by the public user.

There are three common use cases for the url filter:

- Enable 'webgateway' urls which include everything needed for the
full image viewer:

::

$ bin/omero config set omero.web.public.url_filter '/webgateway'

Then you can access public images via the following link
`\http://your_host/webgateway/img_detail/IMAGE_ID/`.

- Create your own public pages in a separate app
(see :doc:`create app </developers/Web/CreateApp>`) and allow
public access to that app. For example, to allow only
URLs that start with '/my_web_public' you would use:

::

$ bin/omero config set omero.web.public.url_filter '/my_web_public'


- You can use the full webclient UI for public browsing of images. However,
the webclient UI was not designed for public use and allows various actions
that create data or are resource intensive.
These can be selectively disabled using the following command:

::

$ bin/omero config set omero.web.public.url_filter '^/(?!webadmin|webclient/(action|logout|annotate_(file|tags|comment|rating|map)|script_ui|ome_tiff|figure_script)|webgateway/(archived_files|download_as))'

- Set the :property:`omero.web.public.server_id` public user will be automatically
connected to. Default: 1 (the first server in :property:`omero.web.server_list`)

::

$ bin/omero config set omero.web.public.server_id 1

If you wish to mix public and restricted access to the system, the user
can always access the login page using the following link
`\http://your_host/webclient/login/`.


Reusing OMERO session
---------------------

Since OMERO 4.4, the OMERO.web framework has supported password-less, OMERO
session key-based authentication. For example a direct link to image will look
as follows:

::

https://your_host/webgateway/img_detail/IMAGE_ID/?server=SERVER_ID&bsession=OMERO_SESSION_KEY

.. note::

SERVER_ID should match the index from the list set using
:property:`omero.web.server_list` from the server session
you created. If your list contains only one server the index will be 1.

For more details about how to create an OMERO session see
:doc:`server-side session </developers/Server/Sessions>` or
use :doc:`command line interface </users/cli/sessions>` to create one.
content was moved to :doc:`/sysadmins/public`
19 changes: 18 additions & 1 deletion omero/developers/Web/ViewPort.txt
Expand Up @@ -16,6 +16,7 @@ Insert the following:
<div id="omeroviewport"><iframe width="850" height="600" src="http://localhost:8000/webclient/img_detail/IMAGE_ID/" id="omeroviewport" name="omeroviewport"></iframe></div>


.. _launching_web_viewer:

Launching OMERO.web viewer
--------------------------
Expand All @@ -40,6 +41,22 @@ Then in ``<BODY>`` insert the following:

<a href="#" onclick="return openPopup('http://localhost:8000/webclient/img_detail/IMAGE_ID/')">Open viewer</a>


Example:
^^^^^^^^

.. raw:: html

<p style="width:160px; margin-right:10px; padding:5px; background-color: #f8f8f8; border: 1px solid #ccc;">
<a onclick="window.open(this.href, '', 'resizable=no,status=no,location=no,width=800,top=100,left=100,height=600,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no'); return false;" href="https://nightshade.openmicroscopy.org/webgateway/img_detail/3933597/">
<img src="https://nightshade.openmicroscopy.org/webgateway/render_thumbnail/3933597/150/150/" style="margin:5px;"/>
</a>
<i>Click on the thumbnail to view and manipulate the image in OMERO.</i>
</p>


.. _embedding_web_viewport:

Customising the content of the embedded OMERO.web viewport
----------------------------------------------------------

Expand All @@ -48,7 +65,7 @@ in any HTML page, allowing use of resources directly from an OMERO server.

::

$ bin/omero config set omero.web.public.url_filter '/webgateway'
$ bin/omero config set omero.web.public.url_filter '^/webgateway'

Provided the image corresponding to ``IMAGE_ID`` is in the PUBLIC group, it
can be accessed via the link:
Expand Down
52 changes: 34 additions & 18 deletions omero/developers/Web/WebGateway.txt
Expand Up @@ -31,6 +31,8 @@ then go to ``webgateway/…`` or if you have logged in to a server at
Rendered thumbnail


.. _urls_from_within_OMERO_web:

URLs from within OMERO web
^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand All @@ -47,8 +49,9 @@ Image viewer

::

webgateway/img_detail/<imageid>/
{% url 'webgateway.views.full_viewer' image_id %}
URL: https://your_host/webgateway/img_detail/<imageid>/

Template tag: {% url 'webgateway.views.full_viewer' image_id %}



Expand All @@ -59,44 +62,57 @@ Images

::

webgateway/render_image/<imageid>/<z>/<t>/
{% url 'webgateway.views.render_image' image_id theZ theT %}
URL: https://your_host/webgateway/render_image/<imageid>/<z>/<t>/

Template tag: {% url 'webgateway.views.render_image' image_id theZ theT %}

From OMERO 4.4.4, omitting Z and T will use the default values:
webgateway/render_image/<imageid>/
{% url 'webgateway.views.render_image' image_id %}
From OMERO 4.4.4, omitting Z and T will use the default values:


::

URL: https://your_host/webgateway/render_image/<imageid>/

Template tag: {% url 'webgateway.views.render_image' image_id %}

- Makes a jpeg laying out each active channel in a separate panel

::

webgateway/render_split_channel/<imageId>/<z>/<t>/
{% url 'webgateway.views.render_split_channel' image_id theZ theT %}
URL: https://your_host/webgateway/render_split_channel/<imageId>/<z>/<t>/

Template tag: {% url 'webgateway.views.render_split_channel' image_id theZ theT %}

- Plots the intensity of a row of pixels in an image. w is line width

::

webgateway/render_row_plot/<imageId>/<z>/<t>/<y>/<w>
{% url 'webgateway.views.render_row_plot' image_id theZ theT yPos width %}
URL: https://your_host/webgateway/render_row_plot/<imageId>/<z>/<t>/<y>/<w>

Template tag: {% url 'webgateway.views.render_row_plot' image_id theZ theT yPos width %}

- Plots the intensity of a column of pixels in an image.

::

webgateway/render_col_plot/<imageId>/<z>/<t>/<x>/<w>/
{% url 'webgateway.views.render_col_plot' image_id theZ theT xPos width %}
URL: https://your_host/webgateway/render_col_plot/<imageId>/<z>/<t>/<x>/<w>/

Template tag: {% url 'webgateway.views.render_col_plot' image_id theZ theT xPos width %}

- Returns a jpeg of a thumbnail for an image. w and h are optional
(default is 64). Specify just one to retain aspect ratio.
Since OMERO 5.1 it is also possible to specify Z and T indices in the query string.

::

webgateway/render_thumbnail/<imageId>/<w>/<h>
webgateway/render_thumbnail/<imageId>/?z=10 # default size, z=10
{% url 'webgateway.views.render_thumbnail' image_id 100 %} # size 100
{% url 'webgateway.views.render_thumbnail' image_id %} # default size
URL: https://your_host/webgateway/render_thumbnail/<imageId>/?z=10

Template tag: {% url 'webgateway.views.render_thumbnail' image_id %}?z=10 # default size, z=10

URL: https://your_host/webgateway/render_thumbnail/<imageId>/<w>/<h>

Template tag: {% url 'webgateway.views.render_thumbnail' image_id 100 %} # size 100


Rendering settings
""""""""""""""""""
Expand Down Expand Up @@ -156,7 +172,7 @@ Individual parameters are:

::

webgateway/render_image/2602/10/0/?c=1|100:505$0000FF,2|463:2409$00FF00,3|620:3879$FF0000,-4|447:4136$FF0000&p=normal
https://your_host/webgateway/render_image/2602/10/0/?c=1|100:505$0000FF,2|463:2409$00FF00,3|620:3879$FF0000,-4|447:4136$FF0000&p=normal

JSON methods
""""""""""""
Expand Down
7 changes: 6 additions & 1 deletion omero/developers/index.txt
Expand Up @@ -115,9 +115,14 @@ Web
Web/WritingViews
Web/WritingTemplates
Web/CSRF
Web/PublicData


.. toctree::
:maxdepth: 1
:hidden:

Web/PublicData

*******
Insight
*******
Expand Down
1 change: 1 addition & 0 deletions omero/sysadmins/index.txt
Expand Up @@ -58,6 +58,7 @@ performance and security.
server-webstart-codesigning
omero-home-prefix
config
public

***********************
Data Import and Storage
Expand Down

0 comments on commit fb49132

Please sign in to comment.