From 90bcd4d7fddc86d573c0cfc5d84e126ed1df2a83 Mon Sep 17 00:00:00 2001 From: groditi Date: Thu, 22 Oct 2009 18:24:11 +0000 Subject: first part of fix for attributes and roles mess. metclass coompat bug still lurks --- lib/ComponentUI/Controller/Root.pm | 3 ++- lib/ComponentUI/Controller/TestModel/Bar.pm | 2 +- lib/ComponentUI/Controller/TestModel/Baz.pm | 3 ++- lib/ComponentUI/Controller/TestModel/Foo.pm | 8 ++++---- lib/Reaction/UI/Controller.pm | 4 ++-- lib/Reaction/UI/Controller/Collection.pm | 2 +- lib/Reaction/UI/Controller/Collection/CRUD.pm | 2 +- lib/Reaction/UI/Controller/Collection/CRUD/Search.pm | 3 ++- lib/Reaction/UI/Controller/Role/Action/Simple.pm | 2 +- lib/Reaction/UI/Controller/Root.pm | 3 ++- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/lib/ComponentUI/Controller/Root.pm b/lib/ComponentUI/Controller/Root.pm index 9a2017f..d88fce3 100644 --- a/lib/ComponentUI/Controller/Root.pm +++ b/lib/ComponentUI/Controller/Root.pm @@ -2,8 +2,9 @@ package ComponentUI::Controller::Root; use strict; use warnings; -use base 'Reaction::UI::Controller::Root'; + use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Root'; } use aliased 'Reaction::UI::ViewPort'; use aliased 'Reaction::UI::ViewPort::SiteLayout'; diff --git a/lib/ComponentUI/Controller/TestModel/Bar.pm b/lib/ComponentUI/Controller/TestModel/Bar.pm index 7ede58e..c346480 100644 --- a/lib/ComponentUI/Controller/TestModel/Bar.pm +++ b/lib/ComponentUI/Controller/TestModel/Bar.pm @@ -1,7 +1,7 @@ package ComponentUI::Controller::TestModel::Bar; -use base 'Reaction::UI::Controller::Collection::CRUD'; use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } __PACKAGE__->config( model_name => 'TestModel', diff --git a/lib/ComponentUI/Controller/TestModel/Baz.pm b/lib/ComponentUI/Controller/TestModel/Baz.pm index 6c88792..f426780 100644 --- a/lib/ComponentUI/Controller/TestModel/Baz.pm +++ b/lib/ComponentUI/Controller/TestModel/Baz.pm @@ -1,7 +1,8 @@ package ComponentUI::Controller::TestModel::Baz; -use base 'Reaction::UI::Controller::Collection::CRUD'; use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } + use ComponentUI::UI::ViewPort::Baz::ListView::Member; __PACKAGE__->config( diff --git a/lib/ComponentUI/Controller/TestModel/Foo.pm b/lib/ComponentUI/Controller/TestModel/Foo.pm index 8730432..d9f3659 100644 --- a/lib/ComponentUI/Controller/TestModel/Foo.pm +++ b/lib/ComponentUI/Controller/TestModel/Foo.pm @@ -1,7 +1,7 @@ package ComponentUI::Controller::TestModel::Foo; -use base 'Reaction::UI::Controller::Collection::CRUD'; use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } use aliased 'Reaction::UI::ViewPort::SearchableListViewContainer'; use aliased 'ComponentUI::TestModel::Foo::SearchSpec'; @@ -67,9 +67,9 @@ override _build_action_viewport_args => sub { }; sub object : Chained('base') PathPart('id') CaptureArgs(1) { - my ($self, $c, $object) = @_; - $self->next::method($c, $object); - # just as failing use case + my ($self, $c, $object) = @_; + $self->next::method($c, $object); + # just as failing use case } 1; diff --git a/lib/Reaction/UI/Controller.pm b/lib/Reaction/UI/Controller.pm index 4777ccd..58eb03b 100644 --- a/lib/Reaction/UI/Controller.pm +++ b/lib/Reaction/UI/Controller.pm @@ -1,11 +1,11 @@ package Reaction::UI::Controller; -use base qw(Catalyst::Controller); # Reaction::Object); - use Reaction::Class; use Scalar::Util 'weaken'; use namespace::clean -except => [ qw(meta) ]; +BEGIN { extends 'Catalyst::Controller'; } + has context => (is => 'ro', isa => 'Object', weak_ref => 1); with( 'Catalyst::Component::InstancePerContext', diff --git a/lib/Reaction/UI/Controller/Collection.pm b/lib/Reaction/UI/Controller/Collection.pm index 38cd61d..15245f4 100644 --- a/lib/Reaction/UI/Controller/Collection.pm +++ b/lib/Reaction/UI/Controller/Collection.pm @@ -1,7 +1,7 @@ package Reaction::UI::Controller::Collection; -use base 'Reaction::UI::Controller'; use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller'; } use aliased 'Reaction::UI::ViewPort::Collection::Grid'; diff --git a/lib/Reaction/UI/Controller/Collection/CRUD.pm b/lib/Reaction/UI/Controller/Collection/CRUD.pm index bebfc75..f37790d 100644 --- a/lib/Reaction/UI/Controller/Collection/CRUD.pm +++ b/lib/Reaction/UI/Controller/Collection/CRUD.pm @@ -1,7 +1,7 @@ package Reaction::UI::Controller::Collection::CRUD; -use base 'Reaction::UI::Controller::Collection'; use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Collection'; } use aliased 'Reaction::UI::ViewPort::ListView'; diff --git a/lib/Reaction/UI/Controller/Collection/CRUD/Search.pm b/lib/Reaction/UI/Controller/Collection/CRUD/Search.pm index e9d467d..a9aa15f 100644 --- a/lib/Reaction/UI/Controller/Collection/CRUD/Search.pm +++ b/lib/Reaction/UI/Controller/Collection/CRUD/Search.pm @@ -1,6 +1,7 @@ package Reaction::UI::Controller::Collection::CRUD::Search; -use parent 'Reaction::UI::Controller::Collection::CRUD'; + use Reaction::Class; +BEGIN { extends 'Reaction::UI::Controller::Collection::CRUD'; } use aliased 'Reaction::UI::ViewPort::SearchableListViewContainer'; diff --git a/lib/Reaction/UI/Controller/Role/Action/Simple.pm b/lib/Reaction/UI/Controller/Role/Action/Simple.pm index bf5ba16..351d124 100644 --- a/lib/Reaction/UI/Controller/Role/Action/Simple.pm +++ b/lib/Reaction/UI/Controller/Role/Action/Simple.pm @@ -15,7 +15,7 @@ sub _build_action_viewport_args { {} } sub setup_viewport { my ($self, $c, $vp_args) = @_; my $action_name = $c->stack->[-1]->name; - my $vp = $self->action_viewport_map->{$action_name}, + my $vp = $self->action_viewport_map->{$action_name}; my $args = $self->merge_config_hashes( $vp_args || {}, $self->action_viewport_args->{$action_name} || {} , diff --git a/lib/Reaction/UI/Controller/Root.pm b/lib/Reaction/UI/Controller/Root.pm index eb0e3b5..bea629c 100644 --- a/lib/Reaction/UI/Controller/Root.pm +++ b/lib/Reaction/UI/Controller/Root.pm @@ -1,9 +1,10 @@ package Reaction::UI::Controller::Root; -use base qw/Reaction::UI::Controller/; use Reaction::Class; use Reaction::UI::Window; +BEGIN { extends 'Reaction::UI::Controller'; } + __PACKAGE__->config( view_name => 'XHTML', content_type => 'text/html', -- cgit v1.2.3