GPMSWiki/DeveloperDocumentation/MigrationHelp/SessionManagementChanges: Difference between revisions

From BRF-Software
Jump to navigation Jump to search
imported>MichaelDondrup
No edit summary
imported>MichaelDondrup
No edit summary
Line 48: Line 48:


### End Class Methods ###
### End Class Methods ###


__END__
__END__
Line 57: Line 55:


== API ==
== API ==
The API is completely different from the old one, especially when it come to initialization of sessions. The only function that is unchanged is '''param''', fortunately ;-) It can be used to get and set session parameters


* The function '''params''' delivered all parameter values as key value pairs. This function does no longer exist. To replace it:
* The function '''params''' delivered all parameter values as key value pairs. This function does no longer exist. To replace it:
** get all session parameters by using function ''getParams'' to get all parameter names
** get all session parameters by using function ''getParams'' to get all parameter names
** use ''param'' on each name and store the value
** use ''param'' on each name and store the value
*
* There is no '''param_permanent''' any more, because you don't want it :-/ If you do, blame Burkhard and suffer

Revision as of 11:42, 7 November 2008

Changes in the Session Management

The new Sessionmanagement module is completely new and build from scratch. It supports hierarchical sessions, and also anonymous sessions. Complete redesign implies vast changes throughout the API. So expect some work.

Classes

You can have multiple sessions of different classes. An application specific subclass of Session::GPMS is mandatory. It has to be placed in the application subdirectory share/perl/Session/GPMS.

Here is a simple example:


package Session::GPMS::EMMAII;

=head1 NAME

Session::GPMS::EMMA2

=head1 DESCRIPTION

Sample implementation of a Session::GPMS::Application class, using GPMS::Application_Frame::Sample

=cut

use strict;
use warnings;
use GPMS::Application_Frame::EMMAII;

use base qw(Session::GPMS::Application);

1;

### Begin Class Methods ###

sub AppFrameClass {
    # we use GPMS::Application_Frame::EMMAII
    return "GPMS::Application_Frame::EMMAII";
}

sub NeedSingleton {
    # we cannot have multiple instances of an EMMA apllications at the moment
    # this could change in the future....
    return 1;
}

### End Class Methods ###

__END__


API

The API is completely different from the old one, especially when it come to initialization of sessions. The only function that is unchanged is param, fortunately ;-) It can be used to get and set session parameters

  • The function params delivered all parameter values as key value pairs. This function does no longer exist. To replace it:
    • get all session parameters by using function getParams to get all parameter names
    • use param on each name and store the value
  • There is no param_permanent any more, because you don't want it :-/ If you do, blame Burkhard and suffer