cvsuser 02/05/21 06:46:24 Modified: P5EEx/Blue/P5EEx/Blue Context.pm SharedDatastore.pm Widget.pm P5EEx/Blue/P5EEx/Blue/Widget StateMachine.pm Removed: P5EEx/Blue/examples Config.1 Config.1.out Reference.1 Reference.1.out config.ini config.pl config.properties Log: updated to use Test::More Revision Changes Path 1.29 +15 -5 p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm Index: Context.pm =================================================================== RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Context.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -r1.28 -r1.29 --- Context.pm 17 May 2002 20:18:54 -0000 1.28 +++ Context.pm 21 May 2002 13:46:23 -0000 1.29 @@ -1,6 +1,6 @@ ############################################################################# -## $Id: Context.pm,v 1.28 2002/05/17 20:18:54 spadkins Exp $ +## $Id: Context.pm,v 1.29 2002/05/21 13:46:23 spadkins Exp $ ############################################################################# package P5EEx::Blue::Context; @@ -372,6 +372,7 @@ my ($args, $lcf_type, $new_service, $override, $lightweight, $attrib); my ($service, $config, $class, $session); my ($service_store, $service_config, $service_type, $service_type_config); + my ($default); if (!defined $type) { P5EEx::Blue::Exception->throw( @@ -455,11 +456,10 @@ # take care of all %$args attributes next ################################################################ - # A "lightweight" widget is one which never has to handle events. - # 1. its attributes are only ever required when it is displayed + # A "lightweight" service is one which never has to handle events. + # 1. its attributes are only ever required when they are all supplied # 2. its attributes will be OK by combining the %$args with the %$config # and %$store. - # 3. all of the necessary %$args are supplied whereever it is displayed. # This all saves space in the Session store, as the attribute values can # be relied upon to be supplied by the config file and the code (and # minimal reliance on the Session store). @@ -479,6 +479,16 @@ # don't include the entry which says whether we are overriding or not next if ($attrib eq "override"); + if ($attrib eq "default") { + if ($name =~ /^(.+)\.([^.]+)$/) { + $self->wget($1, $2, $args->{default}, 1); + } + else { + $self->wget("session", $name, $args->{default}, 1); + } + next; + } + # include attrib if overriding OR attrib not provided in the widget configs already if (!defined $service->{$attrib} || ($override && $service->{$attrib} ne $args->{$attrib})) { 1.3 +3 -3 p5ee/P5EEx/Blue/P5EEx/Blue/SharedDatastore.pm Index: SharedDatastore.pm =================================================================== RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/SharedDatastore.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -r1.2 -r1.3 --- SharedDatastore.pm 5 Apr 2002 22:02:41 -0000 1.2 +++ SharedDatastore.pm 21 May 2002 13:46:23 -0000 1.3 @@ -1,6 +1,6 @@ ############################################################################# -## $Id: SharedDatastore.pm,v 1.2 2002/04/05 22:02:41 spadkins Exp $ +## $Id: SharedDatastore.pm,v 1.3 2002/05/21 13:46:23 spadkins Exp $ ############################################################################# package P5EEx::Blue::SharedDatastore; @@ -67,8 +67,8 @@ =head1 Class: P5EEx::Blue::SharedDatastore A SharedDatastore service represents a single hash in which scalars or -deep references may be stored. (They are automatically serialized using -Storable for storage.) +deep references may be stored. (They are automatically serialized +for storage.) It is essentially identical to an MLDBM, but it supports more implementations than an MLDBM (MLDBM is one of the implementations). 1.16 +1 -4 p5ee/P5EEx/Blue/P5EEx/Blue/Widget.pm Index: Widget.pm =================================================================== RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Widget.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -r1.15 -r1.16 --- Widget.pm 9 May 2002 22:17:19 -0000 1.15 +++ Widget.pm 21 May 2002 13:46:23 -0000 1.16 @@ -1,6 +1,6 @@ ############################################################################# -## $Id: Widget.pm,v 1.15 2002/05/09 22:17:19 spadkins Exp $ +## $Id: Widget.pm,v 1.16 2002/05/21 13:46:23 spadkins Exp $ ############################################################################# package P5EEx::Blue::Widget; @@ -184,9 +184,6 @@ $self->{$attrib} = $container->{$attrib}; } } - } - if (defined $self->{default}) { - $self->set_default($self->{default}); } } 1.2 +11 -5 p5ee/P5EEx/Blue/P5EEx/Blue/Widget/StateMachine.pm Index: StateMachine.pm =================================================================== RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Widget/StateMachine.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -r1.1 -r1.2 --- StateMachine.pm 20 May 2002 19:46:04 -0000 1.1 +++ StateMachine.pm 21 May 2002 13:46:23 -0000 1.2 @@ -1,10 +1,10 @@ ###################################################################### -## $Id: StateMachine.pm,v 1.1 2002/05/20 19:46:04 spadkins Exp $ +## $Id: StateMachine.pm,v 1.2 2002/05/21 13:46:23 spadkins Exp $ ###################################################################### package P5EEx::Blue::Widget::StateMachine; -$VERSION = do { my @r=(q$Revision: 1.1 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r}; +$VERSION = do { my @r=(q$Revision: 1.2 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r}; use P5EEx::Blue::Widget; @ISA = ( "P5EEx::Blue::Widget" ); @@ -13,7 +13,7 @@ =head1 NAME -P5EEx::Blue::Widget::StateMachine - a simple state machine +P5EEx::Blue::Widget::StateMachine - a state machine =head1 SYNOPSIS @@ -66,12 +66,21 @@ my ($transition, $transitions); $transitions = $self->{state}{$state}; + + $context->dbgprint("$name.handle_event($wname,$event,@args) transitions=$transitions") + if ($P5EEx::Blue::DEBUG && $context->dbg(1)); + if (defined $transitions) { $transition = $transitions->{"$wname-$event"}; $transition = $transitions->{$event} if (!defined $transition); $transition = $transitions->{$wname} if (!defined $transition); + $context->dbgprint("$name.handle_event() transition=$transition") + if ($P5EEx::Blue::DEBUG && $context->dbg(1)); + if ($transition) { if ($transition->{state}) { + $context->dbgprint("$name.handle_event() state=[$state \-> $transition->{state}]") + if ($P5EEx::Blue::DEBUG && $context->dbg(1)); $state = $transition->{state}; $self->set_value($state); } @@ -81,9 +90,6 @@ $var = shift(@args); $value = shift(@args); $self->set($var,$value); - } - elsif ($self->{args}) { - $self->delete("args"); } } if ($self->{saveRawArgs}) {