taverna-player 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +18 -0
  3. data/LICENCE.rdoc +29 -0
  4. data/README.rdoc +663 -0
  5. data/Rakefile +65 -0
  6. data/app/assets/javascripts/taverna_player/application.js +14 -0
  7. data/app/assets/javascripts/taverna_player/runs.js +42 -0
  8. data/app/assets/stylesheets/scaffold.css +56 -0
  9. data/app/assets/stylesheets/taverna_player/application.css +13 -0
  10. data/app/assets/stylesheets/taverna_player/coderay.css +120 -0
  11. data/app/controllers/taverna_player/application_controller.rb +16 -0
  12. data/app/controllers/taverna_player/runs_controller.rb +18 -0
  13. data/app/controllers/taverna_player/service_credentials_controller.rb +18 -0
  14. data/app/helpers/taverna_player/application_helper.rb +55 -0
  15. data/app/helpers/taverna_player/runs_helper.rb +84 -0
  16. data/app/models/taverna_player/interaction.rb +25 -0
  17. data/app/models/taverna_player/run.rb +117 -0
  18. data/app/models/taverna_player/run_port.rb +148 -0
  19. data/app/models/taverna_player/service_credential.rb +56 -0
  20. data/app/views/layouts/taverna_player/embedded.html.erb +27 -0
  21. data/app/views/taverna_player/runs/_button.html.erb +19 -0
  22. data/app/views/taverna_player/runs/_info.html.erb +56 -0
  23. data/app/views/taverna_player/runs/_info.json.jbuilder +2 -0
  24. data/app/views/taverna_player/runs/_inputs.html.erb +34 -0
  25. data/app/views/taverna_player/runs/_inputs.json.jbuilder +8 -0
  26. data/app/views/taverna_player/runs/_interaction.html.erb +68 -0
  27. data/app/views/taverna_player/runs/_outputs.html.erb +41 -0
  28. data/app/views/taverna_player/runs/_poll.html.erb +27 -0
  29. data/app/views/taverna_player/runs/create.json.jbuilder +3 -0
  30. data/app/views/taverna_player/runs/embedded/_button.html.erb +19 -0
  31. data/app/views/taverna_player/runs/embedded/_info.html.erb +25 -0
  32. data/app/views/taverna_player/runs/embedded/_inputs.html.erb +32 -0
  33. data/app/views/taverna_player/runs/embedded/_outputs.html.erb +32 -0
  34. data/app/views/taverna_player/runs/embedded/new.html.erb +58 -0
  35. data/app/views/taverna_player/runs/embedded/show.html.erb +39 -0
  36. data/app/views/taverna_player/runs/embedded/show.js.erb +35 -0
  37. data/app/views/taverna_player/runs/index.html.erb +40 -0
  38. data/app/views/taverna_player/runs/index.json.jbuilder +1 -0
  39. data/app/views/taverna_player/runs/new.html.erb +56 -0
  40. data/app/views/taverna_player/runs/new.json.jbuilder +1 -0
  41. data/app/views/taverna_player/runs/show.html.erb +29 -0
  42. data/app/views/taverna_player/runs/show.js.erb +25 -0
  43. data/app/views/taverna_player/runs/show.json.jbuilder +25 -0
  44. data/app/views/taverna_player/service_credentials/_form.html.erb +53 -0
  45. data/app/views/taverna_player/service_credentials/edit.html.erb +18 -0
  46. data/app/views/taverna_player/service_credentials/index.html.erb +41 -0
  47. data/app/views/taverna_player/service_credentials/new.html.erb +17 -0
  48. data/app/views/taverna_player/service_credentials/show.html.erb +36 -0
  49. data/config/routes.rb +34 -0
  50. data/db/migrate/20130313105546_create_taverna_player_runs.rb +16 -0
  51. data/db/migrate/20130315163019_create_taverna_player_run_ports.rb +15 -0
  52. data/db/migrate/20130318170744_add_attachment_file_to_taverna_player_run_ports.rb +6 -0
  53. data/db/migrate/20130319183634_create_delayed_jobs.rb +22 -0
  54. data/db/migrate/20130320102600_add_status_message_to_taverna_player_runs.rb +5 -0
  55. data/db/migrate/20130321100110_add_depth_and_metadata_to_taverna_player_run_ports.rb +6 -0
  56. data/db/migrate/20130704095504_add_attachment_results_to_taverna_player_runs.rb +5 -0
  57. data/db/migrate/20130705142704_add_embedded_to_taverna_player_runs.rb +5 -0
  58. data/db/migrate/20130714140911_create_taverna_player_interactions.rb +13 -0
  59. data/db/migrate/20130717083653_add_proxy_to_taverna_player_runs.rb +6 -0
  60. data/db/migrate/20130717155415_add_stop_to_taverna_player_runs.rb +5 -0
  61. data/db/migrate/20130811152840_add_attachment_log_to_taverna_player_runs.rb +5 -0
  62. data/db/migrate/20130811211725_change_taverna_player_runs_state_column.rb +5 -0
  63. data/db/migrate/20130812155839_add_name_to_taverna_player_runs.rb +5 -0
  64. data/db/migrate/20130918135348_create_taverna_player_service_credentials.rb +15 -0
  65. data/db/migrate/20130919154200_add_displayed_to_taverna_player_interactions.rb +5 -0
  66. data/db/migrate/20131007153209_add_job_ref_to_taverna_player_runs.rb +13 -0
  67. data/db/migrate/20131010094537_add_reply_caching_to_taverna_player_interactions.rb +19 -0
  68. data/db/migrate/20131017141514_add_failure_message_to_taverna_player_run.rb +5 -0
  69. data/db/migrate/20131018152940_add_serial_number_to_taverna_player_interactions.rb +5 -0
  70. data/db/migrate/20131018160715_add_parent_run_id_to_taverna_player_runs.rb +5 -0
  71. data/db/migrate/20131102113933_add_page_uri_to_taverna_player_interaction.rb +5 -0
  72. data/db/migrate/20131105115218_remove_proxy_from_taverna_player_runs.rb +11 -0
  73. data/db/migrate/20131105141934_change_taverna_player_interactions_output_value_column_name.rb +5 -0
  74. data/db/migrate/20131112165520_add_user_to_taverna_player_run.rb +5 -0
  75. data/lib/generators/taverna_player/callbacks_generator.rb +25 -0
  76. data/lib/generators/taverna_player/controllers_generator.rb +30 -0
  77. data/lib/generators/taverna_player/install_generator.rb +30 -0
  78. data/lib/generators/taverna_player/job_generator.rb +26 -0
  79. data/lib/generators/taverna_player/models_generator.rb +27 -0
  80. data/lib/generators/taverna_player/renderers_generator.rb +26 -0
  81. data/lib/generators/taverna_player/views_generator.rb +27 -0
  82. data/lib/generators/templates/ReadMe.txt +118 -0
  83. data/lib/generators/templates/callbacks/render_callbacks.rb +56 -0
  84. data/lib/generators/templates/callbacks/worker_callbacks.rb +31 -0
  85. data/lib/generators/templates/controllers/runs_controller.rb +20 -0
  86. data/lib/generators/templates/controllers/service_credentials_controller.rb +20 -0
  87. data/lib/generators/templates/initializer.rb +154 -0
  88. data/lib/generators/templates/models/run.rb +20 -0
  89. data/lib/tasks/delete-cancelled-runs.rake +26 -0
  90. data/lib/tasks/delete-old-embedded-runs.rake +26 -0
  91. data/lib/taverna-player.rb +139 -0
  92. data/lib/taverna_player/concerns/controllers/runs_controller.rb +281 -0
  93. data/lib/taverna_player/concerns/controllers/service_credentials_controller.rb +89 -0
  94. data/lib/taverna_player/concerns/models/run.rb +205 -0
  95. data/lib/taverna_player/engine.rb +23 -0
  96. data/lib/taverna_player/model_proxy.rb +51 -0
  97. data/lib/taverna_player/output_renderer.rb +96 -0
  98. data/lib/taverna_player/render_callbacks.rb +41 -0
  99. data/lib/taverna_player/version.rb +15 -0
  100. data/lib/taverna_player/worker.rb +325 -0
  101. data/script/delayed_job +5 -0
  102. data/script/rails +8 -0
  103. data/taverna_player.gemspec +46 -0
  104. data/test/dummy/Rakefile +7 -0
  105. data/test/dummy/app/assets/javascripts/application.js +16 -0
  106. data/test/dummy/app/assets/stylesheets/application.css +14 -0
  107. data/test/dummy/app/controllers/application_controller.rb +15 -0
  108. data/test/dummy/app/controllers/home_controller.rb +16 -0
  109. data/test/dummy/app/controllers/taverna_player/runs_controller.rb +25 -0
  110. data/test/dummy/app/controllers/taverna_player/service_credentials_controller.rb +25 -0
  111. data/test/dummy/app/controllers/workflows_controller.rb +17 -0
  112. data/test/dummy/app/models/user.rb +15 -0
  113. data/test/dummy/app/models/workflow.rb +32 -0
  114. data/test/dummy/app/views/home/index.html.erb +18 -0
  115. data/test/dummy/app/views/layouts/application.html.erb +43 -0
  116. data/test/dummy/app/views/workflows/index.html.erb +35 -0
  117. data/test/dummy/config.ru +4 -0
  118. data/test/dummy/config/application.rb +58 -0
  119. data/test/dummy/config/boot.rb +10 -0
  120. data/test/dummy/config/database.yml +25 -0
  121. data/test/dummy/config/environment.rb +5 -0
  122. data/test/dummy/config/environments/development.rb +37 -0
  123. data/test/dummy/config/environments/production.rb +67 -0
  124. data/test/dummy/config/environments/test.rb +37 -0
  125. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  126. data/test/dummy/config/initializers/inflections.rb +15 -0
  127. data/test/dummy/config/initializers/mime_types.rb +5 -0
  128. data/test/dummy/config/initializers/secret_token.rb +7 -0
  129. data/test/dummy/config/initializers/session_store.rb +8 -0
  130. data/test/dummy/config/initializers/taverna_player.example.rb +40 -0
  131. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  132. data/test/dummy/config/locales/en.yml +5 -0
  133. data/test/dummy/config/routes.rb +22 -0
  134. data/test/dummy/db/migrate/20130314103555_create_workflows.rb +12 -0
  135. data/test/dummy/db/migrate/20130318141557_create_taverna_player_runs.taverna_player.rb +17 -0
  136. data/test/dummy/db/migrate/20130318141558_create_taverna_player_run_ports.taverna_player.rb +16 -0
  137. data/test/dummy/db/migrate/20130318173013_add_attachment_file_to_taverna_player_run_ports.taverna_player.rb +7 -0
  138. data/test/dummy/db/migrate/20130319183816_create_delayed_jobs.taverna_player.rb +23 -0
  139. data/test/dummy/db/migrate/20130320102635_add_status_message_to_taverna_player_runs.taverna_player.rb +6 -0
  140. data/test/dummy/db/migrate/20130321161859_add_depth_and_metadata_to_taverna_player_run_ports.taverna_player.rb +7 -0
  141. data/test/dummy/db/migrate/20130704100146_add_attachment_results_to_taverna_player_runs.taverna_player.rb +6 -0
  142. data/test/dummy/db/migrate/20130705142816_add_embedded_to_taverna_player_runs.taverna_player.rb +6 -0
  143. data/test/dummy/db/migrate/20130714142144_create_taverna_player_interactions.taverna_player.rb +14 -0
  144. data/test/dummy/db/migrate/20130717084809_add_proxy_to_taverna_player_runs.taverna_player.rb +7 -0
  145. data/test/dummy/db/migrate/20130718102707_add_stop_to_taverna_player_runs.taverna_player.rb +6 -0
  146. data/test/dummy/db/migrate/20130811204449_add_attachment_log_to_taverna_player_runs.taverna_player.rb +6 -0
  147. data/test/dummy/db/migrate/20130811212709_change_taverna_player_runs_state_column.taverna_player.rb +6 -0
  148. data/test/dummy/db/migrate/20130812161152_add_name_to_taverna_player_runs.taverna_player.rb +6 -0
  149. data/test/dummy/db/migrate/20130918155525_create_taverna_player_service_credentials.taverna_player.rb +16 -0
  150. data/test/dummy/db/migrate/20130919155202_add_displayed_to_taverna_player_interactions.taverna_player.rb +6 -0
  151. data/test/dummy/db/migrate/20131007153659_add_job_ref_to_taverna_player_runs.taverna_player.rb +14 -0
  152. data/test/dummy/db/migrate/20131016123941_add_reply_caching_to_taverna_player_interactions.taverna_player.rb +20 -0
  153. data/test/dummy/db/migrate/20131017141614_add_failure_message_to_taverna_player_run.taverna_player.rb +6 -0
  154. data/test/dummy/db/migrate/20131018153316_add_serial_number_to_taverna_player_interactions.taverna_player.rb +6 -0
  155. data/test/dummy/db/migrate/20131018164614_add_parent_run_id_to_taverna_player_runs.taverna_player.rb +6 -0
  156. data/test/dummy/db/migrate/20131102114343_add_page_uri_to_taverna_player_interaction.taverna_player.rb +6 -0
  157. data/test/dummy/db/migrate/20131105115724_remove_proxy_from_taverna_player_runs.taverna_player.rb +12 -0
  158. data/test/dummy/db/migrate/20131105142417_change_taverna_player_interactions_output_value_column_name.taverna_player.rb +6 -0
  159. data/test/dummy/db/migrate/20131112165815_add_user_to_taverna_player_run.taverna_player.rb +6 -0
  160. data/test/dummy/db/migrate/20131114130937_create_users.rb +10 -0
  161. data/test/dummy/db/schema.rb +123 -0
  162. data/test/dummy/lib/callbacks.rb +35 -0
  163. data/test/dummy/log/.gitkeep +0 -0
  164. data/test/dummy/public/404.html +26 -0
  165. data/test/dummy/public/422.html +26 -0
  166. data/test/dummy/public/500.html +25 -0
  167. data/test/dummy/public/favicon.ico +0 -0
  168. data/test/dummy/script/delayed_job +5 -0
  169. data/test/dummy/script/rails +6 -0
  170. data/test/dummy/test/functional/home_controller_test.rb +28 -0
  171. data/test/dummy/test/functional/workflows_controller_test.rb +21 -0
  172. data/test/fixtures/files/crassostrea_gigas.csv +737 -0
  173. data/test/fixtures/taverna_player/interactions.yml +32 -0
  174. data/test/fixtures/taverna_player/run_ports.yml +54 -0
  175. data/test/fixtures/taverna_player/runs.yml +69 -0
  176. data/test/fixtures/taverna_player/service_credentials.yml +25 -0
  177. data/test/fixtures/users.yml +16 -0
  178. data/test/fixtures/workflows.yml +32 -0
  179. data/test/functional/taverna_player/runs_controller_test.rb +316 -0
  180. data/test/functional/taverna_player/service_credentials_controller_test.rb +99 -0
  181. data/test/taverna_player_test.rb +25 -0
  182. data/test/test_helper.rb +33 -0
  183. data/test/unit/helpers/taverna_player/application_helper_test.rb +70 -0
  184. data/test/unit/helpers/taverna_player/runs_helper_test.rb +45 -0
  185. data/test/unit/taverna_player/interaction_test.rb +47 -0
  186. data/test/unit/taverna_player/run_port_test.rb +309 -0
  187. data/test/unit/taverna_player/run_test.rb +196 -0
  188. data/test/unit/taverna_player/service_credential_test.rb +64 -0
  189. data/test/workflows/hello.t2flow +164 -0
  190. data/test/workflows/list_with_errors.t2flow +107 -0
  191. data/test/workflows/pass_through.t2flow +12 -0
  192. metadata +539 -0
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env rake
2
+ #------------------------------------------------------------------------------
3
+ # Copyright (c) 2013 The University of Manchester, UK.
4
+ #
5
+ # BSD Licenced. See LICENCE.rdoc for details.
6
+ #
7
+ # Taverna Player was developed in the BioVeL project, funded by the European
8
+ # Commission 7th Framework Programme (FP7), through grant agreement
9
+ # number 283359.
10
+ #
11
+ # Author: Robert Haines
12
+ #------------------------------------------------------------------------------
13
+
14
+ begin
15
+ require 'bundler/setup'
16
+ rescue LoadError
17
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
18
+ end
19
+ begin
20
+ require 'rdoc/task'
21
+ rescue LoadError
22
+ require 'rdoc/rdoc'
23
+ require 'rake/rdoctask'
24
+ RDoc::Task = Rake::RDocTask
25
+ end
26
+
27
+ RDoc::Task.new(:rdoc) do |rdoc|
28
+ rdoc.rdoc_dir = 'rdoc'
29
+ rdoc.main = 'README.rdoc'
30
+ rdoc.title = 'Taverna Player'
31
+ rdoc.options << '--line-numbers'
32
+ rdoc.options << "--tab-width=2"
33
+
34
+ files = [
35
+ "README.rdoc",
36
+ "LICENCE.rdoc",
37
+ "app/helpers/taverna_player/application_helper.rb",
38
+ "app/models/taverna_player/run.rb",
39
+ "app/models/taverna_player/run_port.rb",
40
+ "app/models/taverna_player/service_credential.rb",
41
+ "lib/taverna-player.rb",
42
+ "lib/taverna_player/output_renderer.rb"
43
+ ]
44
+
45
+ rdoc.rdoc_files.include(files)
46
+ end
47
+
48
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
49
+ load 'rails/tasks/engine.rake'
50
+
51
+
52
+
53
+ Bundler::GemHelper.install_tasks
54
+
55
+ require 'rake/testtask'
56
+
57
+ Rake::TestTask.new(:test) do |t|
58
+ t.libs << 'lib'
59
+ t.libs << 'test'
60
+ t.pattern = 'test/**/*_test.rb'
61
+ t.verbose = false
62
+ end
63
+
64
+
65
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require pmrpc
14
+ //= require_tree .
@@ -0,0 +1,42 @@
1
+ //-----------------------------------------------------------------------------
2
+ // Copyright (c) 2013 The University of Manchester, UK.
3
+ //
4
+ // BSD Licenced. See LICENCE.rdoc for details.
5
+ //
6
+ // Taverna Player was developed in the BioVeL project, funded by the European
7
+ // Commission 7th Framework Programme (FP7), through grant agreement
8
+ // number 283359.
9
+ //
10
+ // Author: Robert Haines
11
+ //-----------------------------------------------------------------------------
12
+
13
+ // Copied from http://www.netlobo.com/url_query_string_javascript.html
14
+ function getParameterValue(name) {
15
+ name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
16
+ var regexS = "[\\?&]" + name + "=([^&#]*)";
17
+ var regex = new RegExp(regexS);
18
+ var results = regex.exec(window.location.href);
19
+
20
+ if (results == null)
21
+ return "";
22
+ else
23
+ return results[1];
24
+ }
25
+
26
+ function interaction_reply(url, status, results) {
27
+ var outputData = JSON.stringify(results);
28
+
29
+ jQuery.ajax({
30
+ url: url,
31
+ type: "POST",
32
+ async: false,
33
+ data: outputData,
34
+ headers: {
35
+ "Content-Type": "application/json",
36
+ "X-Taverna-Interaction-Reply": escape(status),
37
+ "X-CSRF-Token": jQuery('meta[name="csrf-token"]').attr("content")
38
+ }
39
+ });
40
+
41
+ return false;
42
+ }
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,120 @@
1
+ .CodeRay {
2
+ background-color: hsl(0,0%,95%);
3
+ border: 1px solid silver;
4
+ color: black;
5
+ }
6
+ .CodeRay pre {
7
+ margin: 0px;
8
+ }
9
+
10
+ span.CodeRay { white-space: pre; border: 0px; padding: 2px; }
11
+
12
+ table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px; }
13
+ table.CodeRay td { padding: 2px 4px; vertical-align: top; }
14
+
15
+ .CodeRay .line-numbers {
16
+ background-color: hsl(100,65%,90%);
17
+ color: gray;
18
+ text-align: right;
19
+ -webkit-user-select: none;
20
+ -moz-user-select: none;
21
+ user-select: none;
22
+ }
23
+ .CodeRay .line-numbers a {
24
+ background-color: hsl(100,65%,90%) !important;
25
+ color: gray !important;
26
+ text-decoration: none !important;
27
+ }
28
+ .CodeRay .line-numbers a:target { color: blue !important; }
29
+ .CodeRay .line-numbers .highlighted { color: red !important; }
30
+ .CodeRay .line-numbers .highlighted a { color: red !important; }
31
+ .CodeRay span.line-numbers { padding: 0px 4px; }
32
+ .CodeRay .line { display: block; float: left; width: 100%; }
33
+ .CodeRay .code { width: 100%; }
34
+
35
+ .CodeRay .debug { color: white !important; background: blue !important; }
36
+
37
+ .CodeRay .annotation { color:#007 }
38
+ .CodeRay .attribute-name { color:#b48 }
39
+ .CodeRay .attribute-value { color:#700 }
40
+ .CodeRay .binary { color:#509 }
41
+ .CodeRay .char .content { color:#D20 }
42
+ .CodeRay .char .delimiter { color:#710 }
43
+ .CodeRay .char { color:#D20 }
44
+ .CodeRay .class { color:#B06; font-weight:bold }
45
+ .CodeRay .class-variable { color:#369 }
46
+ .CodeRay .color { color:#0A0 }
47
+ .CodeRay .comment { color:#777 }
48
+ .CodeRay .comment .char { color:#444 }
49
+ .CodeRay .comment .delimiter { color:#444 }
50
+ .CodeRay .complex { color:#A08 }
51
+ .CodeRay .constant { color:#036; font-weight:bold }
52
+ .CodeRay .decorator { color:#B0B }
53
+ .CodeRay .definition { color:#099; font-weight:bold }
54
+ .CodeRay .delimiter { color:black }
55
+ .CodeRay .directive { color:#088; font-weight:bold }
56
+ .CodeRay .doc { color:#970 }
57
+ .CodeRay .doc-string { color:#D42; font-weight:bold }
58
+ .CodeRay .doctype { color:#34b }
59
+ .CodeRay .entity { color:#800; font-weight:bold }
60
+ .CodeRay .error { color:#F00; background-color:#FAA }
61
+ .CodeRay .escape { color:#666 }
62
+ .CodeRay .exception { color:#C00; font-weight:bold }
63
+ .CodeRay .float { color:#60E }
64
+ .CodeRay .function { color:#06B; font-weight:bold }
65
+ .CodeRay .global-variable { color:#d70 }
66
+ .CodeRay .hex { color:#02b }
67
+ .CodeRay .imaginary { color:#f00 }
68
+ .CodeRay .include { color:#B44; font-weight:bold }
69
+ .CodeRay .inline { background-color: hsla(0,0%,0%,0.07); color: black }
70
+ .CodeRay .inline-delimiter { font-weight: bold; color: #666 }
71
+ .CodeRay .instance-variable { color:#33B }
72
+ .CodeRay .integer { color:#00D }
73
+ .CodeRay .key .char { color: #60f }
74
+ .CodeRay .key .delimiter { color: #404 }
75
+ .CodeRay .key { color: #606 }
76
+ .CodeRay .keyword { color:#080; font-weight:bold }
77
+ .CodeRay .label { color:#970; font-weight:bold }
78
+ .CodeRay .local-variable { color:#963 }
79
+ .CodeRay .namespace { color:#707; font-weight:bold }
80
+ .CodeRay .octal { color:#40E }
81
+ .CodeRay .operator { }
82
+ .CodeRay .predefined { color:#369; font-weight:bold }
83
+ .CodeRay .predefined-constant { color:#069 }
84
+ .CodeRay .predefined-type { color:#0a5; font-weight:bold }
85
+ .CodeRay .preprocessor { color:#579 }
86
+ .CodeRay .pseudo-class { color:#00C; font-weight:bold }
87
+ .CodeRay .regexp .content { color:#808 }
88
+ .CodeRay .regexp .delimiter { color:#404 }
89
+ .CodeRay .regexp .modifier { color:#C2C }
90
+ .CodeRay .regexp { background-color:hsla(300,100%,50%,0.06); }
91
+ .CodeRay .reserved { color:#080; font-weight:bold }
92
+ .CodeRay .shell .content { color:#2B2 }
93
+ .CodeRay .shell .delimiter { color:#161 }
94
+ .CodeRay .shell { background-color:hsla(120,100%,50%,0.06); }
95
+ .CodeRay .string .char { color: #b0b }
96
+ .CodeRay .string .content { color: #D20 }
97
+ .CodeRay .string .delimiter { color: #710 }
98
+ .CodeRay .string .modifier { color: #E40 }
99
+ .CodeRay .string { background-color:hsla(0,100%,50%,0.05); }
100
+ .CodeRay .symbol .content { color:#A60 }
101
+ .CodeRay .symbol .delimiter { color:#630 }
102
+ .CodeRay .symbol { color:#A60 }
103
+ .CodeRay .tag { color:#070 }
104
+ .CodeRay .type { color:#339; font-weight:bold }
105
+ .CodeRay .value { color: #088; }
106
+ .CodeRay .variable { color:#037 }
107
+
108
+ .CodeRay .insert { background: hsla(120,100%,50%,0.12) }
109
+ .CodeRay .delete { background: hsla(0,100%,50%,0.12) }
110
+ .CodeRay .change { color: #bbf; background: #007; }
111
+ .CodeRay .head { color: #f8f; background: #505 }
112
+ .CodeRay .head .filename { color: white; }
113
+
114
+ .CodeRay .delete .eyecatcher { background-color: hsla(0,100%,50%,0.2); border: 1px solid hsla(0,100%,45%,0.5); margin: -1px; border-bottom: none; border-top-left-radius: 5px; border-top-right-radius: 5px; }
115
+ .CodeRay .insert .eyecatcher { background-color: hsla(120,100%,50%,0.2); border: 1px solid hsla(120,100%,25%,0.5); margin: -1px; border-top: none; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
116
+
117
+ .CodeRay .insert .insert { color: #0c0; background:transparent; font-weight:bold }
118
+ .CodeRay .delete .delete { color: #c00; background:transparent; font-weight:bold }
119
+ .CodeRay .change .change { color: #88f }
120
+ .CodeRay .head .head { color: #f4f }
@@ -0,0 +1,16 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2013 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ module TavernaPlayer
14
+ class ApplicationController < ApplicationController
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2013 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ module TavernaPlayer
14
+ class RunsController < TavernaPlayer::ApplicationController
15
+ # See lib/taverna_player/concerns/controllers/runs_controller.rb
16
+ include TavernaPlayer::Concerns::Controllers::RunsController
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2013 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ module TavernaPlayer
14
+ class ServiceCredentialsController < TavernaPlayer::ApplicationController
15
+ # See lib/taverna_player/concerns/controllers/service_credentials_controller.rb
16
+ include TavernaPlayer::Concerns::Controllers::ServiceCredentialsController
17
+ end
18
+ end
@@ -0,0 +1,55 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2013 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ module TavernaPlayer
14
+
15
+ # These helpers will be available in the main application when you use
16
+ # Taverna Player.
17
+ module ApplicationHelper
18
+
19
+ # :call-seq:
20
+ # new_embedded_run_path(workflow) -> string
21
+ #
22
+ # Given a workflow instance, or workflow id, this method returns the URI
23
+ # path to a new embedded run of that workflow.
24
+ def new_embedded_run_path(id_or_model)
25
+ id = workflow_id(id_or_model)
26
+
27
+ raw(taverna_player.new_run_path(:workflow_id => id, :embedded => true))
28
+ end
29
+
30
+ # :call-seq:
31
+ # new_embedded_run_url(workflow) -> string
32
+ #
33
+ # Given a workflow instance, or workflow id, this method returns the full
34
+ # URI to a new embedded run of that workflow.
35
+ def new_embedded_run_url(id_or_model)
36
+ id = workflow_id(id_or_model)
37
+
38
+ raw(taverna_player.new_run_url(:workflow_id => id, :embedded => true))
39
+ end
40
+
41
+ private
42
+
43
+ def workflow_id(id_or_model)
44
+ case id_or_model
45
+ when TavernaPlayer::Run
46
+ id_or_model.workflow_id
47
+ when TavernaPlayer.workflow_proxy.class_name
48
+ id_or_model.id
49
+ else
50
+ id_or_model
51
+ end
52
+ end
53
+
54
+ end
55
+ end
@@ -0,0 +1,84 @@
1
+ #------------------------------------------------------------------------------
2
+ # Copyright (c) 2013 The University of Manchester, UK.
3
+ #
4
+ # BSD Licenced. See LICENCE.rdoc for details.
5
+ #
6
+ # Taverna Player was developed in the BioVeL project, funded by the European
7
+ # Commission 7th Framework Programme (FP7), through grant agreement
8
+ # number 283359.
9
+ #
10
+ # Author: Robert Haines
11
+ #------------------------------------------------------------------------------
12
+
13
+ module TavernaPlayer
14
+ module RunsHelper
15
+
16
+ def interaction_redirect(interaction)
17
+ if interaction.page_uri.blank?
18
+ run_url(interaction.run) + "/interaction/#{interaction.unique_id}"
19
+ else
20
+ interaction.page_uri
21
+ end
22
+ end
23
+
24
+ def show_output(run, output)
25
+ if output.depth == 0
26
+ if output.value.blank?
27
+ content = run_path(output.run_id) + "/output/#{output.name}"
28
+ else
29
+ if output.metadata[:size] < 255
30
+ content = output.value
31
+ else
32
+ Zip::ZipFile.open(run.results.path) do |zip|
33
+ content = zip.read(output.name)
34
+ end
35
+ end
36
+ end
37
+ raw(TavernaPlayer.output_renderer.render(content, output.metadata[:type]))
38
+ else
39
+ parse_port_list(run, output)
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ def parse_port_list(run, output)
46
+ types = output.metadata[:type]
47
+ content = String.new
48
+
49
+ Zip::ZipFile.open(run.results.path) do |zip|
50
+ content = deep_parse(types, output, zip)
51
+ end
52
+
53
+ content
54
+ end
55
+
56
+ def deep_parse(types, output, zip, index = [])
57
+ content = "<ol>"
58
+ i = 0
59
+ types.each do |type|
60
+ if type.is_a?(Array)
61
+ content += "<li><br />" +
62
+ deep_parse(type, output, zip, index + [i]) + "</li>"
63
+ else
64
+ # Text outputs are inlined here by us. Other types are linked and
65
+ # inlined by the browser.
66
+ content += "<li>(#{type})<p>"
67
+ if type.starts_with?("text")
68
+ path = (index + [i]).map { |j| j += 1 }.join("/")
69
+ data = zip.read("#{output.name}/#{path}")
70
+ else
71
+ path = (index + [i]).join("/")
72
+ data = run_path(output.run_id) + "/output/#{output.name}/#{path}"
73
+ end
74
+ content += TavernaPlayer.output_renderer.render(data, type)
75
+ content += "</p></li>"
76
+ end
77
+ i += 1
78
+ end
79
+
80
+ raw(content += "</ol>")
81
+ end
82
+
83
+ end
84
+ end