cvsuser 02/07/12 14:05:43
Modified: P5EEx/Blue/P5EEx/Blue Context.pm
Log:
cleaned up default handling
Revision Changes Path
1.33 +20 -13 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.32
retrieving revision 1.33
diff -u -w -r1.32 -r1.33
--- Context.pm 26 Jun 2002 04:09:17 -0000 1.32
+++ Context.pm 12 Jul 2002 21:05:43 -0000 1.33
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Context.pm,v 1.32 2002/06/26 04:09:17 spadkins Exp $
+## $Id: Context.pm,v 1.33 2002/07/12 21:05:43 spadkins Exp $
#############################################################################
package P5EEx::Blue::Context;
@@ -10,6 +10,8 @@
use P5EEx::Blue::P5EE;
use P5EEx::Blue::UserAgent;
+use Date::Format;
+
=head1 NAME
P5EEx::Blue::Context - context in which we are currently running
@@ -211,7 +213,7 @@
$self->init(\%args);
eval {
- $self->dbgprint("Context->new(): configClass=$config_class
sessionClass=$session_class")
+ $self->dbgprint("Context->new(): configClass=$config_class
sessionClass=$session_class (", join(",",%args), ")")
if ($P5EEx::Blue::DEBUG && $self->dbg(1));
$self->{session} = P5EEx::Blue::P5EE->new($session_class, "new", \%args);
@@ -482,16 +484,6 @@
# 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})) {
@@ -508,6 +500,20 @@
if ($new_service) {
+ if (defined $service->{default}) {
+ $default = $service->{default};
+ if ($default eq "{today}") {
+ $default = time2str("%Y-%m-%d",time);
+ }
+ if ($name =~ /^(.+)\.([^.]+)$/) {
+ $self->wget($1, $2, $default, 1);
+ }
+ else {
+ $self->wget("session", $name, $default, 1);
+ }
+ $self->wdelete($name, "default");
+ }
+
$class = $service->{"${lcf_type}Class"}; # find class of service
if (!defined $class || $class eq "") { # error if no class given
@@ -1301,7 +1307,8 @@
sub dbgprint {
my $self = shift;
my ($file);
- $file = $self->{initconfig}{debugfile};
+ $file = "";
+ $file = $self->{initconfig}{debugfile} if (ref($self));
if (! $file) {
print STDOUT "Debug: ", @_, "\n";
}