cvsuser 02/03/06 15:03:24
Modified: P5EEx/Blue/P5EEx/Blue Context.pm Widget.pm devguide.pod
P5EEx/Blue/P5EEx/Blue/Context HTML.pm
Log:
changed the 'global' widget to the 'session' widget
Revision Changes Path
1.20 +6 -8 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.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- Context.pm 2 Mar 2002 03:20:06 -0000 1.19
+++ Context.pm 6 Mar 2002 23:03:24 -0000 1.20
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Context.pm,v 1.19 2002/03/02 03:20:06 spadkins Exp $
+## $Id: Context.pm,v 1.20 2002/03/06 23:03:24 spadkins Exp $
#############################################################################
package P5EEx::Blue::Context;
@@ -497,7 +497,7 @@
$class = $service->{"${lcf_type}Class"}; # find class of service
if (!defined $class || $class eq "") { # error if no class given
- if ($name eq "global") {
+ if ($name eq "session") {
$class = "P5EEx::Blue::$type"; # assume the "generic" class
}
else {
@@ -636,7 +636,7 @@
Sample Usage:
- $wname = $context->wget("global", "wname");
+ $wname = $context->wget("session", "wname");
$width = $context->wget("main.app.toolbar.calc", "width");
=cut
@@ -711,7 +711,7 @@
Sample Usage:
- $context->wset("global", "wname", "main_screen");
+ $context->wset("session", "wname", "main_screen");
$context->wset("main.app.toolbar.calc", "width", 50);
=cut
@@ -738,10 +738,7 @@
if (defined $self->{session}{cache}{Widget}{$name});
return;
} # match {
- elsif ($var =~ /^([a-zA-Z0-9_\.-]+)([\{\}\[\]].*)$/) {
-
- $name = $1;
- $var = $2;
+ elsif ($var =~ /^\{/) { # i.e. "{columnSelected}{first_name}"
$var =~ s/\{([^\}]+)\}/\{"$1"\}/g; # put quotes around hash keys
@@ -753,6 +750,7 @@
eval $perl;
print STDERR "ERROR: Context->wset($name,$var,$value): eval ($perl): $@\n"
if ($@);
}
+ # else we do nothing with it!
return $value;
}
1.9 +4 -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.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- Widget.pm 2 Mar 2002 03:07:46 -0000 1.8
+++ Widget.pm 6 Mar 2002 23:03:24 -0000 1.9
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Widget.pm,v 1.8 2002/03/02 03:07:46 spadkins Exp $
+## $Id: Widget.pm,v 1.9 2002/03/06 23:03:24 spadkins Exp $
#############################################################################
package P5EEx::Blue::Widget;
@@ -242,7 +242,7 @@
$container = $self->get("container");
if (defined $container) {
$wc = $self->{context};
- return 0 if ($container eq "global");
+ return 0 if ($container eq "session");
$w = $wc->widget($container);
return $w->handle_event(@_); # bubble the event to container widget
}
@@ -265,7 +265,7 @@
$self->{context}->wset($1, $2, $value);
}
else {
- $self->{context}->wset("global", $name, $value);
+ $self->{context}->wset("session", $name, $value);
}
}
@@ -276,7 +276,7 @@
return $self->{context}->wget($1, $2, $default, $setdefault);
}
else {
- return $self->{context}->wget("global", $name, $default, $setdefault);
+ return $self->{context}->wget("session", $name, $default, $setdefault);
}
}
1.4 +4 -4 p5ee/P5EEx/Blue/P5EEx/Blue/devguide.pod
Index: devguide.pod
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/devguide.pod,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -r1.3 -r1.4
--- devguide.pod 2 Mar 2002 03:07:46 -0000 1.3
+++ devguide.pod 6 Mar 2002 23:03:24 -0000 1.4
@@ -378,7 +378,7 @@
Variables without indexing characters or dots are "plain variables".
If the special variable "wname" was also supplied, all plain variables
are understood to be attributes of the $wname widget. Otherwise,
-all plain variables are stored in the "global" widget.
+all plain variables are stored in the "session" widget.
After all variables are stored in the Session, events are handled.
There are two kinds of events, "user events" (such as come from
@@ -407,18 +407,18 @@
The display_current_widget() method is implemented in the parent
class, P5EEx::Blue::Context::HTML.
-A attribute "global.current_widget" contains the name of the current
+A attribute "session.current_widget" contains the name of the current
widget to display.
If this is not set, check the CGI variable "wname"
-(and set global.current_widget if found).
+(and set session.current_widget if found).
If this is not set, check the Initialization Config (i.e. the copy
of %main::conf, stored in the $context) for a variable named
"defaultWname".
If this is not set, use the $PATH_INFO, with internal "/'s"
converted to dots (i.e. "/app/selector" => "app.selector").
Otherwise, use "default" as the current widget
-(and set global.current_widget).
+(and set session.current_widget).
Then the current widget is summoned and handed to the display_items()
method.
1.7 +7 -7 p5ee/P5EEx/Blue/P5EEx/Blue/Context/HTML.pm
Index: HTML.pm
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Context/HTML.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -w -r1.6 -r1.7
--- HTML.pm 2 Mar 2002 03:07:46 -0000 1.6
+++ HTML.pm 6 Mar 2002 23:03:24 -0000 1.7
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: HTML.pm,v 1.6 2002/03/02 03:07:46 spadkins Exp $
+## $Id: HTML.pm,v 1.7 2002/03/06 23:03:24 spadkins Exp $
#############################################################################
package P5EEx::Blue::Context::HTML;
@@ -77,7 +77,7 @@
$context->display_current_widget();
-The display_current_widget() method searches the "global widget" for an
+The display_current_widget() method searches the "session widget" for an
attribute of "current_widget" and uses that as the name of the widget which should
be displayed in the browser.
@@ -87,18 +87,18 @@
my $self = shift;
my ($current_widget, $w);
- $current_widget = $self->wget("global","current_widget");
+ $current_widget = $self->wget("session","current_widget");
if (!$current_widget) { # no current widget is defined
# maybe it arrived in a CGI variable named "wname"
$current_widget = $self->{cgi}->param("wname");
- $self->wset("global","current_widget",$current_widget) if ($current_widget);
+ $self->wset("session","current_widget",$current_widget) if
($current_widget);
# maybe we can find it in the {initconfig}
if (!$current_widget && defined $self->{initconfig}{defaultWname}) {
$current_widget = $self->{initconfig}{defaultWname};
- $self->wset("global","current_widget",$current_widget) if
($current_widget);
+ $self->wset("session","current_widget",$current_widget) if
($current_widget);
}
# maybe we can infer it from the PATH_INFO
@@ -107,13 +107,13 @@
$current_widget =~ s!^/!!; # remove leading "/"
# TODO: I may interpret PATH_INFO to include method(args) someday
$current_widget =~ s!/!.!g; # for now, convert "/" to "."
(/app/toolbar => app.toolbar)
- $self->wset("global","current_widget",$current_widget) if
($current_widget);
+ $self->wset("session","current_widget",$current_widget) if
($current_widget);
}
# oh well. just use "default".
if (!$current_widget) {
$current_widget = "default";
- $self->wset("global","current_widget",$current_widget);
+ $self->wset("session","current_widget",$current_widget);
}
}