Skip to content
Snippets Groups Projects
Commit 63e89bd7 authored by Glenn Proctor's avatar Glenn Proctor
Browse files

Added accessor for web_data.

parent 2b2f4b18
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,8 @@ Bio::EnsEMBL::Analysis.pm - Stores details of an analysis run
-created => $created,
-description => 'some warm words about this analysis',
-display_label => 'UNIprot alignment',
-displayable => '1'
-displayable => '1',
-web_data => 'web metadata info'
);
=head1 DESCRIPTION
......@@ -95,8 +96,8 @@ sub new {
my ($id, $adaptor, $db, $db_version, $db_file, $program, $program_version,
$program_file, $gff_source, $gff_feature, $module, $module_version,
$parameters, $created, $logic_name, $description, $display_label,
$displayable) =
$parameters, $created, $logic_name, $description, $display_label,
$displayable, $web_data) =
rearrange([qw(ID
ADAPTOR
......@@ -116,6 +117,7 @@ sub new {
DESCRIPTION
DISPLAY_LABEL
DISPLAYABLE
WEB_DATA
)],@args);
$self->dbID ($id);
......@@ -136,6 +138,7 @@ sub new {
$self->description( $description );
$self->display_label( $display_label );
$self->displayable( $displayable );
$self->web_data ( $web_data );
return $self; # success - we hope!
}
......@@ -529,6 +532,28 @@ sub displayable {
}
=head2 web_data
Arg [1] : string $web_data
Example : none
Description: get/set for attribute web_data
Returntype : string
Exceptions : none
Caller : general
Status : Stable
=cut
sub web_data {
my ($self,$arg) = @_;
if (defined($arg)) {
$self->{_web_data} = $arg;
}
return $self->{_web_data};
}
=head2 compare
Arg 1 : Bio::EnsEMBL::Analysis $ana
......
......@@ -104,7 +104,7 @@ sub fetch_all {
db, db_version, db_file,
module, module_version,
gff_source, gff_feature,
created, parameters, description, display_label, displayable
created, parameters, description, display_label, displayable, web_data
FROM analysis
LEFT JOIN analysis_description
ON analysis.analysis_id = analysis_description.analysis_id } );
......@@ -224,7 +224,7 @@ sub fetch_by_dbID {
db, db_version, db_file,
module, module_version,
gff_source, gff_feature,
created, parameters, description, display_label, displayable
created, parameters, description, display_label, displayable, web_data
FROM analysis
LEFT JOIN analysis_description
ON analysis.analysis_id = analysis_description.analysis_id
......@@ -275,7 +275,7 @@ sub fetch_by_logic_name {
db, db_version, db_file,
module, module_version,
gff_source, gff_feature,
created, parameters, description, display_label, displayable
created, parameters, description, display_label, displayable, web_data
FROM analysis
LEFT JOIN analysis_description
ON analysis.analysis_id = analysis_description.analysis_id
......@@ -436,12 +436,13 @@ sub store {
defined( $analysis->display_label() )) {
$sth = $self->prepare( "INSERT IGNORE INTO analysis_description (analysis_id, display_label, description, displayable) VALUES (?,?,?,?)");
$sth = $self->prepare( "INSERT IGNORE INTO analysis_description (analysis_id, display_label, description, displayable, web_data) VALUES (?,?,?,?, ?)");
$sth->bind_param(1,$dbID,SQL_INTEGER);
$sth->bind_param(2,$analysis->display_label(),SQL_VARCHAR);
$sth->bind_param(3,$analysis->description,SQL_LONGVARCHAR);
$sth->bind_param(4,$analysis->displayable,SQL_TINYINT);
$sth->bind_param(4,$analysis->web_data(),SQL_LONGVARCHAR);
$sth->execute();
$sth->finish();
......@@ -521,15 +522,15 @@ sub update {
if ($sth->fetchrow_hashref) { # update if exists
$sth = $self->prepare
("UPDATE analysis_description SET description = ?, display_label = ?, displayable = ? WHERE analysis_id = ?");
("UPDATE analysis_description SET description = ?, display_label = ?, displayable = ?, web_data = ? WHERE analysis_id = ?");
$sth->execute($a->description(), $a->display_label(), $a->displayable(), $a->dbID);
$sth->execute($a->description(), $a->display_label(), $a->displayable(), $a->web_data(), $a->dbID);
} else { # create new entry
if( $a->description() || $a->display_label()) {
$sth = $self->prepare( "INSERT IGNORE INTO analysis_description (analysis_id, display_label, description, displayable) VALUES (?,?,?,?)");
$sth->execute( $a->dbID(), $a->display_label(), $a->description(), $a->displayable() );
$sth = $self->prepare( "INSERT IGNORE INTO analysis_description (analysis_id, display_label, description, displayable, web_data) VALUES (?,?,?,?,?)");
$sth->execute( $a->dbID(), $a->display_label(), $a->description(), $a->displayable(), $a->web_data() );
$sth->finish();
}
......@@ -672,7 +673,8 @@ sub _objFromHashref {
-logic_name => $rowHash->{logic_name},
-description => $rowHash->{description},
-display_label => $rowHash->{display_label},
-displayable => $rowHash->{displayable}
-displayable => $rowHash->{displayable},
-web_data => $rowHash->{web_data}
);
return $analysis;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment