EnsEMBL::Web::Component::Website SelectAnalysis
Included librariesPackage variablesGeneral documentationMethods
Toolbar
WebCvsRaw content
Package variables
No package variables defined.
Included modules
EnsEMBL::Web::Data::Analysis
Inherit
EnsEMBL::Web::Component
Synopsis
No synopsis!
Description
No description!
Methods
_init
No description
Code
caption
No description
Code
content
No description
Code
Methods description
None available.
Methods code
_initdescriptionprevnextTop
sub _init {
  my $self = shift;
  $self->cacheable( 0 );
  $self->ajaxable(  0 );
}
captiondescriptionprevnextTop
sub caption {
  my $self = shift;
  return '';
}
contentdescriptionprevnextTop
sub content {
  my $self = shift;
  my $object = $self->object;
  my $species = $object->species_defs->ENSEMBL_PRIMARY_SPECIES;
  my $html = '<h1>Select an analysis</h1>';

  my $core_object = EnsEMBL::Web::Data::Analysis->new;
  my $connected = $core_object->connect;

  if ($connected) {
    my $form = EnsEMBL::Web::Form->new('select_analysis', '/Website/AnalysisDescription', 'post');
    my @analyses = $core_object->find_all;
    my @sorted = sort {$a->logic_name cmp $b->logic_name} @analyses;
    my @values;

    foreach my $analysis (@sorted) {
      push @values, {'name' => $analysis->logic_name, 'value' => $analysis->id};
    }

    $form->add_element(
      'name' => 'analysis_id',
      'type' => 'DropDown',
      'label' => 'Analysis',
      'values' =>\@ values,
      'select' => 'select',
      'required' => 'yes',
    );
    $form->add_element(
      'name' => 'submit',
      'type' => 'Submit',
      'value' => 'Next',
    );

    $html .= $form->render;
  }
  else {
    $html .= $self->_error('DB Error', "Could not connect to $species core database");
  }
  return $html;
}

1;
}
General documentation
No general documentation available.