Hi BK,
I see Ola has answered already. Her answer is probably what you want but here's what I was going to say....
I'm not familiar with the basket, so I can't answer directly, but I can give you some tips on how to work this sort of thing in the web client.
- Go to the url you're interested in. In this case its
webclient/basket/
- Look for the urls.py file that defines this url. In
- Code: Select all
omeroweb/webclient/urls.py
you'll find a few 'basket' urls. This is the only one that matches the url above:
- Code: Select all
url( r'^basket/(?:(?P<action>[a-zA-Z]+)/)?$', views.basket_action, name="basket_action"),
where 'action' = None.
The code that handles this is in views.basket_action, so look in webclient/views.py for the basket_action function.
You can find the code for when action = None. If you want to look at webclient/controller/basket.py you can see how BaseBasket gets the basket image Ids, but you're probably more interested in the template used to display the images.
- Code: Select all
webclient/basket/basket.html
This looks like the code that displays the images in basket
- Code: Select all
{% for c in basket.imageInBasket %}
<tr id="{{ c.id }}">
<td class="action">
<img src="{% url render_thumbnail_resize 32 c.id %}" alt="image" title="{{ c.name }}"/>
<input type="checkbox" name="image" id="{{ c.id }}" class="hide">
</td>
<td class="desc">{{ c.name|truncatebefor:"65" }} {% if c.annotation_counter %}<img src="{% url webstatic "images/knotes16.png" %}" alt="a" title="annotation"/>{% endif %}{% if not c.isOwned %} <img src="{% url webstatic "images/kgpg12.png" %}" alt="l" title="locked"/>{% endif %}</td>
<td class="roles">{{ c.getDate }}</td>
</tr>
{% endfor %}
You can do something similar to pass the image IDs to your app by creating a link with the image IDs in the request string. Like this
- Code: Select all
<a href="/myApp/selected_images/?iIds={% for c in basket.imageInBasket %}{{ c.id }}{% if not forloop.last %},{% endif %}{% endfor %}">My App Link</a>
Will link to a url like this
- Code: Select all
/myApp/selected_images/?iIds=2305,2306,2307
You can then get the image IDs by doing
- Code: Select all
iIds = request.REQUEST.get('iIds', None)
if iIds:
imageIds = iIds.split(",")
... etc.
Hopefully you'll be able to use these tips for working out how to do most stuff in OmeroWeb.