Commit 78adb390 authored by vpodpecan's avatar vpodpecan

added category for final MUSE components (third release)

parent b211310c
[
{
"pk": 20,
"model": "workflows.category",
"fields": {
"uid": "853d1bb3-3710-4fae-a95a-2955abd7b7fe",
"parent": null,
"workflow": null,
"user": null,
"order": 1,
"name": "MUSE_v3"
}
},
{
"pk": 98,
"model": "workflows.abstractwidget",
"fields": {
"category": 20,
"treeview_image": "",
"name": "Create Integer List",
"is_streaming": false,
"uid": "5ff6a81e-c5c8-4f95-b7d3-c55c69af1997",
"interaction_view": "",
"image": "",
"package": "MUSE_v3",
"static_image": "construction_work .png",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"action": "MUSE_v3_create_integers",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": ""
}
},
{
"pk": 248,
"model": "workflows.abstractinput",
"fields": {
"widget": 98,
"name": "Integer List String",
"short_name": "str",
"uid": "043d99f3-117f-4678-aeff-f7536823510c",
"default": "3\r\n2\r\n1\r\n4",
"required": false,
"multi": false,
"parameter_type": "textarea",
"variable": "intStr",
"parameter": true,
"order": 1,
"description": "Comma or new-line separated list of integers"
}
},
{
"pk": 253,
"model": "workflows.abstractinput",
"fields": {
"widget": 98,
"name": "Sort list",
"short_name": "bol",
"uid": "46440b57-a531-42c2-813d-7faacf61c53d",
"default": "true",
"required": true,
"multi": false,
"parameter_type": "checkbox",
"variable": "sort",
"parameter": true,
"order": 2,
"description": "Should the list be sorted"
}
},
{
"pk": 104,
"model": "workflows.abstractoutput",
"fields": {
"widget": 98,
"name": "Integer List",
"short_name": "lst",
"variable": "intList",
"uid": "5256b420-0263-4c53-a9ef-2fbbb504870f",
"order": 1,
"description": "List of integers"
}
},
{
"pk": 101,
"model": "workflows.abstractwidget",
"fields": {
"category": 20,
"treeview_image": "",
"name": "Filter Integers",
"is_streaming": false,
"uid": "573e5851-454f-4f86-ae38-b1066d0427f6",
"interaction_view": "MUSE_v3_filter_integers",
"image": "",
"package": "MUSE_v3",
"static_image": "construction_work .png",
"post_interact_action": "MUSE_v3_post_filter_integers",
"user": null,
"visualization_view": "",
"action": "MUSE_v3_pre_filter_integers",
"wsdl_method": "",
"wsdl": "",
"interactive": true,
"has_progress_bar": false,
"order": 2,
"description": ""
}
},
{
"pk": 250,
"model": "workflows.abstractinput",
"fields": {
"widget": 101,
"name": "Integer List",
"short_name": "lst",
"uid": "12c980ea-31bf-472b-b977-154ecb27b460",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "intList",
"parameter": false,
"order": 1,
"description": "List of integers"
}
},
{
"pk": 106,
"model": "workflows.abstractoutput",
"fields": {
"widget": 101,
"name": "Filtered Integer List",
"short_name": "lst",
"variable": "intList",
"uid": "ff1b21a8-6c28-4e84-adbd-b15b03255dc3",
"order": 1,
"description": "Filtered list of integers"
}
},
{
"pk": 99,
"model": "workflows.abstractwidget",
"fields": {
"category": 20,
"treeview_image": "",
"name": "Sum Integers",
"is_streaming": false,
"uid": "4669c737-83d0-4c9f-8470-6c13606f62fb",
"interaction_view": "",
"image": "",
"package": "MUSE_v3",
"static_image": "construction_work .png",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"action": "MUSE_v3_sum_integers",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 3,
"description": ""
}
},
{
"pk": 249,
"model": "workflows.abstractinput",
"fields": {
"widget": 99,
"name": "Integer List",
"short_name": "lst",
"uid": "2f960d52-6ca7-41bd-8136-a4068480c1d2",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "intList",
"parameter": false,
"order": 1,
"description": "List of integers"
}
},
{
"pk": 105,
"model": "workflows.abstractoutput",
"fields": {
"widget": 99,
"name": "Sum",
"short_name": "int",
"variable": "sum",
"uid": "3a482328-6fc4-4876-aa7f-e6770050d4a9",
"order": 1,
"description": "Sum of integer list"
}
},
{
"pk": 100,
"model": "workflows.abstractwidget",
"fields": {
"category": 20,
"treeview_image": "",
"name": "Display Summation",
"is_streaming": false,
"uid": "53faa492-56ad-4102-9aee-5aec008aba16",
"interaction_view": "",
"image": "",
"package": "MUSE_v3",
"static_image": "construction_work .png",
"post_interact_action": "",
"user": null,
"visualization_view": "MUSE_v3_display_summation",
"action": "MUSE_v3_pre_display_summation",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 4,
"description": ""
}
},
{
"pk": 251,
"model": "workflows.abstractinput",
"fields": {
"widget": 100,
"name": "Integer List",
"short_name": "lst",
"uid": "59bed2f6-cef1-4e9f-b0e8-30c134fbf21f",
"default": "",
"required": false,
"multi": false,
"parameter_type": null,
"variable": "intList",
"parameter": false,
"order": 1,
"description": "List of integers"
}
},
{
"pk": 252,
"model": "workflows.abstractinput",
"fields": {
"widget": 100,
"name": "Sum",
"short_name": "int",
"uid": "397eeb5b-1fe7-485f-8898-f043115e11b9",
"default": "",
"required": false,
"multi": false,
"parameter_type": null,
"variable": "sum",
"parameter": false,
"order": 2,
"description": "Sum (possibly correct) of integer list"
}
}
]
\ No newline at end of file
from django.shortcuts import render
def MUSE_v3_filter_integers(request,input_dict,output_dict,widget):
return render(request, 'interactions/MUSE_v3_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})
\ No newline at end of file
import re
def MUSE_v3_create_integers(input_dict):
intStr = input_dict['intStr']
intList = []
for i in re.findall(r'\w+', intStr):
try:
intList.append(int(i))
except:
pass
if input_dict['sort'].lower() == "true":
intList.sort()
return {'intList':intList}
def MUSE_v3_sum_integers(input_dict):
intList = input_dict['intList']
return {'sum':sum(intList)}
def MUSE_v3_pre_filter_integers(input_dict):
return input_dict
def MUSE_v3_post_filter_integers(postdata,input_dict,output_dict):
intListOut = postdata['intListOut']
intList = []
for i in intListOut:
try:
intList.append(int(i))
except:
pass
return {'intList': intList}
def MUSE_v3_pre_display_summation(input_dict):
return {}
\ No newline at end of file
{
"model": "workflows.category",
"fields": {
"name": "MUSE_v3",
"parent": null,
"order": 1,
"uid": "853d1bb3-3710-4fae-a95a-2955abd7b7fe"
}
}
\ No newline at end of file
import os
# === STANDARD PACKAGE SETTINGS ===
PACKAGE_ROOT = os.path.dirname(__file__)
# === AUTO IMPORT OPTIONS ===
#If auto_import_package_data is true then given data file is automatically imported when ClowdFlows project is newly deployed or refreshed from git
AUTO_IMPORT_DB = False
#For auto_import_package_data_replace_option description see the 'replace' option in workflows/import_package command
AUTO_IMPORT_DB_REPLACE_OPTION = True
#If file(s) other than ./db/package_data.json should be imported, auto_import_package_data_files should be corrected
AUTO_IMPORT_DB_FILES = [os.path.join(PACKAGE_ROOT,'db/package_data.json')]
<div id="widgetinteract-{{widget.pk}}" rel="{{widget.pk}}" class="widgetinteractdialog" title="{{widget.name}} wants your input!">
<form id="interactionform-{{widget.pk}}" name="interactionform-{{widget.pk}}">
{% for i in intList %}
<input type="checkbox" name="intListOut" value="{{i}}" style="display:inline;width:auto;">{{i}}<br>
{% endfor %}
<input type="hidden" name="widget_id" value="{{widget.pk}}">
</form>
</div>
\ No newline at end of file
<div id="widgetvisualization-{{widget.pk}}" rel="{{widget.pk}}" class="widgetvisualizationdialog" title="{{widget.name}} visualization">
<div style="width:400px;font-family:monospace;">
<table style="width:auto; border-collapse:collapse;">
{% for i in input_dict.intList %}
<tr style="width:auto">
<td style="text-align: right; width:auto; line-height: 0.5em; padding: 2px; padding-bottom: 4px; padding-top: 0; margin:2px;">
{% if forloop.first %} {% else %}+{% endif %}
</td>
<td style="text-align: right; width:auto; line-height: 0.5em; padding: 2px; padding-bottom: 4px; padding-top: 0; margin:2px;">
{{ i }}
</td>
</tr>
{% endfor %}
<tr style="width:auto">
<td style="text-align: right; width:auto; line-height: 0.5em; border-top: 1px solid black; padding: 2px; padding-top: 4px; margin:2px;">
=
</td>
<td style="text-align: right; width:auto; line-height: 0.5em; border-top: 1px solid black; padding: 2px;margin:2px;">
{{ input_dict.sum }}
</td>
</tr>
</table>
<br/>
{{ check }}
</div>
</div>
\ No newline at end of file
from django.conf.urls.defaults import patterns, include, url
urlpatterns = patterns('',
#url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/nx/Index.html$', 'workflows.latino.views.get_adc_index', name='get adc index'),
#url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/(?P<narrow_doc>n?)x/Index.html$', 'workflows.latino.views.get_adc_index', name='get adc index'),
#url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/(?P<narrow_doc>n?)x/Index(?P<document_id_from>[0-9]+)-(?P<document_id_to>[0-9]+).html$', 'workflows.latino.views.get_adc_index', name='get adc index'),
#url(r'^get-adc-index/widget(?P<widget_id>[0-9]+)/(?P<narrow_doc>n?)x/Document(?P<document_id>[0-9]+).html', 'workflows.latino.views.get_adc_page', name='get adc page'),
)
\ No newline at end of file
from django.shortcuts import render
def MUSE_v3_display_summation(request,input_dict,output_dict,widget):
if sum(input_dict['intList']) == input_dict['sum']:
check = 'The calculation appears correct.'
else:
check = 'The calculation appears incorrect!'
return render(request, 'visualizations/MUSE_v3_display_integers.html',{'widget':widget,'input_dict':input_dict, 'output_dict':output_dict, 'check':check})
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