[Bio] / Sprout / SearchHelper.pm Repository:
ViewVC logotype

Diff of /Sprout/SearchHelper.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.26, Sun Feb 4 13:07:24 2007 UTC revision 1.27, Wed Feb 21 13:18:27 2007 UTC
# Line 88  Line 88 
88  TRUE if this is a feature-filtered search, else FALSE. B<NOTE> that this  TRUE if this is a feature-filtered search, else FALSE. B<NOTE> that this
89  field is updated by the B<FeatureQuery> object.  field is updated by the B<FeatureQuery> object.
90    
91    =item extraPos
92    
93    C<0> if the extra columns are to be at the beginning, else C<1>. The
94    default is zero; use the L</SetExtraPos> method to change this option.
95    
96  =back  =back
97    
98  =head2 Adding a new Search Tool  =head2 Adding a new Search Tool
# Line 310  Line 315 
315                    genomeList => undef,                    genomeList => undef,
316                    genomeParms => [],                    genomeParms => [],
317                    filtered => 0,                    filtered => 0,
318                      extraPos => 0,
319                   };                   };
320      # Bless and return it.      # Bless and return it.
321      bless $retVal, $class;      bless $retVal, $class;
# Line 370  Line 376 
376      return ($self->{type} eq 'new');      return ($self->{type} eq 'new');
377  }  }
378    
379    =head3 SetExtraPos
380    
381    C<< $shelp->SetExtraPos($newValue); >>
382    
383    Indicate whether the extra columns should be in the front (C<0>) or end (C<1>) columns of the results.
384    
385    =over 4
386    
387    =item newValue
388    
389    C<1> if the extra columns should be displayed at the end, else C<0>.
390    
391    =back
392    
393    =cut
394    
395    sub SetExtraPos {
396        my ($self, $newValue) = @_;
397        $self->{extraPos} = $newValue;
398    }
399    
400  =head3 ID  =head3 ID
401    
402  C<< my $sessionID = $shelp->ID(); >>  C<< my $sessionID = $shelp->ID(); >>
# Line 672  Line 699 
699      # Check for a first-call situation.      # Check for a first-call situation.
700      if (! defined $self->{cols}) {      if (! defined $self->{cols}) {
701          Trace("Setting up the columns.") if T(3);          Trace("Setting up the columns.") if T(3);
702          # Here we need to set up the column information. Start with the extras,          # Here we need to set up the column information. First we accumulate the extras,
703          # sorted by column name.          # sorted by column name.
704          my @colNames = ();          my @xtraNames = ();
705          for my $col (sort keys %{$extraCols}) {          for my $col (sort keys %{$extraCols}) {
706              push @colNames, "X=$col";              push @xtraNames, "X=$col";
707            }
708            # Set up the column name array.
709            my @colNames = ();
710            # If extras go at the beginning, put them in first.
711            if (! $self->{extraPos}) {
712                push @colNames, @xtraNames;
713          }          }
714          # Add the default columns.          # Add the default columns.
715          push @colNames, $self->DefaultFeatureColumns();          push @colNames, $self->DefaultFeatureColumns();
716          # Add any additional columns requested by the feature filter.          # Add any additional columns requested by the feature filter.
717          push @colNames, FeatureQuery::AdditionalColumns($self);          push @colNames, FeatureQuery::AdditionalColumns($self);
718            # If extras go at the end, put them in here.
719            if ($self->{extraPos}) {
720                push @colNames, @xtraNames;
721            }
722          Trace("Full column list determined.") if T(3);          Trace("Full column list determined.") if T(3);
723          # Save the full list.          # Save the full list.
724          $self->{cols} = \@colNames;          $self->{cols} = \@colNames;
# Line 1543  Line 1580 
1580    
1581  =head3 FeatureFilterRows  =head3 FeatureFilterRows
1582    
1583  C<< my $htmlText = $shelp->FeatureFilterRows(); >>  C<< my $htmlText = $shelp->FeatureFilterRows(@subset); >>
1584    
1585  This method creates table rows that can be used to filter features. The form  This method creates table rows that can be used to filter features. The form
1586  values can be used to select features by genome using the B<FeatureQuery>  values can be used to select features by genome using the B<FeatureQuery>
1587  object.  object.
1588    
1589    =over 4
1590    
1591    =item subset
1592    
1593    List of rows to display. The default (C<all>) is to display all rows.
1594    C<words> displays the word search box, C<subsys> displays the subsystem
1595    selector, and C<options> displays the options row.
1596    
1597    =item RETURN
1598    
1599    Returns the html text for table rows containing the desired feature filtering controls.
1600    
1601    =back
1602    
1603  =cut  =cut
1604    
1605  sub FeatureFilterRows {  sub FeatureFilterRows {
1606      # Get the parameters.      # Get the parameters.
1607      my ($self) = @_;      my ($self, @subset) = @_;
1608        if (@subset == 0 || $subset[0] eq 'all') {
1609            @subset = qw(words subsys options);
1610        }
1611      # Return the result.      # Return the result.
1612      return FeatureQuery::FilterRows($self);      return FeatureQuery::FilterRows($self, @subset);
1613  }  }
1614    
1615  =head3 GBrowseFeatureURL  =head3 GBrowseFeatureURL
# Line 2153  Line 2207 
2207                      if ($hasChildren) {                      if ($hasChildren) {
2208                          Trace("Processing children of $myLabel.") if T(4);                          Trace("Processing children of $myLabel.") if T(4);
2209                          push @childHtml, ShowBranch($cgi, $myLabel, $myID, $myContent, $options, 'none');                          push @childHtml, ShowBranch($cgi, $myLabel, $myID, $myContent, $options, 'none');
2210                            Trace("Children of $myLabel finished.") if T(4);
2211                      }                      }
2212                  }                  }
2213              }              }
# Line 2187  Line 2242 
2242              }              }
2243              # Next, we format the label.              # Next, we format the label.
2244              my $labelHtml = $myLabel;              my $labelHtml = $myLabel;
2245              Trace("Formatting tree node for $myLabel.") if T(4);              Trace("Formatting tree node for \"$myLabel\".") if T(4);
2246              # Apply a hyperlink if necessary.              # Apply a hyperlink if necessary.
2247              if (defined $attrHash->{link}) {              if (defined $attrHash->{link}) {
2248                  $labelHtml = $cgi->a({ href => $attrHash->{link}, target => $options->{target} },                  $labelHtml = $cgi->a({ href => $attrHash->{link}, target => $options->{target} },

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3