annotate Lib/IMPL/Web/Application/CustomResource.pm @ 334:71221d79e6b4

removing web resources contracts
author cin
date Thu, 13 Jun 2013 02:24:57 +0400
parents 04a093f0a5a6
children e8be9062ecf2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
1 package IMPL::Web::Application::CustomResource;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
2 use strict;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
3
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
4 use IMPL::Const qw(:prop);
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
5
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
6 use IMPL::declare {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
7 require => {
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
8 NotAllowedException => 'IMPL::Web::NotAllowedException',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
9 HttpResponse => 'IMPL::Web::HttpResponse'
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
10 },
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
11 base => [
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
12 'IMPL::Web::Application::Resource' => '@_'
330
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
13 ],
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
14 props => [
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
15 accessCheck => PROP_RW
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
16 ]
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
17 };
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
18
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
19 our %RESOURCE_BINDINGS = (
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
20 GET => 'HttpGet',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
21 POST => 'HttpPost',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
22 PUT => 'HttpPut',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
23 DELETE => 'HttpDelete',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
24 HEAD => 'HttpHead'
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
25 );
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
26
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
27 __PACKAGE__->static_accessor(_rxResourcesMap => undef, 'own');
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
28 __PACKAGE__->static_accessor(_nameResourcesMap => undef, 'own');
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
29
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
30 sub namedResources {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
31 shift->_nameResourcesMap;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
32 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
33
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
34 sub regexResources {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
35 shift->_rxResourcesMap;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
36 }
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
37
330
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
38 sub CTOR {
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
39 my ($this,%args) = @_;
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
40
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
41 $this->accessCheck($args{accessCheck})
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
42 if $args{accessCheck};
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
43
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
44 $this->verbs->{options} ||= \&_HttpOptionsBinding;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
45
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
46 while(my ($verb,$methodName) = each %RESOURCE_BINDINGS) {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
47 $this->verbs->{lc($verb)} ||= sub {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
48 my ($resource,$action) = @_;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
49
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
50 if (eval { $resource->can($methodName) }) {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
51 return $resource->$methodName($action);
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
52 } else {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
53 die NotAllowedException->new(allow => join(',', _GetAllowedHttpMethods($resource)));
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
54 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
55 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
56 }
330
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
57 }
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
58
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
59 sub FindChildResourceInfo {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
60 my ( $this, $name ) = @_;
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
61
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
62 $this->_PrepareResourcesCache()
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
63 unless($this->_nameResourcesMap);
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
64
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
65 return $this->next::method($name);
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
66 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
67
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
68 sub PrepareResourcesCache {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
69 # suppress default caching mechanisn
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
70 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
71
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
72 sub _PrepareResourcesCache {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
73 # a little bit wired
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
74 my ($self) = @_;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
75 my %nameMap;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
76 my @rxMap;
248
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
77
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
78 foreach my $res ($self->GetChildResources()) {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
79 #skip resources without contract
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
80 next unless $res->{contract};
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
81
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
82 if ( my $name = $res->{name} ) {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
83 $nameMap{$name} = $res;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
84 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
85 if ( $res->{match} ) {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
86 push @rxMap,$res;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
87 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
88 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
89
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
90 $self->_rxResourcesMap(\@rxMap);
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
91 $self->_nameResourcesMap(\%nameMap);
295
cin
parents: 248
diff changeset
92 }
cin
parents: 248
diff changeset
93
330
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
94 sub AccessCheck {
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
95 my ($this,$verb) = @_;
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
96
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
97 my $handler = $this->accessCheck;
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
98
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
99 if(ref($handler) eq 'CODE') {
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
100 return &$handler($this,$verb);
330
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
101 }
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
102 }
fe725fad2d90 Added access checking to web resources
sergey
parents: 295
diff changeset
103
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
104 sub GetChildResources {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
105
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
106 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
107
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
108 sub _HttpOptionsBinding {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
109 my ($this) = @_;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
110
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
111 my @allow = $this->_GetAllowedHttpMethods();
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
112 return HttpResponse->new(
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
113 status => '200 OK',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
114 headers => {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
115 allow => join ( ',', @allow )
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
116 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
117 );
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
118 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
119
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
120 sub _GetAllowedHttpMethods {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
121 my ($this) = @_;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
122 return grep $this->can($RESOURCE_BINDINGS{$_}), keys %RESOURCE_BINDINGS;
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
123 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
124
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
125
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
126 1;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
127
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
128 __END__
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
129
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
130 =pod
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
131
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
132 =head1 NAME
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
133
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
134 C<IMPL::Web::Application::CustomResource> - базовый класс для ресурсов,
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
135 реальзуемых в коде.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
136
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
137 =head1 SYNOPSIS
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
138
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
139 =begin code
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
140
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
141 package MyApp::Web::Resources::ProfileResource;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
142 use IMPL::declare {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
143 base => [
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
144 'IMPL::Web::Application::CustomResource' => '@_'
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
145 ]
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
146 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
147
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
148 sub HttpGet {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
149 my ($this) = @_;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
150 return $this->model;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
151 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
152
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
153 sub HttpPut {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
154 my ($this,$action) = @_;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
155
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
156 my $form = MyApp::Web::Schema::UpdateUser->new();
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
157
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
158 $this->model->update( $form->Bind($action) );
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
159 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
160
334
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
161 sub GetChildResources {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
162 return {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
163 name => 'create',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
164 contract => {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
165 class => 'My::Web::FormResource',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
166 formName => 'create',
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
167 schema => 'profile.schema'
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
168 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
169 },
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
170 {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
171 match => qr/^(.*)$/,
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
172 contract => {
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
173 class => 'My::Web::ItemResource'
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
174 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
175 }
71221d79e6b4 removing web resources contracts
cin
parents: 332
diff changeset
176 }
332
04a093f0a5a6 IMPL::Web::Application refactoring: resources are created per client request
cin
parents: 330
diff changeset
177
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
178 =end code
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
179
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
180 =head1 MEMBERS
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
181
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
182 =head2 C<[static]contractFactory>
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
183
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
184 Фабрика, используемая для получения контракта ресурса. По умолчанию
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
185 C<IMPL::Web::Application::CustomResourceContract>.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
186
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
187 =head2 C<[static]contractInstance>
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
188
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
189 Экземпляр контракта для ресурса. Создается при первом обращении при помощи
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
190 метода C<InitContract()>.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
191
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
192 =head2 C<[static]InitContract()>
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
193
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
194 Создает новый экземпляр контракта, используя фабрику из свойства C<contractFactory>.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
195
248
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
196 =head2 C<[static]CreateContract(%args)>
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
197
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
198 Создает новый контракт, который при создании ресурсов будет передавать им в
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
199 конструкторе параметры C<%args>. Реализуется при помощи C<IMPL::Object::Factory>
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
200 которой задается параметр ссылка на C<%args>, т.о. при создании ресурса, ему в
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
201 конструкторе будет передан список из ключей и значений хеша C<%args>, а затем
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
202 остальные аргументы.
814d755e5d12 Minor fixes
sergey
parents: 240
diff changeset
203
295
cin
parents: 248
diff changeset
204 =head2 C<[static]CreateResource(%args)>
cin
parents: 248
diff changeset
205
cin
parents: 248
diff changeset
206 Создает контракт по-умолчанию и вызывает у него метод C<CreateResource(%args)>.
cin
parents: 248
diff changeset
207
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
208 =head2 C<[static]GetChildResources()>
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
209
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
210 Статический метод, который должны переопределять новые классы ресурсов, у
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
211 которых есть дочерние ресурсы.
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
212
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
213 =begin code
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
214
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
215 package MyApp::Web::MyResource
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
216
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
217 sub GetChildResources {
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
218 my $self = shift;
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
219 return
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
220 $self->SUPER::GetChildResources(),
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
221 {
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
222 name => 'info',
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
223 contract => $contractInfo
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
224 };
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
225 }
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
226
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
227 =end code
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
228
230
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
229 Метод возвращает список из хешей, которые будут переданы в качестве параметра
6d8092d8ce1b *reworked IMPL::Security
sergey
parents: 229
diff changeset
230 C<resources> контракту данного ресурса.
229
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
231
47f77e6409f7 heavily reworked the resource model of the web application:
sergey
parents:
diff changeset
232 =cut