taverna-player 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
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,13 @@
1
+ class CreateTavernaPlayerInteractions < ActiveRecord::Migration
2
+ def change
3
+ create_table :taverna_player_interactions do |t|
4
+ t.string :uri
5
+ t.boolean :replied, :default => false
6
+ t.references :run
7
+
8
+ t.timestamps
9
+ end
10
+
11
+ add_index :taverna_player_interactions, :run_id
12
+ end
13
+ end
@@ -0,0 +1,6 @@
1
+ class AddProxyToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :proxy_notifications, :string
4
+ add_column :taverna_player_runs, :proxy_interactions, :string
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddStopToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :stop, :boolean, :default => false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddAttachmentLogToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def change
3
+ add_attachment :taverna_player_runs, :log
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class ChangeTavernaPlayerRunsStateColumn < ActiveRecord::Migration
2
+ def change
3
+ rename_column :taverna_player_runs, :state, :saved_state
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddNameToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :name, :string, :default => "None"
4
+ end
5
+ end
@@ -0,0 +1,15 @@
1
+ class CreateTavernaPlayerServiceCredentials < ActiveRecord::Migration
2
+ def change
3
+ create_table :taverna_player_service_credentials do |t|
4
+ t.string :uri, :null => false
5
+ t.string :name
6
+ t.text :description
7
+ t.string :login
8
+ t.string :password
9
+
10
+ t.timestamps
11
+ end
12
+
13
+ add_index :taverna_player_service_credentials, :uri
14
+ end
15
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayedToTavernaPlayerInteractions < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_interactions, :displayed, :boolean, :default => false
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class AddJobRefToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def up
3
+ change_table :taverna_player_runs do |t|
4
+ t.references :delayed_job
5
+ end
6
+ end
7
+
8
+ def down
9
+ change_table :taverna_player_runs do |t|
10
+ t.remove :delayed_job_id
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ class AddReplyCachingToTavernaPlayerInteractions < ActiveRecord::Migration
2
+ def up
3
+ remove_column :taverna_player_interactions, :uri
4
+ add_column :taverna_player_interactions, :unique_id, :string
5
+ add_column :taverna_player_interactions, :page, :text
6
+ add_column :taverna_player_interactions, :feed_reply, :string
7
+ add_column :taverna_player_interactions, :output_value, :text, :limit => 16777215
8
+ add_index :taverna_player_interactions, :unique_id
9
+ end
10
+
11
+ def down
12
+ remove_index :taverna_player_interactions, :unique_id
13
+ remove_column :taverna_player_interactions, :output_value
14
+ remove_column :taverna_player_interactions, :feed_reply
15
+ remove_column :taverna_player_interactions, :page
16
+ remove_column :taverna_player_interactions, :unique_id
17
+ add_column :taverna_player_interactions, :uri, :string
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ class AddFailureMessageToTavernaPlayerRun < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :failure_message, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddSerialNumberToTavernaPlayerInteractions < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_interactions, :serial, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddParentRunIdToTavernaPlayerRuns < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :parent_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPageUriToTavernaPlayerInteraction < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_interactions, :page_uri, :string
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class RemoveProxyFromTavernaPlayerRuns < ActiveRecord::Migration
2
+ def up
3
+ remove_column :taverna_player_runs, :proxy_notifications
4
+ remove_column :taverna_player_runs, :proxy_interactions
5
+ end
6
+
7
+ def down
8
+ add_column :taverna_player_runs, :proxy_interactions, :string
9
+ add_column :taverna_player_runs, :proxy_notifications, :string
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class ChangeTavernaPlayerInteractionsOutputValueColumnName < ActiveRecord::Migration
2
+ def change
3
+ rename_column :taverna_player_interactions, :output_value, :data
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserToTavernaPlayerRun < ActiveRecord::Migration
2
+ def change
3
+ add_column :taverna_player_runs, :user_id, :integer
4
+ end
5
+ end
@@ -0,0 +1,25 @@
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 Generators
15
+ class CallbacksGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../templates/callbacks", __FILE__)
17
+
18
+ desc "Create some basic callbacks in 'lib/taverna_player_callbacks.rb'"
19
+
20
+ def copy_callbacks
21
+ copy_file "worker_callbacks.rb", "lib/taverna_player_callbacks.rb"
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,30 @@
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 Generators
15
+ class ControllersGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../templates/controllers", __FILE__)
17
+
18
+ desc "Copy the Taverna Player controllers into the main app for "\
19
+ "customization."
20
+
21
+ def copy_controllers
22
+ copy_file "runs_controller.rb",
23
+ "app/controllers/taverna_player/runs_controller.rb"
24
+
25
+ copy_file "service_credentials_controller.rb",
26
+ "app/controllers/taverna_player/service_credentials_controller.rb"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,30 @@
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 Generators
15
+ class InstallGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../templates", __FILE__)
17
+
18
+ desc "Creates a Taverna Player initializer"
19
+
20
+ def copy_initializer
21
+ copy_file "initializer.rb",
22
+ "config/initializers/taverna_player.rb.example"
23
+ end
24
+
25
+ def show_readme
26
+ readme "ReadMe.txt" if behavior == :invoke
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,26 @@
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 Generators
15
+ class JobGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../../../script", __FILE__)
17
+
18
+ desc "Installs the delayed_job script, if required"
19
+
20
+ def copy_job_script
21
+ copy_file "delayed_job",
22
+ "script/delayed_job"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
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 Generators
15
+ class ModelsGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../templates/models", __FILE__)
17
+
18
+ desc "Copy the Taverna Player models into the main app for "\
19
+ "customization."
20
+
21
+ def copy_models
22
+ copy_file "run.rb",
23
+ "app/models/taverna_player/run.rb"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,26 @@
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 Generators
15
+ class RenderersGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../templates/callbacks", __FILE__)
17
+
18
+ desc "Create some basic renderer callbacks in "\
19
+ "'lib/taverna_player_renderers.rb'"
20
+
21
+ def copy_callbacks
22
+ copy_file "render_callbacks.rb", "lib/taverna_player_renderers.rb"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,27 @@
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 Generators
15
+ class ViewsGenerator < Rails::Generators::Base
16
+ source_root File.expand_path("../../../../app/views", __FILE__)
17
+
18
+ desc "Copy the Taverna Player views and layouts into the main app for "\
19
+ "user customization."
20
+
21
+ def copy_views_and_layouts
22
+ directory "taverna_player", "app/views/taverna_player"
23
+ directory "layouts", "app/views/layouts"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,118 @@
1
+
2
+ ==============================================================================
3
+
4
+ An example initializer has been installed to:
5
+
6
+ config/initializers/taverna_player.rb.example
7
+
8
+ Please look through this file and make any alterations as required. BEFORE you
9
+ configure the Taverna Server URI and login information copy this file to:
10
+
11
+ config/initializers/taverna_player.rb
12
+
13
+ Then check the example file into your repository, add the non-example file to
14
+ your version control ignore file (e.g. .gitignore) and then configure the
15
+ sensitive Taverna Server information. This allows you to check in most of the
16
+ Taverna Player configuration, leaving the sensitive parts out.
17
+
18
+ In your application's install instructions remember to tell your users to copy
19
+ the example initializer and configure their Taverna Server information.
20
+
21
+ There is also some manual setup to do, if you haven't already done it:
22
+
23
+ 1. Mount the Taverna Player engine in your config/routes.rb. For example:
24
+
25
+ mount TavernaPlayer::Engine, :at => "/"
26
+
27
+ You can also nest the Taverna Player runs resources within your workflows
28
+ resources if you wish, like this:
29
+
30
+ resources :workflows do
31
+ resources :runs, :controller => "TavernaPlayer::Runs",
32
+ :except => :edit
33
+ end
34
+
35
+ The runs resources in Taverna Player do not provide an edit view by
36
+ default so, unless you add it yourself by overriding the controller you
37
+ should add the :except clause to the routes.
38
+
39
+ 2. Perform Taverna Player's migrations:
40
+
41
+ rake taverna_player:install:migrations
42
+ rake db:migrate
43
+
44
+ 3. Make sure you have defined root_url to something in your config/routes.rb.
45
+ For example:
46
+
47
+ root :to => "home#index"
48
+
49
+ 4. Add Taverna Player's assets to your application's manifests.
50
+ In app/assets/javascripts/application.js:
51
+
52
+ //= require taverna_player/application
53
+
54
+ In app/assets/stylesheets/application.css
55
+
56
+ *= require taverna_player/application
57
+
58
+ And everything should be found by the asset pipeline automatically.
59
+
60
+ 5. Make sure you have flash messages in your main layout
61
+ (usually app/views/layouts/application.html.erb). For example:
62
+
63
+ <p class="notice"><%= notice %></p>
64
+ <p class="alert"><%= alert %></p>
65
+
66
+ 6. Taverna Player uses delayed_job to run workflows on a Taverna Server. If
67
+ your application is not already using delayed_job then you can install
68
+ the delayed_job script in your "script" directory with:
69
+
70
+ rails generate taverna_player:job
71
+
72
+ 7. Taverna Player comes with some very simple, unstyled views and layouts.
73
+ If you wish to override these with your own customized views you can copy
74
+ them into your application with:
75
+
76
+ rails generate taverna_player:views
77
+
78
+ The views are copied to the app/views/taverna_player directory so that
79
+ they take precedence over the default ones. You can delete any that you
80
+ do not need to customize but there are no penalties for leaving them
81
+ there.
82
+
83
+ 8. If you need to override the Taverna Player controllers, to implement user
84
+ authorization for example, you can copy some customizable stubs with:
85
+
86
+ rails generate taverna_player:controllers
87
+
88
+ The stubs are copied to the app/controllers/taverna_player directory so
89
+ that they take precedence over the default ones. You can delete any that
90
+ you do not need to customize but there are no penalties for leaving them
91
+ there.
92
+
93
+ 9. If you need to override the Taverna Player Run model, to add columns to
94
+ the table for example, you can copy a customizable stub with:
95
+
96
+ rails generate taverna_player:models
97
+
98
+ The stub is copied to the app/models/taverna_player directory so that it
99
+ takes precedence over the default one.
100
+
101
+ 10. If you want to use pre- and post-run callbacks you can setup some basic
102
+ stubs with:
103
+
104
+ rails generate taverna_player:callbacks
105
+
106
+ They will be saved to "lib/taverna_player_callbacks.rb". Don't forget to
107
+ then require and register them in the Taverna Player initializer.
108
+
109
+ 11. You can add to, or change, the workflow run outputs render methods to
110
+ better suit your particular application. To copy the defaults that
111
+ Taverna Player ships with into your application for customization run:
112
+
113
+ rails generate taverna_player:renderers
114
+
115
+ They will be saved to "lib/taverna_player_renderers.rb". Don't forget to
116
+ then require and register them in the Taverna Player initializer.
117
+
118
+ ==============================================================================