示例#1
0
def base(request, context):
    # Keep existing service name previously set by any of the webtools
    serviceName = getVarFromRequest(request, SERVICE_NAME)

    if serviceName is None and SERVICE_NAME in context:
        serviceName = context[SERVICE_NAME]

    context_base = {
        # ICON
        'favicon': getResourceIcon('favicon'),
        'logo_scipion': getResourceIcon('logo_scipion'),
        'logo_scipion_transparent':
        getResourceIcon('logo_scipion_transparent'),
        # CSS
        'general_css': getResourceCss('general'),
        'messi_css': getResourceCss('messi'),
        'font_awesome': getResourceCss('font_awesome'),
        # JS
        'jquery': getResourceJs('jquery'),
        'messi_js': getResourceJs('messi'),
        # JS
        'utils': getResourceJs('utils'),
        "projectName": getVarFromRequest(request, PROJECT_NAME),
        SERVICE_NAME: serviceName
    }

    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#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
示例#3
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
示例#4
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
示例#5
0
def base(request, context):
    
    context_base = {
                    #ICON
                    'favicon': getResourceIcon('favicon'),
                    'logo_scipion': getResourceIcon('logo_scipion'),
                    'logo_scipion_transparent' : getResourceIcon('logo_scipion_transparent'),
                    #CSS
                    'general_css': getResourceCss('general'),
                    'messi_css': getResourceCss('messi'),
                    'font_awesome': getResourceCss('font_awesome'),
                    #JS
                    'jquery': getResourceJs('jquery'),
                    'messi_js': getResourceJs('messi'),
                    #JS
                    'utils': getResourceJs('utils'),
                    }
    
    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#6
0
def getExtIconPath(ext):

    txt = {'txt', 'log', 'out', 'err', 'stdout', 'stderr', 'emx'}
    img = {'png', 'gif', 'jpg', 'jpeg'}
    py = {'py', 'pyc'}
    java = {'java'}
    md = {'xmd', 'star', 'pos'}
    sqlite = {'sqlite', 'db'}
    particle = {
        'xmp', 'tif', 'tiff', 'spi', 'mrc', 'map', 'raw', 'inf', 'dm3', '.em',
        'pif', 'psd', 'spe', 'ser', 'img', 'hed'
    }
    vol = {'vol'}
    stk = {'stk', 'mrcs', 'st', 'pif'}

    if ext == 'folder':
        res = getResourceIcon('folder')
#     elif ext == 'unknown':
#         res = getResourceIcon('file_normal')
    else:
        if ext in txt:
            res = getResourceIcon('file_text')
        elif ext in img or ext in particle:
            res = getResourceIcon('file_image')
        elif ext in py:
            res = getResourceIcon('file_python')
        elif ext in java:
            res = getResourceIcon('file_java')
        elif ext in md:
            res = getResourceIcon('file_md')
        elif ext in sqlite:
            res = getResourceIcon('file_sqlite')
        elif ext in vol:
            res = getResourceIcon('file_vol')
        elif ext in stk:
            res = getResourceIcon('file_stack')
        else:
            res = getResourceIcon('file_normal')

    return res
示例#7
0
def getExtIconPath(ext):

    txt = {'txt', 'log', 'out', 'err', 'stdout', 'stderr', 'emx'}
    img = {'png', 'gif', 'jpg', 'jpeg'}
    py = {'py', 'pyc'} 
    java = {'java'}
    md = {'xmd', 'star', 'pos'}
    sqlite = {'sqlite', 'db'}
    particle = {'xmp', 'tif', 'tiff', 'spi', 'mrc', 'map', 'raw', 
                'inf', 'dm3', '.em', 'pif', 'psd', 'spe', 
                'ser', 'img', 'hed'}
    vol = {'vol'}
    stk = {'stk', 'mrcs', 'st', 'pif'}
    
    if ext == 'folder':
        res = getResourceIcon('folder')
