annotate Lib/IMPL/Web/Application.pm @ 129:e4f15cbc3f1a

Fixed utf-8 problem
author wizard
date Tue, 15 Jun 2010 20:12:58 +0400
parents 6dd659f6f66c
children 06a34c197b05
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
1 package IMPL::Web::Application;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
2 use strict;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
3 use warnings;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
4
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 59
diff changeset
5 use base qw(IMPL::Config IMPL::Object::Singleton);
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
6
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
7 require IMPL::Web::Application::Action;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
8 require IMPL::Web::Application::Response;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
9
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
10 use IMPL::Class::Property;
57
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
11 use CGI;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
12
60
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 59
diff changeset
13 __PACKAGE__->PassThroughArgs;
b0c068da93ac Lazy activation for the configuration objects (final concept)
wizard
parents: 59
diff changeset
14
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
15 BEGIN {
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
16 public property handlerError => prop_all;
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
17 public property actionFactory => prop_all;
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents: 58
diff changeset
18 public property handlersQuery => prop_all | prop_list;
65
2840c4c85db8 Application configuration improvements
wizard
parents: 63
diff changeset
19 public property responseCharset => prop_all;
73
wizard
parents: 67
diff changeset
20 public property security => prop_all;
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 62
diff changeset
21 public property options => prop_all;
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
22 public property fetchRequestMethod => prop_all;
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
23 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
24
62
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
25 sub CTOR {
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
26 my ($this) = @_;
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
27
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
28 $this->actionFactory('IMPL::Web::Application::Action') unless $this->actionFactory;
65
2840c4c85db8 Application configuration improvements
wizard
parents: 63
diff changeset
29 $this->responseCharset('utf-8') unless $this->responseCharset;
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
30 $this->fetchRequestMethod(\&defaultFetchRequest) unless $this->fetchRequestMethod;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
31 $this->handlerError(\&defaultHandlerError) unless $this->handlerError;
62
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
32 }
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
33
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
34 sub Run {
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
35 my ($this) = @_;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
36
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
37 while (my $query = $this->FetchRequest()) {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
38
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
39 my $action = $this->actionFactory->new(
62
c64bd1bf727d Web application
wizard
parents: 60
diff changeset
40 query => $query,
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
41 application => $this,
65
2840c4c85db8 Application configuration improvements
wizard
parents: 63
diff changeset
42 );
2840c4c85db8 Application configuration improvements
wizard
parents: 63
diff changeset
43
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
44 eval {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
45 $action->response->charset($this->responseCharset);
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
46
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
47 $action->ChainHandler($_) foreach $this->handlersQuery;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
48
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
49 $action->Invoke();
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
50
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
51 $action->response->Complete;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
52 };
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
53 if ($@) {
99
6dd659f6f66c Minor changes, DOM schema is in development (in the aspect of a forms)
wizard
parents: 97
diff changeset
54 my $e = $@;
129
e4f15cbc3f1a Fixed utf-8 problem
wizard
parents: 99
diff changeset
55 # we are expecting this method to be safe otherwise we can trust nothing in this wolrd
99
6dd659f6f66c Minor changes, DOM schema is in development (in the aspect of a forms)
wizard
parents: 97
diff changeset
56 $this->handlerError()->($this,$action,$e);
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
57 }
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
58 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
59 }
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
60
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
61 sub FetchRequest {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
62 my ($this) = @_;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
63
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
64 if( ref $this->fetchRequestMethod eq 'CODE' ) {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
65 return $this->fetchRequestMethod->($this);
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
66 } else {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
67 die new IMPL::Exception("Unknown fetchRequestMethod type",ref $this->fetchRequestMethod);
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
68 }
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
69 }
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
70
57
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
71 {
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
72 my $hasFetched = 0;
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
73
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
74 sub defaultFetchRequest {
129
e4f15cbc3f1a Fixed utf-8 problem
wizard
parents: 99
diff changeset
75 my ($this) = @_;
57
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
76 return undef if $hasFetched;
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
77 $hasFetched = 1;
129
e4f15cbc3f1a Fixed utf-8 problem
wizard
parents: 99
diff changeset
78 my $query = CGI->new();
e4f15cbc3f1a Fixed utf-8 problem
wizard
parents: 99
diff changeset
79 $query->charset($this->responseCharset);
e4f15cbc3f1a Fixed utf-8 problem
wizard
parents: 99
diff changeset
80 return $query;
57
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
81 }
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
82 }
bf59ee1cd506 Web application main class functionality
wizard
parents: 52
diff changeset
83
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
84 sub defaultHandlerError {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
85 my ($this,$action,$e) = @_;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
86 warn $e;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
87 if ( eval { $action->ReinitResponse(); 1; } ) {
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
88 $action->response->contentType('text/plain');
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
89 $action->response->charset($this->responseCharset);
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
90 $action->response->status(500);
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
91 my $hout = $action->response->streamBody;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
92 print $hout $e;
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
93 $action->response->Complete();
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
94 }
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
95 }
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
96
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
97 1;
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
98
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
99 __END__
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
100
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
101 =pod
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
102
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
103 =head1 SYNOPSIS
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
104
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
105 =begin code
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
106
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
107 require MyApp;
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
108
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
109 my $instance = spawn MyApp('app.config');
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
110
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
111 $instance->Run();
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
112
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
113 =end code
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
114
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
115 =head1 DESCRIPTION
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
116
73
wizard
parents: 67
diff changeset
117 C< use base qw( IMPL::Config IMPL::Object::Singleton )>
wizard
parents: 67
diff changeset
118
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
119 Зкземпляр приложения содержит в себе глобальные настройки, реализует контроллер запросов,
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
120 в качестве источника запросов используется CGI или иной совместимый модуль.
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
121
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
122 Процесс обработки запроса состоит из следующих частей
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
123
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
124 =over
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
125
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
126 =item 1
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
127
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
128 Получение cgi запроса
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
129
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
130 =item 2
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
131
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
132 Создание объекта C<IMPL::Web::Application::Action>
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
133
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
134 =item 3
52
15d720913562 security in work
wizard@linux-odin.local
parents: 49
diff changeset
135
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
136 Формирование цепочки вызовов при помощи C<< IMPL::Web::Application::Action->ChainHandler >>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
137
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
138 =item 4
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
139
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
140 Выполнение запроса C<< IMPL::Web::Application::Action->Invoke >>
49
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
141
16ada169ca75 migrating to the Eclipse IDE
wizard@linux-odin.local
parents: 47
diff changeset
142 =cut
67
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
143
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
144 Также приложение поддерживает отложенное создание объектов, которые по первому обращению
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
145 к свойствам. Это реализовано в базовом классе C< IMPL::Configuration >. Для настройки
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
146 активаторов можно использовать свойство C<options>, в которое должен быть помещен хеш
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
147 со ссылками на активаторы, см. пример ниже C<CONFIGURATION>.
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
148
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
149 =head2 CONFIGURATION
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
150
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
151 Ниже приведен пример конфигурации приложения
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
152
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
153 =begin code xml
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
154
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
155 <?xml version="1.0" encoding="UTF-8"?>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
156 <Application id='app' type="Test::Web::Application::Instance">
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
157
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
158 <!-- Begin custom properties -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
159 <name>Sample application</name>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
160 <dataSource type='IMPL::Config::Activator' id='ds'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
161 <factory>IMPL::Object</factory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
162 <parameters type='HASH'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
163 <db>data</db>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
164 <user>nobody</user>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
165 </parameters>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
166 </dataSource>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
167 <securityMod type='IMPL::Config::Activator'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
168 <factory>IMPL::Object</factory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
169 <parameters type='HASH'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
170 <ds refid='ds'/>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
171 </parameters>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
172 </securityMod>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
173 <!-- End custom properties -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
174
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
175 <!-- direct access to the activators -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
176 <options type="HASH">
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
177 <dataSource refid='ds'/>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
178 </options>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
179
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
180 <!-- Set default output encoding, can be changed due query handling -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
181 <responseCharset>utf-8</responseCharset>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
182
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
183 <!-- Actions creation configuration -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
184 <actionFactory type="IMPL::Object::Factory">
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
185
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
186 <!-- Construct actions -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
187 <factory>IMPL::Web::Application::Action</factory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
188 <parameters type='HASH'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
189
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
190 <!-- with special responseFactory -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
191 <responseFactory type='IMPL::Object::Factory'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
192
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
193 <!-- Where resopnses have a special streamOut -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
194 <factory>IMPL::Web::Application::Response</factory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
195 <parameters type='HASH'>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
196
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
197 <!-- in memory dummy output instead of STDOUT -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
198 <streamOut>memory</streamOut>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
199
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
200 </parameters>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
201 </responseFactory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
202 </parameters>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
203 </actionFactory>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
204
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
205 <!-- Query processing chain -->
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
206 <handlersQuery type="IMPL::Object::List">
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
207 <item type="IMPL::Web::QueryHandler::PageFormat">
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
208 <templatesCharset>cp1251</templatesCharset>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
209 </item>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
210 </handlersQuery>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
211 </Application>
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
212
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
213 =end code xml
9f5795a10939 Documentation, minor fixes
wizard
parents: 65
diff changeset
214
73
wizard
parents: 67
diff changeset
215 =head1 MEMBERS
wizard
parents: 67
diff changeset
216
wizard
parents: 67
diff changeset
217 =over
wizard
parents: 67
diff changeset
218
wizard
parents: 67
diff changeset
219 =item C<[get,set] handlerError>
wizard
parents: 67
diff changeset
220
wizard
parents: 67
diff changeset
221 Обработчик который будет вызван в случае возникновения необработанной ошибки
wizard
parents: 67
diff changeset
222 в процессе работы приложения. После чего приложение корректно завершается.
wizard
parents: 67
diff changeset
223
wizard
parents: 67
diff changeset
224 =item C<[get,set] actionFactory>
wizard
parents: 67
diff changeset
225
wizard
parents: 67
diff changeset
226 Фабрика объектов, которая используется приложением, для создания объектов
wizard
parents: 67
diff changeset
227 типа C<IMPL::Web::Application::Action> при обработки C<CGI> запросов.
wizard
parents: 67
diff changeset
228
wizard
parents: 67
diff changeset
229 =begin code
wizard
parents: 67
diff changeset
230
wizard
parents: 67
diff changeset
231 my $action = $this->actionFactory->new(
wizard
parents: 67
diff changeset
232 query => $query,
wizard
parents: 67
diff changeset
233 application => $this,
wizard
parents: 67
diff changeset
234 );
wizard
parents: 67
diff changeset
235
wizard
parents: 67
diff changeset
236 =end code
wizard
parents: 67
diff changeset
237
97
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
238 =item C< [get,set] fetchRequestMethod >
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
239
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
240 Метод получения CGI запроса. Возвращает C<CGI> объект следующего запроса, если
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
241 запросов больше нет, то возвращает C<undef>. По-умолчанию использует C<defaultFetchRequest>.
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
242
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
243 Может быть как ссылкой на функцию, так и объектом типа C<IMPL::Web::Application::RequestFetcher>.
964587c5183c Added SecureCall to Web QueryHandlers stack
wizard
parents: 73
diff changeset
244
73
wizard
parents: 67
diff changeset
245 =item C< [get,set,list] handlersQuery >
wizard
parents: 67
diff changeset
246
wizard
parents: 67
diff changeset
247 Список обработчиков запросов, которые будут переданы созданному объекту-действию.
wizard
parents: 67
diff changeset
248
wizard
parents: 67
diff changeset
249 =item C< [get,set] responseCharset>
wizard
parents: 67
diff changeset
250
wizard
parents: 67
diff changeset
251 Кодировка ответа клиенту.
wizard
parents: 67
diff changeset
252
wizard
parents: 67
diff changeset
253 =item C< [get,set] security >
wizard
parents: 67
diff changeset
254
wizard
parents: 67
diff changeset
255 Объект C<IMPL::Web::Security>, для работы с инфраструктурой безопасности.
wizard
parents: 67
diff changeset
256
wizard
parents: 67
diff changeset
257 =item C< [get,set] options >
wizard
parents: 67
diff changeset
258
wizard
parents: 67
diff changeset
259 Обычно ссылка на хеш с настраиваемыми объектами, используется для возможности
wizard
parents: 67
diff changeset
260 програмной настройки активаторов, т.к. напрямую через свойства приложения получить
wizard
parents: 67
diff changeset
261 к ним доступ не получится.
wizard
parents: 67
diff changeset
262
wizard
parents: 67
diff changeset
263 =back
wizard
parents: 67
diff changeset
264
wizard
parents: 67
diff changeset
265 =cut