Beispiel #1
0
def viewer_element(request):
    from views_util import loadProtocolProject
    from views_protocol import updateProtocolParams
    
    project, protocolViewer = loadProtocolProject(request)
    protId = request.POST.get('protRunIdViewer', None)
    viewerParam = request.POST.get('viewerParam', None)
    
    protocol = project.getProtocol(int(protId))
    protocolViewer.setProtocol(protocol)
    updateProtocolParams(request, protocolViewer, project)
    
    views = protocolViewer._getVisualizeDict()[viewerParam](viewerParam)
    
    if views is None:
        print "no viewer found"
    else:
        urls = []
        for v in views:
             # COMMAND VIEW
             if isinstance(v, CommandView):
        #             v.show()
                print "CommandView IS ONLY AVAILABLE ON DESKTOP!"
             else:
                urls.append(viewToUrl(request, v))

        jsonStr = json.dumps(urls, ensure_ascii=False)
    return HttpResponse(jsonStr, mimetype='application/javascript')
Beispiel #2
0
def viewer_element(request):
    from views_util import loadProtocolProject
    from views_protocol import updateProtocolParams

    project, protocolViewer = loadProtocolProject(request)
    protId = request.POST.get('protRunIdViewer', None)
    viewerParam = request.POST.get('viewerParam', None)

    protocol = project.getProtocol(int(protId))
    protocolViewer.setProtocol(protocol)
    updateProtocolParams(request, protocolViewer, project)

    views = protocolViewer._getVisualizeDict()[viewerParam](viewerParam)

    if views is None:
        print "no viewer found"
    else:
        urls = []
        for v in views:
            # COMMAND VIEW
            if isinstance(v, CommandView):
                #             v.show()
                print "CommandView IS ONLY AVAILABLE ON DESKTOP!"
            else:
                urls.append(viewToUrl(request, v))

        jsonStr = json.dumps(urls, ensure_ascii=False)
    return HttpResponse(jsonStr, content_type='application/javascript')
Beispiel #3
0
def wizard(request):
    from views_util import loadProtocolProject
    from views_protocol import updateProtocolParams
    
    # Get the post-dictionary
    requestDict = getattr(request, "POST")

    # Get and instance the wizard class
    className = requestDict.get("wizClassName")
    wizClass = globals().get(className, None)()

    # Get the protocol object
    project, protocol = loadProtocolProject(request)
    updateProtocolParams(request, protocol, project)

    print "======================= in wizard: " + str(wizClass)
    
    # Obtain the parameters for the wizard
    return wizClass._run(protocol, request)