#     elif ext == 'unknown':
#         res = getResourceIcon('file_normal')
    else:
        if ext in txt:
            res = getResourceIcon('file_text')
        elif ext in img or ext in particle:
            res =  getResourceIcon('file_image')
        elif ext in py:
            res = getResourceIcon('file_python')
        elif ext in java:
            res = getResourceIcon('file_java')
        elif ext in md:
            res = getResourceIcon('file_md')
        elif ext in sqlite:
            res = getResourceIcon('file_sqlite')
        elif ext in vol:
            res = getResourceIcon('file_vol')
        elif ext in stk:
            res = getResourceIcon('file_stack')
        else:
            res = getResourceIcon('file_normal')
    
    return res
示例#8
0
def base(request, context):

    context_base = {
        #ICON
        'favicon': getResourceIcon('favicon'),
        'logo_scipion': getResourceIcon('logo_scipion'),
        'logo_scipion_transparent':
        getResourceIcon('logo_scipion_transparent'),
        #CSS
        'general_css': getResourceCss('general'),
        'messi_css': getResourceCss('messi'),
        'font_awesome': getResourceCss('font_awesome'),
        #JS
        'jquery': getResourceJs('jquery'),
        'messi_js': getResourceJs('messi'),
        #JS
        'utils': getResourceJs('utils'),
    }

    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#9
0
def base_wiz(request, context):
    
    context_base = {'general_style': getResourceCss('general'),
                    'wizard_style': getResourceCss('wizard'),
                    'jquery_ui_style': getResourceCss('jquery_ui'),
                    'font_awesome': getResourceCss('font_awesome'),
                    'jquery': getResourceJs('jquery'),
                    'jquery_ui': getResourceJs('jquery_ui'),
                    'jquery_ui_touch': getResourceJs('jquery_ui_touch'),
                    'wizard_utils': getResourceJs('wizard_utils'),
                    'raphael':getResourceJs('raphael'),
                    'projectName': request.session['projectName'],
                    'loading' : getResourceIcon('loading'),
                    }
    
    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#10
0
def upload(request, form=None):
    # Load documents for the list page
    mode = request.GET.get('mode', None)
    path = os.path.join(request.session['projectPath'],'Uploads')
    split_path = path.split("/ScipionUserData/")
    relative_path = "ScipionUserData/" + split_path[1]

    context = {'relative_path': relative_path,
               'form': DocumentForm(),
               'logo_scipion_small': getResourceIcon('logo_scipion_small'),
               "upload_utils": getResourceJs('upload_utils'),
               "mode": mode,
               }

    context = base_form(request, context)
    
    # Render list page with the documents and the form
    return render_to_response('upload/upload.html', context, 
                              context_instance=RequestContext(request))
示例#11
0
def base_wiz(request, context):

    context_base = {
        'general_style': getResourceCss('general'),
        'wizard_style': getResourceCss('wizard'),
        'jquery_ui_style': getResourceCss('jquery_ui'),
        'font_awesome': getResourceCss('font_awesome'),
        'jquery': getResourceJs('jquery'),
        'jquery_ui': getResourceJs('jquery_ui'),
        'jquery_ui_touch': getResourceJs('jquery_ui_touch'),
        'wizard_utils': getResourceJs('wizard_utils'),
        'raphael': getResourceJs('raphael'),
        'projectName': request.session['projectName'],
        'loading': getResourceIcon('loading'),
    }

    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#12
