Adding support for generic saving and retrieving of settings.

git-svn-id: svn://10.0.0.236/trunk@107760 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ian%hixie.ch 2001-11-09 20:13:21 +00:00
parent 7b02c6d19e
commit 3443dd9f0e

View File

@ -108,3 +108,27 @@ sub setDBIDatabaseSettings {
$configuration->propertySet("$prefix.$property", $database->propertyGet($property));
}
}
# this takes an object supporting the dataSource.configuration.client
# service and retrieves its settings.
sub getSettings {
my $self = shift;
my($app, $object, $prefix) = @_;
my $configuration = $self->database($app);
foreach my $property ($object->settings) {
my $value = $configuration->propertyGet("$prefix.$property");
$self->assert($value, 1, "The configuration is missing a valid value for '$prefix.$property'");
$object->propertySet($property, $value);
}
}
# this takes an object supporting the dataSource.configuration.client
# service and saves its settings.
sub setSettings {
my $self = shift;
my($app, $object, $prefix) = @_;
my $configuration = $self->database($app);
foreach my $property ($object->settings) {
$configuration->propertySet("$prefix.$property", $object->propertyGet($property));
}
}