| 7 |
############################################ |
############################################ |
| 8 |
# |
# |
| 9 |
# $Log$ |
# $Log$ |
| 10 |
|
# Revision 1.14 2002/12/19 16:27:59 joko |
| 11 |
|
# - moved 'sub dropDb' to Data::Storage::Handler::DBI |
| 12 |
|
# |
| 13 |
|
# Revision 1.13 2002/12/17 21:54:12 joko |
| 14 |
|
# + feature when using Tangram: |
| 15 |
|
# + what? each object created should delivered with a globally(!?) unique identifier (GUID) besides the native tangram object id (OID) |
| 16 |
|
# + patched Tangram::Storage (jonen) |
| 17 |
|
# + enhanced Data::Storage::Schema::Tangram (joko) |
| 18 |
|
# + enhanced Data::Storage::Handler::Tangram 'sub getObjectByGuid' (jonen) |
| 19 |
|
# + how? |
| 20 |
|
# + each concrete (non-abstract) class gets injected with an additional field/property called 'guid' - this is done (dynamically) on schema level |
| 21 |
|
# + this property ('guid') gets filled on object creation/insertion from 'sub Tangram::Storage::_insert' using Data::UUID from CPAN |
| 22 |
|
# + (as for now) this property can get accessed by calling 'getObjectByGuid' on the already known storage-handle used throughout the application |
| 23 |
|
# |
| 24 |
# Revision 1.12 2002/12/12 02:50:15 joko |
# Revision 1.12 2002/12/12 02:50:15 joko |
| 25 |
# + this now (unfortunately) needs DBI for some helper functions |
# + this now (unfortunately) needs DBI for some helper functions |
| 26 |
# + TODO: these have to be refactored to another scope! (soon!) |
# + TODO: these have to be refactored to another scope! (soon!) |
| 415 |
} |
} |
| 416 |
} |
} |
| 417 |
|
|
|
sub dropDb { |
|
|
my $self = shift; |
|
|
my $dsn = $self->{locator}->{dbi}->{dsn}; |
|
|
|
|
|
$logger->debug( __PACKAGE__ . "->dropDb( dsn $dsn )" ); |
|
|
|
|
|
$dsn =~ s/database=(.+?);//; |
|
|
my $database_name = $1; |
|
|
|
|
|
my $ok; |
|
|
|
|
|
if ( my $dbh = DBI->connect($dsn, '', '', { |
|
|
PrintError => 0, |
|
|
} ) ) { |
|
|
if ($database_name) { |
|
|
if ($dbh->do("DROP DATABASE $database_name;")) { |
|
|
$ok = 1; |
|
|
} |
|
|
} |
|
|
|
|
|
$dbh->disconnect(); |
|
|
|
|
|
} |
|
|
|
|
|
return $ok; |
|
|
} |
|
|
|
|
| 418 |
1; |
1; |
| 419 |
__END__ |
__END__ |
| 420 |
|
|
| 541 |
- 'sub getACLByMethodname($id, $context)' |
- 'sub getACLByMethodname($id, $context)' |
| 542 |
- 'sub getACLByName($id, $context)' |
- 'sub getACLByName($id, $context)' |
| 543 |
( would require a kinda registry to look up these very names pointing to arbitrary locations (code, data, ...) ) |
( would require a kinda registry to look up these very names pointing to arbitrary locations (code, data, ...) ) |
| 544 |
|
- add more hooks and various levels |
| 545 |
|
- better integrate introduced 'getObjectByGuid'-mechanism from Data::Storage::Handler::Tangram |
| 546 |
|
|
| 547 |
|
|
| 548 |
=head3 LINKS / REFERENCES |
=head3 LINKS / REFERENCES |