0
def base_wiz(request, context):
    context_base = {
        'general_style': getResourceCss('general'),
        'wizard_style': getResourceCss('wizard'),
        'jquery_ui_style': getResourceCss('jquery_ui'),
        'font_awesome': getResourceCss('font_awesome'),
        'jquery': getResourceJs('jquery'),
        'jquery_ui': getResourceJs('jquery_ui'),
        'jquery_ui_touch': getResourceJs('jquery_ui_touch'),
        'wizard_utils': getResourceJs('wizard_utils'),
        'raphael': getResourceJs('raphael'),
        'utils': getResourceJs('utils'),
        CTX_PROJECT_NAME: getVarFromRequest(request, PROJECT_NAME),
        SERVICE_NAME: getVarFromRequest(request, SERVICE_NAME),
        'loading': getResourceIcon('loading'),
    }

    context = VARS_base(request, context)
    context.update(context_base)
    return context
示例#13
0
def contextForm(request):
    from views_base import base_form
    from django.core.context_processors import csrf
    from views_util import getResourceCss, getResourceIcon, getResourceJs, getResourceLogo
    from pyworkflow.protocol.params import Group, Line
    
    project, protocol = loadProtocolProject(request, requestType='GET')
    action = request.GET.get('action', None)
    paramProt = request.GET.get('paramProt', None)
    protRunIdViewer = request.GET.get('protRunIdViewer', None)
    
    # Patch : to fix the relion dynamic way to generate the viewer form
    #         For this is necessary to call setProtocol method
    if protRunIdViewer is not None:
        protocol_parent = project.getProtocol(int(protRunIdViewer))
        protocol.setProtocol(protocol_parent)
    
    hosts = project.getHostNames()
    print "Host in the project: ", hosts
    
    visualize = 0
    
    viewerDict = None
    if action == 'visualize':
        visualize = 1
        viewerDict = protocol._getVisualizeDict()
    elif action == 'protSimple':
        visualize = 2
    elif action == 'copy':
        protocol = project.copyProtocol(protocol)
        
    package = protocol.getClassPackage()
    logoPath = ''
    path = getattr(package, '_logo', '')
    if path != '': 
        logoPath = getResourceLogo(path)
            
    wizards = findWizardsWeb(protocol)
    
    protocol.htmlCitations = parseText(protocol.citations())
    protocol.htmlDoc = parseText(protocol.getDoc())
    
    for section in protocol._definition.iterSections():
        for paramName, param in section.iterParams():
            protVar = getattr(protocol, paramName, None)
            if protVar is None:
