comparison Lib/IMPL/Web/Application/Action.pm @ 266:89179bb8c388

*corrected TTView to handle plain (and undefined) values *added URL generating methods to Application::Action *fixed the compare validatior for schemas
author cin
date Mon, 14 Jan 2013 03:10:06 +0400
parents 32aceba4ee6d
children 4abda21186cd
comparison
equal deleted inserted replaced
265:6b6d4b2275a1 266:89179bb8c388
3 3
4 use Carp qw(carp); 4 use Carp qw(carp);
5 5
6 use IMPL::Const qw(:prop); 6 use IMPL::Const qw(:prop);
7 use IMPL::Web::CGIWrapper(); 7 use IMPL::Web::CGIWrapper();
8 use URI;
8 9
9 use IMPL::declare { 10 use IMPL::declare {
10 base => [ 11 base => [
11 'IMPL::Object' => undef, 12 'IMPL::Object' => undef,
12 'IMPL::Object::Autofill' => '@_' 13 'IMPL::Object::Autofill' => '@_'
48 } 49 }
49 50
50 $this->_launder($value, $rx ); 51 $this->_launder($value, $rx );
51 } 52 }
52 53
54 sub urlParam {
55 my ($this,$name,$rx) = @_;
56
57 $this->_launder(scalar( $this->query->url_param($name) ), $rx);
58 }
59
53 sub rawData { 60 sub rawData {
54 my ($this) = @_; 61 my ($this) = @_;
55 62
56 local $IMPL::Web::CGIWrapper::NO_DECODE = 1; 63 local $IMPL::Web::CGIWrapper::NO_DECODE = 1;
57 if ($this->requestMethod eq 'POST') { 64 if ($this->requestMethod eq 'POST') {
77 84
78 sub baseUrl { 85 sub baseUrl {
79 my ($this) = @_; 86 my ($this) = @_;
80 87
81 return $this->query->url(-base => 1); 88 return $this->query->url(-base => 1);
89 }
90
91 sub applicationUrl {
92 shift->application->baseUrl;
93 }
94
95 sub applicationFullUrl {
96 my ($this) = @_;
97
98 return URI->new_abs($this->application->baseUrl, $this->query->url(-base => 1));
99 }
100
101 sub CreateFullUrl {
102 my ($this,$path) = @_;
103
104 return $path ? URI->new($path,$this->applicationFullUrl) : $this->applicationFullUrl;
105 }
106
107 sub CreateAbsoluteUrl {
108 my ($this,$path) = @_;
109
110 return $path ? URI->new($path,$this->applicationUrl) : $this->applicationUrl;
82 } 111 }
83 112
84 sub _launder { 113 sub _launder {
85 my ($this,$value,$rx) = @_; 114 my ($this,$value,$rx) = @_;
86 115