Exemple #1
0
def contentContext(request, project):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider

    projectName = project.getShortName()
    print "ProjectName: ", projectName
    project_settings = project.getSettings()
    request.session['projectPath'] = project.getPath()
    request.session['projectName'] = projectName

    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()

    # load the protocol tree current active
    htmlTree = loadProtTree(project)

    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current
    choiceSelected = choices.index(project.getCurrentProtocolView().text.get())

    # show the project name in the header.html
    projectNameHeader = 'Project ' + str(projectName)

    context = {
        'projectName': projectName,
        'view': 'protocols',
        'editTool': getResourceIcon('edit_toolbar'),
        'copyTool': getResourceIcon('copy_toolbar'),
        'deleteTool': getResourceIcon('delete_toolbar'),
        'browseTool': getResourceIcon('browse_toolbar'),
        'stopTool': getResourceIcon('stop_toolbar'),
        'analyzeTool': getResourceIcon('analyze_toolbar'),
        'treeTool': getResourceIcon('tree_toolbar'),
        'listTool': getResourceIcon('list_toolbar'),
        'graph_utils': getResourceJs('graph_utils'),
        'project_content_utils': getResourceJs('project_content_utils'),
        'jquery_cookie': getResourceJs('jquery_cookie'),
        'jquery_treeview': getResourceJs('jquery_treeview'),
        'project_content_css': getResourceCss('project_content'),
        'protTreeHtml': htmlTree,
        'choices': choices,
        'choiceSelected': choiceSelected,
        'runs': runs,
        'columns': provider.getColumns(),
        'projectNameHeader': projectNameHeader,
        'runsView': runsView,
        'selectedRuns': selectedRuns
    }

    context = base_flex(request, context)

    return context
Exemple #2
0
def contentContext(request, project):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider
    
    projectName = project.getShortName()
    print "ProjectName: ", projectName
    project_settings = project.getSettings()
    request.session['projectPath'] = project.getPath()
    request.session['projectName'] = projectName
    
    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD    
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()
        
    # load the protocol tree current active
    htmlTree = loadProtTree(project)
    
    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current 
    choiceSelected =  choices.index(project.getCurrentProtocolView().text.get())
    
    # show the project name in the header.html
    projectNameHeader = 'Project '+ str(projectName)
    
    context = {'projectName': projectName,
               'view':'protocols',
               'editTool': getResourceIcon('edit_toolbar'),
               'copyTool': getResourceIcon('copy_toolbar'),
               'deleteTool': getResourceIcon('delete_toolbar'),
               'browseTool': getResourceIcon('browse_toolbar'),
               'stopTool': getResourceIcon('stop_toolbar'),
               'analyzeTool': getResourceIcon('analyze_toolbar'),
               'treeTool': getResourceIcon('tree_toolbar'),
               'listTool': getResourceIcon('list_toolbar'),
               'graph_utils': getResourceJs('graph_utils'),
               'project_content_utils': getResourceJs('project_content_utils'),
               'jquery_cookie': getResourceJs('jquery_cookie'),
               'jquery_treeview': getResourceJs('jquery_treeview'),
               'project_content_css':getResourceCss('project_content'),
               'protTreeHtml': htmlTree,
               'choices':choices,
               'choiceSelected': choiceSelected,
               'runs': runs,
               'columns': provider.getColumns(),
               'projectNameHeader': projectNameHeader, 
               'runsView': runsView,
               'selectedRuns': selectedRuns
               }

    context = base_flex(request, context)
    
    return context
Exemple #3
0
def contentContext(request, project, serviceName=None):
    from pyworkflow.gui.tree import ProjectRunsTreeProvider

    projectName = project.getShortName()
    if serviceName is None:
        serviceName = getVarFromRequest(request, SERVICE_NAME)

    project_settings = project.getSettings()
    request.session[CTX_PROJECT_PATH] = project.getPath()
    request.session[PROJECT_NAME] = projectName

    provider = ProjectRunsTreeProvider(project)
    runs = formatProvider(provider, "runs")
    request.session['runs'] = runs

    # Get the selected runs stored in BD
    selectedRuns = project_settings.runSelection

    # Get the run mode view (0:list / 1:graph / 2:small graph) stored in BD
    runsView = project_settings.runsView.get()

    # load the protocol tree current active
    htmlTree = loadProtTree(project, serviceName)

    # get the choices to load protocol trees
    choices = project.getProtocolViews()

    # get the choice current
    choiceSelected = choices.index(project.getCurrentProtocolView().text.get())

    context = {
        CTX_PROJECT_NAME: projectName,
        'view': 'protocols',
        'editTool': getResourceIcon('edit_toolbar'),
        'copyTool': getResourceIcon('copy_toolbar'),
        'deleteTool': getResourceIcon('delete_toolbar'),
        'browseTool': getResourceIcon('browse_toolbar'),
        'stopTool': getResourceIcon('stop_toolbar'),
        'analyzeTool': getResourceIcon('analyze_toolbar'),
        'treeTool': getResourceIcon('tree_toolbar'),
        'listTool': getResourceIcon('list_toolbar'),
        'graph_utils': getResourceJs('graph_utils'),
        'project_content_utils': getResourceJs('project_content_utils'),
        'jquery_cookie': getResourceJs('jquery_cookie'),
        'jquery_treeview': getResourceJs('jquery_treeview'),
        'project_content_css': getResourceCss('project_content'),
        'protTreeHtml': htmlTree,
        'choices': choices,
        'choiceSelected': choiceSelected,
        'runs': runs,
        'columns': provider.getColumns(),
        'runsView': runsView,
        'selectedRuns': selectedRuns,
        SERVICE_NAME: serviceName
    }

    context = base_flex(request, context)

    return context
Exemple #4
0
def tree_prot_view(request):
    projectName = request.session['projectName'] 
    project = loadProject(request)
     
    # load the protocol tree current active
    htmlTree = loadProtTree(project)
    
    return render_to_response('project_content/tree_prot_view.html', {'protTreeHtml': htmlTree})
Exemple #5
0
def tree_prot_view(request):
    project = loadProject(request)

    # load the protocol tree current active
    htmlTree = loadProtTree(project)

    return render_to_response('project_content/tree_prot_view.html',
                              {'protTreeHtml': htmlTree})