Commit 056688ca authored by Yadd's avatar Yadd

Some doc (#595)

parent 1b03f1fb
......@@ -122,8 +122,11 @@ sub sendError {
);
# SOAP responses
if ( $req->accept =~ m#(?:application|text)/xml#
or $req->contentType =~ m#(?:application|text)/xml# )
if (
$req->accept =~ m#(?:application|text)/xml#
or ( $req->contentType
and $req->contentType =~ m#(?:application|text)/xml# )
)
{
my $s = '<soapenv:Body>
<soapenv:Fault>
......
......@@ -296,6 +296,15 @@ Content type of posted datas.
Length of posted datas.
=head3 respHeaders
Used to store response headers. Be careful, it contains an array, not a hash
reference because headers can be multi-valued.
Exemple:
$req->respHeaders( "Location" => "http://x.y.z/", Etag => "XYZ", );
=head2 Private accessors
=head3 _psgixBuffered
......@@ -308,10 +317,20 @@ PSGI psgix.input variable.
=head2 Methods
=head3 parseBody()
Transform JSON or form/url-encoded POST content into GET parameters. Using this
it is possible to manage POST requests like GET requests.
=head3 jsonBodyToObj()
Get the content of a JSON POST request as Perl object.
=head3 wantJSON
Return true if current request ask JSON content (verify that "Accept" header
contains "application/json" or "text/json").
=head1 SEE ALSO
L<http://lemonldap-ng.org/>, L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Handler>,
......
# Lemonldap::NG::Portal::Main::Request extends Lemonldap::NG::Common::PSGI::Request
# to add all parameters needed to manage authentication:
#
# - steps: list of methods to call
# - datas: free hash ref where plugins can store their datas
# - user infos:
# * id: Apache::Session id
# * sessionInfo: hash ref that will be stored in session DB
# * user: username given by authentication module, used by userDB module
# - query elements:
# * mustRedirect: boolean to indicate that response must be a redirection
# * urlNotBase64: boolean to indicate that url isn't Base64 encoded
# - menu elements:
# * info: info to display at login
# * menuError
# * notification: see notification plugin
# * errorType: returns positive/warning/negative depending on error (stored
# in error property)
package Lemonldap::NG::Portal::Main::Request;
# Developpers, be careful: new() is never called so default values will not be
......@@ -137,3 +119,133 @@ sub info {
# TODO: oldpassword
1;
__END__
=head1 NAME
=encoding utf8
Lemonldap::NG::Portal::Main::Request - HTTP request object used in LLNG
portal methods.
=head1 SYNOPSIS
# Somewhere in a plugin...
sub run {
my ( $self, $req ) = @_;
# $req is a Lemonldap::NG::Portal::Main::Request object
...
}
=head1 DESCRIPTION
Lemonldap::NG::Portal::Main::Request extends Lemonldap::NG::Common::PSGI::Request
to add all parameters needed to manage portal jobs.
=head1 METHODS
=head2 Accessors
=head3 steps()
Stack of methods to call for this requests. It can be modified to change
authentication process
=head3 datas()
Free hash ref where plugins can store their datas. Using it is a LLNG best
practice
=head3 User information
=head4 id()
Session id (main cookie value).
=head4 sessionInfo()
Hash ref that will be stored in session DB.
=head4 user()
Username given by authentication module, used by userDB module.
=head3 mustRedirect()
Boolean to indicate that response must be a redirection (used for example when
request is a POST).
=head3 urlNotBase64
Boolean to indicate that url isn't Base64 encoded.
=head2 Other methods
=head3 info()
Store info to display in response.
=head3 menuError()
=head3 notification()
see notification plugin.
=head3 errorType()
Returns positive/warning/negative depending on value stored in error property.
=head1 SEE ALSO
L<http://lemonldap-ng.org/>, L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Handler>,
L<Plack>, L<PSGI>, L<Lemonldap::NG::Common::PSGI>,
L<Lemonldap::NG::Common::PSGI::Router>, L<HTML::Template>,
=head1 AUTHORS
=over
=item Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
=item François-Xavier Deltombe, E<lt>fxdeltombe@gmail.com.E<gt>
=item Xavier Guimard, E<lt>x.guimard@free.frE<gt>
=item Thomas Chemineau, E<lt>thomas.chemineau@gmail.comE<gt>
=back
=head1 BUG REPORT
Use OW2 system to report bug or ask for features:
L<http://jira.ow2.org>
=head1 DOWNLOAD
Lemonldap::NG is available at
L<http://forge.objectweb.org/project/showfiles.php?group_id=274>
=head1 COPYRIGHT AND LICENSE
=over
=item Copyright (C) 2015-2016 by Xavier Guimard, E<lt>x.guimard@free.frE<gt>
=item Copyright (C) 2015-2016 by Clément Oudot, E<lt>clem.oudot@gmail.comE<gt>
=back
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see L<http://www.gnu.org/licenses/>.
=cut
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment