User Story #6342 (new)
Opened 13 years ago
Last modified 12 years ago
Connection provider and decorators in webclient — at Version 6
Reported by: | atarkowska | Owned by: | atarkowska |
---|---|---|---|
Priority: | major | Milestone: | OMERO-Beta4.4 |
Component: | Web | Keywords: | n.a. |
Cc: | jburel | Story Points: | n.a. |
Sprint: | n.a. | Importance: | n.a. |
Total Remaining Time: | 0.0d | Estimated Remaining Time: | n.a. |
Description (last modified by wmoore)
Due to the changes in #6387, Web should have one common strategy to create connection, keep it alive and retrieve in specific use cases. That is also related to decorators.
Tickets - DRAFT ONLY!!!
Examples of common functionality that exists (and could be moved to decorators) or that we might want to provide via decorators.
- Error handling, connection & redirect or error if json.
conn = None try: conn = kwargs["conn"] except: logger.error(traceback.format_exc()) return handlerInternalError("Connection is not available. Please contact your administrator.")
- Would be nice to allow 3rd party developers to specify templates. E.g. as in webgateway
def full_viewer(request, iid, server_id=None, _conn=None, **kwargs): .... template = kwargs.get('template', "webgateway/omero_image.html") ...etc.
- Also we have this a lot
t = template_loader.get_template(template) c = Context(request,context) logger.debug('TEMPLATE: '+template) return HttpResponse(t.render(c))
# check menu menu = request.REQUEST.get("menu") if menu is not None: request.session['nav']['menu'] = menu else: menu = request.session['nav']['menu'] # check view view = request.REQUEST.get("view") if view is not None: request.session['nav']['view'] = view else: view = request.session['nav']['view']
This line (or equivalent) is needed in many views
context['nav'] = request.session['nav']
Due to various parameters added to the request in isUserConnected
def sessionHelper(request): ... request.session['nav']={"blitz": blitz, "menu": "mydata", "view": "tree", "basket": 0, "experimenter":None} def navHelper(request, conn): ... request.session['nav']['tab_links'] = links
Change History (6)
comment:1 Changed 13 years ago by atarkowska
- Milestone changed from OMERO-Beta4.3.2 to Unscheduled
comment:2 Changed 13 years ago by atarkowska
- Description modified (diff)
comment:3 Changed 13 years ago by atarkowska
- Description modified (diff)
comment:4 Changed 13 years ago by atarkowska
- Milestone changed from Unscheduled to OMERO-Beta4.4
comment:5 Changed 12 years ago by wmoore
- Description modified (diff)
comment:6 Changed 12 years ago by wmoore
- Description modified (diff)