7 |
############################################ |
############################################ |
8 |
# |
# |
9 |
# $Log$ |
# $Log$ |
10 |
|
# Revision 1.10 2002/12/07 03:37:23 joko |
11 |
|
# + updated pod |
12 |
|
# |
13 |
|
# Revision 1.9 2002/12/01 22:15:45 joko |
14 |
|
# - sub createDb: moved to handler |
15 |
|
# |
16 |
# Revision 1.8 2002/11/29 04:48:23 joko |
# Revision 1.8 2002/11/29 04:48:23 joko |
17 |
# + updated pod |
# + updated pod |
18 |
# |
# |
368 |
if ( my $dbh = DBI->connect($dsn, '', '', { |
if ( my $dbh = DBI->connect($dsn, '', '', { |
369 |
PrintError => 0, |
PrintError => 0, |
370 |
} ) ) { |
} ) ) { |
371 |
|
|
372 |
|
# TODO: REVIEW |
373 |
$dbh->disconnect(); |
$dbh->disconnect(); |
374 |
|
|
375 |
return 1; |
return 1; |
376 |
} else { |
} else { |
377 |
$logger->warning( __PACKAGE__ . "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr ); |
$logger->warning( __PACKAGE__ . "[$self->{locator}->{type}]" . "->testDsn(): " . "DBI-error: " . $DBI::errstr ); |
385 |
return $status; |
return $status; |
386 |
} |
} |
387 |
|
|
|
sub createDb { |
|
|
my $self = shift; |
|
|
my $dsn = $self->{locator}->{dbi}->{dsn}; |
|
|
|
|
|
$logger->debug( __PACKAGE__ . "->createDb( 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("CREATE DATABASE $database_name;")) { |
|
|
$ok = 1; |
|
|
} |
|
|
} |
|
|
$dbh->disconnect(); |
|
|
} |
|
|
|
|
|
return $ok; |
|
|
|
|
|
} |
|
388 |
|
|
389 |
sub dropDb { |
sub dropDb { |
390 |
my $self = shift; |
my $self = shift; |
405 |
$ok = 1; |
$ok = 1; |
406 |
} |
} |
407 |
} |
} |
408 |
|
|
409 |
$dbh->disconnect(); |
$dbh->disconnect(); |
410 |
|
|
411 |
} |
} |
412 |
|
|
413 |
return $ok; |
return $ok; |
517 |
- .pst - files (Outlook Post Storage?) |
- .pst - files (Outlook Post Storage?) |
518 |
- XML (e.g. via XML::Simple?) |
- XML (e.g. via XML::Simple?) |
519 |
- Move to t3, look at InCASE |
- Move to t3, look at InCASE |
520 |
|
- some kind of security layer for methods/objects |
521 |
|
- acls (stored via tangram/ldap?) for functions, methods and objects (entity- & data!?) |
522 |
|
- where are the hooks needed then? |
523 |
|
- is Data::Storage & Co. okay, or do we have to touch the innards of DBI and/or Tangram? |
524 |
|
- an attempt to start could be: |
525 |
|
- 'sub getACLByObjectId($id, $context)' |
526 |
|
- 'sub getACLByMethodname($id, $context)' |
527 |
|
- 'sub getACLByName($id, $context)' |
528 |
|
( would require a kinda registry to look up these very names pointing to arbitrary locations (code, data, ...) ) |
529 |
|
|
530 |
|
|
531 |
|
|
532 |
=head3 LINKS / REFERENCES |
=head3 LINKS / REFERENCES |