Commit 5fa2f983 authored by Penom Nom's avatar Penom Nom

add property to configure the list of available worflows

parent 8388c4ee
......@@ -29,6 +29,8 @@ server_socket_host = 127.0.0.1
server_socket_port = 8080
# date format
date_format = %d/%m/%Y
# A space separated list of workfow that will not be available in the web interface
availablewf_filter = AddAnalysis AddProject AddFiles RADseq
[email]
# if you want an email to be sent at the end of the workflow execution
......
......@@ -44,6 +44,8 @@ import jflow.utils as utils
from cctools.util import time_format
from jflow.utils import get_octet_string_representation
from ng6.config_reader import NG6ConfigReader
# function in charge to upload large files
class UploadFieldStorage(cgi.FieldStorage):
"""Our version uses a named temporary file instead of the default
......@@ -124,6 +126,7 @@ class JFlowServer (object):
# Create a workflow manager to get access to our workflows
self.wfmanager = WorkflowsManager()
self.jflow_config_reader = JFlowConfigReader()
self.ng6_config_reader = NG6ConfigReader()
def jsonify(func):
'''JSON and JSONP decorator for CherryPy'''
......@@ -466,6 +469,11 @@ class JFlowServer (object):
on_web_outputs[cpt_name][outf] = self._webify_outputs(JFlowServer.JFLOW_WDATA, on_disk_outputs[cpt_name][outf])
return on_web_outputs
@cherrypy.expose
@jsonify
def get_workflow_filters(self, **kwargs):
return self.ng6_config_reader.get_workflow_filters()
@cherrypy.expose
@jsonify
def validate_field(self, **kwargs):
......
......@@ -124,7 +124,14 @@ class NG6ConfigReader(object):
return mid_array
except :
raise Error("Failed when parsing the config file !")
def get_workflow_filters(self):
filters = self.reader.get("global", 'availablewf_filter')
if filters :
return filters.split()
return []
def get_server_parameters(self):
"""
return the server parameters
......
......@@ -1820,9 +1820,19 @@ function addRunHandler() {
$("#close").show();
$('#availableWorkflows').html("wait");
$('#setAndRunModal').modal();
$('#availableWorkflows').availablewf({
filters:["AddAnalysis", "AddProject", "AddFiles", "RADseq"],
serverURL: $("#server_url").val()
$.ajax({
url: $("#server_url").val() + "/get_workflow_filters?",
dataType: "jsonp",
error: function () {
$('#availableWorkflows').html('<div class="alert alert-error"><strong>Error!</strong> An error occured when attempting to get workflows.</div>');
},
success: function(data) {
$('#availableWorkflows').availablewf({
filters : data,
serverURL: $("#server_url").val()
});
}
});
$('#availableWorkflows').on('select.availablewf', function(event, workflow) {
$("#myCarousel").carousel('next');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment