Move EUtilParameters to Tools (seems more appropriate)
[bioperl-live.git] / Bio / Tools / EUtilities / History.pm
blob7ead53ed42346e39af55c20bc1a4000c09b7864c
1 # $Id$
3 # BioPerl module for Bio::Tools::EUtilities::History
5 # Cared for by Chris Fields
7 # Copyright Chris Fields
9 # You may distribute this module under the same terms as perl itself
11 # POD documentation - main docs before the code
13 # Part of the EUtilities BioPerl package
15 =head1 NAME
17 Bio::Tools::EUtilities::History - simple HistoryI implementation for holding
18 NCBI search history.
20 =head1 SYNOPSIS
22 #### should not create instance directly; Bio::Tools::EUtilities does this ####
24 my $hist = Bio::Tools::EUtilities->new(-eutil => 'epost',
25 -file => 'epost.xml');
27 if ($hist->has_History) {
28 # do something here
31 ($webenv, $querykey) = $hist->get_history;
33 $webenv = $hist->get_webenv;
35 $query_key = $hist->get_query_key;
37 =head1 DESCRIPTION
39 This class is the simplest Bio::Tools::EUtilities::HistoryI implementation and
40 is primarily used for epost. This class adds methods to objects for dealing with
41 NCBI history data (WebEnv and query_key). These can be used as parameters for
42 futher queries against data sets stored on the NCBI server, much like NCBI's
43 Entrez search history.
45 NOTE: I plan on testing how long this data is stored remotely. I believe NCBI
46 deletes remote data after 24 hours.
48 =head1 FEEDBACK
50 =head2 Mailing Lists
52 User feedback is an integral part of the evolution of this and other Bioperl
53 modules. Send your comments and suggestions preferably to one of the Bioperl
54 mailing lists. Your participation is much appreciated.
56 bioperl-l@lists.open-bio.org - General discussion
57 http://www.bioperl.org/wiki/Mailing_lists - About the mailing lists
59 =head2 Reporting Bugs
61 Report bugs to the Bioperl bug tracking system to help us keep track the bugs
62 and their resolution. Bug reports can be submitted via the web.
64 http://bugzilla.open-bio.org/
66 =head1 AUTHOR
68 Email cjfields at uiuc dot edu
70 =head1 APPENDIX
72 The rest of the documentation details each of the object methods. Internal
73 methods are usually preceded with a _
75 =cut
77 # Let the code begin...
79 package Bio::Tools::EUtilities::History;
80 use strict;
81 use warnings;
82 #use URI::Escape qw(uri_unescape);
84 use base qw(Bio::Tools::EUtilities);
86 =head1 Bio::Tools::EUtilities::History relevant methods
88 These are inherited through the Bio::Tools::EUtilities interface
89 Bio::Tools::EUtilities::HistoryI
91 =head2 history
93 Title : history
94 Usage : my ($webenv, $qk) = $hist->history
95 Function : Get/Set two-element list of webenv() and query_key()
96 Returns : array
97 Args : two-element list of webenv, querykey
99 =cut
101 =head2 get_webenv
103 Title : get_webenv
104 Usage : my $webenv = $hist->get_webenv
105 Function : returns web environment key needed to retrieve results from
106 NCBI server
107 Returns : string (encoded key)
108 Args : none
110 =cut
112 =head2 get_query_key
114 Title : get_query_key
115 Usage : my $qk = $hist->get_query_key
116 Function : returns query key (integer) for the history number for this session
117 Returns : integer
118 Args : none
120 =cut
122 =head2 has_History
124 Title : has_History
125 Usage : if ($hist->has_History) {...}
126 Function : returns TRUE if full history (webenv, query_key) is present
127 Returns : BOOLEAN, value eval'ing to TRUE or FALUE
128 Args : none
130 =cut
132 # private method
134 sub _add_data {
135 my ($self, $simple) = @_;
136 map { $self->{'_'.lc $_} = $simple->{$_} } keys %$simple;
140 __END__