From: Chris W. <la...@us...> - 2004-11-28 04:25:28
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20759 Modified Files: Action.pm Log Message: doc updates Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** Action.pm 28 Nov 2004 01:02:13 -0000 1.61 --- Action.pm 28 Nov 2004 04:24:42 -0000 1.62 *************** *** 814,818 **** while ( my ( $field, $value ) = each %{ $props } ) { ! # These aren't defined in %PROPS if ( $field =~ /^(cache_expire|is_secure|name)$/ ) { $self->$field( $value ); --- 814,819 ---- while ( my ( $field, $value ) = each %{ $props } ) { ! # These aren't defined in %PROPS -- let them deal with ! # undefined values if ( $field =~ /^(cache_expire|is_secure|name)$/ ) { $self->$field( $value ); *************** *** 2115,2119 **** An arrayref of invalid tasks for this action. Note that the action dispatcher will B<never> execute a task with a leading underscore ! (e.g., '_find_records'); Example: --- 2116,2121 ---- An arrayref of invalid tasks for this action. Note that the action dispatcher will B<never> execute a task with a leading underscore ! (e.g., '_find_records'). This method will not return ! leading-underscore tasks. Example: *************** *** 2236,2244 **** # TODO: will this work? ! my $action = OpenInteract2::Action->new( ! { name => 'foo', ! class => 'OpenInteract2::Action::FooAction', ! task_default => 'drink', ! soda => 'Jolt' } ); =head2 Object Methods --- 2238,2247 ---- # TODO: will this work? ! my $action = OpenInteract2::Action->new({ ! name => 'foo', ! class => 'OpenInteract2::Action::FooAction', ! task_default => 'drink', ! soda => 'Jolt', ! }); =head2 Object Methods *************** *** 2301,2306 **** Examples: ! my $action = OpenInteract2::Action->new({ name => 'games', ! task => 'explore' }); my $url = $action->create_url; # $url: "/games/explore/" --- 2304,2311 ---- Examples: ! my $action = OpenInteract2::Action->new({ ! name => 'games', ! task => 'explore', ! }); my $url = $action->create_url; # $url: "/games/explore/" *************** *** 2362,2366 **** content. ! TODO: fill in info about caching Returns: content generated by the action --- 2367,2374 ---- content. ! Most actions do not implement this method, instead implementing a task ! and using the base class implementation of C<execute()> to lookup the ! task and perform the necessary security checks and caching. (Learn ! about caching in L<OpenInteract2::Manual::Caching>.) Returns: content generated by the action *************** *** 2427,2431 **** skipped. ! Currently we only set properties for which there is a defined value. Returns: action object (C<$self>) --- 2435,2440 ---- skipped. ! Currently we only set properties for which there is a defined value in ! C<\%properties>. Returns: action object (C<$self>) *************** *** 2451,2460 **** # Same ! $action->property( $property_name ); ! $action->$property_name(); ! # Same ! $action->property( $property_name, $value ); ! $action->$property_name( $value ); See L<PROPERTIES> for the list of properties in each action. --- 2460,2469 ---- # Same ! $action->property( 'task_invalid' ); ! $action->task_invalid(); ! # Same ! $action->property( task_invalid => [ 'foo' ] ); ! $action->task_invalid( [ 'foo' ] ); See L<PROPERTIES> for the list of properties in each action. *************** *** 2474,2478 **** the action as parameters. ! Currently we only set parameters for which there is a defined value. Returns: action object (C<$self>) --- 2483,2488 ---- the action as parameters. ! Currently we only set parameters for which there is a defined value in ! C<\%params>. Returns: action object (C<$self>) *************** *** 2494,2498 **** B<param_add( $key, @values )> ! Adds (rather than replaces) the values C<@value> to the parameter C<$key>. If there is a value already set for C<$key>, or if you pass multiple values, it is turned into an array reference and C<@values> --- 2504,2508 ---- B<param_add( $key, @values )> ! Adds (rather than replaces) the values C<@values> to the parameter C<$key>. If there is a value already set for C<$key>, or if you pass multiple values, it is turned into an array reference and C<@values> *************** *** 2509,2515 **** # $full_msg = 'Ooops I... did it again' ! $action->param( error_msg => "Ooops I..." ); ! $action->param_add( error_msg => "did it again" ); ! $action->param( error_msg => 'and again' ); my $full_msg = join( ' ', $action->param( 'error_msg' ) ); # $full_msg = 'and again' --- 2519,2525 ---- # $full_msg = 'Ooops I... did it again' ! $action->param( error_msg => "Ooops I..." ); # Set to value ! $action->param_add( error_msg => "did it again" ); # ...add new value to existing ! $action->param( error_msg => 'and again' ); # ...replace the earlier values entirely my $full_msg = join( ' ', $action->param( 'error_msg' ) ); # $full_msg = 'and again' *************** *** 2591,2594 **** --- 2601,2612 ---- CTX->request->language_handle->maketext( $key, @args ); + Example: + + if ( $@ ) { + $action->param_add( + error_msg => $action->_msg( 'my.error.message', "$@" ) + ); + } + B<_find_task()> *************** *** 2632,2644 **** =item * ! Does not begin with an underscore. =item * ! Is not listed in the C<task_invalid> property. =item * ! Is listed in the C<task_valid> property, if that property is defined. =back --- 2650,2662 ---- =item * ! does not begin with an underscore. =item * ! is not listed in the C<task_invalid> property. =item * ! is listed in the C<task_valid> property if that property is defined. =back |