cvsuser 02/05/09 15:15:11
Modified: P5EEx/Blue/P5EEx/Blue Context.pm
Log:
got Domains working
Revision Changes Path
1.27 +58 -53 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.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- Context.pm 19 Apr 2002 04:35:31 -0000 1.26
+++ Context.pm 9 May 2002 22:15:11 -0000 1.27
@@ -1,6 +1,6 @@
#############################################################################
-## $Id: Context.pm,v 1.26 2002/04/19 04:35:31 spadkins Exp $
+## $Id: Context.pm,v 1.27 2002/05/09 22:15:11 spadkins Exp $
#############################################################################
package P5EEx::Blue::Context;
@@ -1111,35 +1111,40 @@
sub domain {
my ($self, $domain) = @_;
- my ($config, $domainref, $repository, $rep);
+ my ($domain_config, $domain_session, $repository, $rep);
my ($values, $labels, $needs_loading, $time_to_live, $time);
my ($class, $method, $args, $rows, $row);
$self->dbgprint("Context->domain($domain)")
if ($P5EEx::Blue::DEBUG && $self->dbg(1));
- $config = $self->{config}{Domain}{$domain};
- $domainref = $self->{session}{Domain}{$domain};
- if (defined $domainref) {
- $values = $domainref->{values};
- $values = $config->{values} if (!$values);
- $labels = $domainref->{labels};
- $labels = $config->{labels} if (!$labels);
+ $domain_config = $self->{config}{Domain}{$domain};
+ $domain_session = $self->{session}{Domain}{$domain};
+ $domain_config = {} if (!defined $domain_config);
+ $domain_session = {} if (!defined $domain_session);
+
+ $values = $domain_session->{values};
+ $values = $domain_config->{values} if (!$values);
+
+ $labels = $domain_session->{labels};
+ $labels = $domain_config->{labels} if (!$labels);
$needs_loading = 0;
- $repository = $config->{repository};
+ $repository = $domain_session->{repository};
+ $repository = $domain_config->{repository} if (!$repository);
+
if (defined $repository && $repository ne "") {
if (!defined $values || !defined $labels) {
$needs_loading = 1;
}
else {
- $time_to_live = $config->{time_to_live};
+ $time_to_live = $domain_config->{time_to_live};
if (defined $time_to_live && $time_to_live ne "" && $time_to_live
>= 0) {
if ($time_to_live == 0) {
$needs_loading = 1;
}
else {
- if (time() >= $domainref->{time} + $time_to_live) {
+ if (time() >= $domain_session->{time} + $time_to_live) {
$needs_loading = 1;
}
}
@@ -1153,9 +1158,9 @@
if ($needs_loading) {
$rep = $self->repository($repository);
if (defined $rep) {
- #$method = $domainref->{getmethod};
+ #$method = $domain_session->{getmethod};
#$method = "get" if (!defined $method);
- #$args = $domainref->{getmethod_args};
+ #$args = $domain_session->{getmethod_args};
#$args = [ $domain ] if (!defined $args);
#$self->dbgprint("Context->domain($domain): $rep->$method(@$args)")
@@ -1168,16 +1173,16 @@
# push(@$values, $row->[0]);
# $labels->{$row->[0]} = $row->[1];
#}
- #$domainref->{values} = $values;
- #$domainref->{labels} = $labels;
+ #$domain_session->{values} = $values;
+ #$domain_session->{labels} = $labels;
#$time = time();
- #$domainref->{time} = $time;
+ #$domain_session->{time} = $time;
}
- $values = $domainref->{values};
- $labels = $domainref->{labels};
- }
+ $values = $domain_session->{values};
+ $labels = $domain_session->{labels};
}
+
$values = [] if (! defined $values);
$labels = {} if (! defined $labels);
return ($values, $labels);