From: Chris W. <la...@us...> - 2005-03-02 15:28:59
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24621/OpenInteract2 Modified Files: Request.pm Log Message: OIN-135: add param_url_additional() property, used to store additional (non-action and non-task) parameters from the URL Index: Request.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Request.pm,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** Request.pm 25 Feb 2005 05:37:45 -0000 1.52 --- Request.pm 2 Mar 2005 15:28:44 -0000 1.53 *************** *** 26,30 **** now server_name remote_host user_agent referer cookie_header language_header ! url_absolute url_relative url_initial session auth_user auth_group auth_is_admin auth_is_logged_in ); --- 26,30 ---- now server_name remote_host user_agent referer cookie_header language_header ! url_absolute url_relative url_initial session auth_user auth_group auth_is_admin auth_is_logged_in ); *************** *** 79,82 **** --- 79,93 ---- # PARAMETERS + sub param_url_additional { + my ( $self, @added ) = @_; + if ( scalar @added ) { + $self->{_URL_PARAMS} = \@added; + } + else { + $self->{_URL_PARAMS} ||= []; + } + return wantarray ? @{ $self->{_URL_PARAMS} } : $self->{_URL_PARAMS}; + } + sub param_toggled { my ( $self, $name ) = @_; *************** *** 513,529 **** B<param( [ $name, $value ] )> ! With no arguments, this returns a list -- not an arrayref! -- of ! parameters the client passed in. ! If you pass in C<$name> by itself then you get the value(s) associated ! with it. If C<$name> has not been previously set you get an empty list ! or undef depending on the context. Otherwise, we return the ! context-sensitive value of C<$name> ! If you pass in a C<$value> along with C<$name> then it is assigned to ! C<$name>, overwriting whatever may have been there before. ! Returns: list of parameters (no argument), the parameter associated ! with the first argument (one argument, two arguments), B<param_toggled( $name )> --- 524,556 ---- B<param( [ $name, $value ] )> ! See docs in L<OpenInteract2::ParamContainer> ! B<param_url_additional()> ! Property that returns as a list any additional path information as ! parameters. This allows REST-style URLs. ! What constitutes 'additional' is determined by the relevant ! L<OpenInteract2::ActionResolver> class -- the one that's able to ! resolve a URL into an L<OpenInteract2::Action> object is also ! responsible for setting this property. ! ! For instance, instead of: ! ! http://www.foo.com/news/display/?news_id=1 ! ! You could have: ! ! http://www.foo.com/news/display/1 ! ! And instead of: ! ! http://www.foo.com/news/archive/?year=2005&month=8 ! ! You could use: ! ! http://www.foo.com/news/archive/2005/8 ! ! Returns: list of additional parameters, in order. B<param_toggled( $name )> |