import Net::Whois::Raw into install/5.005 directory *sigh*
[freeside.git] / rt / lib / RT / Search / Generic.pm
1 # BEGIN LICENSE BLOCK
2
3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4
5 # (Except where explictly superceded by other copyright notices)
6
7 # This work is made available to you under the terms of Version 2 of
8 # the GNU General Public License. A copy of that license should have
9 # been provided with this software, but in any event can be snarfed
10 # from www.gnu.org.
11
12 # This work is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 # General Public License for more details.
16
17 # Unless otherwise specified, all modifications, corrections or
18 # extensions to this work which alter its source code become the
19 # property of Best Practical Solutions, LLC when submitted for
20 # inclusion in the work.
21
22
23 # END LICENSE BLOCK
24 =head1 NAME
25
26   RT::Search::Generic - ;
27
28 =head1 SYNOPSIS
29
30     use RT::Search::Generic;
31     my $tickets = RT::Tickets->new($CurrentUser);
32     my $foo = RT::Search::Generic->new(Argument => $arg,
33                                        TicketsObj => $tickets);
34     $foo->Prepare();
35     while ( my $ticket = $foo->Next ) {
36         # Do something with each ticket we've found
37     }
38
39
40 =head1 DESCRIPTION
41
42
43 =head1 METHODS
44
45
46 =begin testing
47
48 ok (require RT::Search::Generic);
49
50 =end testing
51
52
53 =cut
54
55 package RT::Search::Generic;
56
57 use strict;
58
59 # {{{ sub new 
60 sub new  {
61   my $proto = shift;
62   my $class = ref($proto) || $proto;
63   my $self  = {};
64   bless ($self, $class);
65   $self->_Init(@_);
66   return $self;
67 }
68 # }}}
69
70 # {{{ sub _Init 
71 sub _Init  {
72   my $self = shift;
73   my %args = ( 
74            TicketsObj => undef,
75                Argument => undef,
76                @_ );
77   
78   $self->{'TicketsObj'} = $args{'TicketsObj'}; 
79   $self->{'Argument'} = $args{'Argument'};
80 }
81 # }}}
82
83 # {{{ sub Argument 
84
85 =head2 Argument
86
87 Return the optional argument associated with this Search
88
89 =cut
90
91 sub Argument  {
92   my $self = shift;
93   return($self->{'Argument'});
94 }
95 # }}}
96
97
98 =head2 TicketsObj 
99
100 Return the Tickets object passed into this search
101
102 =cut
103
104 sub TicketsObj {
105     my $self = shift;
106     return($self->{'TicketsObj'});
107 }
108
109 # {{{ sub Describe 
110 sub Describe  {
111   my $self = shift;
112   return ($self->loc("No description for [_1]", ref $self));
113 }
114 # }}}
115
116 # {{{ sub Prepare
117 sub Prepare  {
118   my $self = shift;
119   return(1);
120 }
121 # }}}
122
123 eval "require RT::Search::Generic_Vendor";
124 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Generic_Vendor.pm});
125 eval "require RT::Search::Generic_Local";
126 die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Generic_Local.pm});
127
128 1;