| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#$Id: Component.pm 303 2008-08-24 16:09:48Z zag $ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package HTML::WebDAO::Component; |
|
4
|
1
|
|
|
1
|
|
5
|
use HTML::WebDAO::Base; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
60
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use base qw(HTML::WebDAO::Element); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
142
|
|
|
6
|
|
|
|
|
|
|
use strict 'vars'; |
|
7
|
|
|
|
|
|
|
use Data::Dumper; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub _url_method { |
|
10
|
|
|
|
|
|
|
my $self = shift; |
|
11
|
|
|
|
|
|
|
my $method = shift; |
|
12
|
|
|
|
|
|
|
my $ref; |
|
13
|
|
|
|
|
|
|
$ref->{path} = join '/' => $self->__path2me, $method; |
|
14
|
|
|
|
|
|
|
my %args = @_; |
|
15
|
|
|
|
|
|
|
$ref->{pars} = \%args if @_; |
|
16
|
|
|
|
|
|
|
my $res; |
|
17
|
|
|
|
|
|
|
$self->SendEvent( |
|
18
|
|
|
|
|
|
|
"_sess_servise", |
|
19
|
|
|
|
|
|
|
{ |
|
20
|
|
|
|
|
|
|
funct => 'geturl', |
|
21
|
|
|
|
|
|
|
par => $ref, |
|
22
|
|
|
|
|
|
|
result => \$res |
|
23
|
|
|
|
|
|
|
} |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
return $res; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub url_method { |
|
30
|
|
|
|
|
|
|
my $self = shift; |
|
31
|
|
|
|
|
|
|
my $method = shift; |
|
32
|
|
|
|
|
|
|
my @upath = (); |
|
33
|
|
|
|
|
|
|
push @upath, $self->__path2me if $self->__path2me; |
|
34
|
|
|
|
|
|
|
if ( defined $self->__extra_path ) { |
|
35
|
|
|
|
|
|
|
my $extr = $self->__extra_path; |
|
36
|
|
|
|
|
|
|
$extr = [$extr] unless ( ref($extr) eq 'ARRAY' ); |
|
37
|
|
|
|
|
|
|
push @upath, @$extr; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
push @upath, $method if defined $method; |
|
40
|
|
|
|
|
|
|
my $sess = $self->getEngine->_session; |
|
41
|
|
|
|
|
|
|
if ( $sess->set_absolute_url() ) { |
|
42
|
|
|
|
|
|
|
unshift @upath, $sess->Cgi_env->{base_url}; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my $path = join '/' => @upath; |
|
46
|
|
|
|
|
|
|
my $str = ''; |
|
47
|
|
|
|
|
|
|
if (@_) { |
|
48
|
|
|
|
|
|
|
my %args = @_; |
|
49
|
|
|
|
|
|
|
my @pars; |
|
50
|
|
|
|
|
|
|
while ( my ( $key, $val ) = each %args ) { |
|
51
|
|
|
|
|
|
|
push @pars, "$key=$val"; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
$str .= "?" . join "&" => @pars; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
return $path . $str; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub response { |
|
59
|
|
|
|
|
|
|
my $self = shift; |
|
60
|
|
|
|
|
|
|
return $self->getEngine->response; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
1; |