--- nfo/perl/libs/Data/Storage.pm 2002/12/11 06:53:19 1.11 +++ nfo/perl/libs/Data/Storage.pm 2002/12/17 21:54:12 1.13 @@ -1,4 +1,4 @@ -# $Id: Storage.pm,v 1.11 2002/12/11 06:53:19 joko Exp $ +# $Id: Storage.pm,v 1.13 2002/12/17 21:54:12 joko Exp $ # # Copyright (c) 2002 Andreas Motl # @@ -7,6 +7,21 @@ ############################################ # # $Log: Storage.pm,v $ +# Revision 1.13 2002/12/17 21:54:12 joko +# + feature when using Tangram: +# + what? each object created should delivered with a globally(!?) unique identifier (GUID) besides the native tangram object id (OID) +# + patched Tangram::Storage (jonen) +# + enhanced Data::Storage::Schema::Tangram (joko) +# + enhanced Data::Storage::Handler::Tangram 'sub getObjectByGuid' (jonen) +# + how? +# + each concrete (non-abstract) class gets injected with an additional field/property called 'guid' - this is done (dynamically) on schema level +# + this property ('guid') gets filled on object creation/insertion from 'sub Tangram::Storage::_insert' using Data::UUID from CPAN +# + (as for now) this property can get accessed by calling 'getObjectByGuid' on the already known storage-handle used throughout the application +# +# Revision 1.12 2002/12/12 02:50:15 joko +# + this now (unfortunately) needs DBI for some helper functions +# + TODO: these have to be refactored to another scope! (soon!) +# # Revision 1.11 2002/12/11 06:53:19 joko # + updated pod # @@ -199,6 +214,9 @@ use Data::Storage::Locator; use Data::Dumper; +# TODO: wipe out! +use DBI; + # TODO: actually implement level (integrate with Log::Dispatch) my $TRACELEVEL = 0; @@ -364,6 +382,19 @@ return $database_name; } +sub testAvailability { + my $self = shift; + my $status = $self->testDsn(); + $self->{locator}->{status}->{available} = $status; + return $status; +} + +sub isConnected { + my $self = shift; + # TODO: REVIEW! + return 1 if $self->{STORAGEHANDLE}; +} + sub testDsn { my $self = shift; my $dsn = $self->{locator}->{dbi}->{dsn}; @@ -381,14 +412,6 @@ } } -sub testAvailability { - my $self = shift; - my $status = $self->testDsn(); - $self->{locator}->{status}->{available} = $status; - return $status; -} - - sub dropDb { my $self = shift; my $dsn = $self->{locator}->{dbi}->{dsn}; @@ -416,11 +439,6 @@ return $ok; } -sub isConnected { - my $self = shift; - return 1 if $self->{STORAGEHANDLE}; -} - 1; __END__ @@ -547,7 +565,8 @@ - 'sub getACLByMethodname($id, $context)' - 'sub getACLByName($id, $context)' ( would require a kinda registry to look up these very names pointing to arbitrary locations (code, data, ...) ) - + - add more hooks and various levels + - better integrate introduced 'getObjectByGuid'-mechanism from Data::Storage::Handler::Tangram =head3 LINKS / REFERENCES