#                raise Exception("_fillSection: param '%s' not found in protocol" % paramName)
               
                # GROUP PARAM
                if isinstance(param, Group):
                    for paramGroupName, paramGroup in param.iterParams():
                        protVar = getattr(protocol, paramGroupName, None)
                        
                        # LINE PARAM
                        if isinstance(paramGroup, Line):
                            for paramLineName, paramLine in paramGroup.iterParams():
                                protVar = getattr(protocol, paramLineName, None)
                                
                                if protVar is None:
                                    pass
                                else:
                                    paramLine = PreprocessParamForm(request, paramLine, paramLineName, wizards, viewerDict, visualize, protVar)                  
                                
                            # PATCH: This is applied to all the params in the line, maybe just need for the first one.
                            for name, _ in paramGroup.iterParams():
                                wizParamName = name
                                if wizParamName in wizards:
                                    paramGroup.hasWizard = True
                                    paramGroup.wizardClassName = wizards[wizParamName].__name__
                                
                            if visualize == 1:
                                if paramGroupName in viewerDict:
                                    paramGroup.hasViewer = True
                            
                            if not paramGroup.help.empty():
                                paramGroup.htmlHelp = parseText(paramGroup.help.get())
                                
                            paramGroup.htmlCond = paramGroup.condition.get()
                            paramGroup.htmlDepend = ','.join(paramGroup._dependants)
                            paramGroup.htmlCondParams = ','.join(paramGroup._conditionParams)   
                            
                        elif protVar is None:
                            pass
                        else:
                            paramGroup = PreprocessParamForm(request, paramGroup, paramGroupName, wizards, viewerDict, visualize, protVar)
                
                    param.htmlCond = param.condition.get()
                    param.htmlDepend = ','.join(param._dependants)
                    param.htmlCondParams = ','.join(param._conditionParams)   
                            
                # LINE PARAM
                if isinstance(param, Line):
                    for paramLineName, paramLine in param.iterParams():
                        protVar = getattr(protocol, paramLineName, None)
                        
                        if protVar is None:
                            pass
                        else:
                            paramLine = PreprocessParamForm(request, paramLine, paramLineName, wizards, viewerDict, visualize, protVar)                  
                        
                    # PATCH: This is applied to all the params in the line, maybe just need for the first one.
                    for name, _ in param.iterParams():
                        wizParamName = name
                        if wizParamName in wizards:
                            param.hasWizard = True
                            param.wizardClassName = wizards[wizParamName].__name__
                        
                    if visualize == 1:
                        if paramName in viewerDict:
                            param.hasViewer = True
                    
                    if not param.help.empty():
                        param.htmlHelp = parseText(param.help.get())
                        
                    param.htmlCond = param.condition.get()
                    param.htmlDepend = ','.join(param._dependants)
                    param.htmlCondParams = ','.join(param._conditionParams)   
                                     
            else:
                # OTHER PARAM
                param = PreprocessParamForm(request, param, paramName, wizards, viewerDict, visualize, protVar)
    
    context = {SERVICE_NAME: getVarFromRequest(request, SERVICE_NAME),
               CTX_PROJECT_NAME: project.getShortName(),
               'protocol': protocol,
               'package_logo': logoPath,
               'protRunIdViewer': protRunIdViewer,
               'definition': protocol._definition,
               'visualize': visualize,
               'paramProt': paramProt,
               'favicon': getResourceIcon('favicon'),
               'comment': getResourceIcon('edit_toolbar'),
               'jquery_ui_css': getResourceCss('jquery_ui'),
               'wizard': getResourceIcon('wizard'),
               'protocol_form_utils': getResourceJs('protocol_form_utils'),
               'hosts': hosts,
               'comment': parseText(protocol.getObjComment()),
               'showHost': True,
               'showParallel': True
               }
    
    # Update the context dictionary with the special params
    for paramName in SPECIAL_PARAMS:
        context[paramName] = protocol.getAttributeValue(paramName, '')

    # Cross Site Request Forgery protection is need it
    context.update(csrf(request))
    context = base_form(request, context)

    return context
