my $self = shift;
my %map;
$map{list} = Grid;
- $map{view} = Object if grep {$_ eq 'view'} @{$self->default_member_actions};
+ $map{view} = Object; #if grep {$_ eq 'view'} @{$self->default_member_actions};
return \%map;
}
=back
+=head2 default_member_actions
+
+Read-write lazy building arrayref. The names of the member actions (the actions
+that apply to each member of the collection and typically have an object as a
+target e.g. update,delete) to be enabled by default. By default, this is only
+'view'
+
+=over 4
+
+=item B<_build_defualt_member_actions - Provided builder method, see METHODS
+
+=item B<has_default_member_actions> - Auto generated predicate
+
+=item B<clear_default_member_actions>- Auto generated clearer method
+
+=back
+
+=head2 default_collection_actions
+
+Read-write lazy building arrayref. The names of the collection actions (the
+actions that apply to the entire collection and typically have a collection as
+a target e.g. create, delete_all) to be enabled by default. By default, this
+is only empty.
+
+=over 4
+
+=item B<_build_defualt_member_actions - Provided builder method, see METHODS
+
+=item B<has_default_member_actions> - Auto generated predicate
+
+=item B<clear_default_member_actions>- Auto generated clearer method
+
+=back
+
=head1 METHODS
=head2 get_collection $c
=head2 _build_action_viewport_map
-Provided builder for C<action_viewport_map>. Returns a hash with two items:
+Provided builder for C<action_viewport_map>. Returns a hash containing:
- list => 'Reaction::UI::ViewPort::ListView',
+ list => 'Reaction::UI::ViewPort::Collection::Grid',
view => 'Reaction::UI::ViewPort::Object',
=head2 _build_action_viewport_args
-Returns an empty hashref.
+By default will reurn a hashref containing action prototypes for all default
+member and collection actions. The prototype URI generators are generated by
+C<_build_member_action_prototype> and C<_build_collection_action_prototype>
+respectively and labels are the result of replacing underscores in the name
+with spaces and capitalizing the first letter. If you plan to use custom
+actions that are not supported by this scheme or you would like to customize
+the values it is suggested you wrap / override this method.
+
+Default output for a controller having only 'view' enabled:
+
+ { list => {
+ action_prototypes => {},
+ Member => {
+ action_prototypes => {
+ view => {label => 'View', uri => sub{...} },
+ },
+ },
+ },
+ }
+
+=head2 _build_member_action_prototype $label, $action_name
+
+Creates an action prototype suitable for creating action links in
+L<Reaction::UI::ViewPort::Role::Actions>. C<$action_name> should be the name of
+a Catalyst action in this controller.The prototype will generate a URI
+based on the action, current captures.
+
+=head2 _build_collection_action_prototype $label, $action_name
=head2 basic_page $c, \%vp_args
my $map = $self->next::method(@_);
$map->{list} = ListView if exists $map->{list};
- my %allowed = map { $_ => undef }
- ( @{$self->default_member_actions}, @{$self->default_collection_actions} );
-
- my @local_actions = qw/create update delete delete_all/;
- $map->{$_} = Action for grep { exists $allowed{$_} } @local_actions;
+ #my %allowed = map { $_ => undef }
+ # ( @{$self->default_member_actions}, @{$self->default_collection_actions} );
+ #my @local_actions = qw/create update delete delete_all/;
+ #$map->{$_} = Action for grep { exists $allowed{$_} } @local_actions;
+ $map->{$_} = Action for @local_actions;
return $map;
}
=head2 _build_action_viewport_map
-Map C<create>, C<update>, C<delete> and C<delete_all> to use the
-C<Action|Reaction::UI::ViewPort::Action> viewport by default.
+Map C<create>, C<update>, C<delete> and C<delete_all> to use the
+L<Action|Reaction::UI::ViewPort::Action> viewport by default and have C<list>
+use L<ListView|Reaction::UI::ViewPort::ListView> by default.
+
+=head2 _build_default_member_actions
-=head2 _build_action_viewport_args
+Add C<update> and C<delete> to the list of default actions.
-Add action_prototypes to the C<list> action so that action links render correctly in L<ListView|Rection::UI::ViewPort::Listview>.
+=head2 _build_default_collection_actions
+
+Add C<create> and C<delete_all> to the list of default actions.
=head1 ACTIONS
=head2 delete
-Chained to C<object>, deletee a single object.
-
+Chained to C<object>, delete a single object.
See L<Delete|Reaction::InterfaceModel::Action::DBIC::Result::Delete>
for more info.