annotate Lib/IMPL/Web/View/ObjectFactory.pm @ 241:f48a1a9f4fa2

+Added ViewResult to allow implementation of the view environment. *TTDocuments now storing creation parameters *TTControls automatically propagating layout and title meta to their attributes +Added UnauthorizaedException web exception *minor fixes
author sergey
date Thu, 18 Oct 2012 04:49:55 +0400
parents abc7c26bf615
children 7c517134c42f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
240
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
1 package IMPL::Web::View::ObjectFactory;
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
2 use strict;
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
3
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
4 our $AUTOLOAD;
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
5
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
6 use IMPL::declare {
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
7 require => {
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
8 Exception => 'IMPL::Exception',
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
9 OpException => '-IMPL::InvalidOperationException'
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
10 },
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
11 base =>[
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
12 'IMPL::Object::Factory' => '@_'
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
13 ]
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
14 };
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
15
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
16 sub AUTOLOAD {
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
17 my $this = shift;
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
18 my ($method) = ($AUTOLOAD =~ m/(\w+)$/);
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
19
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
20 return if $method eq 'DESTROY';
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
21 my $target = $this->factory;
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
22 if ( $target->can($method) ) {
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
23 return $target->$method(@_);
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
24 } else {
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
25 die OpException->new("Method '$method' isn't found in '$target'")
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
26 }
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
27 }
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
28
abc7c26bf615 +Added ObjectFactory for templates with static members support
sergey
parents:
diff changeset
29 1;