Will Moore | Jean-Marie Burel
/api//api/v0/login/
import requests
session = requests.Session()
# Set CSRF token
token = session.get("http://server.org/api/v0/token/").json()['data']
session.headers.update({'X-CSRFToken': token,
'Referer': "http://server.org/api/v0/token/"})
# Login
session.post("http://server.org/api/v0/login/", data={'username': USERNAME,
'password': PASSWORD,
'server': 1})
# List Projects
rsp = session.get("http://server.org/api/v0/m/projects/").json()
for p in rsp['data']:
print p['@id'], p['Name']
Full examples in
Python,
Java
$ bin/omero config append omero.web.open_with '["omero_iviewer", "omero_iviewer_index",
{"supported_objects":["image"], "script_url": "omero_iviewer/openwith.js"}]'
// openwith.js
OME.setOpenWithUrlProvider("omero_iviewer", function(selected, url) {
// Add image Id to url
url += selected[0].id + "/";
// We try to traverse the jstree, to find parent of selected image
var inst = $.jstree.reference('#dataTree');
var parent = OME.getTreeImageContainerBestGuess(selected[0].id);
url += '?' + parent.type + '=' + parent.data.id
return url;
});
* Simplified example. See
iviewer openwith.js
for original.
| gallery* | mapr | figure | iviewer | player* | webtagging | forms | |
| JS | - | jQuery | Backbone | Aurelia | React | React | React |
|---|---|---|---|---|---|---|---|
| Build tool | - | - | Grunt | Webpack | Webpack | Webpack | Webpack |
| pip install? | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
*prototype app
$ pip install omero-iviewer
$ bin/omero config append omero.web.apps '"omero_iviewer"'