Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/MGRAST/MetagenomeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ $(document).ready( function() {

$("#grouping_link").live('click', function () {
switch_project_grouping();
table_reset_filters(all_metagenomes_table_id);
});
$("#ungrouping_link").live('click', function () {
switch_project_grouping();
table_reset_filters(all_metagenomes_table_id);
});
function switch_project_grouping(){
if (grouped_by_project) {
Expand Down
10 changes: 6 additions & 4 deletions src/MGRAST/Upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ function update_inbox (data, files, action) {
var fn = DataStore['user_inbox'][user.login].fileinfo[i][h];
if (fn.match(/(fasta|fna|fastq|fa|faa)$/)) {
var inf = DataStore['user_inbox'][user.login].fileinfo[i+'/'+fn];
if (inf) {
var trow = [ 0, i, fn, inf['format'], inf['file size'], inf['creation date'], inf['bp count'], inf['sequencing method'], inf['md5'], tdata.length ];
if (inf && inf['bp count']) {
var trow = [ 0, i, fn, inf['format'], inf['file size'], inf['creation date'], inf['bp count'], inf['sequencing method guess'], inf['sequence type'], inf['file checksum'], tdata.length ];
tdata[tdata.length] = trow;
}
}
Expand All @@ -83,8 +83,10 @@ function update_inbox (data, files, action) {
for (var i=0; i<sequence_files.length; i++) {
var fn = sequence_files[i];
var inf = DataStore['user_inbox'][user.login].fileinfo[fn];
var trow = [ 0, "-", fn, "-", inf['file size'], inf['creation date'], inf['bp count'], inf['sequencing method guess'], inf['md5'], tdata.length ];
tdata[tdata.length] = trow;
if (inf['bp count']) {
var trow = [ 0, "-", fn, "-", inf['file size'], inf['creation date'], inf['bp count'], inf['sequencing method guess'], inf['sequence type'], inf['file checksum'], tdata.length ];
tdata[tdata.length] = trow;
}
}
initialize_table(0, tdata);
}
Expand Down
4 changes: 2 additions & 2 deletions src/MGRAST/WebPage/MetagenomeSelect.pm
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ sub output {
{ name => 'depth', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'location', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'ph', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'country', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'country', filter => 1, visible => 0 },
{ name => 'temperature', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'sequencing&nbsp;method', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'pi', filter => 1, operator => 'combobox', visible => 0 },
{ name => 'pi', filter => 1, visible => 0 },
{ name => 'avg&nbsp;seq&nbsp;length', filter => 1, sortable => 1, operators => ['less','more'], visible => 0 },
{ name => 'drisee', filter => 1, sortable => 1, operators => ['less','more'], visible => 0 },
{ name => '&alpha;-diversity', filter => 1, sortable => 1, operators => ['less','more'], visible => 0 }
Expand Down
13 changes: 9 additions & 4 deletions src/MGRAST/WebPage/Upload.pm
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,13 @@ sub output {
</div>
</div>

<p>Alternative upload is available via the command line and ftp. Please refer to our <a href='http://blog.metagenomics.anl.gov/mg-rast-v3-2-faq/#command_line_submission' target=_blank>blog</a> for a detailed description.</p>
<p>To generate a webkey needed for this procedure, please click the following <b>'generate webkey'</b> button. <div id='generate_key'><input type='button' class='btn' value='generate webkey' onclick='generate_webkey();'></div>
<p>In addition to using your web browser for uploads to the system the following alternatives are available:</p>
<table>
<tr><td width="125px"><b>ftp</b></td><td>ftp://incoming.metagenomics.anl.gov/<span id="ftp_webkey">YOUR_PRIVATE_WEBKEY</span></td></tr>
<tr><td><b>http</b></td><td>http://api.metagenomics.anl.gov/inbox/<span id="http_webkey">YOUR_PRIVATE_WEBKEY</span></td></tr>
<tr><td colspan=2 style='padding-top: 10px; padding-bottom: 10px;'><div id='generate_key'><input type='button' class='btn' onclick='generate_webkey();' value='generate webkey'></div></td></tr>
</table>
<p><b>Note:</b> The <a href='http://blog.metagenomics.anl.gov/mg-rast-v3-2-faq/#command_line_submission' target=_blank>Blog</a> lists a number of examples for data transfer.</p>

</div>

Expand Down Expand Up @@ -711,9 +716,9 @@ sub generate_webkey {
my ($sec,$min,$hour,$mday,$mon,$year) = localtime($existing_date);
my $tdate_readable = ($year + 1900)." ".sprintf("%02d", $mon + 1)."-".sprintf("%02d", $mday)." ".sprintf("%02d", $hour).":".sprintf("%02d", $min).".".sprintf("%02d", $sec);
$content .= " <b>valid until</b>: <input type='text' readOnly=1 size=20 value='" . $tdate_readable . "'>";
$content .= "<br><b>Your temporary ftp url is:</b> ftp://ftp.mcs.anl.gov/".$existing_key."<br><br>";
$content .= " <input type='button' class='btn' value='generate new key' onclick='generate_webkey(1);'>";

$content .= "<img src='./Html/clear.gif' onload='document.getElementById(\"ftp_webkey\").innerHTML=\"" . $existing_key . "\";document.getElementById(\"http_webkey\").innerHTML=\"" . $existing_key . "\";'>";

print $cgi->header;
print $content;
exit 0;
Expand Down
36 changes: 36 additions & 0 deletions src/WebApplication/WebComponent/Login.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package WebComponent::Login;
use strict;
use warnings;

use WebConfig;

use base qw( WebComponent );

1;
Expand Down Expand Up @@ -113,6 +115,40 @@ sub perform_login {
my $user = $self->application->dbmaster->User->init( { login => $login } );
if (ref $user and crypt($password, $user->password) eq $user->password) {

# check for login dependencies that were created after the user got the account
if (ref $WebConfig::LOGIN_DEPENDENCIES) {

foreach my $d (@{$WebConfig::LOGIN_DEPENDENCIES->{$self->application->backend->name}}) {

# get the backend
my $d_backend = $self->application->dbmaster->Backend->init({ name => $d });
if (ref $d_backend) {

# create and grant the login right
my $back_app = WebApplication->new( $d_backend );
{
package WebApplication;
sub new {
my $self = { backend => $_[1] };
bless $self, 'WebApplication';
}
sub backend {
my ($self) = @_;
return $self->{backend};
}
}
if ($user->has_right($back_app, 'login')) {
my $r = $user->add_login_right($self->application->backend);
$r->granted(1);
last;
}
else {
die "Unable to find backend '$d'.";
}
}
}
}

if ($user->active and ($user->has_right($self->application, 'login') || $FIG_Config::open_gates)) {

$self->application->session->user($user);
Expand Down
17 changes: 16 additions & 1 deletion src/WebApplication/WebComponent/js/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ function table_submit (id, form_name, submit_all, no_submit, button_name) {
for (h=0;h<row.length;h++) {
if (column_types[h]) {
if (submit_all || row[h] != table_data[data_index][i][h]) {
if(typeof row[h] == "string") {
row[h] = row[h].replace(/\'/g, "&#39;");
}
input_fields += "<input type='hidden' name='ic_" + id + "_" + h + "' value='" + row[h] + "'>";
}
}
Expand Down Expand Up @@ -339,6 +342,16 @@ function initialize_table (id, data) {
table_combo_columns[data_index] = combo_columns.split(/@~/);
var column_types = document.getElementById("table_column_types_" + id).value;
table_column_types[data_index] = column_types.split(/@~/);
for (var i=0;i<data.length;i++) {
for (var h=0;h<data[i].length-1;h++) {
if (table_column_types[data_index][h]) {
if (! table_input_columns_data[data_index][i]) {
table_input_columns_data[data_index][i] = [];
}
table_input_columns_data[data_index][i][h] = data[i][h];
}
}
}

table_filter(id);
} else if (document.getElementById("table_data_" + id)) {
Expand Down Expand Up @@ -1022,7 +1035,9 @@ function fill_table (id, start, stop, show_prev, show_next) {
var this_data = table_input_columns_data[data_index][relative_rownum][colnum];
cell_data = "<input type='hidden' id='" + cell_id + "' value='" + this_data + "'>" + this_data;
} else if (table_column_types[data_index][colnum] == 'textfield') {
cell_data = "<input type='text' id='" + cell_id + "' value='" + table_input_columns_data[data_index][relative_rownum][colnum] +
var value = table_input_columns_data[data_index][relative_rownum][colnum];
value = value.replace(/\'/g, "&#39;");
cell_data = "<input type='text' id='" + cell_id + "' value='" + value +
"' style='width:100%;' onchange='update_input_data(this.id);'>";
} else if (table_column_types[data_index][colnum].match(re)) {
var entries = table_column_types[data_index][colnum].split(/@#/);
Expand Down