[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.7, Tue Oct 3 11:05:45 2006 UTC revision 1.9, Sat Oct 7 13:18:11 2006 UTC
# Line 214  Line 214 
214                      }                      }
215                  }                  }
216              }              }
         }  
217          # Close the session file.          # Close the session file.
218          $self->CloseSession();          $self->CloseSession();
219            }
220          # Return the result count.          # Return the result count.
221          return $retVal;          return $retVal;
222      }      }
# Line 316  Line 316 
316      return $self->{query};      return $self->{query};
317  }  }
318    
319    
320    
321  =head3 DB  =head3 DB
322    
323  C<< my $sprout = $shelp->DB(); >>  C<< my $sprout = $shelp->DB(); >>
# Line 673  Line 675 
675      for my $colName (@{$self->{cols}}) {      for my $colName (@{$self->{cols}}) {
676          push @output, $self->FeatureColumnValue($colName, $record, $extraCols);          push @output, $self->FeatureColumnValue($colName, $record, $extraCols);
677      }      }
678      # Compute the sort key. The sort key floats NMPDR organism features to the      # Compute the sort key. The sort key usually floats NMPDR organism features to the
679      # top of the return list.      # top of the return list.
680      my $key = $self->SortKey($record);      my $key = $self->SortKey($record);
681      # Write the feature data.      # Write the feature data.
# Line 756  Line 758 
758      # Check for an open session file.      # Check for an open session file.
759      if (defined $self->{fileHandle}) {      if (defined $self->{fileHandle}) {
760          # We found one, so close it.          # We found one, so close it.
761            Trace("Closing session file.") if T(2);
762          close $self->{fileHandle};          close $self->{fileHandle};
763      }      }
764  }  }
# Line 1082  Line 1085 
1085  Number of rows to display. If omitted, the default is 1 for a single-select list  Number of rows to display. If omitted, the default is 1 for a single-select list
1086  and 10 for a multi-select list.  and 10 for a multi-select list.
1087    
1088    =item crossMenu (optional)
1089    
1090    If specified, is presumed to be the name of another genome menu whose contents
1091    are to be mutually exclusive with the contents of this menu. As a result, instead
1092    of the standard onChange event, the onChange event will deselect any entries in
1093    the other menu.
1094    
1095  =item RETURN  =item RETURN
1096    
1097  Returns the HTML text to generate a C<SELECT> menu inside a form.  Returns the HTML text to generate a C<SELECT> menu inside a form.
# Line 1092  Line 1102 
1102    
1103  sub NmpdrGenomeMenu {  sub NmpdrGenomeMenu {
1104      # Get the parameters.      # Get the parameters.
1105      my ($self, $menuName, $multiple, $selected, $rows) = @_;      my ($self, $menuName, $multiple, $selected, $rows, $cross) = @_;
1106      # Get the Sprout and CGI objects.      # Get the Sprout and CGI objects.
1107      my $sprout = $self->DB();      my $sprout = $self->DB();
1108      my $cgi = $self->Q();      my $cgi = $self->Q();
# Line 1157  Line 1167 
1167      my $showSelect = "showSelected($menuName, '$divID', 1000);";      my $showSelect = "showSelected($menuName, '$divID', 1000);";
1168      # If multiple selection is supported, create an onChange event.      # If multiple selection is supported, create an onChange event.
1169      my $onChange = "";      my $onChange = "";
1170      if ($multiple) {      if ($cross) {
1171            $onChange = " onChange=\"crossUnSelect($menuName, '$divID', $cross, '${formName}_${cross}_status', 1000)\"";
1172        } elsif ($multiple) {
1173          $onChange = " onChange=\"$showSelect\"";          $onChange = " onChange=\"$showSelect\"";
1174      }      }
1175      # Create the SELECT tag and stuff it into the output array.      # Create the SELECT tag and stuff it into the output array.
# Line 1649  Line 1661 
1661      return $retVal;      return $retVal;
1662  }  }
1663    
1664    =head3 FeatureTypeMap
1665    
1666    C<< my %features = SearchHelper::FeatureTypeMap(); >>
1667    
1668    Return a map of feature types to descriptions. The feature type data is stored
1669    in the B<FIG_Config> file. Currently, it only contains a space-delimited list of
1670    feature types. The map returned by this method is a hash mapping the type codes to
1671    descriptive names.
1672    
1673    The reason we have to convert the list from a string is that the B<NMPDRSetup.pl>
1674    script is only able to insert strings into the generated B<FIG_Config> file.
1675    
1676    =cut
1677    
1678    sub FeatureTypeMap {
1679        my @list = split /\s+/, $FIG_Config::feature_types;
1680        my %retVal = map { $_ => $_ } @list;
1681        return %retVal;
1682    }
1683    
1684    =head3 AdvancedClassList
1685    
1686    C<< my @classes = SearchHelper::AdvancedClassList(); >>
1687    
1688    Return a list of advanced class names. This list is used to generate the directory
1689    of available searches on the search page.
1690    
1691    The reason we have to convert the list from a string is that the B<NMPDRSetup.pl>
1692    script is only able to insert strings into the generated B<FIG_Config> file.
1693    
1694    =cut
1695    
1696    sub AdvancedClassList {
1697        return split /\s+/, $FIG_Config::advanced_classes;
1698    }
1699    
1700  =head2 Feature Column Methods  =head2 Feature Column Methods
1701    
1702  The methods in this column manage feature column data. If you want to provide the  The methods in this column manage feature column data. If you want to provide the
# Line 1937  Line 1985 
1985      # Return the result.      # Return the result.
1986      return $retVal;      return $retVal;
1987  }  }
1988    
1989    
1990  1;  1;

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3