示例#14
0
def contextForm(request):
    from views_base import base_form
    from django.core.context_processors import csrf
    from views_util import getResourceCss, getResourceIcon, getResourceJs, getResourceLogo
    from pyworkflow.protocol.params import Group, Line

    project, protocol = loadProtocolProject(request, requestType="GET")
    action = request.GET.get("action", None)
    paramProt = request.GET.get("paramProt", None)
    protRunIdViewer = request.GET.get("protRunIdViewer", None)

    # Patch : to fix the relion dynamic way to generate the viewer form
    #         For this is necessary to call setProtocol method
    if protRunIdViewer is not None:
        protocol_parent = project.getProtocol(int(protRunIdViewer))
        protocol.setProtocol(protocol_parent)

    hosts = project.getHostNames()
    print "Host in the project: ", hosts

    visualize = 0

    viewerDict = None
    if action == "visualize":
        visualize = 1
        viewerDict = protocol._getVisualizeDict()
    elif action == "protSimple":
        visualize = 2
    elif action == "copy":
        protocol = project.copyProtocol(protocol)

    package = protocol.getClassPackage()
    logoPath = ""
    path = getattr(package, "_logo", "")
    if path != "":
        logoPath = getResourceLogo(path)

    wizards = findWizardsWeb(protocol)

    protocol.htmlCitations = parseText(protocol.citations())
    protocol.htmlDoc = parseText(protocol.getDoc())

    for section in protocol._definition.iterSections():
        for paramName, param in section.iterParams():
            protVar = getattr(protocol, paramName, None)
            if protVar is None:
                #                raise Exception("_fillSection: param '%s' not found in protocol" % paramName)

                # GROUP PARAM
                if isinstance(param, Group):
                    for paramGroupName, paramGroup in param.iterParams():
                        protVar = getattr(protocol, paramGroupName, None)

                        # LINE PARAM
                        if isinstance(paramGroup, Line):
                            for paramLineName, paramLine in paramGroup.iterParams():
                                protVar = getattr(protocol, paramLineName, None)

                                if protVar is None:
                                    pass
                                else:
                                    paramLine = PreprocessParamForm(
                                        request, paramLine, paramLineName, wizards, viewerDict, visualize, protVar
                                    )

                            # PATCH: This is applied to all the params in the line, maybe just need for the first one.
                            for name, _ in paramGroup.iterParams():
                                wizParamName = name
                                if wizParamName in wizards:
                                    paramGroup.hasWizard = True
                                    paramGroup.wizardClassName = wizards[wizParamName].__name__

                            if visualize == 1:
                                if paramGroupName in viewerDict:
                                    paramGroup.hasViewer = True

                            if not paramGroup.help.empty():
                                paramGroup.htmlHelp = parseText(paramGroup.help.get())

                            paramGroup.htmlCond = paramGroup.condition.get()
                            paramGroup.htmlDepend = ",".join(paramGroup._dependants)
                            paramGroup.htmlCondParams = ",".join(paramGroup._conditionParams)

                        elif protVar is None:
                            pass
                        else:
                            paramGroup = PreprocessParamForm(
                                request, paramGroup, paramGroupName, wizards, viewerDict, visualize, protVar
                            )

                    param.htmlCond = param.condition.get()
                    param.htmlDepend = ",".join(param._dependants)
                    param.htmlCondParams = ",".join(param._conditionParams)

                # LINE PARAM
                if isinstance(param, Line):
                    for paramLineName, paramLine in param.iterParams():
                        protVar = getattr(protocol, paramLineName, None)

                        if protVar is None:
                            pass
                        else:
                            paramLine = PreprocessParamForm(
                                request, paramLine, paramLineName, wizards, viewerDict, visualize, protVar
                            )

                    # PATCH: This is applied to all the params in the line, maybe just need for the first one.
                    for name, _ in param.iterParams():
                        wizParamName = name
                        if wizParamName in wizards:
                            param.hasWizard = True
                            param.wizardClassName = wizards[wizParamName].__name__

                    if visualize == 1:
                        if paramName in viewerDict:
                            param.hasViewer = True

                    if not param.help.empty():
                        param.htmlHelp = parseText(param.help.get())

                    param.htmlCond = param.condition.get()
                    param.htmlDepend = ",".join(param._dependants)
                    param.htmlCondParams = ",".join(param._conditionParams)

            else:
                # OTHER PARAM
                param = PreprocessParamForm(request, param, paramName, wizards, viewerDict, visualize, protVar)

    context = {
        "projectName": project.getName(),
        "package_logo": logoPath,
        "protocol": protocol,
        "protRunIdViewer": protRunIdViewer,
        "definition": protocol._definition,
        "visualize": visualize,
        "paramProt": paramProt,
        "favicon": getResourceIcon("favicon"),
        "comment": getResourceIcon("edit_toolbar"),
        "jquery_ui_css": getResourceCss("jquery_ui"),
        "wizard": getResourceIcon("wizard"),
        "protocol_form_utils": getResourceJs("protocol_form_utils"),
        "hosts": hosts,
        "comment": parseText(protocol.getObjComment()),
        "showHost": True,
        "showParallel": True,
    }

    # Update the context dictionary with the special params
    for paramName in SPECIAL_PARAMS:
        context[paramName] = protocol.getAttributeValue(paramName, "")

    # Cross Site Request Forgery protection is need it
    context.update(csrf(request))
    context = base_form(request, context)

    return context