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.
- data/.gitignore +18 -0
- data/Gemfile +18 -0
- data/LICENCE.rdoc +29 -0
- data/README.rdoc +663 -0
- data/Rakefile +65 -0
- data/app/assets/javascripts/taverna_player/application.js +14 -0
- data/app/assets/javascripts/taverna_player/runs.js +42 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/assets/stylesheets/taverna_player/application.css +13 -0
- data/app/assets/stylesheets/taverna_player/coderay.css +120 -0
- data/app/controllers/taverna_player/application_controller.rb +16 -0
- data/app/controllers/taverna_player/runs_controller.rb +18 -0
- data/app/controllers/taverna_player/service_credentials_controller.rb +18 -0
- data/app/helpers/taverna_player/application_helper.rb +55 -0
- data/app/helpers/taverna_player/runs_helper.rb +84 -0
- data/app/models/taverna_player/interaction.rb +25 -0
- data/app/models/taverna_player/run.rb +117 -0
- data/app/models/taverna_player/run_port.rb +148 -0
- data/app/models/taverna_player/service_credential.rb +56 -0
- data/app/views/layouts/taverna_player/embedded.html.erb +27 -0
- data/app/views/taverna_player/runs/_button.html.erb +19 -0
- data/app/views/taverna_player/runs/_info.html.erb +56 -0
- data/app/views/taverna_player/runs/_info.json.jbuilder +2 -0
- data/app/views/taverna_player/runs/_inputs.html.erb +34 -0
- data/app/views/taverna_player/runs/_inputs.json.jbuilder +8 -0
- data/app/views/taverna_player/runs/_interaction.html.erb +68 -0
- data/app/views/taverna_player/runs/_outputs.html.erb +41 -0
- data/app/views/taverna_player/runs/_poll.html.erb +27 -0
- data/app/views/taverna_player/runs/create.json.jbuilder +3 -0
- data/app/views/taverna_player/runs/embedded/_button.html.erb +19 -0
- data/app/views/taverna_player/runs/embedded/_info.html.erb +25 -0
- data/app/views/taverna_player/runs/embedded/_inputs.html.erb +32 -0
- data/app/views/taverna_player/runs/embedded/_outputs.html.erb +32 -0
- data/app/views/taverna_player/runs/embedded/new.html.erb +58 -0
- data/app/views/taverna_player/runs/embedded/show.html.erb +39 -0
- data/app/views/taverna_player/runs/embedded/show.js.erb +35 -0
- data/app/views/taverna_player/runs/index.html.erb +40 -0
- data/app/views/taverna_player/runs/index.json.jbuilder +1 -0
- data/app/views/taverna_player/runs/new.html.erb +56 -0
- data/app/views/taverna_player/runs/new.json.jbuilder +1 -0
- data/app/views/taverna_player/runs/show.html.erb +29 -0
- data/app/views/taverna_player/runs/show.js.erb +25 -0
- data/app/views/taverna_player/runs/show.json.jbuilder +25 -0
- data/app/views/taverna_player/service_credentials/_form.html.erb +53 -0
- data/app/views/taverna_player/service_credentials/edit.html.erb +18 -0
- data/app/views/taverna_player/service_credentials/index.html.erb +41 -0
- data/app/views/taverna_player/service_credentials/new.html.erb +17 -0
- data/app/views/taverna_player/service_credentials/show.html.erb +36 -0
- data/config/routes.rb +34 -0
- data/db/migrate/20130313105546_create_taverna_player_runs.rb +16 -0
- data/db/migrate/20130315163019_create_taverna_player_run_ports.rb +15 -0
- data/db/migrate/20130318170744_add_attachment_file_to_taverna_player_run_ports.rb +6 -0
- data/db/migrate/20130319183634_create_delayed_jobs.rb +22 -0
- data/db/migrate/20130320102600_add_status_message_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130321100110_add_depth_and_metadata_to_taverna_player_run_ports.rb +6 -0
- data/db/migrate/20130704095504_add_attachment_results_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130705142704_add_embedded_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130714140911_create_taverna_player_interactions.rb +13 -0
- data/db/migrate/20130717083653_add_proxy_to_taverna_player_runs.rb +6 -0
- data/db/migrate/20130717155415_add_stop_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130811152840_add_attachment_log_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130811211725_change_taverna_player_runs_state_column.rb +5 -0
- data/db/migrate/20130812155839_add_name_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20130918135348_create_taverna_player_service_credentials.rb +15 -0
- data/db/migrate/20130919154200_add_displayed_to_taverna_player_interactions.rb +5 -0
- data/db/migrate/20131007153209_add_job_ref_to_taverna_player_runs.rb +13 -0
- data/db/migrate/20131010094537_add_reply_caching_to_taverna_player_interactions.rb +19 -0
- data/db/migrate/20131017141514_add_failure_message_to_taverna_player_run.rb +5 -0
- data/db/migrate/20131018152940_add_serial_number_to_taverna_player_interactions.rb +5 -0
- data/db/migrate/20131018160715_add_parent_run_id_to_taverna_player_runs.rb +5 -0
- data/db/migrate/20131102113933_add_page_uri_to_taverna_player_interaction.rb +5 -0
- data/db/migrate/20131105115218_remove_proxy_from_taverna_player_runs.rb +11 -0
- data/db/migrate/20131105141934_change_taverna_player_interactions_output_value_column_name.rb +5 -0
- data/db/migrate/20131112165520_add_user_to_taverna_player_run.rb +5 -0
- data/lib/generators/taverna_player/callbacks_generator.rb +25 -0
- data/lib/generators/taverna_player/controllers_generator.rb +30 -0
- data/lib/generators/taverna_player/install_generator.rb +30 -0
- data/lib/generators/taverna_player/job_generator.rb +26 -0
- data/lib/generators/taverna_player/models_generator.rb +27 -0
- data/lib/generators/taverna_player/renderers_generator.rb +26 -0
- data/lib/generators/taverna_player/views_generator.rb +27 -0
- data/lib/generators/templates/ReadMe.txt +118 -0
- data/lib/generators/templates/callbacks/render_callbacks.rb +56 -0
- data/lib/generators/templates/callbacks/worker_callbacks.rb +31 -0
- data/lib/generators/templates/controllers/runs_controller.rb +20 -0
- data/lib/generators/templates/controllers/service_credentials_controller.rb +20 -0
- data/lib/generators/templates/initializer.rb +154 -0
- data/lib/generators/templates/models/run.rb +20 -0
- data/lib/tasks/delete-cancelled-runs.rake +26 -0
- data/lib/tasks/delete-old-embedded-runs.rake +26 -0
- data/lib/taverna-player.rb +139 -0
- data/lib/taverna_player/concerns/controllers/runs_controller.rb +281 -0
- data/lib/taverna_player/concerns/controllers/service_credentials_controller.rb +89 -0
- data/lib/taverna_player/concerns/models/run.rb +205 -0
- data/lib/taverna_player/engine.rb +23 -0
- data/lib/taverna_player/model_proxy.rb +51 -0
- data/lib/taverna_player/output_renderer.rb +96 -0
- data/lib/taverna_player/render_callbacks.rb +41 -0
- data/lib/taverna_player/version.rb +15 -0
- data/lib/taverna_player/worker.rb +325 -0
- data/script/delayed_job +5 -0
- data/script/rails +8 -0
- data/taverna_player.gemspec +46 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +16 -0
- data/test/dummy/app/assets/stylesheets/application.css +14 -0
- data/test/dummy/app/controllers/application_controller.rb +15 -0
- data/test/dummy/app/controllers/home_controller.rb +16 -0
- data/test/dummy/app/controllers/taverna_player/runs_controller.rb +25 -0
- data/test/dummy/app/controllers/taverna_player/service_credentials_controller.rb +25 -0
- data/test/dummy/app/controllers/workflows_controller.rb +17 -0
- data/test/dummy/app/models/user.rb +15 -0
- data/test/dummy/app/models/workflow.rb +32 -0
- data/test/dummy/app/views/home/index.html.erb +18 -0
- data/test/dummy/app/views/layouts/application.html.erb +43 -0
- data/test/dummy/app/views/workflows/index.html.erb +35 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +58 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/taverna_player.example.rb +40 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +22 -0
- data/test/dummy/db/migrate/20130314103555_create_workflows.rb +12 -0
- data/test/dummy/db/migrate/20130318141557_create_taverna_player_runs.taverna_player.rb +17 -0
- data/test/dummy/db/migrate/20130318141558_create_taverna_player_run_ports.taverna_player.rb +16 -0
- data/test/dummy/db/migrate/20130318173013_add_attachment_file_to_taverna_player_run_ports.taverna_player.rb +7 -0
- data/test/dummy/db/migrate/20130319183816_create_delayed_jobs.taverna_player.rb +23 -0
- data/test/dummy/db/migrate/20130320102635_add_status_message_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130321161859_add_depth_and_metadata_to_taverna_player_run_ports.taverna_player.rb +7 -0
- data/test/dummy/db/migrate/20130704100146_add_attachment_results_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130705142816_add_embedded_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130714142144_create_taverna_player_interactions.taverna_player.rb +14 -0
- data/test/dummy/db/migrate/20130717084809_add_proxy_to_taverna_player_runs.taverna_player.rb +7 -0
- data/test/dummy/db/migrate/20130718102707_add_stop_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130811204449_add_attachment_log_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130811212709_change_taverna_player_runs_state_column.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130812161152_add_name_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20130918155525_create_taverna_player_service_credentials.taverna_player.rb +16 -0
- data/test/dummy/db/migrate/20130919155202_add_displayed_to_taverna_player_interactions.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131007153659_add_job_ref_to_taverna_player_runs.taverna_player.rb +14 -0
- data/test/dummy/db/migrate/20131016123941_add_reply_caching_to_taverna_player_interactions.taverna_player.rb +20 -0
- data/test/dummy/db/migrate/20131017141614_add_failure_message_to_taverna_player_run.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131018153316_add_serial_number_to_taverna_player_interactions.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131018164614_add_parent_run_id_to_taverna_player_runs.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131102114343_add_page_uri_to_taverna_player_interaction.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131105115724_remove_proxy_from_taverna_player_runs.taverna_player.rb +12 -0
- data/test/dummy/db/migrate/20131105142417_change_taverna_player_interactions_output_value_column_name.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131112165815_add_user_to_taverna_player_run.taverna_player.rb +6 -0
- data/test/dummy/db/migrate/20131114130937_create_users.rb +10 -0
- data/test/dummy/db/schema.rb +123 -0
- data/test/dummy/lib/callbacks.rb +35 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/delayed_job +5 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/functional/home_controller_test.rb +28 -0
- data/test/dummy/test/functional/workflows_controller_test.rb +21 -0
- data/test/fixtures/files/crassostrea_gigas.csv +737 -0
- data/test/fixtures/taverna_player/interactions.yml +32 -0
- data/test/fixtures/taverna_player/run_ports.yml +54 -0
- data/test/fixtures/taverna_player/runs.yml +69 -0
- data/test/fixtures/taverna_player/service_credentials.yml +25 -0
- data/test/fixtures/users.yml +16 -0
- data/test/fixtures/workflows.yml +32 -0
- data/test/functional/taverna_player/runs_controller_test.rb +316 -0
- data/test/functional/taverna_player/service_credentials_controller_test.rb +99 -0
- data/test/taverna_player_test.rb +25 -0
- data/test/test_helper.rb +33 -0
- data/test/unit/helpers/taverna_player/application_helper_test.rb +70 -0
- data/test/unit/helpers/taverna_player/runs_helper_test.rb +45 -0
- data/test/unit/taverna_player/interaction_test.rb +47 -0
- data/test/unit/taverna_player/run_port_test.rb +309 -0
- data/test/unit/taverna_player/run_test.rb +196 -0
- data/test/unit/taverna_player/service_credential_test.rb +64 -0
- data/test/workflows/hello.t2flow +164 -0
- data/test/workflows/list_with_errors.t2flow +107 -0
- data/test/workflows/pass_through.t2flow +12 -0
- 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,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,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,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,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
|
+
==============================================================================
|