3 # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
5 # (Except where explictly superceded by other copyright notices)
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
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.
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.
24 package RT::URI::base;
27 use base qw(RT::Base);
35 A baseclass (and fallback) RT::URI handler. Every URI handler needs to
36 handle the API presented here
45 Create a new URI handler
51 my $class = ref($proto) || $proto;
53 bless( $self, $class );
54 $self->CurrentUser(@_);
61 $self->{'uri'} = "unknown-object:".ref($obj);
72 if ($uri =~ /^(.*?):/) {
73 $self->{'scheme'} = $1;
75 $self->{'uri'} = $uri;
89 return($self->{'uri'});
94 return($self->{'scheme'});
100 return($self->{'href'} || $self->{'uri'});
110 Return a "pretty" string representing the URI object.
112 This is meant to be used like this:
114 % $re = $uri->Resolver;
115 <A HREF="<% $re->HREF %>"><% $re->AsString %></A>
124 eval "require RT::URI::base_Vendor";
125 die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/base_Vendor.pm});
126 eval "require RT::URI::base_Local";
127 die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/base_Local.pm});