coupler 0.0.1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitmodules +3 -0
- data/.rvmrc +1 -0
- data/.vimrc +40 -0
- data/Gemfile +27 -0
- data/Gemfile.lock +71 -0
- data/LICENSE +20 -0
- data/NOTES +6 -0
- data/README.rdoc +18 -0
- data/Rakefile +42 -0
- data/TODO +11 -0
- data/VERSION +1 -0
- data/bin/coupler +7 -0
- data/db/.gitignore +6 -0
- data/db/migrate/001_initial_schema.rb +166 -0
- data/db/migrate/002_stub.rb +4 -0
- data/db/migrate/003_stub.rb +4 -0
- data/db/migrate/004_create_comparisons.rb +28 -0
- data/db/migrate/005_move_database_name.rb +19 -0
- data/db/migrate/006_upgrade_comparisons.rb +34 -0
- data/db/migrate/007_add_which_to_comparisons.rb +23 -0
- data/db/migrate/008_add_result_field_to_transformations.rb +33 -0
- data/db/migrate/009_add_generated_flag_to_fields.rb +13 -0
- data/db/migrate/010_create_imports.rb +24 -0
- data/db/migrate/011_add_primary_key_type.rb +13 -0
- data/db/migrate/012_add_transformed_with_to_resources.rb +13 -0
- data/db/migrate/013_add_run_count_to_scenarios.rb +13 -0
- data/db/migrate/014_add_last_accessed_at_to_some_tables.rb +13 -0
- data/db/migrate/015_add_run_number_to_results.rb +15 -0
- data/db/migrate/016_fix_scenario_run_count.rb +27 -0
- data/db/migrate/017_rename_comparison_columns.rb +14 -0
- data/db/migrate/018_fix_scenario_linkage_type.rb +8 -0
- data/db/migrate/019_add_columns_to_imports.rb +24 -0
- data/db/migrate/020_rename_import_columns.rb +12 -0
- data/db/migrate/021_add_fields_to_connections.rb +15 -0
- data/db/migrate/022_remove_database_name_from_resources.rb +11 -0
- data/features/connections.feature +28 -0
- data/features/matchers.feature +35 -0
- data/features/projects.feature +11 -0
- data/features/resources.feature +62 -0
- data/features/scenarios.feature +45 -0
- data/features/step_definitions/coupler_steps.rb +145 -0
- data/features/step_definitions/matchers_steps.rb +26 -0
- data/features/step_definitions/resources_steps.rb +12 -0
- data/features/step_definitions/scenarios_steps.rb +7 -0
- data/features/step_definitions/transformations_steps.rb +3 -0
- data/features/support/env.rb +128 -0
- data/features/transformations.feature +22 -0
- data/features/wizard.feature +10 -0
- data/gfx/coupler-header.svg +213 -0
- data/gfx/coupler-sidebar.svg +656 -0
- data/gfx/coupler.svg +184 -0
- data/gfx/icon.svg +75 -0
- data/lib/coupler/base.rb +63 -0
- data/lib/coupler/config.rb +128 -0
- data/lib/coupler/data_uploader.rb +20 -0
- data/lib/coupler/database.rb +31 -0
- data/lib/coupler/extensions/connections.rb +57 -0
- data/lib/coupler/extensions/exceptions.rb +58 -0
- data/lib/coupler/extensions/imports.rb +43 -0
- data/lib/coupler/extensions/jobs.rb +21 -0
- data/lib/coupler/extensions/matchers.rb +64 -0
- data/lib/coupler/extensions/projects.rb +62 -0
- data/lib/coupler/extensions/resources.rb +89 -0
- data/lib/coupler/extensions/results.rb +100 -0
- data/lib/coupler/extensions/scenarios.rb +50 -0
- data/lib/coupler/extensions/transformations.rb +70 -0
- data/lib/coupler/extensions/transformers.rb +58 -0
- data/lib/coupler/extensions.rb +16 -0
- data/lib/coupler/helpers.rb +121 -0
- data/lib/coupler/import_buffer.rb +48 -0
- data/lib/coupler/logger.rb +16 -0
- data/lib/coupler/models/common_model.rb +104 -0
- data/lib/coupler/models/comparison.rb +166 -0
- data/lib/coupler/models/connection.rb +59 -0
- data/lib/coupler/models/field.rb +55 -0
- data/lib/coupler/models/import.rb +238 -0
- data/lib/coupler/models/job.rb +42 -0
- data/lib/coupler/models/jobify.rb +17 -0
- data/lib/coupler/models/matcher.rb +36 -0
- data/lib/coupler/models/project.rb +40 -0
- data/lib/coupler/models/resource.rb +287 -0
- data/lib/coupler/models/result.rb +92 -0
- data/lib/coupler/models/scenario/runner.rb +357 -0
- data/lib/coupler/models/scenario.rb +115 -0
- data/lib/coupler/models/transformation.rb +117 -0
- data/lib/coupler/models/transformer/runner.rb +28 -0
- data/lib/coupler/models/transformer.rb +110 -0
- data/lib/coupler/models.rb +30 -0
- data/lib/coupler/runner.rb +76 -0
- data/lib/coupler/scheduler.rb +56 -0
- data/lib/coupler.rb +34 -0
- data/log/.gitignore +1 -0
- data/misc/README +5 -0
- data/misc/jruby-json.license +57 -0
- data/misc/rack-flash.license +22 -0
- data/script/dbconsole.rb +5 -0
- data/src/edu/vanderbilt/coupler/Main.java +116 -0
- data/src/edu/vanderbilt/coupler/jruby.properties +1 -0
- data/tasks/annotations.rake +84 -0
- data/tasks/db.rake +120 -0
- data/tasks/environment.rake +12 -0
- data/tasks/jeweler.rake +43 -0
- data/tasks/package.rake +58 -0
- data/tasks/rdoc.rake +13 -0
- data/tasks/test.rake +63 -0
- data/tasks/vendor.rake +43 -0
- data/test/README.txt +6 -0
- data/test/config.yml +9 -0
- data/test/coupler/models/test_import.rb +221 -0
- data/test/factories.rb +91 -0
- data/test/fixtures/duplicate-keys.csv +5 -0
- data/test/fixtures/no-headers.csv +50 -0
- data/test/fixtures/people.csv +51 -0
- data/test/fixtures/varying-row-size.csv +4 -0
- data/test/helper.rb +156 -0
- data/test/integration/extensions/test_connections.rb +80 -0
- data/test/integration/extensions/test_imports.rb +94 -0
- data/test/integration/extensions/test_jobs.rb +52 -0
- data/test/integration/extensions/test_matchers.rb +134 -0
- data/test/integration/extensions/test_projects.rb +82 -0
- data/test/integration/extensions/test_resources.rb +150 -0
- data/test/integration/extensions/test_results.rb +89 -0
- data/test/integration/extensions/test_scenarios.rb +88 -0
- data/test/integration/extensions/test_transformations.rb +113 -0
- data/test/integration/extensions/test_transformers.rb +80 -0
- data/test/integration/test_field.rb +45 -0
- data/test/integration/test_import.rb +78 -0
- data/test/integration/test_running_scenarios.rb +379 -0
- data/test/integration/test_transformation.rb +56 -0
- data/test/integration/test_transforming.rb +154 -0
- data/test/table_sets.rb +76 -0
- data/test/unit/models/test_common_model.rb +130 -0
- data/test/unit/models/test_comparison.rb +619 -0
- data/test/unit/models/test_connection.rb +115 -0
- data/test/unit/models/test_field.rb +99 -0
- data/test/unit/models/test_import.rb +130 -0
- data/test/unit/models/test_job.rb +115 -0
- data/test/unit/models/test_matcher.rb +82 -0
- data/test/unit/models/test_project.rb +102 -0
- data/test/unit/models/test_resource.rb +564 -0
- data/test/unit/models/test_result.rb +90 -0
- data/test/unit/models/test_scenario.rb +199 -0
- data/test/unit/models/test_transformation.rb +193 -0
- data/test/unit/models/test_transformer.rb +188 -0
- data/test/unit/test_base.rb +60 -0
- data/test/unit/test_data_uploader.rb +27 -0
- data/test/unit/test_database.rb +23 -0
- data/test/unit/test_helpers.rb +58 -0
- data/test/unit/test_logger.rb +10 -0
- data/test/unit/test_models.rb +12 -0
- data/test/unit/test_runner.rb +76 -0
- data/test/unit/test_scheduler.rb +66 -0
- data/uploads/.gitignore +2 -0
- data/vendor/java/.gitignore +5 -0
- data/webroot/public/css/960.css +1 -0
- data/webroot/public/css/dataTables.css +1057 -0
- data/webroot/public/css/jquery-ui.css +572 -0
- data/webroot/public/css/jquery.treeview.css +68 -0
- data/webroot/public/css/reset.css +1 -0
- data/webroot/public/css/style.css +504 -0
- data/webroot/public/css/text.css +1 -0
- data/webroot/public/favicon.ico +0 -0
- data/webroot/public/images/12_col.gif +0 -0
- data/webroot/public/images/16_col.gif +0 -0
- data/webroot/public/images/add.png +0 -0
- data/webroot/public/images/ajax-loader.gif +0 -0
- data/webroot/public/images/cog.png +0 -0
- data/webroot/public/images/coupler.png +0 -0
- data/webroot/public/images/foo.png +0 -0
- data/webroot/public/images/hammer.png +0 -0
- data/webroot/public/images/header.png +0 -0
- data/webroot/public/images/home.gif +0 -0
- data/webroot/public/images/jobs.gif +0 -0
- data/webroot/public/images/sidebar-bottom.png +0 -0
- data/webroot/public/images/sidebar.png +0 -0
- data/webroot/public/images/treeview-default-line.gif +0 -0
- data/webroot/public/images/treeview-default.gif +0 -0
- data/webroot/public/images/ui-anim_basic_16x16.gif +0 -0
- data/webroot/public/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/webroot/public/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/webroot/public/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/webroot/public/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/webroot/public/images/ui-bg_highlight-hard_30_565356_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-hard_75_888588_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_30_6e3b3a_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_35_8e8b8e_1x100.png +0 -0
- data/webroot/public/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/webroot/public/images/ui-icons_222222_256x240.png +0 -0
- data/webroot/public/images/ui-icons_2e83ff_256x240.png +0 -0
- data/webroot/public/images/ui-icons_454545_256x240.png +0 -0
- data/webroot/public/images/ui-icons_888888_256x240.png +0 -0
- data/webroot/public/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/webroot/public/images/ui-icons_ffffff_256x240.png +0 -0
- data/webroot/public/js/ajaxupload.js +673 -0
- data/webroot/public/js/application.js +40 -0
- data/webroot/public/js/jquery-ui.combobox.js +98 -0
- data/webroot/public/js/jquery-ui.js +9867 -0
- data/webroot/public/js/jquery-ui.min.js +559 -0
- data/webroot/public/js/jquery.dataTables.min.js +587 -0
- data/webroot/public/js/jquery.min.js +154 -0
- data/webroot/public/js/jquery.timeago.js +140 -0
- data/webroot/public/js/jquery.tooltip.min.js +19 -0
- data/webroot/public/js/jquery.treeview.min.js +15 -0
- data/webroot/public/js/resource.js +11 -0
- data/webroot/public/js/results.js +56 -0
- data/webroot/public/js/transformations.js +95 -0
- data/webroot/views/connections/index.erb +5 -0
- data/webroot/views/connections/list.erb +34 -0
- data/webroot/views/connections/new.erb +55 -0
- data/webroot/views/connections/show.erb +36 -0
- data/webroot/views/imports/edit.erb +60 -0
- data/webroot/views/imports/form.erb +81 -0
- data/webroot/views/imports/new.erb +89 -0
- data/webroot/views/index.erb +12 -0
- data/webroot/views/jobs/index.erb +7 -0
- data/webroot/views/jobs/list.erb +24 -0
- data/webroot/views/layout.erb +38 -0
- data/webroot/views/matchers/form.erb +250 -0
- data/webroot/views/matchers/list.erb +32 -0
- data/webroot/views/projects/form.erb +14 -0
- data/webroot/views/projects/index.erb +96 -0
- data/webroot/views/projects/show.erb +24 -0
- data/webroot/views/resources/edit.erb +88 -0
- data/webroot/views/resources/index.erb +5 -0
- data/webroot/views/resources/list.erb +27 -0
- data/webroot/views/resources/new.erb +121 -0
- data/webroot/views/resources/show.erb +86 -0
- data/webroot/views/resources/transform.erb +2 -0
- data/webroot/views/results/csv.erb +12 -0
- data/webroot/views/results/details.erb +15 -0
- data/webroot/views/results/index.erb +2 -0
- data/webroot/views/results/list.erb +22 -0
- data/webroot/views/results/record.erb +24 -0
- data/webroot/views/results/show.erb +68 -0
- data/webroot/views/scenarios/index.erb +5 -0
- data/webroot/views/scenarios/list.erb +20 -0
- data/webroot/views/scenarios/new.erb +99 -0
- data/webroot/views/scenarios/run.erb +2 -0
- data/webroot/views/scenarios/show.erb +50 -0
- data/webroot/views/sidebar.erb +106 -0
- data/webroot/views/transformations/create.erb +115 -0
- data/webroot/views/transformations/for.erb +16 -0
- data/webroot/views/transformations/index.erb +2 -0
- data/webroot/views/transformations/list.erb +29 -0
- data/webroot/views/transformations/new.erb +126 -0
- data/webroot/views/transformations/preview.erb +46 -0
- data/webroot/views/transformers/edit.erb +6 -0
- data/webroot/views/transformers/form.erb +58 -0
- data/webroot/views/transformers/index.erb +2 -0
- data/webroot/views/transformers/list.erb +25 -0
- data/webroot/views/transformers/new.erb +5 -0
- data/webroot/views/transformers/preview.erb +23 -0
- data/webroot/views/transformers/show.erb +0 -0
- metadata +558 -0
@@ -0,0 +1,86 @@
|
|
1
|
+
<%- @breadcrumbs = [@project, @resource] -%>
|
2
|
+
<%- add_javascript('jquery.dataTables.min.js') -%>
|
3
|
+
<%- add_stylesheet('dataTables.css') -%>
|
4
|
+
<h2>Fields</h2>
|
5
|
+
<table id="fields" class="dataTable" style="clear: both;">
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Field</th>
|
9
|
+
<th>Type</th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<%- @fields.each do |field| -%>
|
14
|
+
<tr>
|
15
|
+
<td<%= ' class="altered-field"' if field.is_generated %>><%= field.name %></td>
|
16
|
+
<td<%= ' class="altered-field"' if field.local_db_type %>><%= field.final_db_type %></td>
|
17
|
+
</tr>
|
18
|
+
<%- end -%>
|
19
|
+
</tbody>
|
20
|
+
</table>
|
21
|
+
<p>
|
22
|
+
<a href="/projects/<%= @project.id %>/resources/<%= @resource.id %>/edit">Select Fields</a>
|
23
|
+
</p>
|
24
|
+
|
25
|
+
<h2>Transformations</h2>
|
26
|
+
<div class="section">
|
27
|
+
<%= erb(:"transformations/list", :layout => false) %>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<h2>Status</h2>
|
31
|
+
<div class="section">
|
32
|
+
<%- if @job -%>
|
33
|
+
<% if @job.status == 'running' %>
|
34
|
+
<p>This resource is currently being transformed (since <%= timeago(@job.started_at, 'strong', 'span') %>).</p>
|
35
|
+
<div id="progressbar"></div>
|
36
|
+
<div id="progressbar-info" style="float: left;"><%= "#{@job.completed} / #{@job.total}" if @job.status == 'running' %></div>
|
37
|
+
<img id="progressbar-spinner" src="/images/ajax-loader.gif" alt="Spinner" style="float: left;" />
|
38
|
+
<div class="clear"></div>
|
39
|
+
<% elsif @job.status == 'scheduled' %>
|
40
|
+
<p>This resource is currently scheduled to be transformed (since <%= timeago(@job.created_at, 'strong', 'span') %>).</p>
|
41
|
+
<% end %>
|
42
|
+
<% else %>
|
43
|
+
<p>
|
44
|
+
Status: <span class="strong"<%= ' style="color: red;"' if @resource.status != "ok" %>><%= humanize(@resource.status) %></span><br/>
|
45
|
+
<% if !@transformations.empty? %>
|
46
|
+
Last transformed: <%= timeago(@resource.transformed_at, 'strong', 'span') %>
|
47
|
+
<% end %>
|
48
|
+
</p>
|
49
|
+
<% if !@transformations.empty? %>
|
50
|
+
<form method="get" action="/projects/<%= @project.id %>/resources/<%= @resource.id %>/transform">
|
51
|
+
<p>
|
52
|
+
<input onclick="return confirm('Are you sure you want to transform this resource?');" value="Transform now" type="submit" />
|
53
|
+
</p>
|
54
|
+
</form>
|
55
|
+
<% end %>
|
56
|
+
<% end %>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
<% if !@scenarios.empty? %>
|
60
|
+
<h2>Related Scenarios</h2>
|
61
|
+
<div class="section">
|
62
|
+
<%= erb(:"scenarios/list", :layout => false) %>
|
63
|
+
</div>
|
64
|
+
<% end %>
|
65
|
+
|
66
|
+
<script type="text/javascript">
|
67
|
+
var intervalId;
|
68
|
+
$(function() {
|
69
|
+
$('#fields').dataTable({bJQueryUI: true, aaSorting: [], aoColumns: [null, null] });
|
70
|
+
<%- if @job && @job.status == 'running' -%>
|
71
|
+
$('#progressbar').progressbar({value: <%= @job.percent_completed %>});
|
72
|
+
setInterval(function() {
|
73
|
+
$.get("/jobs/<%= @job.id %>/progress", function(data) {
|
74
|
+
var total = parseInt(data.total);
|
75
|
+
var completed = parseInt(data.completed);
|
76
|
+
var percent = completed / total * 100;
|
77
|
+
$('#progressbar').progressbar('option', 'value', percent);
|
78
|
+
$('#progressbar-info').html(completed + " / " + total);
|
79
|
+
if (percent == 100) {
|
80
|
+
window.location.reload(true);
|
81
|
+
}
|
82
|
+
}, 'json');
|
83
|
+
}, 5000);
|
84
|
+
<%- end -%>
|
85
|
+
});
|
86
|
+
</script>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Project: <%= @snapshot[:project][:name] %>
|
2
|
+
Scenario: <%= @snapshot[:scenario][:name] %>
|
3
|
+
<%- if @snapshot[:resource_2] -%>
|
4
|
+
Resource 1: <%= @snapshot[:resource_1][:name] %>
|
5
|
+
Resource 2: <%= @snapshot[:resource_2][:name] %>
|
6
|
+
<%- else -%>
|
7
|
+
Resource: <%= @snapshot[:resource_1][:name] %>
|
8
|
+
<%- end -%>
|
9
|
+
Host: <%= local_ip %>
|
10
|
+
Time: <%= @result.created_at %>
|
11
|
+
|
12
|
+
<%= @result.to_csv.chomp %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<h2>Group #<%= @group[:id] %></h2>
|
2
|
+
<div id="result-group-0" class="result-group result-group-left"> </div>
|
3
|
+
<div id="result-group-1" class="result-group result-group-right"> </div>
|
4
|
+
<div class="clear"></div>
|
5
|
+
<script type="text/javascript">
|
6
|
+
var detailsUrl = "<%= @result.id %>/details/<%= @group[:id] %>/record";
|
7
|
+
var useWhich = <%= @scenario.linkage_type != 'self-linkage' %>;
|
8
|
+
$(function() {
|
9
|
+
$('#result-tabs').bind("tabsshow", function(e, ui) {
|
10
|
+
contentWidth = $('#group-details').width();
|
11
|
+
});
|
12
|
+
getRecord($('#result-group-0'), 0, useWhich ? 0 : null);
|
13
|
+
getRecord($('#result-group-1'), useWhich ? 0 : 1, useWhich ? 1 : null);
|
14
|
+
});
|
15
|
+
</script>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% if @results.empty? %>
|
2
|
+
<p>There are currently no results for this scenario.</p>
|
3
|
+
<% else %>
|
4
|
+
<table class="list">
|
5
|
+
<thead>
|
6
|
+
<tr>
|
7
|
+
<th>#</th>
|
8
|
+
<th>Run at</th>
|
9
|
+
<th></th>
|
10
|
+
</tr>
|
11
|
+
</thead>
|
12
|
+
<tbody>
|
13
|
+
<% @results.each do |result| %>
|
14
|
+
<tr>
|
15
|
+
<td><%= result.run_number %></td>
|
16
|
+
<td><%= result.created_at %></td>
|
17
|
+
<td><a href="/projects/<%=@project.id%>/scenarios/<%=@scenario.id%>/results/<%=result.id%>">Show</a></td>
|
18
|
+
</tr>
|
19
|
+
<% end %>
|
20
|
+
</tbody>
|
21
|
+
</table>
|
22
|
+
<% end %>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="column-name column-header">
|
2
|
+
Field
|
3
|
+
<div class="resize-handle"></div>
|
4
|
+
</div>
|
5
|
+
<div class="column-value column-header">
|
6
|
+
Value
|
7
|
+
<div class="resize-handle"></div>
|
8
|
+
</div>
|
9
|
+
<%- @num_columns.times do |i| -%>
|
10
|
+
<div class="column-name row-<%= i % 2 %>">
|
11
|
+
<%= @columns[i] || " " %>
|
12
|
+
<div class="resize-handle"></div>
|
13
|
+
</div>
|
14
|
+
<div class="column-value row-<%= i % 2 %>">
|
15
|
+
<%= @columns[i] ? @record[@columns[i]] : " " %>
|
16
|
+
<div class="resize-handle"></div>
|
17
|
+
</div>
|
18
|
+
<%- end -%>
|
19
|
+
<div class="clear"></div>
|
20
|
+
<div class="record-navigation">
|
21
|
+
Record <%= @index + 1 %> of <%= @total %>
|
22
|
+
<span class="record-nav previous-record record-<%= @index > 0 ? @index - 1 : 'x' %><%= " which-#{@which}" if @which %> ui-icon ui-icon-circle-arrow-w"></span>
|
23
|
+
<span class="record-nav next-record record-<%= @index + 1 < @total ? @index + 1 : 'x' %><%= " which-#{@which}" if @which %> ui-icon ui-icon-circle-arrow-e"></span>
|
24
|
+
</div>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<%- add_javascript('jquery.dataTables.min.js', 'results.js') -%>
|
2
|
+
<%- add_stylesheet('dataTables.css') -%>
|
3
|
+
<%- @breadcrumbs = [@project, @scenario, @result] -%>
|
4
|
+
|
5
|
+
<div id="result-tabs">
|
6
|
+
<ul>
|
7
|
+
<li><a href="#groups">Groups</a></li>
|
8
|
+
</ul>
|
9
|
+
<div id="groups">
|
10
|
+
<p>
|
11
|
+
There were <strong><%= groups_dataset.count %></strong> groups of records
|
12
|
+
found. Click on a group row to see more details.
|
13
|
+
</p>
|
14
|
+
<table class="summary dataTable">
|
15
|
+
<thead>
|
16
|
+
<tr>
|
17
|
+
<%- (columns = groups_dataset.columns).each do |column| -%>
|
18
|
+
<%- if column.to_s =~ /pair_(\d+)/ -%>
|
19
|
+
<th><%= "Pair #%d" % ($1.to_i + 1) %></th>
|
20
|
+
<%- else -%>
|
21
|
+
<th><%= column %></th>
|
22
|
+
<%- end -%>
|
23
|
+
<%- end -%>
|
24
|
+
</tr>
|
25
|
+
</thead>
|
26
|
+
<tbody>
|
27
|
+
<%- groups_dataset.each do |group| -%>
|
28
|
+
<tr id="group-<%= group[:id] %>" class="group">
|
29
|
+
<%- columns.each do |column| -%>
|
30
|
+
<td><%= group[column] %></td>
|
31
|
+
<%- end -%>
|
32
|
+
</tr>
|
33
|
+
<%- end -%>
|
34
|
+
</tbody>
|
35
|
+
</table>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
<p>
|
39
|
+
<a href="/projects/<%= @project.id %>/scenarios/<%= @scenario.id %>/results/<%= @result.id %>.csv">Download results »</a>
|
40
|
+
</p>
|
41
|
+
|
42
|
+
<script type="text/javascript">
|
43
|
+
$(function() {
|
44
|
+
$('#result-tabs').tabs({fx: {opacity: 'toggle', duration: 100}});
|
45
|
+
$("table.summary tbody").click(function(e) {
|
46
|
+
/* highlight row */
|
47
|
+
$(oTable.fnSettings().aoData).each(function() {
|
48
|
+
$(this.nTr).removeClass('row_selected');
|
49
|
+
});
|
50
|
+
var tr = $(e.target.parentNode);
|
51
|
+
tr.addClass('row_selected');
|
52
|
+
|
53
|
+
/* get group details */
|
54
|
+
var groupId = tr.attr('id').replace(/^group-/, "");
|
55
|
+
var detailsUrl = window.location.href + "/details/" + groupId;
|
56
|
+
if ($('#group-details').length == 0) {
|
57
|
+
$('#result-tabs').tabs('add', '#group-details', "Details");
|
58
|
+
}
|
59
|
+
$('#group-details').load(detailsUrl, function() {
|
60
|
+
$('#result-tabs').tabs('select', 1);
|
61
|
+
});
|
62
|
+
});
|
63
|
+
var oTable = $('table.summary').dataTable({
|
64
|
+
bJQueryUI: true,
|
65
|
+
aoColumns: <%= columns.collect { |c| case c.to_s when /count$/ then { "sWidth" => "150px" } when "id" then { "sWidth" => "65px" } else nil end }.to_json %>
|
66
|
+
});
|
67
|
+
});
|
68
|
+
</script>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% if @scenarios.empty? %>
|
2
|
+
<p>There are currently no scenarios for this project.</p>
|
3
|
+
<% else %>
|
4
|
+
<table class="list">
|
5
|
+
<thead>
|
6
|
+
<tr>
|
7
|
+
<th>Name</th>
|
8
|
+
<th>Type</th>
|
9
|
+
</tr>
|
10
|
+
</thead>
|
11
|
+
<tbody>
|
12
|
+
<% @scenarios.each do |scenario| %>
|
13
|
+
<tr>
|
14
|
+
<td><a href="/projects/<%= @project.id %>/scenarios/<%= scenario.id %>"><%= scenario[:name] %></a></td>
|
15
|
+
<td><%= scenario.linkage_type %></td>
|
16
|
+
</tr>
|
17
|
+
<% end %>
|
18
|
+
</tbody>
|
19
|
+
</table>
|
20
|
+
<% end %>
|
@@ -0,0 +1,99 @@
|
|
1
|
+
<% @breadcrumbs = [@project, @scenario] %>
|
2
|
+
<%= error_messages_for @scenario %>
|
3
|
+
|
4
|
+
<style type="text/css">
|
5
|
+
#resources {
|
6
|
+
list-style-type: none;
|
7
|
+
margin: 1em;
|
8
|
+
padding: 0;
|
9
|
+
width: 20em;
|
10
|
+
}
|
11
|
+
#resources li {
|
12
|
+
padding: 0.3em;
|
13
|
+
margin: 0.5em;
|
14
|
+
border: 1px solid black;
|
15
|
+
background-color: #eee;
|
16
|
+
cursor: pointer;
|
17
|
+
}
|
18
|
+
#resources li.selected {
|
19
|
+
background-color: yellow;
|
20
|
+
}
|
21
|
+
#resources li.disabled {
|
22
|
+
border-style: dashed;
|
23
|
+
text-decoration: line-through;
|
24
|
+
}
|
25
|
+
</style>
|
26
|
+
|
27
|
+
<form method="post" action="/projects/<%= @project.id %>/scenarios">
|
28
|
+
<table id="form-table" class="form">
|
29
|
+
<tr>
|
30
|
+
<td class="left"><label for="name">Name</label></td>
|
31
|
+
<td>
|
32
|
+
<input id="name" name="scenario[name]" type="text" value="<%= @scenario.name %>" />
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<tr class="alt">
|
36
|
+
<td class="left"><label for="description">Description</label></td>
|
37
|
+
<td>
|
38
|
+
<input id="name" name="scenario[description]" type="text" value="<%= @scenario.description %>" />
|
39
|
+
</td>
|
40
|
+
</tr>
|
41
|
+
</table>
|
42
|
+
|
43
|
+
<h3>Resource(s)</h3>
|
44
|
+
<p>
|
45
|
+
Here you can specify which resource(s) you want to use in this scenario.
|
46
|
+
The number you choose determines the type of linkage that is performed. If
|
47
|
+
you choose one resource, a <em>self-linkage</em> will be performed. If
|
48
|
+
two, a <em>dual-linkage</em> will be performed. You can choose a
|
49
|
+
<strong>maximum of two</strong> resources.
|
50
|
+
</p>
|
51
|
+
<div style="border-bottom: 1px solid #ddd;">
|
52
|
+
Click which resources you want:
|
53
|
+
</div>
|
54
|
+
<ul id="resources">
|
55
|
+
<% @project.resources.each do |resource| %>
|
56
|
+
<li id="resource-<%= resource.id %>" class="resource"><%= resource.name %></li>
|
57
|
+
<% end %>
|
58
|
+
</ul>
|
59
|
+
<div id="linkage-type" style="margin: 1em 0">
|
60
|
+
Linkage type: <strong>N/A</strong>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<p>
|
64
|
+
<input type="submit" value="Submit" /> or <a href="/projects/<%= @project.id %>">Cancel</a>
|
65
|
+
</p>
|
66
|
+
</form>
|
67
|
+
|
68
|
+
<script type="text/javascript">
|
69
|
+
$(function() {
|
70
|
+
$('.resource').disableSelection().click(function() {
|
71
|
+
obj = $(this);
|
72
|
+
if (obj.hasClass('disabled')) return;
|
73
|
+
|
74
|
+
id = obj.attr('id').split('-')[1];
|
75
|
+
if (obj.hasClass('selected')) {
|
76
|
+
obj.removeClass('selected');
|
77
|
+
$('#resource-input-'+id).remove();
|
78
|
+
}
|
79
|
+
else {
|
80
|
+
obj.addClass('selected');
|
81
|
+
$('form').append("<input id='resource-input-"+id+"' type='hidden' name='scenario[resource_ids][]' value='"+id+"' />");
|
82
|
+
}
|
83
|
+
|
84
|
+
switch($('.resource.selected').length) {
|
85
|
+
case 0:
|
86
|
+
$('#linkage-type strong').text("N/A");
|
87
|
+
break;
|
88
|
+
case 1:
|
89
|
+
$('#linkage-type strong').text("self-linkage");
|
90
|
+
$('.resource.disabled').removeClass('disabled');
|
91
|
+
break;
|
92
|
+
case 2:
|
93
|
+
$('#linkage-type strong').text("dual-linkage");
|
94
|
+
$('.resource:not(.selected)').addClass('disabled');
|
95
|
+
break;
|
96
|
+
}
|
97
|
+
});
|
98
|
+
});
|
99
|
+
</script>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<% @breadcrumbs = [@project, @scenario] %>
|
2
|
+
<% if flash[:newly_created] %>
|
3
|
+
<div id="notice">
|
4
|
+
Scenario successfully created! Next you'll need to add a matcher.
|
5
|
+
</div>
|
6
|
+
<% end %>
|
7
|
+
|
8
|
+
<h2>Resource(s)</h2>
|
9
|
+
<div class="section">
|
10
|
+
<%= erb(:"resources/list", :layout => false) %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<h2>Matcher</h2>
|
14
|
+
<div class="section">
|
15
|
+
<%= erb(:"matchers/list", :layout => false) %>
|
16
|
+
<%- if @matcher.nil? -%>
|
17
|
+
<p>
|
18
|
+
<a href="/projects/<%= @project.id %>/scenarios/<%= @scenario.id %>/matchers/new">Add matcher</a>
|
19
|
+
</p>
|
20
|
+
<%- end -%>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<h2>Status</h2>
|
24
|
+
<div class="section">
|
25
|
+
<% if !@running_jobs.empty? %>
|
26
|
+
<p>This scenario is currently being run:</p>
|
27
|
+
<%= erb(:'jobs/list', {:layout => false}, {:jobs => @running_jobs, :show_target => false}) %>
|
28
|
+
<% elsif !@scheduled_jobs.empty? %>
|
29
|
+
<p>This scenario is currently scheduled to run:</p>
|
30
|
+
<%= erb(:'jobs/list', {:layout => false}, {:jobs => @scheduled_jobs, :show_target => false}) %>
|
31
|
+
<% else %>
|
32
|
+
<div class="p">
|
33
|
+
Status: <span class="strong"<%= ' style="color: red"' if @scenario.status != 'ok' %>><%= humanize(@scenario.status) %></span><br/>
|
34
|
+
Last run: <%= timeago(@scenario.last_run_at, "inline strong") %>
|
35
|
+
</div>
|
36
|
+
<%- if @scenario.status == 'ok' -%>
|
37
|
+
<form method="get" action="/projects/<%= @project.id %>/scenarios/<%= @scenario.id %>/run" class="button-to">
|
38
|
+
<p>
|
39
|
+
<input onclick="return confirm('Are you sure you want to run this scenario?');" value="Run now" type="submit" />
|
40
|
+
</p>
|
41
|
+
</form>
|
42
|
+
<%- end -%>
|
43
|
+
<% end %>
|
44
|
+
</div>
|
45
|
+
<% if @results.length > 0 %>
|
46
|
+
<h2>Results</h2>
|
47
|
+
<div class="section">
|
48
|
+
<%= erb(:"results/list", :layout => false) %>
|
49
|
+
</div>
|
50
|
+
<% end %>
|
@@ -0,0 +1,106 @@
|
|
1
|
+
<div class='accordion'>
|
2
|
+
<h3><a href="/projects">Projects</a></h3>
|
3
|
+
<div>
|
4
|
+
<%- projects = Coupler::Models::Project.recently_accessed -%>
|
5
|
+
<%- if projects.empty? -%>
|
6
|
+
<%- else -%>
|
7
|
+
<ul class="accordion-top">
|
8
|
+
<%- projects.each_with_index do |project, i| -%>
|
9
|
+
<%- current_project = @project && @project.id == project.id -%>
|
10
|
+
<li class="<%= current_project ? "current-project" : i % 2 == 0 ? "alt" : "" %>">
|
11
|
+
<span class="ui-icon <%= current_project ? 'ui-icon-triangle-1-e' : 'ui-icon-document' %>"></span>
|
12
|
+
<a href="/projects/<%= project.id %>"><%= project.name %></a>
|
13
|
+
<%- if current_project -%>
|
14
|
+
<ul>
|
15
|
+
<li>
|
16
|
+
<span class="ui-icon ui-icon-document"></span>
|
17
|
+
<a href="/projects/<%= project.id %>/resources">Resources</a>
|
18
|
+
</li>
|
19
|
+
<li>
|
20
|
+
<span class="ui-icon ui-icon-document"></span>
|
21
|
+
<a href="/projects/<%= project.id %>/scenarios">Scenarios</a>
|
22
|
+
</li>
|
23
|
+
</ul>
|
24
|
+
<%- end -%>
|
25
|
+
</li>
|
26
|
+
<%- end -%>
|
27
|
+
</ul>
|
28
|
+
<%- end -%>
|
29
|
+
<ul class="buttons">
|
30
|
+
<%- if Coupler::Models::Project.count > projects.count -%>
|
31
|
+
<li><button class="more-projects">More</button></li>
|
32
|
+
<%- end -%>
|
33
|
+
<li><button class="new-project">New</button></li>
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
<h3><a href="/connections">Connections</a></h3>
|
37
|
+
<div>
|
38
|
+
<%- connections = Coupler::Models::Connection.recently_accessed -%>
|
39
|
+
<%- if connections.empty? -%>
|
40
|
+
<%- else -%>
|
41
|
+
<ul class="accordion-top">
|
42
|
+
<%- connections.each_with_index do |connection, i| -%>
|
43
|
+
<li<%= ' class="alt"' if i % 2 == 1 %>>
|
44
|
+
<span class="ui-icon ui-icon-signal-diag"></span>
|
45
|
+
<a href="/connections/<%= connection.id %>"><%= connection.name %></a>
|
46
|
+
</li>
|
47
|
+
<%- end -%>
|
48
|
+
</ul>
|
49
|
+
<%- end -%>
|
50
|
+
<ul class="buttons">
|
51
|
+
<%- if Coupler::Models::Connection.count > connections.count -%>
|
52
|
+
<li><button class="more-connections">More</button></li>
|
53
|
+
<%- end -%>
|
54
|
+
<li><button class="new-connection">New</button></li>
|
55
|
+
</ul>
|
56
|
+
</div>
|
57
|
+
<h3><a href="/transformers">Transformers</a></h3>
|
58
|
+
<div>
|
59
|
+
<%- transformers = Coupler::Models::Transformer.recently_accessed -%>
|
60
|
+
<%- if transformers.empty? -%>
|
61
|
+
<%- else -%>
|
62
|
+
<ul class="accordion-top">
|
63
|
+
<%- transformers.each_with_index do |transformer, i| -%>
|
64
|
+
<li<%= ' class="alt"' if i % 2 == 1 %>>
|
65
|
+
<span class="ui-icon ui-icon-carat-2-e-w"></span>
|
66
|
+
<a href="/transformers"><%= transformer.name %></a>
|
67
|
+
</li>
|
68
|
+
<%- end -%>
|
69
|
+
</ul>
|
70
|
+
<%- end -%>
|
71
|
+
<ul class="buttons">
|
72
|
+
<%- if Coupler::Models::Transformer.count > transformers.count -%>
|
73
|
+
<li><button class="more-transformers">More</button></li>
|
74
|
+
<%- end -%>
|
75
|
+
<li><button class="new-transformer">New</button></li>
|
76
|
+
</ul>
|
77
|
+
</div>
|
78
|
+
<h3><a href="/jobs">Jobs</a></h3>
|
79
|
+
<div>
|
80
|
+
<%- jobs = Coupler::Models::Job.recently_accessed -%>
|
81
|
+
<%- if jobs.empty? -%>
|
82
|
+
There are no recent jobs.
|
83
|
+
<%- else -%>
|
84
|
+
<ul class="accordion-top">
|
85
|
+
<%- jobs.each_with_index do |job, i| -%>
|
86
|
+
<li<%= ' class="alt"' if i % 2 == 1 %>>
|
87
|
+
<%- if job.status == 'done' -%>
|
88
|
+
<span class="ui-icon ui-icon-check"></span>
|
89
|
+
<%- elsif job.status == 'failed' -%>
|
90
|
+
<span class="ui-icon ui-icon-alert"></span>
|
91
|
+
<%- elsif job.status == 'running' -%>
|
92
|
+
<span class="ui-icon ui-icon-play"></span>
|
93
|
+
<%- elsif job.status == 'scheduled' -%>
|
94
|
+
<span class="ui-icon ui-icon-clock"></span>
|
95
|
+
<%- end -%>
|
96
|
+
<%- if job.resource -%>
|
97
|
+
<a href="/jobs">Transform: <%= job.resource.name %></a>
|
98
|
+
<%- elsif job.scenario -%>
|
99
|
+
<a href="/jobs">Run: <%= job.scenario.name %></a>
|
100
|
+
<%- end -%>
|
101
|
+
</li>
|
102
|
+
<%- end -%>
|
103
|
+
</ul>
|
104
|
+
<%- end -%>
|
105
|
+
</div>
|
106
|
+
</div>
|
@@ -0,0 +1,115 @@
|
|
1
|
+
<% @breadcrumbs = [@project, @resource, @transformation] %>
|
2
|
+
<% add_javascript('jquery-ui.combobox.js', 'jquery.dataTables.min.js', 'transformations.js') %>
|
3
|
+
<% add_stylesheet('dataTables.css') %>
|
4
|
+
<%= error_messages_for @transformation %>
|
5
|
+
<form method="post" action="/projects/<%= @project.id %>/resources/<%= @resource.id %>/transformations">
|
6
|
+
<div class="hidden">
|
7
|
+
<input type="hidden" name="transformation[source_field_id]" value="<%= @transformation.source_field_id %>" />
|
8
|
+
<input type="hidden" name="transformation[transformer_id]" value="<%= @transformation.transformer_id %>" />
|
9
|
+
</div>
|
10
|
+
<h2>Source Field</h2>
|
11
|
+
<div class="section">
|
12
|
+
<table class="show no-border">
|
13
|
+
<tr>
|
14
|
+
<td class="col1">
|
15
|
+
<label for="source_field_id" class="strong">Field:</label>
|
16
|
+
</td>
|
17
|
+
<td id="source-field-name"><%= @transformation.source_field.name %></td>
|
18
|
+
</tr>
|
19
|
+
<tr id="field-info">
|
20
|
+
<td class="col1">Current Type:</td>
|
21
|
+
<td><span id='field-type'><%= @transformation.source_field.final_type %></span> (<span id='field-db-type'><%= @transformation.source_field.final_db_type %></span>)</td>
|
22
|
+
</tr>
|
23
|
+
</table>
|
24
|
+
</div>
|
25
|
+
<div id="transformer">
|
26
|
+
<h2>Transformer</h2>
|
27
|
+
<div class="section">
|
28
|
+
<% if @transformation.transformer_id %>
|
29
|
+
<div id="transformer-select">
|
30
|
+
<table class='show no-border'>
|
31
|
+
<tr>
|
32
|
+
<td class='col1'>
|
33
|
+
<label for="transformer_id" class='strong'>Select existing:</label>
|
34
|
+
</td>
|
35
|
+
<td id="transformer-name"><%= @transformation.transformer.name %></td>
|
36
|
+
</tr>
|
37
|
+
<tr id="transformer-info">
|
38
|
+
<td class="col1">Result Type:</td>
|
39
|
+
<td id='transformer-result-type'><%= @transformation.transformer.result_type %></td>
|
40
|
+
</tr>
|
41
|
+
</table>
|
42
|
+
</div>
|
43
|
+
<% else %>
|
44
|
+
<div id="transformer-attributes">
|
45
|
+
<table class="show no-border">
|
46
|
+
<tr>
|
47
|
+
<td class="col1"><label for="transformer-name">Name:</label></td>
|
48
|
+
<td><input id="transformer-name" name="transformation[transformer_attributes][name]" type="text" value="<%= @transformation.transformer.name %>" /></td>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td class="col1" style="vertical-align: top"><label for="transformer-allowed_types">Allowed Field Types:</label></td>
|
52
|
+
<td>
|
53
|
+
<select id="transformer-allowed_types" name="transformation[transformer_attributes][allowed_types][]" multiple="multiple">
|
54
|
+
<% [%w{integer Integer}, %w{string String}, %w{datetime Date/Time}].each do |(value, label)| %>
|
55
|
+
<option value="<%= value %>"<%= ' selected="selected"' if @transformation.transformer.accepts_type?(value) %>><%= label %></option>
|
56
|
+
<% end %>
|
57
|
+
</select>
|
58
|
+
</td>
|
59
|
+
</tr>
|
60
|
+
<tr>
|
61
|
+
<td class="col1"><label for="transformer-result_type">Result Type:</label></td>
|
62
|
+
<td>
|
63
|
+
<select id="transformer-result_type" name="transformation[transformer_attributes][result_type]">
|
64
|
+
<% [['same', 'Same as original field type'], %w{integer Integer}, %w{string String}, %w{datetime Date/Time}].each do |(value, label)| %>
|
65
|
+
<option value="<%= value %>"<%= ' selected="selected"' if @transformation.transformer.result_type == value %>><%= label %></option>
|
66
|
+
<% end %>
|
67
|
+
</select>
|
68
|
+
</td>
|
69
|
+
</tr>
|
70
|
+
<tr>
|
71
|
+
<td class="col1" style="vertical-align: top"><label for="transformer-code">Code:</label></td>
|
72
|
+
<td><textarea id="transformer-code" name="transformation[transformer_attributes][code]" rows="10" cols="25"><%= @transformation.transformer.code %></textarea></td>
|
73
|
+
</tr>
|
74
|
+
</table>
|
75
|
+
</div>
|
76
|
+
<% end %>
|
77
|
+
</div>
|
78
|
+
<div id="result-field-selection">
|
79
|
+
<h2>Result Field</h2>
|
80
|
+
<div class="section">
|
81
|
+
<p>
|
82
|
+
<input id="result-field-same" type="radio" name="transformation[result_field_id]" value="<%= @transformation.source_field_id %>"<%= ' checked="checked"' if @transformation.result_field_id == @transformation.source_field_id %> />
|
83
|
+
<label for="result-field-same">Same as source field</label>
|
84
|
+
<input id="result-field-new" type="radio" name="transformation[result_field_id]" value=""<%= ' checked="checked"' if @transformation.result_field.new? %> />
|
85
|
+
<label for="result-field-new">New field</label>
|
86
|
+
</p>
|
87
|
+
<div id="result-field-attributes"<%= ' class="hidden"' unless @transformation.result_field.new? %>>
|
88
|
+
<label for="result-field-name" class="strong">Name:</label>
|
89
|
+
<input id="result-field-name" type="text" name="transformation[result_field_attributes][name]" <%= @transformation.result_field.new? ? %{value="#{@transformation.result_field.name}"}: 'value="" disabled="disabled"' %> />
|
90
|
+
</div>
|
91
|
+
<div id="preview-button">
|
92
|
+
<p><button>Preview</button></p>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
</div>
|
96
|
+
<div id="transformation-result">
|
97
|
+
<h2>Result</h2>
|
98
|
+
<div class="section visible-overflow">
|
99
|
+
<h3>Preview</h3>
|
100
|
+
<div id="transformation-preview" style="float: left;">
|
101
|
+
<%= erb(:'transformations/preview', :layout => false) %>
|
102
|
+
</div>
|
103
|
+
<div class="clear"></div>
|
104
|
+
</div>
|
105
|
+
<p>
|
106
|
+
<input type="submit" value="Submit" /> or <a href="/projects/<%= @project.id %>/resources/<%= @resource.id %>">Cancel</a>
|
107
|
+
</p>
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
</form>
|
111
|
+
<script type="text/javascript">
|
112
|
+
var fields = <%= @fields.inject({}) { |h, f| h[f.id] = { 'name' => f.name, 'type' => f.final_type, 'db_type' => f.final_db_type }; h }.to_json %>;
|
113
|
+
var transformers = <%= @transformers.inject({}) { |h, t| h[t.id] = { 'name' => t.name, 'allowed_types' => t.allowed_types, 'result_type' => t.result_type }; h }.to_json %>;
|
114
|
+
var previewUrl = "/projects/<%= @project.id %>/resources/<%= @resource.id %>/transformations/preview";
|
115
|
+
</script>
|