Commit e228cc18 authored by vpodpecan's avatar vpodpecan

few widgets copied from old MUSE package + some fixes

parent e6b7b909
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
return render(request, 'interactions/MUSE_v3_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})
def MUSE_string_to_file(request, input_dict, output_dict, widget):
from mothra.settings import MEDIA_ROOT
from workflows.helpers import ensure_dir
basename = '/'.join([str(request.user.id), str(widget.id) + str(input_dict['fending'])])
destination = '/'.join([MEDIA_ROOT, basename])
ensure_dir(destination)
with open(destination, 'w') as f:
f.write(str(input_dict['data']))
return render(request, 'visualizations/MUSE_string_to_file.html', {'widget': widget, 'fileURL': basename})
......@@ -200,7 +200,7 @@ def MUSE_PG_GDEE_text(input_dict):
#end
def PG_GDEE_path(input_dict):
def MUSE_PG_GDEE_path(input_dict):
url = input_dict['url']
path = input_dict['path']
lang = input_dict['lang']
......@@ -216,9 +216,34 @@ def PG_GDEE_path(input_dict):
#### COPIED FROM OLD MUSE PACKAGE
def MUSE_mapping_to_KR_precomputed(input_dict):
url = input_dict['url']
data = input_dict['input_data']
import socket
cli = JSONWSPClient(url)
result = cli.mapping_to_KR_precomputed(SRL=data)
mapping, xml = result.response_dict['result']
return {'mapping': mapping, 'xml': xml}
#end
def MUSE_mapping_to_KR(input_dict):
url = input_dict['url']
data = input_dict['input_data']
import socket
cli = JSONWSPClient(url)
socket.setdefaulttimeout(None)
result = cli.mapping_to_KR(SRL=data)
mapping, xml = result.response_dict['result']
return {'mapping': mapping, 'xml': xml}
#end
......
{
"model": "workflows.category",
"fields": {
"name": "Utilities",
"parent": "853d1bb3-3710-4fae-a95a-2955abd7b7fe",
"order": 4,
"uid": "4ed86661-3802-4d53-b0f8-d68e1e79b28b"
}
}
\ No newline at end of file
{
"model": "workflows.category",
"fields": {
"name": "3D virtual environment",
"parent": "853d1bb3-3710-4fae-a95a-2955abd7b7fe",
"order": 1,
"uid": "feb15899-59e3-46c8-994c-bbe806668fc8"
}
}
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "c0ecc61e-3fe1-4681-8ed7-8d45e796d9d0",
"treeview_image": "",
"uid": "15044fea-249e-47e4-85bb-9f221dff407c",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "Returns the precomputed mapping to knowledge representation for Tuk story",
"static_image": "",
"action": "MUSE_mapping_to_KR_precomputed",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Mapping to Knowledge representation (precomputed)"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "15044fea-249e-47e4-85bb-9f221dff407c",
"name": "Service url",
"short_name": "url",
"default": "http://grom.ijs.si:8001/MUSE_services_V3/jsonwsp/description",
"description": "URL of the MUSE service",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 2,
"uid": "086888e6-5245-4b02-936f-9150e518286d"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "15044fea-249e-47e4-85bb-9f221dff407c",
"name": "Input data",
"short_name": "str",
"default": "",
"description": "Plain text file with special annotations",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "input_data",
"parameter": false,
"order": 1,
"uid": "29cccf02-c126-4aea-b3f0-c7f3adba87d0"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "15044fea-249e-47e4-85bb-9f221dff407c",
"name": "XML with results",
"short_name": "xml",
"description": "XML with results",
"variable": "xml",
"order": 2,
"uid": "6e3a52a7-1335-4d22-a498-80969e6681fd"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "15044fea-249e-47e4-85bb-9f221dff407c",
"name": "Instantiated event templates",
"short_name": "tpl",
"description": "Instantiated event-templates with argument roles as defined in the domain.\r\n",
"variable": "mapping",
"order": 1,
"uid": "f70a183a-11da-4106-a6ce-d8f2933a6610"
}
}
]
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "feb15899-59e3-46c8-994c-bbe806668fc8",
"treeview_image": "",
"uid": "16a08e1b-9c2a-4080-b45b-7d16ce3c5a24",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "Local copy of the 3D demonstrator for the Tuk the Hunter children story",
"static_image": "",
"action": "MUSE_virtual_environment_demonstrator_tuk_local",
"visualization_view": "MUSE_virtual_environment_demonstrator_tuk_local",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Tuk the Hunter 3D demonstrator (local)"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "16a08e1b-9c2a-4080-b45b-7d16ce3c5a24",
"name": "mapping file URL",
"short_name": "lnk",
"default": "",
"description": "A link to the XML file contating mapping to knowledge representation",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "mappingLink",
"parameter": false,
"order": 1,
"uid": "7b6fff11-1076-44d1-a0f6-f6a1c196e9d7"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "16a08e1b-9c2a-4080-b45b-7d16ce3c5a24",
"name": "Unity3D app link",
"short_name": "lnk",
"default": "Tuk-Text-Workflow-Web.html",
"description": "A link to the Tuk Unity3D web app",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "unityLink",
"parameter": true,
"order": 2,
"uid": "867160f8-93e5-4a79-ab35-cb8577c4e98b"
}
}
]
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "4ed86661-3802-4d53-b0f8-d68e1e79b28b",
"treeview_image": "",
"uid": "2ff1194f-e2f7-4abf-a049-26faae3ba9e6",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "Displays XML in a modal window",
"static_image": "",
"action": "MUSE_view_xml",
"visualization_view": "MUSE_view_xml",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "View XML"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "2ff1194f-e2f7-4abf-a049-26faae3ba9e6",
"name": "XML document",
"short_name": "xml",
"default": "",
"description": "XML document as string",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "xml_data",
"parameter": false,
"order": 1,
"uid": "61678848-0930-4902-8467-39e1d0cdcbe1"
}
}
]
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "4ed86661-3802-4d53-b0f8-d68e1e79b28b",
"treeview_image": "",
"uid": "686ae43e-46db-4340-8c21-15d79d84ae81",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "MUSE_string_to_file",
"has_progress_bar": false,
"image": "",
"description": "Creates a statically served file from the given (text) content.",
"static_image": "",
"action": "MUSE_string_to_file",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "MUSE_string_to_file_finished",
"wsdl_method": "",
"wsdl": "",
"interactive": true,
"is_streaming": false,
"order": 1,
"name": "String to statically hosted file"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "686ae43e-46db-4340-8c21-15d79d84ae81",
"name": "File extension",
"short_name": "typ",
"default": ".xml",
"description": "Extension of the static file",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "fending",
"parameter": true,
"order": 2,
"uid": "10575f0d-0fc2-4064-8dfd-eeee56cb3f88"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "686ae43e-46db-4340-8c21-15d79d84ae81",
"name": "Input data",
"short_name": "str",
"default": "",
"description": "Input data as string",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "data",
"parameter": false,
"order": 1,
"uid": "8d4f2164-03e4-4616-914f-45bd6e669036"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "686ae43e-46db-4340-8c21-15d79d84ae81",
"name": "Link",
"short_name": "url",
"description": "Link to the statically hosted file",
"variable": "fileURL",
"order": 1,
"uid": "d77f9ed0-ecd9-4a04-9248-2246f5a4e934"
}
}
]
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "feb15899-59e3-46c8-994c-bbe806668fc8",
"treeview_image": "",
"uid": "6b040c91-3157-4e0b-a604-beb516b77e3e",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "3D demonstrator for the Tuk the Hunter children story",
"static_image": "",
"action": "MUSE_virtual_environment_demonstrator_tuk",
"visualization_view": "MUSE_virtual_environment_demonstrator_tuk",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Tuk the Hunter 3D demonstrator"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "6b040c91-3157-4e0b-a604-beb516b77e3e",
"name": "mapping file URL",
"short_name": "lnk",
"default": "",
"description": "A link to the XML file contating mapping to knowledge representation",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "mappingLink",
"parameter": false,
"order": 1,
"uid": "2d1d3965-ed9b-4b45-93b8-f7c69634c6ff"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "6b040c91-3157-4e0b-a604-beb516b77e3e",
"name": "Unity3D app link",
"short_name": "lnk",
"default": "https://ive.scm.tees.ac.uk/muse/tuk-text/Tuk-Text-Workflow-Web.html",
"description": "A link to the Tuk Unity3D web app",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "unityLink",
"parameter": true,
"order": 2,
"uid": "97735dc7-5f07-4b51-89e6-875ed4cdd980"
}
}
]
\ No newline at end of file
......@@ -12,7 +12,7 @@
"image": "",
"description": "This function calls the command line version of G-DEE (a document engineering environment for clinical guidelines).",
"static_image": "",
"action": "PG_GDEE_path",
"action": "MUSE_PG_GDEE_path",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
......@@ -37,7 +37,7 @@
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 1,
"order": 3,
"uid": "04c44a3c-8370-4bed-988f-ed49406181b1"
}
},
......@@ -71,7 +71,7 @@
"parameter_type": "select",
"variable": "lang",
"parameter": true,
"order": 1,
"order": 2,
"uid": "e692430c-d5fc-4ee6-890a-c8195673ae29"
}
},
......
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "c0ecc61e-3fe1-4681-8ed7-8d45e796d9d0",
"treeview_image": "",
"uid": "e69cf7bf-378c-4f51-8a7f-1e8f523432dd",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "Calls the mapping to knowledge representation service",
"static_image": "",
"action": "MUSE_mapping_to_KR",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Mapping to Knowledge representation"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "e69cf7bf-378c-4f51-8a7f-1e8f523432dd",
"name": "Input data",
"short_name": "str",
"default": "",
"description": "Plain text file with special annotations",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "input_data",
"parameter": false,
"order": 1,
"uid": "7c646240-9f4c-455d-a40e-6bdbcf86bd77"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "e69cf7bf-378c-4f51-8a7f-1e8f523432dd",
"name": "Service url",
"short_name": "url",
"default": "http://grom.ijs.si:8001/MUSE_services_V3/jsonwsp/description",
"description": "URL of the MUSE service",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 2,
"uid": "a93203d3-d761-4f1b-b5ea-47e12f87a4e2"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "e69cf7bf-378c-4f51-8a7f-1e8f523432dd",
"name": "XML with results",
"short_name": "xml",
"description": "XML with results",
"variable": "xml",
"order": 2,
"uid": "6a4d02c9-0fae-4637-bd59-aa30907581b2"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "e69cf7bf-378c-4f51-8a7f-1e8f523432dd",
"name": "Instantiated event templates",
"short_name": "tpl",
"description": "Instantiated event-templates with argument roles as defined in the domain.\r\n",
"variable": "mapping",
"order": 1,
"uid": "d58169f9-772a-4a98-8057-04d1dd57bb13"
}
}
]
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity Web Player | Tuk the Hunter - Text Parsing</title>
<script type='text/javascript' src='https://ssl-webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/jquery.min.js'></script>
<script type="text/javascript">
<!--
var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";
if (document.location.protocol == 'https:')
unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>');
-->
</script>
<script type="text/javascript">
<!--
var config = {
width: 960,
height: 600,
params: { enableDebugging:"0" }
};
var u = new UnityObject2(config);
jQuery(function() {
var $missingScreen = jQuery("#unityPlayer").find(".missing");
var $brokenScreen = jQuery("#unityPlayer").find(".broken");
$missingScreen.hide();
$brokenScreen.hide();
u.observeProgress(function (progress) {
switch(progress.pluginStatus) {
case "broken":
$brokenScreen.find("a").click(function (e) {
e.stopPropagation();
e.preventDefault();
u.installPlugin();
return false;
});
$brokenScreen.show();
break;
case "missing":
$missingScreen.find("a").click(function (e) {
e.stopPropagation();
e.preventDefault();
u.installPlugin();
return false;
});
$missingScreen.show();
break;
case "installed":
$missingScreen.remove();
break;
case "first":
break;
}
});